From owner-svn-src-all@freebsd.org Sun Jun 11 00:16:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F40C9BF9402; Sun, 11 Jun 2017 00:16:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB13367BA2; Sun, 11 Jun 2017 00:16:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5B0GLLc055826; Sun, 11 Jun 2017 00:16:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5B0GL2J055823; Sun, 11 Jun 2017 00:16:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201706110016.v5B0GL2J055823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Jun 2017 00:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319815 - in head/sys: conf dev/mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 00:16:23 -0000 Author: ian Date: Sun Jun 11 00:16:21 2017 New Revision: 319815 URL: https://svnweb.freebsd.org/changeset/base/319815 Log: Add some utility functions to help a PHY driver on an FDT-configured system retrieve its config data from the fdt data. The properties that are common to all phys are decoded and returned in a structure. The fdt node handles for the mac and phy devices are also returned in the config data struct, so a driver can easily obtain additional hardware-specific config values from the fdt data. Added: head/sys/dev/mii/mii_fdt.c (contents, props changed) head/sys/dev/mii/mii_fdt.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jun 10 23:55:13 2017 (r319814) +++ head/sys/conf/files Sun Jun 11 00:16:21 2017 (r319815) @@ -2204,6 +2204,7 @@ dev/mii/micphy.c optional miibus fdt | micphy fdt dev/mii/mii.c optional miibus | mii dev/mii/mii_bitbang.c optional miibus | mii_bitbang dev/mii/mii_physubr.c optional miibus | mii +dev/mii/mii_fdt.c optional miibus fdt | mii fdt dev/mii/miibus_if.m optional miibus | mii dev/mii/mlphy.c optional miibus | mlphy dev/mii/nsgphy.c optional miibus | nsgphy Added: head/sys/dev/mii/mii_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mii/mii_fdt.c Sun Jun 11 00:16:21 2017 (r319815) @@ -0,0 +1,200 @@ +/*- + * Copyright (c) 2017 Ian Lepore + * All rights reserved. + * + * Development sponsored by Microsemi, Inc. + * + * 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$"); + +/* + * Utility functions for PHY drivers on systems configured using FDT data. + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +/* + * Table to translate MII_CONTYPE_xxxx constants to/from devicetree strings. + * We explicitly associate the enum values with the strings in a table to avoid + * relying on this list being sorted in the same order as the enum in miivar.h, + * and to avoid problems if the enum gains new types that aren't in the FDT + * data. However, the "unknown" entry must be first because it is referenced + * using subscript 0 in mii_fdt_contype_to_name(). + */ +static struct contype_names { + mii_contype_t type; + const char *name; +} fdt_contype_names[] = { + {MII_CONTYPE_UNKNOWN, "unknown"}, + {MII_CONTYPE_MII, "mii"}, + {MII_CONTYPE_GMII, "gmii"}, + {MII_CONTYPE_SGMII, "sgmii"}, + {MII_CONTYPE_QSGMII, "qsgmii"}, + {MII_CONTYPE_TBI, "tbi"}, + {MII_CONTYPE_REVMII, "rev-mii"}, + {MII_CONTYPE_RMII, "rmii"}, + {MII_CONTYPE_RGMII, "rgmii"}, + {MII_CONTYPE_RGMII_ID, "rgmii-id"}, + {MII_CONTYPE_RGMII_RXID, "rgmii-rxid"}, + {MII_CONTYPE_RGMII_TXID, "rgmii-txid"}, + {MII_CONTYPE_RTBI, "rtbi"}, + {MII_CONTYPE_SMII, "smii"}, + {MII_CONTYPE_XGMII, "xgmii"}, + {MII_CONTYPE_TRGMII, "trgmii"}, + {MII_CONTYPE_2000BX, "2000base-x"}, + {MII_CONTYPE_2500BX, "2500base-x"}, + {MII_CONTYPE_RXAUI, "rxaui"}, +}; + +static phandle_t +mii_fdt_get_phynode(phandle_t macnode) +{ + static const char *props[] = { + "phy-handle", "phy", "phy-device" + }; + pcell_t xref; + u_int i; + + for (i = 0; i < nitems(props); ++i) { + if (OF_getencprop(macnode, props[i], &xref, sizeof(xref)) > 0) + return (OF_node_from_xref(xref)); + } + return (-1); +} + +mii_contype_t +mii_fdt_contype_from_name(const char *name) +{ + u_int i; + + for (i = 0; i < nitems(fdt_contype_names); ++i) { + if (strcmp(name, fdt_contype_names[i].name) == 0) + return (fdt_contype_names[i].type); + } + return (MII_CONTYPE_UNKNOWN); +} + +const char * +mii_fdt_contype_to_name(mii_contype_t contype) +{ + u_int i; + + for (i = 0; i < nitems(fdt_contype_names); ++i) { + if (contype == fdt_contype_names[i].type) + return (fdt_contype_names[i].name); + } + return (fdt_contype_names[0].name); +} + +mii_contype_t +mii_fdt_get_contype(phandle_t macnode) +{ + char val[32]; + + if (OF_getprop(macnode, "phy-mode", val, sizeof(val)) <= 0 && + OF_getprop(macnode, "phy-connection-type", val, sizeof(val)) <= 0) { + return (MII_CONTYPE_UNKNOWN); + } + return (mii_fdt_contype_from_name(val)); +} + +void +mii_fdt_free_config(struct mii_fdt_phy_config *cfg) +{ + + free(cfg, M_OFWPROP); +} + +mii_fdt_phy_config_t * +mii_fdt_get_config(device_t phydev) +{ + mii_fdt_phy_config_t *cfg; + device_t miibus, macdev; + pcell_t val; + + miibus = device_get_parent(phydev); + macdev = device_get_parent(miibus); + + cfg = malloc(sizeof(*cfg), M_OFWPROP, M_ZERO | M_WAITOK); + + /* + * If we can't find our parent MAC's node, there's nothing more we can + * fill in; cfg is already full of zero/default values, return it. + */ + if ((cfg->macnode = ofw_bus_get_node(macdev)) == -1) + return (cfg); + + cfg->con_type = mii_fdt_get_contype(cfg->macnode); + + /* + * If we can't find our own PHY node, there's nothing more we can fill + * in, just return what we've got. + */ + if ((cfg->phynode = mii_fdt_get_phynode(cfg->macnode)) == -1) + return (cfg); + + if (OF_getencprop(cfg->phynode, "max-speed", &val, sizeof(val)) > 0) + cfg->max_speed = val; + + if (ofw_bus_node_is_compatible(cfg->phynode, + "ethernet-phy-ieee802.3-c45")) + cfg->flags |= MIIF_FDT_COMPAT_CLAUSE45; + + if (OF_hasprop(cfg->phynode, "broken-turn-around")) + cfg->flags |= MIIF_FDT_BROKEN_TURNAROUND; + if (OF_hasprop(cfg->phynode, "enet-phy-lane-swap")) + cfg->flags |= MIIF_FDT_LANE_SWAP; + if (OF_hasprop(cfg->phynode, "enet-phy-lane-no-swap")) + cfg->flags |= MIIF_FDT_NO_LANE_SWAP; + if (OF_hasprop(cfg->phynode, "eee-broken-100tx")) + cfg->flags |= MIIF_FDT_EEE_BROKEN_100TX; + if (OF_hasprop(cfg->phynode, "eee-broken-1000t")) + cfg->flags |= MIIF_FDT_EEE_BROKEN_1000T; + if (OF_hasprop(cfg->phynode, "eee-broken-10gt")) + cfg->flags |= MIIF_FDT_EEE_BROKEN_10GT; + if (OF_hasprop(cfg->phynode, "eee-broken-1000kx")) + cfg->flags |= MIIF_FDT_EEE_BROKEN_1000KX; + if (OF_hasprop(cfg->phynode, "eee-broken-10gkx4")) + cfg->flags |= MIIF_FDT_EEE_BROKEN_10GKX4; + if (OF_hasprop(cfg->phynode, "eee-broken-10gkr")) + cfg->flags |= MIIF_FDT_EEE_BROKEN_10GKR; + + return (cfg); +} Added: head/sys/dev/mii/mii_fdt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mii/mii_fdt.h Sun Jun 11 00:16:21 2017 (r319815) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2017 Ian Lepore + * All rights reserved. + * + * Development sponsored by Microsemi, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_MII_FDT_H_ +#define _DEV_MII_FDT_H_ + +/* + * Common FDT config for a PHY, as documented in the devicetree bindings + * documents ethernet.txt and phy.txt. Boolean properties are represented as + * bits in the flags member. + */ +struct mii_fdt_phy_config { + phandle_t macnode; /* Node (not xref) of parent MAC */ + phandle_t phynode; /* Node (not xref) of PHY */ + mii_contype_t con_type; /* MAC<->PHY connection type */ + u_int max_speed; /* Mbits/sec, 0 = not specified */ + uint32_t flags; /* MIIF_FDT_xxx boolean properties */ +}; +typedef struct mii_fdt_phy_config mii_fdt_phy_config_t; + +/* PHY config flags. */ +#define MIIF_FDT_COMPAT_CLAUSE45 0x0001 +#define MIIF_FDT_BROKEN_TURNAROUND 0x0002 +#define MIIF_FDT_LANE_SWAP 0x0004 +#define MIIF_FDT_NO_LANE_SWAP 0x0008 +#define MIIF_FDT_EEE_BROKEN_100TX 0x0010 +#define MIIF_FDT_EEE_BROKEN_1000T 0x0020 +#define MIIF_FDT_EEE_BROKEN_10GT 0x0040 +#define MIIF_FDT_EEE_BROKEN_1000KX 0x0080 +#define MIIF_FDT_EEE_BROKEN_10GKX4 0x0100 +#define MIIF_FDT_EEE_BROKEN_10GKR 0x0200 + +/* + * Convert between mii_contype enums and devicetree property strings. + */ +const char *mii_fdt_contype_to_name(mii_contype_t contype); +mii_contype_t mii_fdt_contype_from_name(const char *name); + +/* Get the connection type from the given MAC node. */ +mii_contype_t mii_fdt_get_contype(phandle_t macnode); + +/* + * Get/free the config for the given PHY device. + */ +void mii_fdt_free_config(struct mii_fdt_phy_config *cfg); +mii_fdt_phy_config_t *mii_fdt_get_config(device_t phydev); + +#endif From owner-svn-src-all@freebsd.org Sun Jun 11 00:38:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A56ABF9B27; Sun, 11 Jun 2017 00:38:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 295FC6862F; Sun, 11 Jun 2017 00:38:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5B0cHl0063767; Sun, 11 Jun 2017 00:38:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5B0cHpO063764; Sun, 11 Jun 2017 00:38:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201706110038.v5B0cHpO063764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Jun 2017 00:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319817 - in head/sys: conf dev/mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 00:38:18 -0000 Author: ian Date: Sun Jun 11 00:38:16 2017 New Revision: 319817 URL: https://svnweb.freebsd.org/changeset/base/319817 Log: Add a driver for the Vitesse/Microsemi VSC8501 PHY. Added: head/sys/dev/mii/vscphy.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/mii/miidevs Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jun 11 00:17:07 2017 (r319816) +++ head/sys/conf/files Sun Jun 11 00:38:16 2017 (r319817) @@ -2223,6 +2223,7 @@ dev/mii/tlphy.c optional miibus | tlphy dev/mii/truephy.c optional miibus | truephy dev/mii/ukphy.c optional miibus | mii dev/mii/ukphy_subr.c optional miibus | mii +dev/mii/vscphy.c optional miibus | vscphy dev/mii/xmphy.c optional miibus | xmphy dev/mk48txx/mk48txx.c optional mk48txx dev/mlx/mlx.c optional mlx Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Sun Jun 11 00:17:07 2017 (r319816) +++ head/sys/dev/mii/miidevs Sun Jun 11 00:38:16 2017 (r319817) @@ -337,7 +337,8 @@ model TI TNETE2101 0x0003 TNETE2101 media interface model xxTSC 78Q2120 0x0014 78Q2120 10/100 media interface model xxTSC 78Q2121 0x0015 78Q2121 100BASE-TX media interface -/* Vitesse Semiconductor */ +/* Vitesse Semiconductor (now Microsemi) */ +model xxVITESSE VSC8501 0x0013 Vitesse VSC8501 10/100/1000TX PHY model xxVITESSE VSC8641 0x0003 Vitesse VSC8641 10/100/1000TX PHY /* XaQti Corp. PHYs */ Added: head/sys/dev/mii/vscphy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mii/vscphy.c Sun Jun 11 00:38:16 2017 (r319817) @@ -0,0 +1,272 @@ +/*- + * Copyright (c) 2017 Ian Lepore + * All rights reserved. + * + * Development sponsored by Microsemi, Inc. + * + * 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$"); + +/* + * Microsemi / Vitesse VSC8501 (and similar). + */ + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include "miidevs.h" +#include "miibus_if.h" + +#ifdef FDT +#include +#include +#include +#include +#endif + +/* Vitesse VSC8501 */ +#define VSC8501_EXTPAGE_REG 0x001f + +#define VSC8501_EXTCTL1_REG 0x0017 +#define VSC8501_EXTCTL1_RGMII_MODE (1u << 12) + +#define VSC8501_RGMII_CTRL_PAGE 0x02 +#define VSC8501_RGMII_CTRL_REG 0x14 +#define VSC8501_RGMII_DELAY_MASK 0x07 +#define VSC8501_RGMII_DELAY_TXSHIFT 0 +#define VSC8501_RGMII_DELAY_RXSHIFT 4 +#define VSC8501_RGMII_RXCLOCK_DISABLE (1u << 11) +#define VSC8501_RGMII_RXSWAP (1u << 7) +#define VSC8501_RGMII_TXSWAP (1u << 3) +#define VSC8501_RGMII_LANESWAP (VSC8501_RGMII_RXSWAP | \ + VSC8501_RGMII_TXSWAP) + +struct vscphy_softc { + mii_softc_t mii_sc; + device_t dev; + mii_contype_t contype; + int rxdelay; + int txdelay; + bool laneswap; +}; + +static void vscphy_reset(struct mii_softc *); +static int vscphy_service(struct mii_softc *, struct mii_data *, int); + +static const struct mii_phydesc vscphys[] = { + MII_PHY_DESC(xxVITESSE, VSC8501), + MII_PHY_END +}; + +static const struct mii_phy_funcs vscphy_funcs = { + vscphy_service, + ukphy_status, + vscphy_reset +}; + +#ifdef FDT +static void +vscphy_fdt_get_config(struct vscphy_softc *vsc) +{ + mii_fdt_phy_config_t *cfg; + pcell_t val; + + cfg = mii_fdt_get_config(vsc->dev); + vsc->contype = cfg->con_type; + vsc->laneswap = (cfg->flags & MIIF_FDT_LANE_SWAP) && + !(cfg->flags & MIIF_FDT_NO_LANE_SWAP); + if (OF_getencprop(cfg->phynode, "rx-delay", &val, sizeof(val)) > 0) + vsc->rxdelay = val; + if (OF_getencprop(cfg->phynode, "tx-delay", &val, sizeof(val)) > 0) + vsc->txdelay = val; + mii_fdt_free_config(cfg); +} +#endif + +static inline int +vscphy_read(struct vscphy_softc *sc, u_int reg) +{ + u_int val; + + val = PHY_READ(&sc->mii_sc, reg); + return (val); +} + +static inline void +vscphy_write(struct vscphy_softc *sc, u_int reg, u_int val) +{ + + PHY_WRITE(&sc->mii_sc, reg, val); +} + +static void +vsc8501_setup_rgmii(struct vscphy_softc *vsc) +{ + int reg; + + vscphy_write(vsc, VSC8501_EXTPAGE_REG, VSC8501_RGMII_CTRL_PAGE); + + reg = vscphy_read(vsc, VSC8501_RGMII_CTRL_REG); + reg &= ~VSC8501_RGMII_RXCLOCK_DISABLE; + reg &= ~VSC8501_RGMII_LANESWAP; + reg &= ~(VSC8501_RGMII_DELAY_MASK << VSC8501_RGMII_DELAY_TXSHIFT); + reg &= ~(VSC8501_RGMII_DELAY_MASK << VSC8501_RGMII_DELAY_RXSHIFT); + if (vsc->laneswap) + reg |= VSC8501_RGMII_LANESWAP; + if (vsc->contype == MII_CONTYPE_RGMII_ID || + vsc->contype == MII_CONTYPE_RGMII_TXID) { + reg |= vsc->txdelay << VSC8501_RGMII_DELAY_TXSHIFT; + } + if (vsc->contype == MII_CONTYPE_RGMII_ID || + vsc->contype == MII_CONTYPE_RGMII_RXID) { + reg |= vsc->rxdelay << VSC8501_RGMII_DELAY_RXSHIFT; + } + vscphy_write(vsc, VSC8501_RGMII_CTRL_REG, reg); + + vscphy_write(vsc, VSC8501_EXTPAGE_REG, 0); +} + +static void +vsc8501_reset(struct vscphy_softc *vsc) +{ + int reg; + + /* + * Must set whether the mac<->phy connection is RGMII first; changes to + * that bit take effect only after a softreset. + */ + reg = vscphy_read(vsc, VSC8501_EXTCTL1_REG); + if (mii_contype_is_rgmii(vsc->contype)) + reg |= VSC8501_EXTCTL1_RGMII_MODE; + else + reg &= ~VSC8501_EXTCTL1_RGMII_MODE; + vscphy_write(vsc, VSC8501_EXTCTL1_REG, reg); + + mii_phy_reset(&vsc->mii_sc); + + /* + * Setup rgmii control register if necessary, after softreset. + */ + if (mii_contype_is_rgmii(vsc->contype)) + vsc8501_setup_rgmii(vsc); +} + +static void +vscphy_reset(struct mii_softc *sc) +{ + struct vscphy_softc *vsc = (struct vscphy_softc *)sc; + + switch (sc->mii_mpd_model) { + case MII_MODEL_xxVITESSE_VSC8501: + vsc8501_reset(vsc); + break; + default: + mii_phy_reset(sc); + break; + } +} + +static int +vscphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) +{ + + switch (cmd) { + case MII_POLLSTAT: + break; + + case MII_MEDIACHG: + mii_phy_setmedia(sc); + break; + + case MII_TICK: + if (mii_phy_tick(sc) == EJUSTRETURN) + return (0); + break; + } + + /* Update the media status. */ + PHY_STATUS(sc); + + /* Callback if something changed. */ + mii_phy_update(sc, cmd); + return (0); +} + +static int +vscphy_probe(device_t dev) +{ + + return (mii_phy_dev_probe(dev, vscphys, BUS_PROBE_DEFAULT)); +} + +static int +vscphy_attach(device_t dev) +{ + struct vscphy_softc *vsc; + + vsc = device_get_softc(dev); + vsc->dev = dev; + +#ifdef FDT + vscphy_fdt_get_config(vsc); +#endif + + mii_phy_dev_attach(dev, MIIF_NOMANPAUSE, &vscphy_funcs, 1); + mii_phy_setmedia(&vsc->mii_sc); + + return (0); +} + +static device_method_t vscphy_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, vscphy_probe), + DEVMETHOD(device_attach, vscphy_attach), + DEVMETHOD(device_detach, mii_phy_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD_END +}; + +static devclass_t vscphy_devclass; + +static driver_t vscphy_driver = { + "vscphy", + vscphy_methods, + sizeof(struct vscphy_softc) +}; + +DRIVER_MODULE(vscphy, miibus, vscphy_driver, vscphy_devclass, 0, 0); From owner-svn-src-all@freebsd.org Sun Jun 11 00:44:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BB63BF9D6B; Sun, 11 Jun 2017 00:44:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D662268A55; Sun, 11 Jun 2017 00:44:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5B0iJcd067919; Sun, 11 Jun 2017 00:44:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5B0iJtI067918; Sun, 11 Jun 2017 00:44:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201706110044.v5B0iJtI067918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Jun 2017 00:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319818 - head/sys/dev/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 00:44:21 -0000 Author: ian Date: Sun Jun 11 00:44:19 2017 New Revision: 319818 URL: https://svnweb.freebsd.org/changeset/base/319818 Log: Convert from local code and constants for mac<->phy connection type to new common fdt helper code. Modified: head/sys/dev/ffec/if_ffec.c Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Sun Jun 11 00:38:16 2017 (r319817) +++ head/sys/dev/ffec/if_ffec.c Sun Jun 11 00:44:19 2017 (r319818) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "miibus_if.h" /* @@ -135,13 +136,6 @@ struct ffec_bufmap { bus_dmamap_t map; }; -enum { - PHY_CONN_UNKNOWN, - PHY_CONN_MII, - PHY_CONN_RMII, - PHY_CONN_RGMII -}; - struct ffec_softc { device_t dev; device_t miibus; @@ -153,7 +147,7 @@ struct ffec_softc { struct resource *mem_res; void * intr_cookie; struct callout ffec_callout; - uint8_t phy_conn_type; + mii_contype_t phy_conn_type; uint8_t fectype; boolean_t link_is_up; boolean_t is_attached; @@ -262,10 +256,10 @@ ffec_miigasket_setup(struct ffec_softc *sc) switch (sc->phy_conn_type) { - case PHY_CONN_MII: + case MII_CONTYPE_MII: ifmode = 0; break; - case PHY_CONN_RMII: + case MII_CONTYPE_RMII: ifmode = FEC_MIIGSK_CFGR_IF_MODE_RMII; break; default: @@ -377,14 +371,17 @@ ffec_miibus_statchg(device_t dev) rcr |= FEC_RCR_MII_MODE; /* Must always be on even for R[G]MII. */ switch (sc->phy_conn_type) { - case PHY_CONN_MII: - break; - case PHY_CONN_RMII: + case MII_CONTYPE_RMII: rcr |= FEC_RCR_RMII_MODE; break; - case PHY_CONN_RGMII: + case MII_CONTYPE_RGMII: + case MII_CONTYPE_RGMII_ID: + case MII_CONTYPE_RGMII_RXID: + case MII_CONTYPE_RGMII_TXID: rcr |= FEC_RCR_RGMII_EN; break; + default: + break; } switch (IFM_SUBTYPE(mii->mii_media_active)) { @@ -1440,7 +1437,6 @@ ffec_attach(device_t dev) phandle_t ofw_node; int error, phynum, rid; uint8_t eaddr[ETHER_ADDR_LEN]; - char phy_conn_name[32]; uint32_t idx, mscr; sc = device_get_softc(dev); @@ -1463,16 +1459,8 @@ ffec_attach(device_t dev) error = ENXIO; goto out; } - if (OF_searchprop(ofw_node, "phy-mode", - phy_conn_name, sizeof(phy_conn_name)) != -1) { - if (strcasecmp(phy_conn_name, "mii") == 0) - sc->phy_conn_type = PHY_CONN_MII; - else if (strcasecmp(phy_conn_name, "rmii") == 0) - sc->phy_conn_type = PHY_CONN_RMII; - else if (strcasecmp(phy_conn_name, "rgmii") == 0) - sc->phy_conn_type = PHY_CONN_RGMII; - } - if (sc->phy_conn_type == PHY_CONN_UNKNOWN) { + sc->phy_conn_type = mii_fdt_get_contype(ofw_node); + if (sc->phy_conn_type == MII_CONTYPE_UNKNOWN) { device_printf(sc->dev, "No valid 'phy-mode' " "property found in FDT data for device.\n"); error = ENOATTR; From owner-svn-src-all@freebsd.org Sun Jun 11 02:04:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79375BFB877; Sun, 11 Jun 2017 02:04:41 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52AA46EFC5; Sun, 11 Jun 2017 02:04:41 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5B24e1h000895; Sun, 11 Jun 2017 02:04:40 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5B24dmk000888; Sun, 11 Jun 2017 02:04:39 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201706110204.v5B24dmk000888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 11 Jun 2017 02:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319819 - in stable/11: lib/libc/sys share/man/man4 sys/compat/freebsd32 sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 02:04:41 -0000 Author: allanjude Date: Sun Jun 11 02:04:39 2017 New Revision: 319819 URL: https://svnweb.freebsd.org/changeset/base/319819 Log: MFC r318765: Allow cpuset_{get,set}affinity in capabilities mode Approved by: re (marius) Modified: stable/11/lib/libc/sys/cpuset_getaffinity.2 stable/11/share/man/man4/capsicum.4 stable/11/sys/compat/freebsd32/capabilities.conf stable/11/sys/compat/freebsd32/freebsd32_sysent.c stable/11/sys/kern/capabilities.conf stable/11/sys/kern/init_sysent.c stable/11/sys/kern/kern_cpuset.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/cpuset_getaffinity.2 ============================================================================== --- stable/11/lib/libc/sys/cpuset_getaffinity.2 Sun Jun 11 00:44:19 2017 (r319818) +++ stable/11/lib/libc/sys/cpuset_getaffinity.2 Sun Jun 11 02:04:39 2017 (r319819) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2016 +.Dd May 23, 2017 .Dt CPUSET_GETAFFINITY 2 .Os .Sh NAME @@ -148,8 +148,14 @@ was either preposterously large or smaller than the ke .It Bq Er EPERM The calling process did not have the credentials required to complete the operation. +.It Bq Er ECAPMODE +The calling process attempted to act on a process other than itself, while +in capability mode. +See +.Xr capsicum 4 . .El .Sh SEE ALSO +.Xr capsicum 4 , .Xr cpuset 1 , .Xr cpuset 2 , .Xr cpuset_getid 2 , Modified: stable/11/share/man/man4/capsicum.4 ============================================================================== --- stable/11/share/man/man4/capsicum.4 Sun Jun 11 00:44:19 2017 (r319818) +++ stable/11/share/man/man4/capsicum.4 Sun Jun 11 02:04:39 2017 (r319819) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 5, 2016 +.Dd May 18, 2017 .Dt CAPSICUM 4 .Os .Sh NAME @@ -87,6 +87,16 @@ greater detail in An extension to the POSIX shared memory API to support anonymous swap objects associated with file descriptors; described in greater detail in .Xr shm_open 2 . +.El +.Pp +In some cases, +.Nm +limits the valid values of some parameters to traditional APIs in order to +restrict access to global namespaces: +.Bl -tag -width indent +.It process IDs +Processes can only act upon their own process ID with syscalls such as +.Xr cpuset_setaffinity 2 . .El .Sh SEE ALSO .Xr cap_enter 2 , Modified: stable/11/sys/compat/freebsd32/capabilities.conf ============================================================================== --- stable/11/sys/compat/freebsd32/capabilities.conf Sun Jun 11 00:44:19 2017 (r319818) +++ stable/11/sys/compat/freebsd32/capabilities.conf Sun Jun 11 02:04:39 2017 (r319819) @@ -76,9 +76,9 @@ close closefrom connectat #cpuset -#freebsd32_cpuset_getaffinity +freebsd32_cpuset_getaffinity #freebsd32_cpuset_getid -#freebsd32_cpuset_setaffinity +freebsd32_cpuset_setaffinity #freebsd32_cpuset_setid dup dup2 Modified: stable/11/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_sysent.c Sun Jun 11 00:44:19 2017 (r319818) +++ stable/11/sys/compat/freebsd32/freebsd32_sysent.c Sun Jun 11 02:04:39 2017 (r319819) @@ -552,8 +552,8 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_cpuset_setid_args), (sy_call_t *)freebsd32_cpuset_setid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 485 = freebsd32_cpuset_setid */ #endif { AS(freebsd32_cpuset_getid_args), (sy_call_t *)freebsd32_cpuset_getid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 486 = freebsd32_cpuset_getid */ - { AS(freebsd32_cpuset_getaffinity_args), (sy_call_t *)freebsd32_cpuset_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 487 = freebsd32_cpuset_getaffinity */ - { AS(freebsd32_cpuset_setaffinity_args), (sy_call_t *)freebsd32_cpuset_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 488 = freebsd32_cpuset_setaffinity */ + { AS(freebsd32_cpuset_getaffinity_args), (sy_call_t *)freebsd32_cpuset_getaffinity, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 487 = freebsd32_cpuset_getaffinity */ + { AS(freebsd32_cpuset_setaffinity_args), (sy_call_t *)freebsd32_cpuset_setaffinity, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 488 = freebsd32_cpuset_setaffinity */ { AS(faccessat_args), (sy_call_t *)sys_faccessat, AUE_FACCESSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 489 = faccessat */ { AS(fchmodat_args), (sy_call_t *)sys_fchmodat, AUE_FCHMODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 490 = fchmodat */ { AS(fchownat_args), (sy_call_t *)sys_fchownat, AUE_FCHOWNAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 491 = fchownat */ Modified: stable/11/sys/kern/capabilities.conf ============================================================================== --- stable/11/sys/kern/capabilities.conf Sun Jun 11 00:44:19 2017 (r319818) +++ stable/11/sys/kern/capabilities.conf Sun Jun 11 02:04:39 2017 (r319819) @@ -133,13 +133,12 @@ closefrom connectat ## -## cpuset(2) and related calls require scoping by process, but should -## eventually be allowed, at least in the current process case. +## cpuset(2) and related calls are limited to caller's own process/thread. ## #cpuset -#cpuset_getaffinity +cpuset_getaffinity #cpuset_getid -#cpuset_setaffinity +cpuset_setaffinity #cpuset_setid ## Modified: stable/11/sys/kern/init_sysent.c ============================================================================== --- stable/11/sys/kern/init_sysent.c Sun Jun 11 00:44:19 2017 (r319818) +++ stable/11/sys/kern/init_sysent.c Sun Jun 11 02:04:39 2017 (r319819) @@ -532,8 +532,8 @@ struct sysent sysent[] = { { AS(cpuset_args), (sy_call_t *)sys_cpuset, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 484 = cpuset */ { AS(cpuset_setid_args), (sy_call_t *)sys_cpuset_setid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 485 = cpuset_setid */ { AS(cpuset_getid_args), (sy_call_t *)sys_cpuset_getid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 486 = cpuset_getid */ - { AS(cpuset_getaffinity_args), (sy_call_t *)sys_cpuset_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 487 = cpuset_getaffinity */ - { AS(cpuset_setaffinity_args), (sy_call_t *)sys_cpuset_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 488 = cpuset_setaffinity */ + { AS(cpuset_getaffinity_args), (sy_call_t *)sys_cpuset_getaffinity, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 487 = cpuset_getaffinity */ + { AS(cpuset_setaffinity_args), (sy_call_t *)sys_cpuset_setaffinity, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 488 = cpuset_setaffinity */ { AS(faccessat_args), (sy_call_t *)sys_faccessat, AUE_FACCESSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 489 = faccessat */ { AS(fchmodat_args), (sy_call_t *)sys_fchmodat, AUE_FCHMODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 490 = fchmodat */ { AS(fchownat_args), (sy_call_t *)sys_fchownat, AUE_FCHOWNAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 491 = fchownat */ Modified: stable/11/sys/kern/kern_cpuset.c ============================================================================== --- stable/11/sys/kern/kern_cpuset.c Sun Jun 11 00:44:19 2017 (r319818) +++ stable/11/sys/kern/kern_cpuset.c Sun Jun 11 02:04:39 2017 (r319819) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -523,6 +524,7 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t int threads; int nfree; int error; + /* * The algorithm requires two passes due to locking considerations. * @@ -1097,6 +1099,15 @@ kern_cpuset_getaffinity(struct thread *td, cpulevel_t if (cpusetsize < sizeof(cpuset_t) || cpusetsize > CPU_MAXSIZE / NBBY) return (ERANGE); + /* In Capability mode, you can only get your own CPU set. */ + if (IN_CAPABILITY_MODE(td)) { + if (level != CPU_LEVEL_WHICH) + return (ECAPMODE); + if (which != CPU_WHICH_TID && which != CPU_WHICH_PID) + return (ECAPMODE); + if (id != -1) + return (ECAPMODE); + } size = cpusetsize; mask = malloc(size, M_TEMP, M_WAITOK | M_ZERO); error = cpuset_which(which, id, &p, &ttd, &set); @@ -1201,6 +1212,15 @@ kern_cpuset_setaffinity(struct thread *td, cpulevel_t if (cpusetsize < sizeof(cpuset_t) || cpusetsize > CPU_MAXSIZE / NBBY) return (ERANGE); + /* In Capability mode, you can only set your own CPU set. */ + if (IN_CAPABILITY_MODE(td)) { + if (level != CPU_LEVEL_WHICH) + return (ECAPMODE); + if (which != CPU_WHICH_TID && which != CPU_WHICH_PID) + return (ECAPMODE); + if (id != -1) + return (ECAPMODE); + } mask = malloc(cpusetsize, M_TEMP, M_WAITOK | M_ZERO); error = copyin(maskp, mask, cpusetsize); if (error) From owner-svn-src-all@freebsd.org Sun Jun 11 03:56:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99ECCBFD7A6; Sun, 11 Jun 2017 03:56:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4832872427; Sun, 11 Jun 2017 03:56:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5B3uDox047179; Sun, 11 Jun 2017 03:56:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5B3uDRH047178; Sun, 11 Jun 2017 03:56:13 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201706110356.v5B3uDRH047178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 11 Jun 2017 03:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319820 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 03:56:14 -0000 Author: cy Date: Sun Jun 11 03:56:13 2017 New Revision: 319820 URL: https://svnweb.freebsd.org/changeset/base/319820 Log: Identify command line syntax errors in poolflush() (ippool -F). Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Sun Jun 11 02:04:39 2017 (r319819) +++ head/contrib/ipfilter/tools/ippool.c Sun Jun 11 03:56:13 2017 (r319820) @@ -557,7 +557,13 @@ poolflush(argc, argv) case 'v' : opts |= OPT_VERBOSE; break; + default : + usage(argv[0]); + break; /* keep compiler happy */ } + + if (argc - 1 - optind > 0) + usage(argv[0]); if (opts & OPT_DEBUG) fprintf(stderr, "poolflush: opts = %#x\n", opts); From owner-svn-src-all@freebsd.org Sun Jun 11 04:00:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF38BFD83F; Sun, 11 Jun 2017 04:00:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EDE572592; Sun, 11 Jun 2017 04:00:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5B40Q4D047398; Sun, 11 Jun 2017 04:00:26 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5B40QOD047397; Sun, 11 Jun 2017 04:00:26 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201706110400.v5B40QOD047397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 11 Jun 2017 04:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319821 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 04:00:28 -0000 Author: cy Date: Sun Jun 11 04:00:26 2017 New Revision: 319821 URL: https://svnweb.freebsd.org/changeset/base/319821 Log: Identify poolstats() (ippool -s) command line syntax errors. Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Sun Jun 11 03:56:13 2017 (r319820) +++ head/contrib/ipfilter/tools/ippool.c Sun Jun 11 04:00:26 2017 (r319821) @@ -451,7 +451,13 @@ poolstats(argc, argv) case 'v' : opts |= OPT_VERBOSE; break; + default : + usage(argv[0]); + break; /* keep compiler happy */ } + + if (argc - 1 - optind > 0) + usage(argv[0]); if (opts & OPT_DEBUG) fprintf(stderr, "poolstats: opts = %#x\n", opts); From owner-svn-src-all@freebsd.org Sun Jun 11 04:03:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52933BFDA19; Sun, 11 Jun 2017 04:03:11 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A09072950; Sun, 11 Jun 2017 04:03:11 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5B43APO051135; Sun, 11 Jun 2017 04:03:10 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5B43ADA051134; Sun, 11 Jun 2017 04:03:10 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201706110403.v5B43ADA051134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 11 Jun 2017 04:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319822 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 04:03:11 -0000 Author: cy Date: Sun Jun 11 04:03:09 2017 New Revision: 319822 URL: https://svnweb.freebsd.org/changeset/base/319822 Log: Flag loadpoolfile() (ippool -f) command line syntax errors. Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Sun Jun 11 04:00:26 2017 (r319821) +++ head/contrib/ipfilter/tools/ippool.c Sun Jun 11 04:03:09 2017 (r319822) @@ -380,7 +380,13 @@ loadpoolfile(argc, argv, infile) case 'v' : opts |= OPT_VERBOSE; break; + default : + usage(argv[0]); + break; /* keep compiler happy */ } + + if (argc - 1 - optind > 0) + usage(argv[0]); if (opts & OPT_DEBUG) fprintf(stderr, "loadpoolfile: opts = %#x\n", opts); From owner-svn-src-all@freebsd.org Sun Jun 11 04:13:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E6FDBFDD6B; Sun, 11 Jun 2017 04:13:58 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DE6A72E17; Sun, 11 Jun 2017 04:13:58 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id B7FB895F9; Sun, 11 Jun 2017 04:13:57 +0000 (UTC) Date: Sun, 11 Jun 2017 04:13:57 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316767 - head/sys/amd64/amd64 Message-ID: <20170611041357.GA19892@FreeBSD.org> References: <201704131549.v3DFnt9I004050@repo.freebsd.org> <20170610235125.GA3587@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170610235125.GA3587@FreeBSD.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 04:13:58 -0000 On Sat, Jun 10, 2017 at 11:51:25PM +0000, Alexey Dokuchaev wrote: > On Thu, Apr 13, 2017 at 03:49:55PM +0000, Konstantin Belousov wrote: > > New Revision: 316767 > > URL: https://svnweb.freebsd.org/changeset/base/316767 > > > > Log: > > Map DMAP as nx. > > > > Demotions preserve PG_NX, so it is enough to set nx bit for initial > > lowest-level paging entries. > > Hi Kostik, > > It seems this change breaks resume with radeonkms(4): my laptop fells into > sleep, but upon resume it immediately reboots with kernels after r316767. > > Reverting these two lines fixes resuming at least up to r316986, but the > latest -CURRENT still reboots, perhaps for another reason. Second revision is r318318 which looks related to r316767. Updating kernel to the latest revision and backing out these two (any one of them alone is not enough) fixed resume for me. Apparently something else is required for nx-mapped DMAP. Anything I can help with debugging this? ./danfe From owner-svn-src-all@freebsd.org Sun Jun 11 09:33:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A3C8C77F76; Sun, 11 Jun 2017 09:33:10 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49D3D85169; Sun, 11 Jun 2017 09:33:10 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5B9X9iP006150; Sun, 11 Jun 2017 09:33:09 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5B9X9QJ006148; Sun, 11 Jun 2017 09:33:09 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201706110933.v5B9X9QJ006148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 11 Jun 2017 09:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319823 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 09:33:10 -0000 Author: dchagin Date: Sun Jun 11 09:33:09 2017 New Revision: 319823 URL: https://svnweb.freebsd.org/changeset/base/319823 Log: MFC r319571: On success, getrandom() Linux system call returns the number of bytes that were copied to the buffer supplied by the user. PR: 219464 Submitted by: Maciej Pasternacki Reported by: Maciej Pasternacki Approved by: re (kib) Modified: stable/11/sys/compat/linux/linux_misc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_misc.c ============================================================================== --- stable/11/sys/compat/linux/linux_misc.c Sun Jun 11 04:03:09 2017 (r319822) +++ stable/11/sys/compat/linux/linux_misc.c Sun Jun 11 09:33:09 2017 (r319823) @@ -2516,6 +2516,7 @@ linux_getrandom(struct thread *td, struct linux_getran { struct uio uio; struct iovec iov; + int error; if (args->flags & ~(LINUX_GRND_NONBLOCK|LINUX_GRND_RANDOM)) return (EINVAL); @@ -2532,7 +2533,10 @@ linux_getrandom(struct thread *td, struct linux_getran uio.uio_rw = UIO_READ; uio.uio_td = td; - return (read_random_uio(&uio, args->flags & LINUX_GRND_NONBLOCK)); + error = read_random_uio(&uio, args->flags & LINUX_GRND_NONBLOCK); + if (error == 0) + td->td_retval[0] = args->count - uio.uio_resid; + return (error); } int From owner-svn-src-all@freebsd.org Sun Jun 11 10:27:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FFB1C78AE7; Sun, 11 Jun 2017 10:27:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id B113232E; Sun, 11 Jun 2017 10:27:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 8A08510373F; Sun, 11 Jun 2017 19:53:48 +1000 (AEST) Date: Sun, 11 Jun 2017 19:53:47 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Jonathan Looney , John Baldwin , "Jonathan T. Looney" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319720 - head/sys/dev/vt In-Reply-To: <20170610182039.GL2088@kib.kiev.ua> Message-ID: <20170611150813.B891@besplex.bde.org> References: <201706082047.v58KlI51079003@repo.freebsd.org> <7306919.ixyIA96xWQ@ralph.baldwin.cx> <20170610091203.GH2088@kib.kiev.ua> <20170610182039.GL2088@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=GCEFH8vNhOtddbTsc2wA:9 a=CjuIK1q_8ugA:10 a=6kGIvZw6iX1k4Y-7sg4_:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 10:27:04 -0000 On Sat, 10 Jun 2017, Konstantin Belousov wrote: > On Sat, Jun 10, 2017 at 09:33:48AM -0700, Jonathan Looney wrote: >> Hi Konstantin, >> >> On Sat, Jun 10, 2017 at 2:12 AM, Konstantin Belousov >> wrote: >>> No, acquire is only specified for loads, and release for stores. In other >>> words, on some hypothetical ll/sc architecture, the atomic_add_acq() >>> could be implemented as follows, in asm-pseudocode >>> atomic_add_acq(int x): >>> ll x, r1 >>> acq x >>> add 1, r >>> sc r1, x >>> Your use of the atomic does not prevent stores reordering. >> >> If this is true, it sounds like the atomic(9) man page needs some revision. >> It says: >> >> When an atomic operation has acquire semantics, the effects of the >> operation must have completed before any subsequent load or store (by >> program order) is performed. Conversely, acquire semantics do not >> require that prior loads or stores have completed before the atomic >> operation is performed. >> >> Up until now, I have relied on this description of the way acquire barriers >> work. If this description is incorrect, I think it is important to fix it >> quickly. I think it is correct, but bit confusing. Its first sentence says that the acquire operation acts as if it completes before any subsequent load or store operation (even non-atomic ones; even to different locations; is it really that strong?) starts. Its second sentence is redundant except for "Conversely". Completion of earlier operations is before the acquire operation is not the converse of starting of later operations after the acquire operation. So the acquire operation gives a sort of read-write barrier that is obviously not very useful by itself. Using only acquire operations, I don't see how to order anything except other acquire operations: acquire1 load/store1 # can be any time after acquire1 acquire2 # must be after acquire1 load/store2 # can be any time after acquire2 Since load/store1 may be delayed until after acquire2, it may be mixed with load/store2 in any order in general. Release operations give an ordering that pairs correctly with acquire operations. Essentially what is misdescribed as the "converse" above. > There are many issues with the atomic(9) man page, and they are not easy > to fix. In essence, useful, implementable and rigorous specification of > the atomics behaviour or the memory model as whole (which cannot be avoided > if atomics are specified) seems to be still somewhat unsolved scientific > problem. > > As is, I strongly suggest to rely on the standard C or C++ > specifications and augment it with some code reading of > arch/include/atomic.h. Despite it is unfeasible to use compiler-provided > atomics in kernel in C runtime, the intended behaviour as specified in > standards give us a strong base to get something that does not have > inherent design mistakes. Unfortunately, this is the only way to get it > correct now. But the standards are even harder to read (since they are more formal and more general). >>> I'm not claiming that this fixes all bugs in this area. (In fact, I >>>> specifically disclaim this.) But, it does stop the crash from occurring. >>>> >>>> If you still feel there are better mechanisms to achieve the desired >>>> ordering, please let me know and I'll be happy to fix and/or improve >>> this. >>> See the pseudocode I posted in my original reply, which uses acq/rel pair. Try to do it without using any atomic ops directly. Atomic ops are too hard to use. Well, I tried it (just reading the code). The bug seems to be from just foot shooting. Normal mutex locking should work, but is not used for calls to vt_resume_flush_timer(). I think this is not just to avoid LORs, since initialization of callouts is done while holding the lock. >> The code you posted for vt_resume_flush_timer() would switch vd_timer_armed >> from 0 to 1 even if VDF_ASYNC is not set; however, that is not what we >> want. vd_timer_armed should be left untouched if VDF_ASYNC is not set. >> >> It sounds like what I want is some sort of fence in vt_upgrade() like jhb@ >> specified in his email. For example: >> >> vd->vd_timer_armed = 1; >> atomic_thread_fence_rel(); >> vd->vd_flags |= VDF_ASYNC; >> >> I recognize a fence would be cleaner since I really only needed the barrier >> and not the atomic operation. Do you agree the above would be sufficient to >> ensure store ordering? > > No, it is not sufficient. The release barrier on write needs a dual > acquire barrier on read to have an effect. So if you prefer to use > fence_rel(), the reader should issue fence_acq() between reading > vd_flags and doing cmpset on vd_timer_armed. The complications seem to be mostly unnecessary since everything is under the vt lock in vt_upgrade(): XX void XX vt_upgrade(struct vt_device *vd) XX { XX ... XX VT_LOCK(vd); The lock is actually the mutex vd->vd_lock. XX if (vd->vd_curwindow == NULL) XX vd->vd_curwindow = vd->vd_windows[VT_CONSWINDOW]; XX XX register_handlers = 0; XX if (!(vd->vd_flags & VDF_ASYNC)) { This flag is clear initially to tell other functions to not do any callout stuff because our callout handler and infrastructure are not initialized yet. We also have foot-shooting, with testing of this flag and testing and setting of vd->vd_timer_armed not under the mutex. This function doesn't have the foot-shooting, but is affected by it since it must be careful to set the flags in an atomic and/or ordered way to support the foot-shooting. XX /* Attach keyboard. */ XX vt_allocate_keyboard(vd); XX XX /* Init 25 Hz timer. */ XX callout_init_mtx(&vd->vd_timer, &vd->vd_lock, 0); Any callout will be locked by the same mutex that VT_LOCK() just acquired, thus cannot race with us. However, with EARLY_AP_STARTUP, ordinary output can easily be running on another CPU (thread). It uses foot-shooting to race with us (and complicated atomic operations to avoid racing with other instances of ordinary output). Non-ordinary output like screen switches might do the same (not very likely early). XX XX /* XX * Start timer when everything ready. XX * Note that the operations here are purposefully ordered. XX * We need to ensure vd_timer_armed is non-zero before we set XX * the VDF_ASYNC flag. That prevents this function from XX * racing with vt_resume_flush_timer() to update the XX * callout structure. XX */ XX atomic_add_acq_int(&vd->vd_timer_armed, 1); The previous version set this to 1 non-atomically after calling callout_reset(). XX vd->vd_flags |= VDF_ASYNC; XX callout_reset(&vd->vd_timer, hz / VT_TIMERFREQ, vt_timer, vd); XX register_handlers = 1; XX } XX XX VT_UNLOCK(vd); It would be more natural to complete our initialization before setting VDF_ACTIVE: (void)atomic_cmpset_int(&vd->vd_timer_armed, 0, 1); callout_reset(... vt_timer ...); vd->vd_flags |= VDF_ASYNC; The cmpset is not quite right, but it is the same as what other instances will do. It is sure to find 0 and set to 1. We just have to set it before VDF_ASYNC. Then I trust callout_reset() to complete its setting for all threads. Then it is safe to set VDF_ASYNC. This setting becomes visible to other CPUs later. It doesn't matter if this is much later. The other instances can't touch callouts until they see it change. Callout handlers can't run until the lock is released, and releasing the lock makes the setting of VDF_ASYNC visible. Grep shows at least the following places with the foot-shooting: - vt_window_switch() drops the lock, then soon calls vt_resume_flush_timer() - vt_mouse_event() calls vt_resume_flush_timer(). I doubt that it holds the lock. - similarly in vt_mouse_state() - vt_replace_backend() drops the lock, then later calls vt_resume_flush_timer(). It calls vt_upgrade() in between(), so can clearly regain full locking. Use lock assertions to find all the places. Bruce From owner-svn-src-all@freebsd.org Sun Jun 11 12:20:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20EB1D860C1; Sun, 11 Jun 2017 12:20:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9B313A6B; Sun, 11 Jun 2017 12:20:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v5BCKPGI084606 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 11 Jun 2017 15:20:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v5BCKPGI084606 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v5BCKPHx084604; Sun, 11 Jun 2017 15:20:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 11 Jun 2017 15:20:25 +0300 From: Konstantin Belousov To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316767 - head/sys/amd64/amd64 Message-ID: <20170611122025.GP2088@kib.kiev.ua> References: <201704131549.v3DFnt9I004050@repo.freebsd.org> <20170610235125.GA3587@FreeBSD.org> <20170611041357.GA19892@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170611041357.GA19892@FreeBSD.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 12:20:36 -0000 On Sun, Jun 11, 2017 at 04:13:57AM +0000, Alexey Dokuchaev wrote: > On Sat, Jun 10, 2017 at 11:51:25PM +0000, Alexey Dokuchaev wrote: > > On Thu, Apr 13, 2017 at 03:49:55PM +0000, Konstantin Belousov wrote: > > > New Revision: 316767 > > > URL: https://svnweb.freebsd.org/changeset/base/316767 > > > > > > Log: > > > Map DMAP as nx. > > > > > > Demotions preserve PG_NX, so it is enough to set nx bit for initial > > > lowest-level paging entries. > > > > Hi Kostik, > > > > It seems this change breaks resume with radeonkms(4): my laptop fells into > > sleep, but upon resume it immediately reboots with kernels after r316767. > > > > Reverting these two lines fixes resuming at least up to r316986, but the > > latest -CURRENT still reboots, perhaps for another reason. > > Second revision is r318318 which looks related to r316767. Updating kernel > to the latest revision and backing out these two (any one of them alone is > not enough) fixed resume for me. > > Apparently something else is required for nx-mapped DMAP. Anything I can > help with debugging this? Do you claim that latest HEAD with reverted r316767 reboots on resume on your machine ? Please confirm. Are you running on AMD CPU ? I want to see the first 100 lines of verbose dmesg, and the output of "cpucontrol -m 0xc0000080 /dev/cpuctl0". Also, try the following patch. diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c index 74f4fedc28f..690f8b765f2 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/x86/acpica/acpi_wakeup.c @@ -224,7 +224,8 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); #ifdef __amd64__ - WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER)); + WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER) & + ~(EFER_LMA)); #else WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); #endif From owner-svn-src-all@freebsd.org Sun Jun 11 13:02:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51CB1D86C38; Sun, 11 Jun 2017 13:02:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3A1D64C2A; Sun, 11 Jun 2017 13:02:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v5BD20S6093843 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 11 Jun 2017 16:02:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v5BD20S6093843 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v5BD1xMg093842; Sun, 11 Jun 2017 16:01:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 11 Jun 2017 16:01:59 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Jonathan Looney , John Baldwin , "Jonathan T. Looney" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319720 - head/sys/dev/vt Message-ID: <20170611130159.GR2088@kib.kiev.ua> References: <201706082047.v58KlI51079003@repo.freebsd.org> <7306919.ixyIA96xWQ@ralph.baldwin.cx> <20170610091203.GH2088@kib.kiev.ua> <20170610182039.GL2088@kib.kiev.ua> <20170611150813.B891@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170611150813.B891@besplex.bde.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 13:02:06 -0000 On Sun, Jun 11, 2017 at 07:53:47PM +1000, Bruce Evans wrote: > On Sat, 10 Jun 2017, Konstantin Belousov wrote: > > > On Sat, Jun 10, 2017 at 09:33:48AM -0700, Jonathan Looney wrote: > >> Hi Konstantin, > >> > >> On Sat, Jun 10, 2017 at 2:12 AM, Konstantin Belousov > >> wrote: > >>> No, acquire is only specified for loads, and release for stores. In other > >>> words, on some hypothetical ll/sc architecture, the atomic_add_acq() > >>> could be implemented as follows, in asm-pseudocode > >>> atomic_add_acq(int x): > >>> ll x, r1 > >>> acq x > >>> add 1, r > >>> sc r1, x > >>> Your use of the atomic does not prevent stores reordering. > >> > >> If this is true, it sounds like the atomic(9) man page needs some revision. > >> It says: > >> > >> When an atomic operation has acquire semantics, the effects of the > >> operation must have completed before any subsequent load or store (by > >> program order) is performed. Conversely, acquire semantics do not > >> require that prior loads or stores have completed before the atomic > >> operation is performed. > >> > >> Up until now, I have relied on this description of the way acquire barriers > >> work. If this description is incorrect, I think it is important to fix it > >> quickly. > > I think it is correct, but bit confusing. Its first sentence says that > the acquire operation acts as if it completes before any subsequent load > or store operation (even non-atomic ones; even to different locations; is > it really that strong?) starts. Its second sentence is redundant except Yes, all operations that are sequenced before/after, in the intra-thread sence of ordering by sequential points. > for "Conversely". Completion of earlier operations is before the acquire > operation is not the converse of starting of later operations after the > acquire operation. > > So the acquire operation gives a sort of read-write barrier that is > obviously not very useful by itself. Using only acquire operations, I > don't see how to order anything except other acquire operations: > > acquire1 > load/store1 # can be any time after acquire1 > acquire2 # must be after acquire1 > load/store2 # can be any time after acquire2 > > Since load/store1 may be delayed until after acquire2, it may be mixed > with load/store2 in any order in general. This is not useful at all, since it would only affect the current thread behaviour, which is already guaranteed to be self-consistent. You need other thread which observes current thread behaviour, for the barriers to have any visible effect. And then, if there is other thread, 'sync with' is only established for acq/rel pairs. > > Release operations give an ordering that pairs correctly with acquire > operations. Essentially what is misdescribed as the "converse" above. > > > There are many issues with the atomic(9) man page, and they are not easy > > to fix. In essence, useful, implementable and rigorous specification of > > the atomics behaviour or the memory model as whole (which cannot be avoided > > if atomics are specified) seems to be still somewhat unsolved scientific > > problem. > > > > As is, I strongly suggest to rely on the standard C or C++ > > specifications and augment it with some code reading of > > arch/include/atomic.h. Despite it is unfeasible to use compiler-provided > > atomics in kernel in C runtime, the intended behaviour as specified in > > standards give us a strong base to get something that does not have > > inherent design mistakes. Unfortunately, this is the only way to get it > > correct now. > > But the standards are even harder to read (since they are more formal and > more general). Sure, but there is large community and literature discussing and exploring the standard. While for atomic(9) there is several people which sometimes discuss it on lists. From owner-svn-src-all@freebsd.org Sun Jun 11 14:08:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CC1DD87BFE; Sun, 11 Jun 2017 14:08:34 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D66986697A; Sun, 11 Jun 2017 14:08:33 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2592518BCF; Sun, 11 Jun 2017 14:08:33 +0000 (UTC) Date: Sun, 11 Jun 2017 14:08:33 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316767 - head/sys/amd64/amd64 Message-ID: <20170611140833.GA49908@FreeBSD.org> References: <201704131549.v3DFnt9I004050@repo.freebsd.org> <20170610235125.GA3587@FreeBSD.org> <20170611041357.GA19892@FreeBSD.org> <20170611122025.GP2088@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="J/dobhs11T7y2rNN" Content-Disposition: inline In-Reply-To: <20170611122025.GP2088@kib.kiev.ua> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 14:08:34 -0000 --J/dobhs11T7y2rNN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Jun 11, 2017 at 03:20:25PM +0300, Konstantin Belousov wrote: > Do you claim that latest HEAD with reverted r316767 reboots on resume > on your machine ? Please confirm. Yes, I do claim that; confirmed. > Are you running on AMD CPU ? Yes, on AMD A8-5550M APU. > I want to see the first 100 lines of verbose dmesg, Attached. > and the output of "cpucontrol -m 0xc0000080 /dev/cpuctl0". # kldload cpuctl # cpucontrol -m 0xc0000080 /dev/cpuctl0 MSR 0xc0000080: 0x00000000 0x00000d01 > Also, try the following patch. Yes, it had fixed resume for me (with r316767 reinstated back in place). ./danfe --J/dobhs11T7y2rNN Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dmesg100.txt" Table 'FACP' at 0x8effc000 Table 'HPET' at 0x8effb000 Table 'APIC' at 0x8effa000 APIC: Found table at 0x8effa000 APIC: Using the MADT enumerator. MADT: Found CPU APIC ID 16 ACPI ID 0: enabled SMP: Added CPU 16 (AP) MADT: Found CPU APIC ID 17 ACPI ID 1: enabled SMP: Added CPU 17 (AP) MADT: Found CPU APIC ID 18 ACPI ID 2: enabled SMP: Added CPU 18 (AP) MADT: Found CPU APIC ID 19 ACPI ID 3: enabled SMP: Added CPU 19 (AP) Copyright (c) 1992-2017 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 12.0-CURRENT #0 r319823M: Sun Jun 11 21:13:32 CST 2017 danfe@solveig.lawndale.high:/tmp/usr/src/sys/GENERIC amd64 FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0) Table 'FACP' at 0x8effc000 Table 'HPET' at 0x8effb000 Table 'APIC' at 0x8effa000 Table 'MCFG' at 0x8eff9000 Table 'TCPA' at 0x8eff8000 Table 'SLIC' at 0x8efd5000 Table 'MSDM' at 0x8efd4000 Table 'FPDT' at 0x8efd3000 Table 'BGRT' at 0x8efd2000 Table 'SSDT' at 0x8efd1000 Table 'SSDT' at 0x8efcf000 Table 'VFCT' at 0x8efc9000 Table 'SSDT' at 0x8efc8000 ACPI: No SRAT table found PPIM 0: PA=0xc0000000, VA=0xffffffff81810000, size=0x300000, mode=0x1 VT(efifb): resolution 1024x768 Preloaded elf kernel "/boot/kernel/kernel" at 0xffffffff817a7000. Calibrating TSC clock ... TSC clock: 2096222875 Hz CPU: AMD A8-5550M APU with Radeon(tm) HD Graphics (2096.22-MHz K8-class CPU) Origin="AuthenticAMD" Id=0x610f31 Family=0x15 Model=0x13 Stepping=1 Features=0x178bfbff Features2=0x3e98320b AMD Features=0x2e500800 AMD Features2=0x1ebbfff Structured Extended Features=0x8 SVM: Features=0x1cff,PauseFilterThreshold> Revision=1, ASIDs=65536 TSC: P-state invariant, performance statistics L1 2MB data TLB: 64 entries, fully associative L1 2MB instruction TLB: 24 entries, fully associative L1 4KB data TLB: 64 entries, fully associative L1 4KB instruction TLB: 48 entries, fully associative L1 data cache: 16 kbytes, 64 bytes/line, 1 lines/tag, 4-way associative L1 instruction cache: 64 kbytes, 64 bytes/line, 1 lines/tag, 2-way associative L2 2MB data TLB: 1024 entries, 8-way associative L2 2MB instruction TLB: 1024 entries, 8-way associative L2 4KB data TLB: 1024 entries, 8-way associative L2 4KB instruction TLB: 1024 entries, 8-way associative L2 unified cache: 2048 kbytes, 64 bytes/line, 1 lines/tag, 16-way associative real memory = 17179869184 (16384 MB) Physical memory chunk(s): 0x0000000000010000 - 0x0000000000089fff, 499712 bytes (122 pages) 0x0000000000090000 - 0x000000000009efff, 61440 bytes (15 pages) 0x0000000000100000 - 0x00000000001fffff, 1048576 bytes (256 pages) 0x00000000017e3000 - 0x000000008d9c5fff, 2350788608 bytes (573923 pages) 0x000000008efff000 - 0x000000008effffff, 4096 bytes (1 pages) 0x0000000100000000 - 0x0000000423f72fff, 13488304128 bytes (3293043 pages) avail memory = 15716007936 (14987 MB) Event timer "LAPIC" quality 100 LAPIC: ipi_wait() us multiplier 19 (r 10500077 tsc 2096222875) ACPI APIC Table: Package ID shift: 4 L2 cache ID shift: 1 L1 cache ID shift: 0 Core ID shift: 0 INTR: Adding local APIC 17 as a target INTR: Adding local APIC 18 as a target INTR: Adding local APIC 19 as a target FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) Package HW ID = 1 Core HW ID = 16 CPU0 (BSP): APIC ID: 16 Core HW ID = 17 CPU1 (AP): APIC ID: 17 Core HW ID = 18 CPU2 (AP): APIC ID: 18 Core HW ID = 19 CPU3 (AP): APIC ID: 19 APIC: CPU 0 has ACPI ID 0 APIC: CPU 1 has ACPI ID 1 APIC: CPU 2 has ACPI ID 2 APIC: CPU 3 has ACPI ID 3 lapic16: MCE Thresholding ELVT unmasked Pentium Pro MTRR support enabled x86bios: IVT 0x000000-0x0004ff at 0xfffff80000000000 x86bios: SSEG 0x09e000-0x09efff at 0xfffffe0421485000 x86bios: ROM 0x0a0000-0x0fefff at 0xfffff800000a0000 arc4random: no preloaded entropy cache ULE: setup cpu 0 --J/dobhs11T7y2rNN-- From owner-svn-src-all@freebsd.org Sun Jun 11 14:33:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1747CD88429; Sun, 11 Jun 2017 14:33:18 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E545D676AA; Sun, 11 Jun 2017 14:33:17 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5BEXHMf028735; Sun, 11 Jun 2017 14:33:17 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5BEXHsl028734; Sun, 11 Jun 2017 14:33:17 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201706111433.v5BEXHsl028734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sun, 11 Jun 2017 14:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319824 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 14:33:18 -0000 Author: sevan (doc committer) Date: Sun Jun 11 14:33:16 2017 New Revision: 319824 URL: https://svnweb.freebsd.org/changeset/base/319824 Log: Tidy up minor nits raised by mandoc lint: Zap trailing white and double spaces Remove extra coma which is not required. Bump date. Reviewed by: gnn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11142 Modified: head/share/man/man4/dtrace_lockstat.4 Modified: head/share/man/man4/dtrace_lockstat.4 ============================================================================== --- head/share/man/man4/dtrace_lockstat.4 Sun Jun 11 09:33:09 2017 (r319823) +++ head/share/man/man4/dtrace_lockstat.4 Sun Jun 11 14:33:16 2017 (r319824) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 9, 2017 +.Dd June 11, 2017 .Dt DTRACE_LOCKSTAT 4 .Os .Sh NAME @@ -61,7 +61,7 @@ The provider contains DTrace probe for inspecting the kernel's lock state transitions. Tracepoints exist for several types of kernel -locking primitives, including mutexes, spin, reader-writer, +locking primitives, including mutexes, spin, reader-writer, and shared exclusive locks. An attempt has been made to provide a regular and easy to understand interface to the @@ -101,7 +101,7 @@ The first argument is a pointer to the lock structure the lock and the second argument is the length of time, in nanoseconds, that the waiting thread was blocked. -The +The .Fn lockstat:::adaptive-block probe fires only after the lock has been successfully acquired, after the adaptive-acquire probe fires. @@ -144,13 +144,13 @@ the lock and the second argument is the length of time in nanoseconds, that the waiting thread was blocked. The third argument is 1 if the thread was were spinning while -trying to acquire a read lock, +trying to acquire a read lock, otherwise it will be 0 indicating that we were spinning for the write lock. The fourth argument is 1 if we were waiting for a reader to release the lock, -otherwise it will be 0 indicating that we were waiting for a writer +otherwise it will be 0 indicating that we were waiting for a writer to release the lock. -The fifth argument is the number of readers that held the lock when -we started spinning; in particular, argument 5 is non-zero only +The fifth argument is the number of readers that held the lock when +we started spinning; in particular, argument 5 is non-zero only if the fourth argument is 1. .Pp The @@ -195,13 +195,13 @@ the lock and the second argument is the length of time in nanoseconds, that the waiting thread was blocked. The third argument is 1 if the thread was were spinning while -trying to acquire a read lock, +trying to acquire a read lock, otherwise it will be 0 indicating that we were spinning for the write lock. The fourth argument is 1 if we were waiting for a reader to release the lock, -otherwise it will be 0 indicating that we were waiting for a writer +otherwise it will be 0 indicating that we were waiting for a writer to release the lock. -The fifth argument is the number of readers that held the lock when -we started spinning; in particular, argument 5 is non-zero only +The fifth argument is the number of readers that held the lock when +we started spinning; in particular, argument 5 is non-zero only if the fourth argument is 1. .Pp The @@ -237,7 +237,7 @@ that the thread was spinning. .Xr dtrace 1 , .Xr lockstat 1 , .Xr locking 9 , -.Xr SDT 9 , +.Xr SDT 9 .Sh HISTORY The .Nm lockstat From owner-svn-src-all@freebsd.org Sun Jun 11 14:39:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 506BBD88593; Sun, 11 Jun 2017 14:39:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 216C8679A9; Sun, 11 Jun 2017 14:39:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5BEd83u029065; Sun, 11 Jun 2017 14:39:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5BEd8M7029064; Sun, 11 Jun 2017 14:39:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706111439.v5BEd8M7029064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 11 Jun 2017 14:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319825 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 14:39:09 -0000 Author: kib Date: Sun Jun 11 14:39:08 2017 New Revision: 319825 URL: https://svnweb.freebsd.org/changeset/base/319825 Log: More accurately handle early EFER restoration on resume. Do not try to set LMA bit while CPU is still in legacy mode. Apparently Intel CPUs ignore non-id writes to LMA, while AMD's (over-)react with #GP. Reported and tested by: danfe Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Sun Jun 11 14:33:16 2017 (r319824) +++ head/sys/x86/acpica/acpi_wakeup.c Sun Jun 11 14:39:08 2017 (r319825) @@ -224,7 +224,8 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); #ifdef __amd64__ - WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER)); + WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER) & + ~(EFER_LMA)); #else WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); #endif From owner-svn-src-all@freebsd.org Sun Jun 11 14:41:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 398FAD8865B; Sun, 11 Jun 2017 14:41:26 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B01367CE0; Sun, 11 Jun 2017 14:41:26 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 6C91C193C6; Sun, 11 Jun 2017 14:41:25 +0000 (UTC) Date: Sun, 11 Jun 2017 14:41:25 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319825 - head/sys/x86/acpica Message-ID: <20170611144125.GB49908@FreeBSD.org> References: <201706111439.v5BEd8M7029064@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201706111439.v5BEd8M7029064@repo.freebsd.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 14:41:26 -0000 On Sun, Jun 11, 2017 at 02:39:08PM +0000, Konstantin Belousov wrote: > New Revision: 319825 > URL: https://svnweb.freebsd.org/changeset/base/319825 > > Log: > More accurately handle early EFER restoration on resume. > > Do not try to set LMA bit while CPU is still in legacy mode. > Apparently Intel CPUs ignore non-id writes to LMA, while AMD's > (over-)react with #GP. > > Reported and tested by: danfe > Sponsored by: The FreeBSD Foundation > MFC after: 3 days Thank you! ./danfe From owner-svn-src-all@freebsd.org Sun Jun 11 15:02:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0813D88D11; Sun, 11 Jun 2017 15:02:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 226F96868E; Sun, 11 Jun 2017 15:02:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 64834D68676; Mon, 12 Jun 2017 00:37:06 +1000 (AEST) Date: Mon, 12 Jun 2017 00:37:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , Jonathan Looney , John Baldwin , "Jonathan T. Looney" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319720 - head/sys/dev/vt In-Reply-To: <20170611130159.GR2088@kib.kiev.ua> Message-ID: <20170611231933.F767@besplex.bde.org> References: <201706082047.v58KlI51079003@repo.freebsd.org> <7306919.ixyIA96xWQ@ralph.baldwin.cx> <20170610091203.GH2088@kib.kiev.ua> <20170610182039.GL2088@kib.kiev.ua> <20170611150813.B891@besplex.bde.org> <20170611130159.GR2088@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=-9vHGlYos2YZWk8VJ18A:9 a=CjuIK1q_8ugA:10 a=6kGIvZw6iX1k4Y-7sg4_:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 15:02:43 -0000 On Sun, 11 Jun 2017, Konstantin Belousov wrote: > On Sun, Jun 11, 2017 at 07:53:47PM +1000, Bruce Evans wrote: >> On Sat, 10 Jun 2017, Konstantin Belousov wrote: >> >>> On Sat, Jun 10, 2017 at 09:33:48AM -0700, Jonathan Looney wrote: >>>> Hi Konstantin, >>>> >>>> On Sat, Jun 10, 2017 at 2:12 AM, Konstantin Belousov >>>> wrote: >>>>> No, acquire is only specified for loads, and release for stores. In other >>>>> words, on some hypothetical ll/sc architecture, the atomic_add_acq() >>>>> could be implemented as follows, in asm-pseudocode >>>>> atomic_add_acq(int x): >>>>> ll x, r1 >>>>> acq x >>>>> add 1, r >>>>> sc r1, x >>>>> Your use of the atomic does not prevent stores reordering. >>>> >>>> If this is true, it sounds like the atomic(9) man page needs some revision. >>>> It says: >>>> >>>> When an atomic operation has acquire semantics, the effects of the >>>> operation must have completed before any subsequent load or store (by >>>> program order) is performed. Conversely, acquire semantics do not >>>> require that prior loads or stores have completed before the atomic >>>> operation is performed. >>>> >>>> Up until now, I have relied on this description of the way acquire barriers >>>> work. If this description is incorrect, I think it is important to fix it >>>> quickly. >> >> I think it is correct, but bit confusing. Its first sentence says that >> the acquire operation acts as if it completes before any subsequent load >> or store operation (even non-atomic ones; even to different locations; is >> it really that strong?) starts. Its second sentence is redundant except > Yes, all operations that are sequenced before/after, in the intra-thread > sence of ordering by sequential points. > >> for "Conversely". Completion of earlier operations is before the acquire >> operation is not the converse of starting of later operations after the >> acquire operation. >> >> So the acquire operation gives a sort of read-write barrier that is >> obviously not very useful by itself. Using only acquire operations, I >> don't see how to order anything except other acquire operations: >> >> acquire1 >> load/store1 # can be any time after acquire1 >> acquire2 # must be after acquire1 >> load/store2 # can be any time after acquire2 >> >> Since load/store1 may be delayed until after acquire2, it may be mixed >> with load/store2 in any order in general. > This is not useful at all, since it would only affect the current thread > behaviour, which is already guaranteed to be self-consistent. You need > other thread which observes current thread behaviour, for the barriers > to have any visible effect. > > And then, if there is other thread, 'sync with' is only established for > acq/rel pairs. Yes, I forgot that the ordering requires cooperation. So the man page is very misleading where it says "the effects of the operation must have completed". Only loads in the operation must have completed. atomic_add_acq_xxx() must also do something special with the store for the operation to be atomic. Bruce From owner-svn-src-all@freebsd.org Sun Jun 11 16:54:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B921D8AB12; Sun, 11 Jun 2017 16:54:06 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAF1B6F83C; Sun, 11 Jun 2017 16:54:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5BGs4Yg085740; Sun, 11 Jun 2017 16:54:04 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5BGs4TD085739; Sun, 11 Jun 2017 16:54:04 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201706111654.v5BGs4TD085739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 11 Jun 2017 16:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319826 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 16:54:06 -0000 Author: jilles Date: Sun Jun 11 16:54:04 2017 New Revision: 319826 URL: https://svnweb.freebsd.org/changeset/base/319826 Log: sh: Enable interrupts before executing EXIT trap and doing final flush. Modified: head/bin/sh/trap.c Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Sun Jun 11 14:39:08 2017 (r319825) +++ head/bin/sh/trap.c Sun Jun 11 16:54:04 2017 (r319826) @@ -526,11 +526,13 @@ exitshell_savedstatus(void) */ evalskip = 0; trap[0] = NULL; + FORCEINTON; evalstring(p, 0); } } if (!setjmp(loc2.loc)) { handler = &loc2; /* probably unnecessary */ + FORCEINTON; flushall(); #if JOBS setjobctl(0); From owner-svn-src-all@freebsd.org Sun Jun 11 19:05:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F41E1D8CE8D; Sun, 11 Jun 2017 19:05:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD8A0736D0; Sun, 11 Jun 2017 19:05:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5BJ5k5k039329; Sun, 11 Jun 2017 19:05:46 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5BJ5jrC039327; Sun, 11 Jun 2017 19:05:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201706111905.v5BJ5jrC039327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 11 Jun 2017 19:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319827 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 19:05:47 -0000 Author: pfg Date: Sun Jun 11 19:05:45 2017 New Revision: 319827 URL: https://svnweb.freebsd.org/changeset/base/319827 Log: extfs: fix the build with no UFS_ACL. Some people may want to drop UFS-style ACLs for slimmer kernels. Let's just not assume everyone needs ACLs. Reported by: bde Submitted by: Fedor Uporov Differential Revision: https://reviews.freebsd.org/D11145 Modified: head/sys/fs/ext2fs/ext2_acl.c head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_acl.c ============================================================================== --- head/sys/fs/ext2fs/ext2_acl.c Sun Jun 11 16:54:04 2017 (r319826) +++ head/sys/fs/ext2fs/ext2_acl.c Sun Jun 11 19:05:45 2017 (r319827) @@ -49,6 +49,8 @@ #include #include +#ifdef UFS_ACL + void ext2_sync_acl_from_inode(struct inode *ip, struct acl *acl) { @@ -522,3 +524,5 @@ ext2_aclcheck(struct vop_aclcheck_args *ap) return (acl_posix1e_check(ap->a_aclp)); } + +#endif /* UFS_ACL */ Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sun Jun 11 16:54:04 2017 (r319826) +++ head/sys/fs/ext2fs/ext2_vnops.c Sun Jun 11 19:05:45 2017 (r319827) @@ -164,9 +164,11 @@ struct vop_vector ext2_vnodeops = { .vop_getextattr = ext2_getextattr, .vop_listextattr = ext2_listextattr, .vop_setextattr = ext2_setextattr, +#ifdef UFS_ACL .vop_getacl = ext2_getacl, .vop_setacl = ext2_setacl, .vop_aclcheck = ext2_aclcheck, +#endif /* UFS_ACL */ .vop_vptofh = ext2_vptofh, }; @@ -1087,6 +1089,7 @@ out: return (error); } +#ifdef UFS_ACL static int ext2_do_posix1e_acl_inheritance_dir(struct vnode *dvp, struct vnode *tvp, mode_t dmode, struct ucred *cred, struct thread *td) @@ -1231,6 +1234,8 @@ out: return (error); } +#endif /* UFS_ACL */ + /* * Mkdir system call */ @@ -1340,6 +1345,7 @@ ext2_mkdir(struct vop_mkdir_args *ap) ip->i_flag |= IN_CHANGE; } +#ifdef UFS_ACL if (dvp->v_mount->mnt_flag & MNT_ACLS) { error = ext2_do_posix1e_acl_inheritance_dir(dvp, tvp, dmode, cnp->cn_cred, cnp->cn_thread); @@ -1347,6 +1353,8 @@ ext2_mkdir(struct vop_mkdir_args *ap) goto bad; } +#endif /* UFS_ACL */ + /* Directory set up, now install its entry in the parent directory. */ error = ext2_direnter(ip, dvp, cnp); if (error) { @@ -1601,6 +1609,8 @@ ext2_pathconf(struct vop_pathconf_args *ap) case _PC_NO_TRUNC: *ap->a_retval = 1; break; + +#ifdef UFS_ACL case _PC_ACL_EXTENDED: if (ap->a_vp->v_mount->mnt_flag & MNT_ACLS) *ap->a_retval = 1; @@ -1613,6 +1623,8 @@ ext2_pathconf(struct vop_pathconf_args *ap) else *ap->a_retval = 3; break; +#endif /* UFS_ACL */ + case _PC_MIN_HOLE_SIZE: *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; break; @@ -1927,12 +1939,14 @@ ext2_makeinode(int mode, struct vnode *dvp, struct vno if (error) goto bad; +#ifdef UFS_ACL if (dvp->v_mount->mnt_flag & MNT_ACLS) { error = ext2_do_posix1e_acl_inheritance_file(dvp, tvp, mode, cnp->cn_cred, cnp->cn_thread); if (error) goto bad; } +#endif /* UFS_ACL */ error = ext2_direnter(ip, dvp, cnp); if (error) From owner-svn-src-all@freebsd.org Sun Jun 11 19:06:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B07CD8CED2; Sun, 11 Jun 2017 19:06:09 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA41373809; Sun, 11 Jun 2017 19:06:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5BJ67t0039388; Sun, 11 Jun 2017 19:06:07 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5BJ676e039387; Sun, 11 Jun 2017 19:06:07 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201706111906.v5BJ676e039387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 11 Jun 2017 19:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319828 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 19:06:09 -0000 Author: jilles Date: Sun Jun 11 19:06:07 2017 New Revision: 319828 URL: https://svnweb.freebsd.org/changeset/base/319828 Log: rc.subr: Optimize repeated sourcing. When /etc/rc runs all /etc/rc.d scripts, it has already loaded /etc/rc.subr but each /etc/rc.d script sources it again (since /etc/rc.d scripts must also work when started stand-alone). Therefore, if rc.subr is already loaded, return so sh need not parse the rest of the file. A second effect is that there is no longer a compound command around most of rc.subr. This reduces memory usage while sh is loading rc.subr for the first time (but this memory is free()d once rc.subr is loaded). For purposes of porting this to other systems, I do not recommend porting this to systems with shells that do not have the change to the return special builtin like in r255215 (before FreeBSD 10.0-RELEASE). This change ensures that return in the top level of a dot script returns from the dot script, even if the dot script was sourced from a function. A comparison of CPU time on an amd64 bhyve virtual machine from a times command added near the end of /etc/rc, all four values summed: x orig1 + quickreturn +--------------------------------------------------------------------------+ | + + + x x x| ||______M__A_________| |______M___A__________| | +--------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 1.704 1.802 1.726 1.744 0.051419841 + 3 1.467 1.559 1.487 1.5043333 0.048387326 Difference at 95.0% confidence -0.239667 +/- 0.113163 -13.7424% +/- 6.48873% (Student's t, pooled s = 0.0499266) Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Jun 11 19:05:45 2017 (r319827) +++ head/etc/rc.subr Sun Jun 11 19:06:07 2017 (r319828) @@ -38,7 +38,9 @@ # Operating System dependent/independent variables # -if [ -z "${_rc_subr_loaded}" ]; then +if [ -n "${_rc_subr_loaded}" ]; then + return +fi _rc_subr_loaded="YES" @@ -2126,7 +2128,3 @@ _echoonce() if kenv -q rc.debug > /dev/null ; then rc_debug=YES fi - -fi # [ -z "${_rc_subr_loaded}" ] - -_rc_subr_loaded=: From owner-svn-src-all@freebsd.org Sun Jun 11 19:09:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DF91D8CF7F; Sun, 11 Jun 2017 19:09:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDAB073978; Sun, 11 Jun 2017 19:09:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5BJ9AMp039525; Sun, 11 Jun 2017 19:09:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5BJ9Awa039524; Sun, 11 Jun 2017 19:09:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201706111909.v5BJ9Awa039524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 11 Jun 2017 19:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319829 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 19:09:12 -0000 Author: pfg Date: Sun Jun 11 19:09:10 2017 New Revision: 319829 URL: https://svnweb.freebsd.org/changeset/base/319829 Log: Remove unnecessary, and mismatched, comment. Submitted by: Fedor Uporov Modified: head/sys/fs/ext2fs/ext2_extattr.c Modified: head/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extattr.c Sun Jun 11 19:06:07 2017 (r319828) +++ head/sys/fs/ext2fs/ext2_extattr.c Sun Jun 11 19:09:10 2017 (r319829) @@ -89,7 +89,7 @@ ext2_extattr_name_to_bsd(int attrnamespace, const char */ #ifdef EXT2FS_DEBUG printf("can not convert ext2fs name to bsd: namespace=%d\n", attrnamespace); -#endif /* DEBUG */ +#endif return (NULL); } From owner-svn-src-all@freebsd.org Sun Jun 11 19:31:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8C8CD8D61A; Sun, 11 Jun 2017 19:31:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94E34743A1; Sun, 11 Jun 2017 19:31:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5BJVgk8050983; Sun, 11 Jun 2017 19:31:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5BJVgIp050980; Sun, 11 Jun 2017 19:31:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706111931.v5BJVgIp050980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 11 Jun 2017 19:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319830 - in head: . usr.sbin/chown/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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 19:31:43 -0000 Author: ngie Date: Sun Jun 11 19:31:42 2017 New Revision: 319830 URL: https://svnweb.freebsd.org/changeset/base/319830 Log: Add more simple positive tests for chown(1) The tests are largely symmetric with the tests for chmod(1)--added in r319642. Remove chown-f_test (added in r268030) since the test coverage is now being provided by `chown_test`. MFC after: 1 month Sponsored by: Dell EMC Isilon Added: head/usr.sbin/chown/tests/chown_test.sh - copied, changed from r319642, head/bin/chmod/tests/chmod_test.sh Deleted: head/usr.sbin/chown/tests/chown-f_test.sh Modified: head/ObsoleteFiles.inc head/usr.sbin/chown/tests/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Jun 11 19:09:10 2017 (r319829) +++ head/ObsoleteFiles.inc Sun Jun 11 19:31:42 2017 (r319830) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20170610: chown-f_test replaced by chown_test +OLD_FILES+=usr/tests/usr.sbin/chown/chown-f_test # 20170609: drop obsolete manpage link (if_rtwn.ko -> rtwn.ko) OLD_FILES+=usr/share/man/man4/if_rtwn.4.gz # 20170531: removal of groff Modified: head/usr.sbin/chown/tests/Makefile ============================================================================== --- head/usr.sbin/chown/tests/Makefile Sun Jun 11 19:09:10 2017 (r319829) +++ head/usr.sbin/chown/tests/Makefile Sun Jun 11 19:31:42 2017 (r319830) @@ -1,9 +1,5 @@ # $FreeBSD$ -.include - -TESTSDIR= ${TESTSBASE}/usr.sbin/chown - -TAP_TESTS_SH= chown-f_test +ATF_TESTS_SH+= chown_test .include Copied and modified: head/usr.sbin/chown/tests/chown_test.sh (from r319642, head/bin/chmod/tests/chmod_test.sh) ============================================================================== --- head/bin/chmod/tests/chmod_test.sh Wed Jun 7 05:33:56 2017 (r319642, copy source) +++ head/usr.sbin/chown/tests/chown_test.sh Sun Jun 11 19:31:42 2017 (r319830) @@ -28,58 +28,61 @@ atf_test_case RH_flag RH_flag_head() { - atf_set "descr" "Verify that setting modes recursively via -R doesn't " \ + atf_set "descr" "Verify that setting ownership recursively via -R doesn't " \ "affect symlinks specified via the arguments when -H " \ "is specified" + atf_set "require.user" "root" } RH_flag_body() { - atf_check mkdir -m 0777 -p A/B + atf_check mkdir -p A/B atf_check ln -s B A/C - atf_check chmod -h 0777 A/C - atf_check -o inline:'40755\n40777\n120777\n' stat -f '%p' A A/B A/C - atf_check chmod -RH 0700 A - atf_check -o inline:'40700\n40700\n120700\n' stat -f '%p' A A/B A/C - atf_check chmod -RH 0600 A/C - atf_check -o inline:'40700\n40600\n120700\n' stat -f '%p' A A/B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RH 84:84 A + atf_check -o inline:'84:84\n84:84\n84:84\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RH 126:126 A/C + atf_check -o inline:'84:84\n126:126\n84:84\n' stat -f '%u:%g' A A/B A/C } atf_test_case RL_flag RL_flag_head() { - atf_set "descr" "Verify that setting modes recursively via -R doesn't " \ + atf_set "descr" "Verify that setting ownership recursively via -R doesn't " \ "affect symlinks specified via the arguments when -L " \ "is specified" + atf_set "require.user" "root" } RL_flag_body() { - atf_check mkdir -m 0777 -p A/B + atf_check mkdir -p A/B atf_check ln -s B A/C - atf_check chmod -h 0777 A/C - atf_check -o inline:'40755\n40777\n120777\n' stat -f '%p' A A/B A/C - atf_check chmod -RL 0700 A - atf_check -o inline:'40700\n40700\n120777\n' stat -f '%p' A A/B A/C - atf_check chmod -RL 0600 A/C - atf_check -o inline:'40700\n40600\n120777\n' stat -f '%p' A A/B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RL 84:84 A + atf_check -o inline:'84:84\n84:84\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RL 126:126 A/C + atf_check -o inline:'84:84\n126:126\n42:42\n' stat -f '%u:%g' A A/B A/C } atf_test_case RP_flag RP_flag_head() { - atf_set "descr" "Verify that setting modes recursively via -R doesn't " \ - "affect symlinks specified via the arguments when -P " \ - "is specified" + atf_set "descr" "Verify that setting ownership recursively via -R " \ + "doesn't affect symlinks specified via the arguments " \ + "when -P is specified" + atf_set "require.user" "root" } RP_flag_body() { - atf_check mkdir -m 0777 -p A/B + atf_check mkdir -p A/B atf_check ln -s B A/C - atf_check chmod -h 0777 A/C - atf_check -o inline:'40755\n40777\n120777\n' stat -f '%p' A A/B A/C - atf_check chmod -RP 0700 A - atf_check -o inline:'40700\n40700\n120700\n' stat -f '%p' A A/B A/C - atf_check chmod -RP 0600 A/C - atf_check -o inline:'40700\n40700\n120600\n' stat -f '%p' A A/B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RP 84:84 A + atf_check -o inline:'84:84\n84:84\n84:84\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RP 126:126 A/C + atf_check -o inline:'84:84\n84:84\n126:126\n' stat -f '%u:%g' A A/B A/C } atf_test_case f_flag cleanup @@ -88,17 +91,18 @@ f_flag_head() atf_set "descr" "Verify that setting a mode for a file with -f " \ "doesn't emit an error message/exit with a non-zero " \ "code" + atf_set "require.user" "root" } f_flag_body() { atf_check truncate -s 0 foo bar - atf_check chmod 0750 foo bar + atf_check chown 0:0 foo bar atf_check chflags uchg foo - atf_check -e not-empty -s not-exit:0 chmod 0700 foo bar - atf_check -o inline:'100750\n100700\n' stat -f '%p' foo bar - atf_check -s exit:0 chmod -f 0600 foo bar - atf_check -o inline:'100750\n100600\n' stat -f '%p' foo bar + atf_check -e not-empty -s not-exit:0 chown 42:42 foo bar + atf_check -o inline:'0:0\n42:42\n' stat -f '%u:%g' foo bar + atf_check -s exit:0 chown -f 84:84 foo bar + atf_check -o inline:'0:0\n84:84\n' stat -f '%u:%g' foo bar } f_flag_cleanup() @@ -112,43 +116,84 @@ h_flag_head() atf_set "descr" "Verify that setting a mode for a file with -f " \ "doesn't emit an error message/exit with a non-zero " \ "code" + atf_set "require.user" "root" } h_flag_body() { atf_check truncate -s 0 foo - atf_check chmod 0600 foo - atf_check -o inline:'100600\n' stat -f '%p' foo - umask 0077 + atf_check -o inline:'0:0\n' stat -f '%u:%g' foo atf_check ln -s foo bar - atf_check -o inline:'100600\n120700\n' stat -f '%p' foo bar - atf_check chmod -h 0500 bar - atf_check -o inline:'100600\n120500\n' stat -f '%p' foo bar - atf_check chmod 0660 bar - atf_check -o inline:'100660\n120500\n' stat -f '%p' foo bar + atf_check -o inline:'0:0\n0:0\n' stat -f '%u:%g' foo bar + atf_check chown -h 42:42 bar + atf_check -o inline:'0:0\n42:42\n' stat -f '%u:%g' foo bar + atf_check chown 84:84 bar + atf_check -o inline:'84:84\n42:42\n' stat -f '%u:%g' foo bar } atf_test_case v_flag v_flag_head() { - atf_set "descr" "Verify that setting a mode with -v emits the file when " \ - "doesn't emit an error message/exit with a non-zero " \ - "code" + atf_set "descr" "Verify that setting ownership with -v emits the " \ + "file doesn't emit an error message/exit with a " \ + "non-zero code" + atf_set "require.user" "root" } v_flag_body() { atf_check truncate -s 0 foo bar - atf_check chmod 0600 foo - atf_check chmod 0750 bar - atf_check -o 'inline:bar\n' chmod -v 0600 foo bar - atf_check chmod -v 0600 foo bar + atf_check chown 0:0 foo + atf_check chown 42:42 bar + atf_check -o 'inline:bar\n' chown -v 0:0 foo bar + atf_check chown -v 0:0 foo bar for f in foo bar; do - echo "$f: 0100600 [-rw------- ] -> 0100700 [-rwx------ ]"; + echo "$f: 0:0 -> 84:84"; done > output.txt - atf_check -o file:output.txt chmod -vv 0700 foo bar - atf_check chmod -vv 0700 foo bar + atf_check -o file:output.txt chown -vv 84:84 foo bar + atf_check chown -vv 84:84 foo bar } +md_file="md.out" +atf_test_case x_flag cleanup +x_flag_head() +{ + atf_set "descr" "Verify that setting a mode with -x doesn't set " \ + "ownership across mountpoints" + atf_set "require.user" "root" +} +x_flag_body() +{ + atf_check -o save:$md_file mdconfig -a -t malloc -s 20m + if ! md_device=$(cat $md_file); then + atf_fail "cat $md_file failed" + fi + atf_check -o not-empty newfs /dev/$md_device + atf_check mkdir mnt + atf_check mount /dev/$md_device mnt + atf_check truncate -s 0 foo bar mnt/bazbaz + atf_check ln -s bar mnt/barbaz + atf_check ln -s ../foo mnt/foobaz + cd mnt + test_files="../foo ../bar barbaz bazbaz foobaz" + atf_check -o inline:'0:0\n0:0\n0:0\n0:0\n0:0\n' \ + stat -f '%u:%g' $test_files + atf_check chown -Rx 42:42 . + atf_check -o inline:'0:0\n0:0\n42:42\n42:42\n42:42\n' \ + stat -f '%u:%g' $test_files + atf_check chown -R 84:84 . + atf_check -o inline:'0:0\n0:0\n84:84\n84:84\n84:84\n' \ + stat -f '%u:%g' $test_files +} +x_flag_cleanup() +{ + if ! md_device=$(cat $md_file) || [ -z "$md_device" ]; then + echo "Couldn't get device from $md_file" + exit 0 + fi + umount mnt + mdconfig -d -u $md_device +} + atf_init_test_cases() { atf_add_test_case RH_flag @@ -157,4 +202,5 @@ atf_init_test_cases() atf_add_test_case f_flag atf_add_test_case h_flag atf_add_test_case v_flag + atf_add_test_case x_flag } From owner-svn-src-all@freebsd.org Sun Jun 11 21:13:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ACECB95651; Sun, 11 Jun 2017 21:13:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2CBC775ED; Sun, 11 Jun 2017 21:13:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5BLDDRq092408; Sun, 11 Jun 2017 21:13:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5BLDCpt092403; Sun, 11 Jun 2017 21:13:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706112113.v5BLDCpt092403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 11 Jun 2017 21:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319834 - in head: etc/mtree usr.bin/stat usr.bin/stat/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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 21:13:14 -0000 Author: ngie Date: Sun Jun 11 21:13:12 2017 New Revision: 319834 URL: https://svnweb.freebsd.org/changeset/base/319834 Log: Write up some basic tests for readlink(1) The tests exercise -f (f_flag), -n (n_flag), and no arguments (basic). MFC after: 1 month Sponsored by: Dell EMC Isilon Added: head/usr.bin/stat/tests/ head/usr.bin/stat/tests/Makefile (contents, props changed) head/usr.bin/stat/tests/readlink_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/stat/Makefile head/usr.bin/stat/stat.1 Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun Jun 11 20:27:38 2017 (r319833) +++ head/etc/mtree/BSD.tests.dist Sun Jun 11 21:13:12 2017 (r319834) @@ -670,6 +670,8 @@ .. soelim .. + stat + .. tail .. tar Modified: head/usr.bin/stat/Makefile ============================================================================== --- head/usr.bin/stat/Makefile Sun Jun 11 20:27:38 2017 (r319833) +++ head/usr.bin/stat/Makefile Sun Jun 11 21:13:12 2017 (r319834) @@ -1,8 +1,12 @@ # $FreeBSD$ +.include + PROG= stat LINKS= ${BINDIR}/stat ${BINDIR}/readlink MLINKS= stat.1 readlink.1 + +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun Jun 11 20:27:38 2017 (r319833) +++ head/usr.bin/stat/stat.1 Sun Jun 11 21:13:12 2017 (r319834) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2012 +.Dd June 22, 2017 .Dt STAT 1 .Os .Sh NAME Added: head/usr.bin/stat/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/stat/tests/Makefile Sun Jun 11 21:13:12 2017 (r319834) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH+= readlink_test + +.include Added: head/usr.bin/stat/tests/readlink_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/stat/tests/readlink_test.sh Sun Jun 11 21:13:12 2017 (r319834) @@ -0,0 +1,73 @@ +# +# Copyright (c) 2017 Dell EMC +# 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$ + +atf_test_case f_flag +basic_head() +{ + atf_set "descr" "Verify that calling readlink without any flags " \ + "prints out the symlink target for a file" +} +basic_body() +{ + atf_check ln -s foo bar + atf_check -o inline:'foo\n' readlink bar +} + +atf_test_case f_flag +f_flag_head() +{ + atf_set "descr" "Verify that calling readlink with -f will not emit " \ + "an error message/exit with a non-zero code" +} +f_flag_body() +{ + atf_check touch A.file + atf_check ln -s nonexistent A.link + atf_check -o inline:"nonexistent\n" \ + -s exit:1 readlink A.file A.link + atf_check -o inline:"$(realpath A.file)\n$PWD/nonexistent\n" \ + -s exit:1 readlink -f A.file A.link +} + +atf_test_case n_flag +n_flag_head() +{ +} +n_flag_body() +{ + atf_check ln -s nonexistent.A A + atf_check ln -s nonexistent.B B + atf_check -o 'inline:nonexistent.A\nnonexistent.B\n' readlink A B + atf_check -o 'inline:nonexistent.Anonexistent.B' readlink -n A B +} + +atf_init_test_cases() +{ + atf_add_test_case basic + atf_add_test_case f_flag + atf_add_test_case n_flag +} From owner-svn-src-all@freebsd.org Sun Jun 11 21:23:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 306B3B95883; Sun, 11 Jun 2017 21:23:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 013D177A40; Sun, 11 Jun 2017 21:23:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5BLNtI7096279; Sun, 11 Jun 2017 21:23:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5BLNtN6096278; Sun, 11 Jun 2017 21:23:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706112123.v5BLNtN6096278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 11 Jun 2017 21:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319836 - head/usr.bin/stat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Jun 2017 21:23:56 -0000 Author: ngie Date: Sun Jun 11 21:23:54 2017 New Revision: 319836 URL: https://svnweb.freebsd.org/changeset/base/319836 Log: stat(1): sort flags in the DESCRIPTION section -x's description should come after -t's description. MFC after: 1 month Sponsored by: Dell EMC Isilon Modified: head/usr.bin/stat/stat.1 Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun Jun 11 21:23:45 2017 (r319835) +++ head/usr.bin/stat/stat.1 Sun Jun 11 21:23:54 2017 (r319836) @@ -179,15 +179,15 @@ Display information in .Dq shell output format, suitable for initializing variables. -.It Fl x -Display information in a more verbose way as known from some -.Tn Linux -distributions. .It Fl t Ar timefmt Display timestamps using the specified format. This format is passed directly to .Xr strftime 3 . +.It Fl x +Display information in a more verbose way as known from some +.Tn Linux +distributions. .El .Ss Formats Format strings are similar to From owner-svn-src-all@freebsd.org Mon Jun 12 00:21:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9493FBF0240; Mon, 12 Jun 2017 00:21:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CE187B987; Mon, 12 Jun 2017 00:21:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C0LtGK069189; Mon, 12 Jun 2017 00:21:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C0LtsX069187; Mon, 12 Jun 2017 00:21:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706120021.v5C0LtsX069187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 00:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319841 - head/usr.bin/stat/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 00:21:56 -0000 Author: ngie Date: Mon Jun 12 00:21:55 2017 New Revision: 319841 URL: https://svnweb.freebsd.org/changeset/base/319841 Log: Add initial tests for stat(1) Testcases for -H, -L, and -f haven't been implemented yet, in part due to additional complexity needed to validate the features: * -H and -f will require an external "helper" program to display/modify the state/permissions for a given path. * -L is being covered partially via the -n testcase today. MFC after: 1 month Added: head/usr.bin/stat/tests/stat_test.sh (contents, props changed) Modified: head/usr.bin/stat/tests/Makefile Modified: head/usr.bin/stat/tests/Makefile ============================================================================== --- head/usr.bin/stat/tests/Makefile Sun Jun 11 22:22:17 2017 (r319840) +++ head/usr.bin/stat/tests/Makefile Mon Jun 12 00:21:55 2017 (r319841) @@ -1,5 +1,6 @@ # $FreeBSD$ ATF_TESTS_SH+= readlink_test +ATF_TESTS_SH+= stat_test .include Added: head/usr.bin/stat/tests/stat_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/stat/tests/stat_test.sh Mon Jun 12 00:21:55 2017 (r319841) @@ -0,0 +1,235 @@ +# +# Copyright (c) 2017 Dell EMC +# 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$ + +atf_test_case F_flag +F_flag_head() +{ + atf_set "descr" "Verify the output format for -F" +} +F_flag_body() +{ + # TODO: socket, whiteout file + atf_check touch a + atf_check mkdir b + atf_check install -m 0777 /dev/null c + atf_check ln -s a d + atf_check mkfifo f + + atf_check -o match:'.* a' stat -Fn a + atf_check -o match:'.* b/' stat -Fn b + atf_check -o match:'.* c\*' stat -Fn c + atf_check -o match:'.* d@' stat -Fn d + atf_check -o match:'.* f\|' stat -Fn f +} + +atf_test_case l_flag +l_flag_head() +{ + atf_set "descr" "Verify the output format for -l" +} +l_flag_body() +{ + atf_check touch a + atf_check ln a b + atf_check ln -s a c + atf_check mkdir d + + paths="a b c d" + + # NOTE: + # - Even though stat -l claims to be equivalent to `ls -lT`, the + # whitespace is a bit more liberal in the `ls -lT` output. + # - `ls -ldT` is used to not recursively list the contents of + # directories. + for path in $paths; do + atf_check -o inline:"$(ls -ldT $path | sed -e 's, , ,g')\n" \ + stat -l $path + done +} + +atf_test_case n_flag +n_flag_head() +{ + atf_set "descr" "Verify that -n suppresses newline output for lines" +} +n_flag_body() +{ + atf_check touch a b + atf_check -o inline:"$(stat a | tr -d '\n')" stat -n a + atf_check -o inline:"$(stat a b | tr -d '\n')" stat -n a b +} + +atf_test_case q_flag +q_flag_head() +{ + atf_set "descr" "Verify that -q suppresses error messages from l?stat(2)" +} +q_flag_body() +{ + ln -s nonexistent broken-link + + atf_check -s exit:1 stat -q nonexistent + atf_check -s exit:1 stat -q nonexistent + atf_check -o not-empty stat -q broken-link + atf_check -o not-empty stat -qL broken-link +} + +atf_test_case r_flag +r_flag_head() +{ + atf_set "descr" "Verify that -r displays output in 'raw mode'" +} +r_flag_body() +{ + atf_check touch a + # TODO: add more thorough checks. + atf_check -o not-empty stat -r a +} + +atf_test_case s_flag +s_flag_head() +{ + atf_set "descr" "Verify the output format for -s" +} +s_flag_body() +{ + atf_check touch a + atf_check ln a b + atf_check ln -s a c + atf_check mkdir d + + paths="a b c d" + + # The order/name of each of the fields is specified by stat(1) manpage. + fields="st_dev st_ino st_mode st_nlink" + fields="$fields st_uid st_gid st_rdev st_size" + fields="$fields st_uid st_gid st_mode" + fields="$fields st_atime st_mtime st_ctime st_birthtime" + fields="$fields st_blksize st_blocks st_flags" + + # NOTE: the following... + # - ... relies on set -eu to ensure that the fields are set, as + # documented, in stat(1). + # - ... uses a subshell to ensure that the eval'ed variables don't + # pollute the next iteration's behavior. + for path in $paths; do + ( + set -eu + eval $(stat -s $path) + for field in $fields; do + eval "$field=\$$field" + done + ) || atf_fail 'One or more fields not set by stat(1)' + done +} + +atf_test_case t_flag +t_flag_head() +{ + atf_set "descr" "Verify the output format for -t" +} + +t_flag_body() +{ + atf_check touch foo + atf_check touch -d 1970-01-01T00:00:42 foo + atf_check -o inline:'42\n' \ + stat -t '%s' -f '%a' foo + atf_check -o inline:'1970-01-01 00:00:42\n' \ + stat -t '%F %H:%M:%S' -f '%Sa' foo +} + +x_output_date() +{ + local date_format='%a %b %d %H:%M:%S %Y' + + stat -t "$date_format" "$@" +} + +x_output() +{ + local path=$1; shift + + local atime_s=$(x_output_date -f '%Sa' $path) + local ctime_s=$(x_output_date -f '%Sc' $path) + local devid=$(stat -f '%Hd,%Ld' $path) + local file_type_s=$(stat -f '%HT' $path) + local gid=$(stat -f '%5g' $path) + local groupname=$(stat -f '%8Sg' $path) + local inode=$(stat -f '%i' $path) + local mode=$(stat -f '%Mp%Lp' $path) + local mode_s=$(stat -f '%Sp' $path) + local mtime_s=$(x_output_date -f '%Sm' $path) + local nlink=$(stat -f '%l' $path) + local size_a=$(stat -f '%-11z' $path) + local uid=$(stat -f '%5u' $path) + local username=$(stat -f '%8Su' $path) + + cat < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C0EABF05B0; Mon, 12 Jun 2017 00:43:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3EE67C0CC; Mon, 12 Jun 2017 00:43:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C0hFIb076950; Mon, 12 Jun 2017 00:43:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C0hFnx076949; Mon, 12 Jun 2017 00:43:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706120043.v5C0hFnx076949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 00:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319842 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 00:43:16 -0000 Author: ngie Date: Mon Jun 12 00:43:14 2017 New Revision: 319842 URL: https://svnweb.freebsd.org/changeset/base/319842 Log: getbsize(3): clarify that underflow/overflow warnings in regard to $BLOCKSIZE gets output via warnx(3) This helps set expectations for how one might deal with those messages, i.e., mute output from /dev/stderr today, since that's where vwarn(3) outputs messages to today. MFC after: 1 month Modified: head/lib/libc/gen/getbsize.3 Modified: head/lib/libc/gen/getbsize.3 ============================================================================== --- head/lib/libc/gen/getbsize.3 Mon Jun 12 00:21:55 2017 (r319841) +++ head/lib/libc/gen/getbsize.3 Mon Jun 12 00:43:14 2017 (r319842) @@ -28,7 +28,7 @@ .\" @(#)getbsize.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 16, 2012 +.Dd June 11, 2017 .Dt GETBSIZE 3 .Os .Sh NAME @@ -67,7 +67,8 @@ Sizes less than 512 bytes are rounded up to 512 bytes, greater than 1 GB are rounded down to 1 GB. In each case .Fn getbsize -produces a warning message. +produces a warning message via +.Xr warnx 3 . .Pp The .Fn getbsize From owner-svn-src-all@freebsd.org Mon Jun 12 01:26:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BFE0BF1239; Mon, 12 Jun 2017 01:26:37 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E1597D075; Mon, 12 Jun 2017 01:26:37 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C1QapL093556; Mon, 12 Jun 2017 01:26:36 GMT (envelope-from gshapiro@FreeBSD.org) Received: (from gshapiro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C1QaqZ093555; Mon, 12 Jun 2017 01:26:36 GMT (envelope-from gshapiro@FreeBSD.org) Message-Id: <201706120126.v5C1QaqZ093555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gshapiro set sender to gshapiro@FreeBSD.org using -f From: Gregory Neil Shapiro Date: Mon, 12 Jun 2017 01:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319843 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 01:26:37 -0000 Author: gshapiro Date: Mon Jun 12 01:26:36 2017 New Revision: 319843 URL: https://svnweb.freebsd.org/changeset/base/319843 Log: Fix 'restart' action: rc.subr only expects to restart one service, not two. PR: 217393 Reported by: Martin Simmons MFC after: 1 week Modified: head/etc/rc.d/sendmail Modified: head/etc/rc.d/sendmail ============================================================================== --- head/etc/rc.d/sendmail Mon Jun 12 00:43:14 2017 (r319842) +++ head/etc/rc.d/sendmail Mon Jun 12 01:26:36 2017 (r319843) @@ -206,12 +206,14 @@ required_files= if checkyesno sendmail_submit_enable; then name="sendmail_submit" rcvar="sendmail_submit_enable" + _rc_restart_done=false run_rc_command "$1" fi if checkyesno sendmail_outbound_enable; then name="sendmail_outbound" rcvar="sendmail_outbound_enable" + _rc_restart_done=false run_rc_command "$1" fi @@ -219,4 +221,5 @@ name="sendmail_msp_queue" rcvar="sendmail_msp_queue_enable" pidfile="${sendmail_msp_queue_pidfile:-/var/spool/clientmqueue/sm-client.pid}" required_files="/etc/mail/submit.cf" +_rc_restart_done=false run_rc_command "$1" From owner-svn-src-all@freebsd.org Mon Jun 12 02:12:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3030BBF1AC0; Mon, 12 Jun 2017 02:12:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 026F97E01D; Mon, 12 Jun 2017 02:12:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C2CN3W015485; Mon, 12 Jun 2017 02:12:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C2CNob015484; Mon, 12 Jun 2017 02:12:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706120212.v5C2CNob015484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 02:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319844 - head/lib/libcam/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 02:12:24 -0000 Author: ngie Date: Mon Jun 12 02:12:22 2017 New Revision: 319844 URL: https://svnweb.freebsd.org/changeset/base/319844 Log: Add positive and negative testcases for cam_get_device(3) MFC after: 1 month Submitted by: Evan Cramer Modified: head/lib/libcam/tests/libcam_test.c Modified: head/lib/libcam/tests/libcam_test.c ============================================================================== --- head/lib/libcam/tests/libcam_test.c Mon Jun 12 01:26:36 2017 (r319843) +++ head/lib/libcam/tests/libcam_test.c Mon Jun 12 02:12:22 2017 (r319844) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -58,6 +59,75 @@ cam_has_error(void) return (strlen(cam_errbuf) != 0); } +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_NULL_path); +ATF_TC_BODY(cam_get_device_negative_test_NULL_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device(NULL, parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_bad_path); +ATF_TC_BODY(cam_get_device_negative_test_bad_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("1ada", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_nul_path); +ATF_TC_BODY(cam_get_device_negative_test_nul_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_root); +ATF_TC_BODY(cam_get_device_negative_test_root, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("/", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_positive_test); +ATF_TC_BODY(cam_get_device_positive_test, tc) +{ + char expected_dev_name[] = "foo"; + char parsed_dev_name[DEV_IDLEN + 1]; + int expected_unit, parsed_unit; + + expected_unit = 1; + + ATF_REQUIRE_MSG(cam_get_device("/dev/foo1", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == 0, + "cam_get_device failed"); + ATF_REQUIRE_STREQ(parsed_dev_name, expected_dev_name); + ATF_REQUIRE(parsed_unit == expected_unit); + + strcpy(parsed_dev_name, ""); + parsed_unit = -1; + + ATF_REQUIRE_MSG(cam_get_device("foo1", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == 0, + "cam_get_device failed"); + ATF_REQUIRE_STREQ(parsed_dev_name, expected_dev_name); + ATF_REQUIRE(parsed_unit == expected_unit); +} + ATF_TC(cam_open_device_negative_test_O_RDONLY); ATF_TC_HEAD(cam_open_device_negative_test_O_RDONLY, tc) { @@ -206,6 +276,11 @@ ATF_TC_BODY(cam_freeccb_negative_test_NULL, tc) ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_NULL_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_bad_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_nul_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_root); + ATF_TP_ADD_TC(tp, cam_get_device_positive_test); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_O_RDONLY); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_nonexistent); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_unprivileged); From owner-svn-src-all@freebsd.org Mon Jun 12 02:38:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E237FBF2017; Mon, 12 Jun 2017 02:38:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3EB07E807; Mon, 12 Jun 2017 02:38:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C2cbkq023891; Mon, 12 Jun 2017 02:38:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C2cbLi023890; Mon, 12 Jun 2017 02:38:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706120238.v5C2cbLi023890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 02:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319845 - head/lib/libcam/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 02:38:39 -0000 Author: ngie Date: Mon Jun 12 02:38:37 2017 New Revision: 319845 URL: https://svnweb.freebsd.org/changeset/base/319845 Log: Remove stdlib.h #include added in r319844 A previous iteration of the tests I added in r319844 involved free(3), but that attempt didn't pan out, so I switched to stack allocated buffers instead of heap allocated ones, making the #include unnecessary. MFC after: 1 month MFC with: r319844 Modified: head/lib/libcam/tests/libcam_test.c Modified: head/lib/libcam/tests/libcam_test.c ============================================================================== --- head/lib/libcam/tests/libcam_test.c Mon Jun 12 02:12:22 2017 (r319844) +++ head/lib/libcam/tests/libcam_test.c Mon Jun 12 02:38:37 2017 (r319845) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@freebsd.org Mon Jun 12 02:42:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68C1FBF21DD; Mon, 12 Jun 2017 02:42:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33E157EBA9; Mon, 12 Jun 2017 02:42:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C2gd4u027594; Mon, 12 Jun 2017 02:42:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C2gdxp027593; Mon, 12 Jun 2017 02:42:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706120242.v5C2gdxp027593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 02:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319846 - head/usr.bin/du X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 02:42:40 -0000 Author: ngie Date: Mon Jun 12 02:42:39 2017 New Revision: 319846 URL: https://svnweb.freebsd.org/changeset/base/319846 Log: du(1): trivial whitespace cleanup MFC after: 1 month Modified: head/usr.bin/du/du.c Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Mon Jun 12 02:38:37 2017 (r319845) +++ head/usr.bin/du/du.c Mon Jun 12 02:42:39 2017 (r319846) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include - #include #include #include @@ -514,7 +513,7 @@ static void ignoreclean(void) { struct ignentry *ign; - + while (!SLIST_EMPTY(&ignores)) { ign = SLIST_FIRST(&ignores); SLIST_REMOVE_HEAD(&ignores, next); From owner-svn-src-all@freebsd.org Mon Jun 12 05:11:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C03BF4137; Mon, 12 Jun 2017 05:11:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E734182461; Mon, 12 Jun 2017 05:11:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C5BhMO088923; Mon, 12 Jun 2017 05:11:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C5Bh9K088922; Mon, 12 Jun 2017 05:11:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706120511.v5C5Bh9K088922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 05:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319847 - head/usr.bin/diff/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 05:11:45 -0000 Author: ngie Date: Mon Jun 12 05:11:43 2017 New Revision: 319847 URL: https://svnweb.freebsd.org/changeset/base/319847 Log: Add some testcases for `diff --side-by-side` support These are were created proactively, in anticipation of the support being fully implemented sometime in the future. The tests currently fail on ^/head@r319845, however. Expect them to fail. PR: 219933 Tested with: gdiff Modified: head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Mon Jun 12 02:42:39 2017 (r319846) +++ head/usr.bin/diff/tests/diff_test.sh Mon Jun 12 05:11:43 2017 (r319847) @@ -6,6 +6,7 @@ atf_test_case header atf_test_case header_ns atf_test_case ifdef atf_test_case group_format +atf_test_case side_by_side simple_body() { @@ -88,6 +89,26 @@ group_format_body() ' "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in" } +side_by_side_body() +{ + atf_expect_fail "--side-by-side not currently implemented (bug # 219933)" + + atf_check -o save:A printf "A\nB\nC\n" + atf_check -o save:B printf "D\nB\nE\n" + + exp_output="A[[:space:]]+|[[:space:]]+D\nB[[:space:]]+B\nC[[:space:]]+|[[:space:]]+E" + exp_output_suppressed="A[[:space:]]+|[[:space:]]+D\nC[[:space:]]+|[[:space:]]+E" + + atf_check -o match:"$exp_output" -s exit:1 \ + diff --side-by-side A B + atf_check -o match:"$exp_output" -s exit:1 \ + diff -y A B + atf_check -o match:"$exp_output_suppressed" -s exit:1 \ + diff -y --suppress-common-lines A B + atf_check -o match:"$exp_output_suppressed" -s exit:1 \ + diff -W 65 -y --suppress-common-lines A B +} + atf_init_test_cases() { atf_add_test_case simple @@ -96,4 +117,5 @@ atf_init_test_cases() atf_add_test_case header_ns atf_add_test_case ifdef atf_add_test_case group_format + atf_add_test_case side_by_side } From owner-svn-src-all@freebsd.org Mon Jun 12 05:45:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADC8DBF483A; Mon, 12 Jun 2017 05:45:24 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-ot0-x234.google.com (mail-ot0-x234.google.com [IPv6:2607:f8b0:4003:c0f::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DA17830A0; Mon, 12 Jun 2017 05:45:24 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-ot0-x234.google.com with SMTP id t31so61268368ota.1; Sun, 11 Jun 2017 22:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Ag8FI/4IkOjA/lRKuqSanSRqXGgOvuPSSlG54I6jMNg=; b=eE/DTyRLcmLghvFpPWg3sXG7N1zD+wYzvrgej72IoWobUXV/OuWYYRZAw1UzI2AiUu plpNhvJqGagMGZvOmNUsDzocZb/jvRcmvhzgDXLIIw45A66LsHgfp2NoVjbrey7I9esx clNJjgbfvAyyR2IBnbkjQA0uTAB0f2exggIFhUKWx9PkLZcoNY6er4hfQAjY57HeNI+p I15QFtTAuD/exDgv1emxBzoDX0iAclbff5GoHk1TqCY2alMA2XxgHlo4EO5gtrPQp1bT Zz02+rb8eV6B6hvR/tABGtDai/9xo76ElfHqYN3x/L/lHZr60tD5jJSWg2iBovO8k6h2 75DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Ag8FI/4IkOjA/lRKuqSanSRqXGgOvuPSSlG54I6jMNg=; b=ICZMynor0NI4mBE7ryxgjvR4ymBkQEILEOdlexpa9BkDd53bn54gvnRVMP+XwLP/BL +47u2yYoarG75LkwOcbLQjYnhRvDaJzddfF7/e/mamnyI5nMxRe6xGtHqmkcOEB/GkdW JjofJ/9iAD1q6WtKFy8zEZ/CHkEdnNmZqYSMTSsS/BsPG5WA8d1nNp1+BubQ0WMc9pjy 8hScNPY+alllbnT9auPP6V+uzXkGHA8ndmvabYWIB/sOiQhcv6RxFfgk/1Rzgge8lFKt 2znTvM3FwX7h2ZlWwL7yoNtJfrhNj9J3u5FgHQIuN7V/IydF8wZ9a9MPqayQa3eTMrEQ axww== X-Gm-Message-State: AKS2vOwDzhQaYXPMGjhBJsKgKvSwXKFQVK/La5aqej9k1T4Tff4NHa/E eqxUL2rOgVKp7ike1XZXueNmJLjY6Q== X-Received: by 10.157.20.166 with SMTP id d35mr20650410ote.260.1497246323638; Sun, 11 Jun 2017 22:45:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.48.71 with HTTP; Sun, 11 Jun 2017 22:45:23 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: References: <201706020235.v522ZGeC076100@repo.freebsd.org> From: Marcelo Araujo Date: Mon, 12 Jun 2017 13:45:23 +0800 Message-ID: Subject: Re: svn commit: r319487 - head/usr.sbin/bhyve To: "Conrad E. Meyer" Cc: Peter Grehan , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 05:45:24 -0000 2017-06-11 2:35 GMT+08:00 Conrad Meyer : > On Sat, Jun 10, 2017 at 11:14 AM, Peter Grehan wrote= : > > strncpy() is specified to zero-fill if the source is shorter than the > > length. Are we missing something ? > > > > The other issues you brought up look valid. > > Hi Peter, > > Oops =E2=80=94 didn't realize that about strncpy()! Thanks for the corre= ction. > > Best, > Conrad > Thanks guys, I will take a look on it very soon and will put you both into the review. Best, --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Mon Jun 12 06:08:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEBEFBF4BCB; Mon, 12 Jun 2017 06:08:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F221837A0; Mon, 12 Jun 2017 06:08:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C68vvJ009622; Mon, 12 Jun 2017 06:08:57 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C68vsB009621; Mon, 12 Jun 2017 06:08:57 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201706120608.v5C68vsB009621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 12 Jun 2017 06:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319848 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 06:08:58 -0000 Author: cy Date: Mon Jun 12 06:08:57 2017 New Revision: 319848 URL: https://svnweb.freebsd.org/changeset/base/319848 Log: -v (verbose) is not a command option. (See ippool.1 for a definition of command options). Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Mon Jun 12 05:11:43 2017 (r319847) +++ head/contrib/ipfilter/tools/ippool.c Mon Jun 12 06:08:57 2017 (r319848) @@ -128,9 +128,6 @@ main(argc, argv) case 's' : err = poolstats(argc, argv); break; - case 'v' : - opts |= OPT_VERBOSE; - break; default : exit(1); } From owner-svn-src-all@freebsd.org Mon Jun 12 07:36:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 319F3BF5E36; Mon, 12 Jun 2017 07:36:01 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F327CBE3; Mon, 12 Jun 2017 07:36:00 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C7a0UN045538; Mon, 12 Jun 2017 07:36:00 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C7a0tU045537; Mon, 12 Jun 2017 07:36:00 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201706120736.v5C7a0tU045537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 12 Jun 2017 07:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319849 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 07:36:01 -0000 Author: dchagin Date: Mon Jun 12 07:35:59 2017 New Revision: 319849 URL: https://svnweb.freebsd.org/changeset/base/319849 Log: Since r318735 (ino64 project) the size of the native struct dirent is equal or greater than the size of Linux struct dirent or struct dirent64. So, remove LINUX_RECLEN_RATIO magic as useless. Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Jun 12 06:08:57 2017 (r319848) +++ head/sys/compat/linux/linux_file.c Mon Jun 12 07:35:59 2017 (r319849) @@ -309,16 +309,6 @@ struct l_dirent64 { #define LINUX_DIRBLKSIZ 512 -/* - * Linux l_dirent is bigger than FreeBSD dirent, thus the buffer size - * passed to kern_getdirentries() must be smaller than the one passed - * to linux_getdents() by certain factor. - */ -#define LINUX_RECLEN_RATIO(X) X * offsetof(struct dirent, d_name) / \ - offsetof(struct l_dirent, d_name); -#define LINUX_RECLEN64_RATIO(X) X * offsetof(struct dirent, d_name) / \ - offsetof(struct l_dirent64, d_name); - int linux_getdents(struct thread *td, struct linux_getdents_args *args) { @@ -337,8 +327,7 @@ linux_getdents(struct thread *td, struct linux_getdent if (ldebug(getdents)) printf(ARGS(getdents, "%d, *, %d"), args->fd, args->count); #endif - buflen = LINUX_RECLEN_RATIO(args->count); - buflen = min(buflen, MAXBSIZE); + buflen = min(args->count, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, @@ -418,8 +407,7 @@ linux_getdents64(struct thread *td, struct linux_getde if (ldebug(getdents64)) uprintf(ARGS(getdents64, "%d, *, %d"), args->fd, args->count); #endif - buflen = LINUX_RECLEN64_RATIO(args->count); - buflen = min(buflen, MAXBSIZE); + buflen = min(args->count, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, @@ -495,7 +483,6 @@ linux_readdir(struct thread *td, struct linux_readdir_ printf(ARGS(readdir, "%d, *"), args->fd); #endif buflen = LINUX_RECLEN(LINUX_NAME_MAX); - buflen = LINUX_RECLEN_RATIO(buflen); buf = malloc(buflen, M_TEMP, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, From owner-svn-src-all@freebsd.org Mon Jun 12 07:44:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 445F3BF6163; Mon, 12 Jun 2017 07:44:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B9C710A2; Mon, 12 Jun 2017 07:44:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C7hxo3049349; Mon, 12 Jun 2017 07:43:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C7hwx9049345; Mon, 12 Jun 2017 07:43:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706120743.v5C7hwx9049345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 07:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319850 - in head: etc/mtree usr.bin/du usr.bin/du/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 07:44:00 -0000 Author: ngie Date: Mon Jun 12 07:43:58 2017 New Revision: 319850 URL: https://svnweb.freebsd.org/changeset/base/319850 Log: Add some initial basic tests for du(1) Tests that exercise the following flags are added in this commit: - -A - -H - -I - -g - -h - -k - -m Additional tests will be added soon. MFC after: 1 month Added: head/usr.bin/du/tests/ head/usr.bin/du/tests/Makefile (contents, props changed) head/usr.bin/du/tests/du_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/du/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Jun 12 07:35:59 2017 (r319849) +++ head/etc/mtree/BSD.tests.dist Mon Jun 12 07:43:58 2017 (r319850) @@ -628,6 +628,8 @@ .. dirname .. + du + .. file2c .. getconf Modified: head/usr.bin/du/Makefile ============================================================================== --- head/usr.bin/du/Makefile Mon Jun 12 07:35:59 2017 (r319849) +++ head/usr.bin/du/Makefile Mon Jun 12 07:43:58 2017 (r319850) @@ -1,7 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= du LIBADD= util + +SUBDIR.${MK_TESTS}+= tests .include Added: head/usr.bin/du/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/du/tests/Makefile Mon Jun 12 07:43:58 2017 (r319850) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH+= du_test + +.include Added: head/usr.bin/du/tests/du_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/du/tests/du_test.sh Mon Jun 12 07:43:58 2017 (r319850) @@ -0,0 +1,153 @@ +# +# Copyright (c) 2017 Ngie Cooper +# 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$ + +atf_test_case A_flag +A_flag_head() +{ + atf_set "descr" "Verify -A behavior" +} +A_flag_body() +{ + # XXX: compressed volumes? + atf_check truncate -s 10g sparse.file + atf_check -o inline:'1\tsparse.file\n' du -g sparse.file + atf_check -o inline:'10\tsparse.file\n' du -A -g sparse.file +} + +atf_test_case H_flag +H_flag_head() +{ + atf_set "descr" "Verify -H behavior" +} +H_flag_body() +{ + local paths1='testdir/A/B testdir/A testdir/C testdir' + local paths2='testdir/A/B testdir/A testdir/C testdir' + local sep='\n[0-9]+\t' + + atf_check mkdir testdir + atf_check -x "cd testdir && mkdir A && touch A/B && ln -s A C" + + atf_check -o save:du.out du -aAH testdir + atf_check egrep -q "[0-9]+\t$(echo $paths1 | tr ' ' "$sep")\n" du.out + atf_check -o save:du_C.out du -aAH testdir/C + atf_check egrep -q "[0-9]+\t$(echo $paths2 | tr ' ' "$sep")\n" du_C.out +} + +atf_test_case I_flag +I_flag_head() +{ + atf_set "descr" "Verify -I behavior" +} +I_flag_body() +{ + paths_sans_foo_named="a/motley/fool/of/sorts fool/parts/with/their/cache bar baz" + paths_foo_named="foo foobar" + paths="$paths_sans_foo_named $paths_foo_named" + + # cd'ing to testdir helps ensure that files from atf/kyua don't + # pollute the results. + atf_check -x "mkdir testdir && cd testdir && mkdir -p $paths" + atf_check -o save:du.out -x "cd testdir && du -s $paths_sans_foo_named" + atf_check -o save:du_I.out -x "cd testdir && du -I '*foo*' -s $paths" + + atf_check diff -u du.out du_I.out +} + +atf_test_case c_flag +c_flag_head() +{ + atf_set "descr" "Verify -c output" +} +c_flag_body() +{ + atf_check truncate -s 0 foo bar +} + +atf_test_case g_flag +g_flag_head() +{ + atf_set "descr" "Verify -g output" +} +g_flag_body() +{ + atf_check truncate -s 1k A + atf_check truncate -s 1m B + atf_check truncate -s 1g C + atf_check truncate -s 1t D + atf_check -o inline:'1\tA\n1\tB\n1\tC\n1024\tD\n' du -Ag A B C D +} + +atf_test_case h_flag +h_flag_head() +{ + atf_set "descr" "Verify -h output" +} +h_flag_body() +{ + atf_check truncate -s 1k A + atf_check truncate -s 1m B + atf_check truncate -s 1g C + atf_check truncate -s 1t D + atf_check -o inline:'1.0K\tA\n1.0M\tB\n1.0G\tC\n1.0T\tD\n' du -Ah A B C D +} + +atf_test_case k_flag +k_flag_head() +{ + atf_set "descr" "Verify -k output" +} +k_flag_body() +{ + atf_check truncate -s 1k A + atf_check truncate -s 1m B + atf_check -o inline:'1\tA\n1024\tB\n' du -Ak A B +} + +atf_test_case m_flag +m_flag_head() +{ + atf_set "descr" "Verify -m output" +} +m_flag_body() +{ + atf_check truncate -s 1k A + atf_check truncate -s 1m B + atf_check truncate -s 1g C + atf_check -o inline:'1\tA\n1\tB\n1024\tC\n' du -Am A B C +} + +atf_init_test_cases() +{ + atf_add_test_case A_flag + atf_add_test_case H_flag + atf_add_test_case I_flag + atf_add_test_case g_flag + atf_add_test_case h_flag + atf_add_test_case k_flag + atf_add_test_case m_flag +} From owner-svn-src-all@freebsd.org Mon Jun 12 07:48:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BBA5BF62AA; Mon, 12 Jun 2017 07:48:53 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06A0512D4; Mon, 12 Jun 2017 07:48:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C7mqVU049653; Mon, 12 Jun 2017 07:48:52 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C7mqAO049652; Mon, 12 Jun 2017 07:48:52 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201706120748.v5C7mqAO049652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 12 Jun 2017 07:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319851 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 07:48:53 -0000 Author: dchagin Date: Mon Jun 12 07:48:51 2017 New Revision: 319851 URL: https://svnweb.freebsd.org/changeset/base/319851 Log: Remove the outdated definition. MFC after: 1 week Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Jun 12 07:43:58 2017 (r319850) +++ head/sys/compat/linux/linux_file.c Mon Jun 12 07:48:51 2017 (r319851) @@ -307,8 +307,6 @@ struct l_dirent64 { roundup(offsetof(struct l_dirent64, d_name) + (namlen) + 1, \ sizeof(uint64_t)) -#define LINUX_DIRBLKSIZ 512 - int linux_getdents(struct thread *td, struct linux_getdents_args *args) { From owner-svn-src-all@freebsd.org Mon Jun 12 09:11:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 058E1BF7984; Mon, 12 Jun 2017 09:11:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4BB238C9; Mon, 12 Jun 2017 09:11:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C9BV3x083698; Mon, 12 Jun 2017 09:11:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C9BVWG083697; Mon, 12 Jun 2017 09:11:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201706120911.v5C9BVWG083697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 12 Jun 2017 09:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319852 - head/usr.sbin/rpc.lockd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 09:11:33 -0000 Author: delphij Date: Mon Jun 12 09:11:31 2017 New Revision: 319852 URL: https://svnweb.freebsd.org/changeset/base/319852 Log: Fix buffer lengths. After r319369, the RPC code validates caller supplied buffer length in taddr2uaddr. When no -h is specified, the sizeof(ai_addr) is used, which is always smaller than the required size and therefore uaddr would be NULL, causing the kernel to copyin() from userland NULL and fail with EFAULT. Reviewed by: kevlo (via Telegram) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D11151 Modified: head/usr.sbin/rpc.lockd/lockd.c Modified: head/usr.sbin/rpc.lockd/lockd.c ============================================================================== --- head/usr.sbin/rpc.lockd/lockd.c Mon Jun 12 07:48:51 2017 (r319851) +++ head/usr.sbin/rpc.lockd/lockd.c Mon Jun 12 09:11:31 2017 (r319852) @@ -902,8 +902,7 @@ lookup_addresses(struct netconfig *nconf) sin->sin_port = htons(0); sin->sin_addr.s_addr = htonl(INADDR_ANY); res->ai_addr = (struct sockaddr*) sin; - res->ai_addrlen = (socklen_t) - sizeof(res->ai_addr); + res->ai_addrlen = sizeof(struct sockaddr_in); break; case AF_INET6: sin6 = malloc(sizeof(struct sockaddr_in6)); @@ -913,7 +912,7 @@ lookup_addresses(struct netconfig *nconf) sin6->sin6_port = htons(0); sin6->sin6_addr = in6addr_any; res->ai_addr = (struct sockaddr*) sin6; - res->ai_addrlen = (socklen_t) sizeof(res->ai_addr); + res->ai_addrlen = sizeof(struct sockaddr_in6); break; default: break; @@ -938,7 +937,7 @@ lookup_addresses(struct netconfig *nconf) } } - servaddr.len = servaddr.maxlen = res->ai_addr->sa_len; + servaddr.len = servaddr.maxlen = res->ai_addrlen; servaddr.buf = res->ai_addr; uaddr = taddr2uaddr(nconf, &servaddr); From owner-svn-src-all@freebsd.org Mon Jun 12 13:49:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F26C2BFCFEC; Mon, 12 Jun 2017 13:49:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2A9970104; Mon, 12 Jun 2017 13:49:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CDnviB008055; Mon, 12 Jun 2017 13:49:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CDnvfj008054; Mon, 12 Jun 2017 13:49:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706121349.v5CDnvfj008054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 12 Jun 2017 13:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319853 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 13:49:59 -0000 Author: emaste Date: Mon Jun 12 13:49:57 2017 New Revision: 319853 URL: https://svnweb.freebsd.org/changeset/base/319853 Log: makefs: use C standard memcpy/memset in userland This file does not exist in NetBSD's makefs, but make the chance for consistency with memcpy/memset used in the rest of makefs. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Mon Jun 12 09:11:31 2017 (r319852) +++ head/usr.sbin/makefs/mtree.c Mon Jun 12 13:49:57 2017 (r319853) @@ -455,7 +455,7 @@ create_node(const char *name, u_int type, fsnode *pare n->inode = ecalloc(1, sizeof(*n->inode)); /* Assign global options/defaults. */ - bcopy(global->inode, n->inode, sizeof(*n->inode)); + memcpy(n->inode, global->inode, sizeof(*n->inode)); n->inode->st.st_mode = (n->inode->st.st_mode & ~S_IFMT) | n->type; if (n->type == S_IFLNK) @@ -1041,8 +1041,8 @@ read_mtree(const char *fname, fsnode *node) if (error) goto out; - bzero(&mtree_global, sizeof(mtree_global)); - bzero(&mtree_global_inode, sizeof(mtree_global_inode)); + memset(&mtree_global, 0, sizeof(mtree_global)); + memset(&mtree_global_inode, 0, sizeof(mtree_global_inode)); mtree_global.inode = &mtree_global_inode; mtree_global_inode.nlink = 1; mtree_global_inode.st.st_nlink = 1; From owner-svn-src-all@freebsd.org Mon Jun 12 14:32:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEABABFDAEC; Mon, 12 Jun 2017 14:32:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA2D471684; Mon, 12 Jun 2017 14:32:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x242.google.com with SMTP id a70so14453790pge.0; Mon, 12 Jun 2017 07:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=RLkL/E2H82985jGCjPmuwU8GMH0Oo6hg6Uw8x7P2ZGc=; b=tlmkgg5Gwx6nUtTKbJkbLg6Kax4csvXIBU2j0AlqOLzJiVUGSa2+hLzHrtdYzFeUuB zVvisSLW/30sOgsuxYdMUtFACJYpiPknSme8zrs5IaMOUNoWOG5ihh2G8bxptYBO6uf3 lc7TzZ1no21alKIzU25rtQIBZvhq/BZmuZ5w7f23JuBXGieZ2dk4QXPKbNkomHvY5jLP fSJVq4AZsvqKou+hklOPfmwbe/CuZo8MnFpMEefECMOo4FWjf6NYg59Klw45I+D9whsq Ju1Z8NrAg1LeQjD/Li3MSdcllL8Ow3gicX9kWjUAYSBdC0i/fyRWOg8kFjL638oC7UZi 6OoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=RLkL/E2H82985jGCjPmuwU8GMH0Oo6hg6Uw8x7P2ZGc=; b=Jz2k+ebeB1ea7zsAAvqWpCy3XByCR9H59CuuKNS37ak0eU5QUTZPcEnaDa+Eyg13nX WaKo9ATdp2x8WW15fPOlrT/cIFZbZpuTVBvcUzU5lqV6x7VMXiWUdjZAwI8F/5b6S38G mLirXG3OztB0AYqiL4RHZfjbXp81ShoUIabzDASubuH4ODSeJeSoHoyE1J9e0eCCy+/3 OBzngpCyMKBxpkmtc6gNnI3vlZCVaj/vQ8lpix7Iu5RqKf0Vu7JbRfRPT35J5alXPgZR JFRKOS8YFOxy1KfASYkGPjDGeHDGSRWWm9VTJIU31Nc+c2wUGnhMehF9YZopIKig+kjk D0kw== X-Gm-Message-State: AKS2vOxZWs6wGRYrLuorcWmTDYObgGP5uUGGWxVfvSh1/pG68ahuU/SW f12Phf4WNNpB2Yf2N20= X-Received: by 10.84.231.194 with SMTP id g2mr13281057pln.34.1497277959840; Mon, 12 Jun 2017 07:32:39 -0700 (PDT) Received: from [192.168.20.13] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i62sm20578296pfj.30.2017.06.12.07.32.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 07:32:39 -0700 (PDT) Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r319349 - in stable/11: contrib/byacc contrib/byacc/package contrib/byacc/package/debian contrib/byacc/package/pkgsrc contrib/byacc/test contrib/byacc/test/btyacc contrib/byacc/test/yac... From: Ngie Cooper X-Mailer: iPhone Mail (14F89) In-Reply-To: <201705311916.v4VJGNeO096940@repo.freebsd.org> Date: Mon, 12 Jun 2017 07:32:38 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Message-Id: <217388AE-894D-4DDB-AE1F-08F8347971BA@gmail.com> References: <201705311916.v4VJGNeO096940@repo.freebsd.org> To: Jung-uk Kim Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 14:32:41 -0000 > On May 31, 2017, at 12:16, Jung-uk Kim wrote: >=20 > Author: jkim > Date: Wed May 31 19:16:22 2017 > New Revision: 319349 > URL: https://svnweb.freebsd.org/changeset/base/319349 >=20 > Log: > MFC: r313105, r313106 >=20 > Update byacc to 20170201. This change broke the tests, due to a missing MFC: https://bugs.freebsd.org/= bugzilla/show_bug.cgi?id=3D216891 . Thanks, -Ngie= From owner-svn-src-all@freebsd.org Mon Jun 12 14:55:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57D3ABFE2D5; Mon, 12 Jun 2017 14:55:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D8E3723DB; Mon, 12 Jun 2017 14:55:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CEsx1o039822; Mon, 12 Jun 2017 14:54:59 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CEsx9E039821; Mon, 12 Jun 2017 14:54:59 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201706121454.v5CEsx9E039821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 12 Jun 2017 14:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319854 - head/bin/ln/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 14:55:01 -0000 Author: asomers Date: Mon Jun 12 14:54:59 2017 New Revision: 319854 URL: https://svnweb.freebsd.org/changeset/base/319854 Log: bin/ln: Set umask appropriately before creating files for testing These changes were missed in D11084 Submitted by: shivansh Reviewed by: asomers MFC after: 1 month X-MFC-With: 319714 Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11158 Modified: head/bin/ln/tests/ln_test.sh Modified: head/bin/ln/tests/ln_test.sh ============================================================================== --- head/bin/ln/tests/ln_test.sh Mon Jun 12 13:49:57 2017 (r319853) +++ head/bin/ln/tests/ln_test.sh Mon Jun 12 14:54:59 2017 (r319854) @@ -98,6 +98,7 @@ target_exists_hard_head() target_exists_hard_body() { + set_umask atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ ln A B @@ -112,6 +113,7 @@ target_exists_symbolic_head() target_exists_symbolic_body() { + set_umask atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ ln -s A B @@ -155,6 +157,7 @@ sf_flag_head() sf_flag_body() { + set_umask atf_check touch A B atf_check ln -sf A B atf_check -o inline:'B: symbolic link to A\n' file B From owner-svn-src-all@freebsd.org Mon Jun 12 16:31:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D83DBFFB1B; Mon, 12 Jun 2017 16:31:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EFA975119; Mon, 12 Jun 2017 16:31:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CGVWj6079470; Mon, 12 Jun 2017 16:31:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CGVW0h079469; Mon, 12 Jun 2017 16:31:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706121631.v5CGVW0h079469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 16:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319855 - head/bin/ln/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 16:31:33 -0000 Author: ngie Date: Mon Jun 12 16:31:32 2017 New Revision: 319855 URL: https://svnweb.freebsd.org/changeset/base/319855 Log: Use readlink(1)/stat(1) to query symlinks instead of file(1) file(1) can be compiled out of the system via MK_FILE == no, and the output isn't guaranteed to be stable. It's better to use stat(1)/readlink(1) instead to query symlink/file paths. MFC after: 1 month MFC with: r319714, r319854 Reported by: ngie Submitted by: shivansh Differential Revision: D11159 (part of a larger diff) Sponsored by: Google, Inc (GSoC 2017) Modified: head/bin/ln/tests/ln_test.sh Modified: head/bin/ln/tests/ln_test.sh ============================================================================== --- head/bin/ln/tests/ln_test.sh Mon Jun 12 14:54:59 2017 (r319854) +++ head/bin/ln/tests/ln_test.sh Mon Jun 12 16:31:32 2017 (r319855) @@ -50,7 +50,8 @@ L_flag_body() stat_A=$(stat -f %i A) stat_C=$(stat -f %i C) atf_check_equal "$stat_A" "$stat_C" - atf_check -o inline:'B: symbolic link to A\n' file B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case P_flag @@ -130,7 +131,8 @@ shf_flag_dir_body() atf_check mkdir -m 0777 A B atf_check ln -s A C atf_check ln -shf B C - atf_check -o inline:'C: symbolic link to B\n' file C + atf_check -o inline:'Symbolic Link\n' stat -f %SHT C + atf_check -o inline:'B\n' readlink C } atf_test_case snf_flag_dir @@ -144,7 +146,8 @@ snf_flag_dir_body() atf_check mkdir -m 0777 A B atf_check ln -s A C atf_check ln -snf B C - atf_check -o inline:'C: symbolic link to B\n' file C + atf_check -o inline:'Symbolic Link\n' stat -f %SHT C + atf_check -o inline:'B\n' readlink C } atf_test_case sf_flag @@ -160,7 +163,8 @@ sf_flag_body() set_umask atf_check touch A B atf_check ln -sf A B - atf_check -o inline:'B: symbolic link to A\n' file B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case s_flag @@ -174,7 +178,8 @@ s_flag_body() set_umask atf_check touch A atf_check ln -s A B - atf_check -o inline:'B: symbolic link to A\n' file B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case s_flag_broken @@ -187,7 +192,8 @@ s_flag_broken_head() s_flag_broken_body() { atf_check ln -s A B - atf_check -o inline:'B: broken symbolic link to A\n' file B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case sw_flag @@ -201,7 +207,8 @@ sw_flag_body() { atf_check -s exit:0 -e inline:'ln: warning: A: No such file or directory\n' \ ln -sw A B - atf_check -o inline:'B: broken symbolic link to A\n' file B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_init_test_cases() From owner-svn-src-all@freebsd.org Mon Jun 12 16:38:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A1EEBFFC54; Mon, 12 Jun 2017 16:38:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AD5375660; Mon, 12 Jun 2017 16:38:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CGcbIk080745; Mon, 12 Jun 2017 16:38:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CGcbe9080744; Mon, 12 Jun 2017 16:38:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706121638.v5CGcbe9080744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 16:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319856 - head/bin/ln/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 16:38:38 -0000 Author: ngie Date: Mon Jun 12 16:38:37 2017 New Revision: 319856 URL: https://svnweb.freebsd.org/changeset/base/319856 Log: Add a testcase for `ln -sF` The testcase fails today, so mark it with atf_expect_fail: in particular, the target (B) isn't being unlinked and the documentation doesn't suggest special handling for directories. Thus, there's either a doc or an implementation bug in ln(1) that needs to be resolved. MFC after: 1 month MFC with: r319714, r319854, r319855 PR: 219943 Reviewed by: ngie Submitted by: shivansh Differential Revision: D11159 (part of a larger diff) Sponsored by: Google, Inc (GSoC 2017) Modified: head/bin/ln/tests/ln_test.sh Modified: head/bin/ln/tests/ln_test.sh ============================================================================== --- head/bin/ln/tests/ln_test.sh Mon Jun 12 16:31:32 2017 (r319855) +++ head/bin/ln/tests/ln_test.sh Mon Jun 12 16:38:37 2017 (r319856) @@ -150,6 +150,22 @@ snf_flag_dir_body() atf_check -o inline:'B\n' readlink C } +atf_test_case sF_flag +sF_flag_head() +{ + atf_set "descr" "Verify that if the target file already exists " \ + "and is a directory, then '-sF' option removes " \ + "it so that the link may occur" +} + +sF_flag_body() +{ + atf_expect_fail "B isn't being unlinked (bug 219943)" + atf_check mkdir A B + atf_check ln -sF A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B +} + atf_test_case sf_flag sf_flag_head() { @@ -220,6 +236,7 @@ atf_init_test_cases() atf_add_test_case target_exists_symbolic atf_add_test_case shf_flag_dir atf_add_test_case snf_flag_dir + atf_add_test_case sF_flag atf_add_test_case sf_flag atf_add_test_case s_flag atf_add_test_case s_flag_broken From owner-svn-src-all@freebsd.org Mon Jun 12 16:43:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6469BBFFEB8; Mon, 12 Jun 2017 16:43:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A17075BBD; Mon, 12 Jun 2017 16:43:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CGhTxj084466; Mon, 12 Jun 2017 16:43:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CGhTJ7084465; Mon, 12 Jun 2017 16:43:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706121643.v5CGhTJ7084465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 16:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319857 - head/bin/ln X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 16:43:31 -0000 Author: ngie Date: Mon Jun 12 16:43:29 2017 New Revision: 319857 URL: https://svnweb.freebsd.org/changeset/base/319857 Log: ln(1): wordsmith -F option description MFC after: 1 month Modified: head/bin/ln/ln.1 Modified: head/bin/ln/ln.1 ============================================================================== --- head/bin/ln/ln.1 Mon Jun 12 16:38:37 2017 (r319856) +++ head/bin/ln/ln.1 Mon Jun 12 16:43:29 2017 (r319857) @@ -32,7 +32,7 @@ .\" @(#)ln.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd November 2, 2012 +.Dd June 12, 2017 .Dt LN 1 .Os .Sh NAME @@ -87,14 +87,18 @@ option should be used with either or .Fl i options. -If none is specified, +If neither .Fl f +nor +.Fl i +is specified, +.Fl f is implied. The .Fl F option is a no-op unless .Fl s -option is specified. +is specified. .It Fl L When creating a hard link to a symbolic link, create a hard link to the target of the symbolic link. From owner-svn-src-all@freebsd.org Mon Jun 12 16:53:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5625C08162; Mon, 12 Jun 2017 16:53:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9589476131; Mon, 12 Jun 2017 16:53:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CGrgqh088541; Mon, 12 Jun 2017 16:53:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CGrgh4088540; Mon, 12 Jun 2017 16:53:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706121653.v5CGrgh4088540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 16:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319858 - head/bin/ln/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 16:53:43 -0000 Author: ngie Date: Mon Jun 12 16:53:42 2017 New Revision: 319858 URL: https://svnweb.freebsd.org/changeset/base/319858 Log: Style fixes: clean up leading whitespace (8 single column spaces -> \t) MFC after: 1 month MFC with: r319714, r319854, r319855, r319856 Modified: head/bin/ln/tests/ln_test.sh Modified: head/bin/ln/tests/ln_test.sh ============================================================================== --- head/bin/ln/tests/ln_test.sh Mon Jun 12 16:43:29 2017 (r319857) +++ head/bin/ln/tests/ln_test.sh Mon Jun 12 16:53:42 2017 (r319858) @@ -28,217 +28,217 @@ set_umask() { - if ! umask 022; then - atf_fail "setting umask failed" - fi + if ! umask 022; then + atf_fail "setting umask failed" + fi } atf_test_case L_flag L_flag_head() { - atf_set "descr" "Verify that when creating a hard link to a " \ - "symbolic link, '-L' option creates a hard" \ - "link to the target of the symbolic link" + atf_set "descr" "Verify that when creating a hard link to a " \ + "symbolic link, '-L' option creates a hard" \ + "link to the target of the symbolic link" } L_flag_body() { - set_umask - atf_check touch A - atf_check ln -s A B - atf_check ln -L B C - stat_A=$(stat -f %i A) - stat_C=$(stat -f %i C) - atf_check_equal "$stat_A" "$stat_C" - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + set_umask + atf_check touch A + atf_check ln -s A B + atf_check ln -L B C + stat_A=$(stat -f %i A) + stat_C=$(stat -f %i C) + atf_check_equal "$stat_A" "$stat_C" + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case P_flag P_flag_head() { - atf_set "descr" "Verify that when creating a hard link to a " \ - "symbolic link, '-P' option creates a hard " \ - "link to the symbolic link itself" + atf_set "descr" "Verify that when creating a hard link to a " \ + "symbolic link, '-P' option creates a hard " \ + "link to the symbolic link itself" } P_flag_body() { - set_umask - atf_check touch A - atf_check ln -s A B - atf_check ln -P B C - stat_B=$(stat -f %i B) - stat_C=$(stat -f %i C) - atf_check_equal "$stat_B" "$stat_C" + set_umask + atf_check touch A + atf_check ln -s A B + atf_check ln -P B C + stat_B=$(stat -f %i B) + stat_C=$(stat -f %i C) + atf_check_equal "$stat_B" "$stat_C" } atf_test_case f_flag f_flag_head() { - atf_set "descr" "Verify that if the target file already exists, " \ - "'-f' option unlinks it so that link may occur" + atf_set "descr" "Verify that if the target file already exists, " \ + "'-f' option unlinks it so that link may occur" } f_flag_body() { - set_umask - atf_check touch A B - atf_check ln -f A B - stat_A=$(stat -f %i A) - stat_B=$(stat -f %i B) - atf_check_equal "$stat_A" "$stat_B" + set_umask + atf_check touch A B + atf_check ln -f A B + stat_A=$(stat -f %i A) + stat_B=$(stat -f %i B) + atf_check_equal "$stat_A" "$stat_B" } atf_test_case target_exists_hard target_exists_hard_head() { - atf_set "descr" "Verify whether creating a hard link fails if the " \ - "target file already exists" + atf_set "descr" "Verify whether creating a hard link fails if the " \ + "target file already exists" } target_exists_hard_body() { - set_umask - atf_check touch A B - atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ - ln A B + set_umask + atf_check touch A B + atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ + ln A B } atf_test_case target_exists_symbolic target_exists_symbolic_head() { - atf_set "descr" "Verify whether creating a symbolic link fails if " \ - "the target file already exists" + atf_set "descr" "Verify whether creating a symbolic link fails if " \ + "the target file already exists" } target_exists_symbolic_body() { - set_umask - atf_check touch A B - atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ - ln -s A B + set_umask + atf_check touch A B + atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ + ln -s A B } atf_test_case shf_flag_dir shf_flag_dir_head() { - atf_set "descr" "Verify that if the target directory is a symbolic " \ - "link, '-shf' option prevents following the link" + atf_set "descr" "Verify that if the target directory is a symbolic " \ + "link, '-shf' option prevents following the link" } shf_flag_dir_body() { - atf_check mkdir -m 0777 A B - atf_check ln -s A C - atf_check ln -shf B C - atf_check -o inline:'Symbolic Link\n' stat -f %SHT C - atf_check -o inline:'B\n' readlink C + atf_check mkdir -m 0777 A B + atf_check ln -s A C + atf_check ln -shf B C + atf_check -o inline:'Symbolic Link\n' stat -f %SHT C + atf_check -o inline:'B\n' readlink C } atf_test_case snf_flag_dir snf_flag_dir_head() { - atf_set "descr" "Verify that if the target directory is a symbolic " \ - "link, '-snf' option prevents following the link" + atf_set "descr" "Verify that if the target directory is a symbolic " \ + "link, '-snf' option prevents following the link" } snf_flag_dir_body() { - atf_check mkdir -m 0777 A B - atf_check ln -s A C - atf_check ln -snf B C - atf_check -o inline:'Symbolic Link\n' stat -f %SHT C - atf_check -o inline:'B\n' readlink C + atf_check mkdir -m 0777 A B + atf_check ln -s A C + atf_check ln -snf B C + atf_check -o inline:'Symbolic Link\n' stat -f %SHT C + atf_check -o inline:'B\n' readlink C } atf_test_case sF_flag sF_flag_head() { - atf_set "descr" "Verify that if the target file already exists " \ - "and is a directory, then '-sF' option removes " \ - "it so that the link may occur" + atf_set "descr" "Verify that if the target file already exists " \ + "and is a directory, then '-sF' option removes " \ + "it so that the link may occur" } sF_flag_body() { atf_expect_fail "B isn't being unlinked (bug 219943)" atf_check mkdir A B - atf_check ln -sF A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check ln -sF A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B } atf_test_case sf_flag sf_flag_head() { - atf_set "descr" "Verify that if the target file already exists, " \ - "'-sf' option unlinks it and creates a symbolic link " \ - "to the source file" + atf_set "descr" "Verify that if the target file already exists, " \ + "'-sf' option unlinks it and creates a symbolic link " \ + "to the source file" } sf_flag_body() { - set_umask - atf_check touch A B - atf_check ln -sf A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + set_umask + atf_check touch A B + atf_check ln -sf A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case s_flag s_flag_head() { - atf_set "descr" "Verify that '-s' option creates a symbolic link" + atf_set "descr" "Verify that '-s' option creates a symbolic link" } s_flag_body() { - set_umask - atf_check touch A - atf_check ln -s A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + set_umask + atf_check touch A + atf_check ln -s A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case s_flag_broken s_flag_broken_head() { - atf_set "descr" "Verify that if the source file does not exists, '-s' " \ - "option creates a broken symbolic link to the source file" + atf_set "descr" "Verify that if the source file does not exists, '-s' " \ + "option creates a broken symbolic link to the source file" } s_flag_broken_body() { - atf_check ln -s A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check ln -s A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case sw_flag sw_flag_head() { - atf_set "descr" "Verify that '-sw' option produces a warning if the " \ - "source of a symbolic link does not currently exist" + atf_set "descr" "Verify that '-sw' option produces a warning if the " \ + "source of a symbolic link does not currently exist" } sw_flag_body() { - atf_check -s exit:0 -e inline:'ln: warning: A: No such file or directory\n' \ - ln -sw A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check -s exit:0 -e inline:'ln: warning: A: No such file or directory\n' \ + ln -sw A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_init_test_cases() { - atf_add_test_case L_flag - atf_add_test_case P_flag - atf_add_test_case f_flag - atf_add_test_case target_exists_hard - atf_add_test_case target_exists_symbolic - atf_add_test_case shf_flag_dir - atf_add_test_case snf_flag_dir - atf_add_test_case sF_flag - atf_add_test_case sf_flag - atf_add_test_case s_flag - atf_add_test_case s_flag_broken - atf_add_test_case sw_flag + atf_add_test_case L_flag + atf_add_test_case P_flag + atf_add_test_case f_flag + atf_add_test_case target_exists_hard + atf_add_test_case target_exists_symbolic + atf_add_test_case shf_flag_dir + atf_add_test_case snf_flag_dir + atf_add_test_case sF_flag + atf_add_test_case sf_flag + atf_add_test_case s_flag + atf_add_test_case s_flag_broken + atf_add_test_case sw_flag } From owner-svn-src-all@freebsd.org Mon Jun 12 17:22:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD058C08BA3; Mon, 12 Jun 2017 17:22:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BD4F76EBC; Mon, 12 Jun 2017 17:22:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CHMNLf000649; Mon, 12 Jun 2017 17:22:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CHMNNo000648; Mon, 12 Jun 2017 17:22:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201706121722.v5CHMNNo000648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 12 Jun 2017 17:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319859 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 17:22:24 -0000 Author: ian Date: Mon Jun 12 17:22:23 2017 New Revision: 319859 URL: https://svnweb.freebsd.org/changeset/base/319859 Log: Add support for "make universe_kernels -DMAKE_GENERIC_KERNELS" to build just the GENERIC kernels for each arch (including variations such as GENERIC-NODEBUG, GENERIC64, etc). This helps with quickly doing a test build for all[*] arches without building dozens of variant kernels for the arches that have lots of hardware/board/system variations. [*] Not all arches have a generic kernel (but they probably should for test-building purposes, even if it can't boot on any real hardware). Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Jun 12 16:53:42 2017 (r319858) +++ head/Makefile Mon Jun 12 17:22:23 2017 (r319859) @@ -522,6 +522,8 @@ TARGET!= uname -m .endif .if defined(MAKE_ALL_KERNELS) _THINNER=cat +.elif defined(MAKE_GENERIC_KERNELS) +_THINNER=grep "GENERIC" || true .else _THINNER=xargs grep -L "^.NO_UNIVERSE" || true .endif From owner-svn-src-all@freebsd.org Mon Jun 12 17:37:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B620C08F59; Mon, 12 Jun 2017 17:37:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19EC5777C4; Mon, 12 Jun 2017 17:37:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CHbIku005443; Mon, 12 Jun 2017 17:37:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CHbImQ005442; Mon, 12 Jun 2017 17:37:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706121737.v5CHbImQ005442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 17:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319860 - stable/11/contrib/byacc/test/yacc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 17:37:19 -0000 Author: ngie Date: Mon Jun 12 17:37:18 2017 New Revision: 319860 URL: https://svnweb.freebsd.org/changeset/base/319860 Log: MFC r313398: Approved by: re (gjb) Apply r274475's to expr.oxout.tab.c to fix the test on FreeBSD YYINT on FreeBSD is int, not short I'll work with the upstream maintainer or come up with a build method of modifying their definitions on install instead of having to modify tests to match our forked YYINT definition. PR: 216891 Modified: stable/11/contrib/byacc/test/yacc/expr.oxout.tab.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/byacc/test/yacc/expr.oxout.tab.c ============================================================================== --- stable/11/contrib/byacc/test/yacc/expr.oxout.tab.c Mon Jun 12 17:22:23 2017 (r319859) +++ stable/11/contrib/byacc/test/yacc/expr.oxout.tab.c Mon Jun 12 17:37:18 2017 (r319860) @@ -178,7 +178,7 @@ extern int YYPARSE_DECL(); #define ID 257 #define CONST 258 #define YYERRCODE 256 -typedef short YYINT; +typedef int YYINT; static const YYINT expr.oxout_lhs[] = { -1, 2, 0, 1, 3, 3, 3, 3, 3, 3, 3, }; From owner-svn-src-all@freebsd.org Mon Jun 12 18:44:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDFBAC0A065; Mon, 12 Jun 2017 18:44:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A489794BC; Mon, 12 Jun 2017 18:44:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CIiEt0033283; Mon, 12 Jun 2017 18:44:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CIiEM9033282; Mon, 12 Jun 2017 18:44:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706121844.v5CIiEM9033282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 12 Jun 2017 18:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319861 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 18:44:15 -0000 Author: bdrewery Date: Mon Jun 12 18:44:14 2017 New Revision: 319861 URL: https://svnweb.freebsd.org/changeset/base/319861 Log: META_MODE: NO_FILEMON should imply nofilemon. This fixes NO_FILEMON to properly still use .depend.OBJ files for dependency tracking. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Mon Jun 12 17:37:18 2017 (r319860) +++ head/share/mk/sys.mk Mon Jun 12 18:44:14 2017 (r319861) @@ -59,7 +59,7 @@ META_MODE+= missing-meta=yes .if !defined(NO_SILENT) META_MODE+= silent=yes .endif -.if !exists(/dev/filemon) +.if !exists(/dev/filemon) || defined(NO_FILEMON) META_MODE+= nofilemon .endif # Require filemon data with bmake From owner-svn-src-all@freebsd.org Mon Jun 12 19:13:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06A12C0A832; Mon, 12 Jun 2017 19:13:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C043A7A523; Mon, 12 Jun 2017 19:13:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CJDTkt045619; Mon, 12 Jun 2017 19:13:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CJDTXJ045618; Mon, 12 Jun 2017 19:13:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706121913.v5CJDTXJ045618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 12 Jun 2017 19:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319862 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 19:13:31 -0000 Author: bdrewery Date: Mon Jun 12 19:13:29 2017 New Revision: 319862 URL: https://svnweb.freebsd.org/changeset/base/319862 Log: META_MODE: Show .ERROR_CMD in error. This uses a hack to get the CMD from the meta file rather than .ERROR_CMD since bmake currently blanks the value for non-jobs mode. Reviewed by: sjg (indirectly) MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/share/mk/local.sys.mk Modified: head/share/mk/local.sys.mk ============================================================================== --- head/share/mk/local.sys.mk Mon Jun 12 18:44:14 2017 (r319861) +++ head/share/mk/local.sys.mk Mon Jun 12 19:13:29 2017 (r319862) @@ -13,7 +13,9 @@ MAKE_PRINT_VAR_ON_ERROR += \ .MAKE.MODE .endif +_ERROR_CMD=${sed -n '/^CMD/s,^CMD ,,p' ${.ERROR_META_FILE}:L:sh} MAKE_PRINT_VAR_ON_ERROR+= \ + _ERROR_CMD \ .CURDIR \ .MAKE \ .OBJDIR \ From owner-svn-src-all@freebsd.org Mon Jun 12 19:29:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73011C0AE20; Mon, 12 Jun 2017 19:29:32 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4187E7AFAC; Mon, 12 Jun 2017 19:29:32 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CJTVfl050904; Mon, 12 Jun 2017 19:29:31 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CJTVbI050903; Mon, 12 Jun 2017 19:29:31 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201706121929.v5CJTVbI050903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 12 Jun 2017 19:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319863 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 19:29:32 -0000 Author: allanjude Date: Mon Jun 12 19:29:31 2017 New Revision: 319863 URL: https://svnweb.freebsd.org/changeset/base/319863 Log: bsdinstall: Make ZFS min_auto_ashift adjustment persistent Reported by: feld Reviewed by: dteske, tsoome MFC after: 3 days Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D10895 Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Jun 12 19:13:29 2017 (r319862) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Jun 12 19:29:31 2017 (r319863) @@ -1443,6 +1443,12 @@ zfs_create_boot() 'kern.geom.label.gptid.enable=\"0\"' \ $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + if [ "$ZFSBOOT_FORCE_4K_SECTORS" ]; then + f_eval_catch $funcname echo "$ECHO_APPEND" \ + 'vfs.zfs.min_auto_ashift=12' \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + fi + if [ "$ZFSBOOT_SWAP_MIRROR" ]; then f_eval_catch $funcname echo "$ECHO_APPEND" \ 'geom_mirror_load=\"YES\"' \ From owner-svn-src-all@freebsd.org Mon Jun 12 19:31:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3061C310CC; Mon, 12 Jun 2017 19:31:27 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C17527B2B1; Mon, 12 Jun 2017 19:31:27 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CJVQVN052435; Mon, 12 Jun 2017 19:31:26 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CJVQqA052434; Mon, 12 Jun 2017 19:31:26 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201706121931.v5CJVQqA052434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 12 Jun 2017 19:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319864 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 19:31:28 -0000 Author: allanjude Date: Mon Jun 12 19:31:26 2017 New Revision: 319864 URL: https://svnweb.freebsd.org/changeset/base/319864 Log: bsdinstall: support Auto ZFS mode for ARM64 Reported by: Shawn Webb MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Mon Jun 12 19:29:31 2017 (r319863) +++ head/usr.sbin/bsdinstall/scripts/auto Mon Jun 12 19:31:26 2017 (r319864) @@ -260,7 +260,7 @@ Shell \"Open a shell and partition by hand\"" CURARCH=$( uname -m ) case $CURARCH in - amd64|i386) # Booting ZFS Supported + amd64|arm64|i386) # Booting ZFS Supported PMODES="$PMODES \"Auto (ZFS)\" \"Guided Root-on-ZFS\"" ;; *) # Booting ZFS Unspported From owner-svn-src-all@freebsd.org Mon Jun 12 19:45:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34217C31822; Mon, 12 Jun 2017 19:45:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01C407BE5C; Mon, 12 Jun 2017 19:45:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CJj63D058712; Mon, 12 Jun 2017 19:45:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CJj6kd058711; Mon, 12 Jun 2017 19:45:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706121945.v5CJj6kd058711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 12 Jun 2017 19:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319865 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 19:45:07 -0000 Author: emaste Date: Mon Jun 12 19:45:05 2017 New Revision: 319865 URL: https://svnweb.freebsd.org/changeset/base/319865 Log: remove stale dependencies for utimens* wrappers removed in r319663 Use a similar approach to r318957 (which was for ptrace dependencies): grep the .depend file for the old source file and delete the stale dependency if found. Reviewed by: bdrewery Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11091 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jun 12 19:31:26 2017 (r319864) +++ head/Makefile.inc1 Mon Jun 12 19:45:05 2017 (r319865) @@ -767,6 +767,17 @@ _worldtmp: .PHONY fi .endif .endfor +# 20170607 remove stale dependencies for utimens* wrappers removed in r319663 +.for f in futimens utimensat +.if exists(${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o) + @if egrep -q '/${f}.c' \ + ${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o; then \ + echo Removing stale dependencies for ${f} syscall wrappers; \ + rm -f ${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.* \ + ${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.*; \ + fi +.endif +.endfor # 20170523 remove stale generated asm files for functions which are no longer # syscalls after r302092 (pipe) and r318736 (others) .for f in getdents lstat mknod pipe stat From owner-svn-src-all@freebsd.org Mon Jun 12 19:51:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAC46C31AE4; Mon, 12 Jun 2017 19:51:58 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AEAE7C1D2; Mon, 12 Jun 2017 19:51:58 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CJpvON059647; Mon, 12 Jun 2017 19:51:57 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CJpvwO059646; Mon, 12 Jun 2017 19:51:57 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201706121951.v5CJpvwO059646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 12 Jun 2017 19:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319866 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 19:51:58 -0000 Author: allanjude Date: Mon Jun 12 19:51:57 2017 New Revision: 319866 URL: https://svnweb.freebsd.org/changeset/base/319866 Log: top: Change the way the ZFS ARC compression ratio is calculated Based on feedback from OpenZFS developers Matt Ahrens and George Wilson, the calculation of the ratio no longer takes in to account overhead. The old formula could result in reporting a negative compression ratio This could confuse the user or give a false impression that there would be an advantage to disabling the compressed ARC feature. The new formula will more closely match an average of the on-disk compression ratio, as reported by the ZFS property 'compressratio' MFC after: 3 days Sponsored by: ScaleEngine Inc. Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Jun 12 19:45:05 2017 (r319865) +++ head/usr.bin/top/machine.c Mon Jun 12 19:51:57 2017 (r319866) @@ -188,9 +188,9 @@ char *arcnames[] = { NULL }; -int carc_stats[5]; +int carc_stats[4]; char *carcnames[] = { - "K Compressed, ", "K Uncompressed, ", ":1 Ratio, ", "K Overhead", + "K Compressed, ", "K Uncompressed, ", ":1 Ratio, ", NULL }; @@ -580,11 +580,9 @@ get_system_info(struct system_info *si) if (carc_enabled) { GETSYSCTL("kstat.zfs.misc.arcstats.compressed_size", arc_stat); carc_stats[0] = arc_stat >> 10; + carc_stats[2] = arc_stat >> 10; /* For ratio */ GETSYSCTL("kstat.zfs.misc.arcstats.uncompressed_size", arc_stat); carc_stats[1] = arc_stat >> 10; - carc_stats[2] = arc_stats[0]; /* ARC Total */ - GETSYSCTL("kstat.zfs.misc.arcstats.overhead_size", arc_stat); - carc_stats[3] = arc_stat >> 10; si->carc = carc_stats; } From owner-svn-src-all@freebsd.org Mon Jun 12 19:54:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B895C31B61; Mon, 12 Jun 2017 19:54:44 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4A6B7C49E; Mon, 12 Jun 2017 19:54:43 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CJshns062800; Mon, 12 Jun 2017 19:54:43 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CJsh91062799; Mon, 12 Jun 2017 19:54:43 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201706121954.v5CJsh91062799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 12 Jun 2017 19:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319867 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 19:54:44 -0000 Author: allanjude Date: Mon Jun 12 19:54:42 2017 New Revision: 319867 URL: https://svnweb.freebsd.org/changeset/base/319867 Log: top: Missing man page update for r319866 MFC after: 3 days Modified: head/usr.bin/top/top.local.1 Modified: head/usr.bin/top/top.local.1 ============================================================================== --- head/usr.bin/top/top.local.1 Mon Jun 12 19:51:57 2017 (r319866) +++ head/usr.bin/top/top.local.1 Mon Jun 12 19:54:42 2017 (r319867) @@ -65,10 +65,7 @@ bytes of memory used by ARC caches bytes of data stored in ARC caches before compression .TP .B Ratio: -ratio of uncompressed data to total ARC size -.TP -.B Overhead: -amount of overhead from ARC compression +compression ratio of data cached in the ARC .SS Swap Stats .TP .B Total: From owner-svn-src-all@freebsd.org Mon Jun 12 20:14:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74480C7709E; Mon, 12 Jun 2017 20:14:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2BC7CF86; Mon, 12 Jun 2017 20:14:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CKEiSD071091; Mon, 12 Jun 2017 20:14:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CKEitK071089; Mon, 12 Jun 2017 20:14:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706122014.v5CKEitK071089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 12 Jun 2017 20:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319868 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 20:14:45 -0000 Author: markj Date: Mon Jun 12 20:14:44 2017 New Revision: 319868 URL: https://svnweb.freebsd.org/changeset/base/319868 Log: Add a helper function for comparing struct uuids. Submitted by: Domagoj Stolfa MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11138 Modified: head/sys/kern/kern_uuid.c head/sys/sys/uuid.h Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Mon Jun 12 19:54:42 2017 (r319867) +++ head/sys/kern/kern_uuid.c Mon Jun 12 20:14:44 2017 (r319868) @@ -424,3 +424,10 @@ parse_uuid(const char *str, struct uuid *uuid) (c[3] & 0xc0) != 0x80 && /* variant 1? */ (c[3] & 0xe0) != 0xc0) ? EINVAL : 0); /* variant 2? */ } + +int +uuidcmp(const struct uuid *uuid1, const struct uuid *uuid2) +{ + + return (memcmp(uuid1, uuid2, sizeof(struct uuid))); +} Modified: head/sys/sys/uuid.h ============================================================================== --- head/sys/sys/uuid.h Mon Jun 12 19:54:42 2017 (r319867) +++ head/sys/sys/uuid.h Mon Jun 12 20:14:44 2017 (r319868) @@ -65,6 +65,7 @@ int snprintf_uuid(char *, size_t, struct uuid *); int printf_uuid(struct uuid *); int sbuf_printf_uuid(struct sbuf *, struct uuid *); int parse_uuid(const char *, struct uuid *); +int uuidcmp(const struct uuid *, const struct uuid *); void be_uuid_dec(void const *buf, struct uuid *uuid); void be_uuid_enc(void *buf, struct uuid const *uuid); From owner-svn-src-all@freebsd.org Mon Jun 12 20:24:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96B8BC7738F; Mon, 12 Jun 2017 20:24:58 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E4C37D582; Mon, 12 Jun 2017 20:24:58 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id l6so17987657iti.1; Mon, 12 Jun 2017 13:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=3bBnFYE38v4iYUauZym0AvNMX+umItaoTOkSCRN5UnI=; b=PfvfcxnYid2HPYFObgxrcQxMIl7qnV3viCWPpUzVAjyjoW0d4nPDfr6VWkTO/ndDbR TCT9rb2fGOPx7jcoD30QhgyFuwlLNjMQMGjeI1nU5E3NOaZBpbVcTwT+HSx4YBG5PS4k Oqrqsj0hc8JkaC3gIPu620nbmbj0cx1rtmhIO/ecY3OOru9IjrbQJzibcArPxx+eLlUb Mo9SXqCm9lrYmIuCFVO+U79ahLV20BHVD7+9apRYlKTOzXwwttSI8HViNMSihb3Hwqll s0QKlS1jTiN1XbZj1XkSeH77FRYFS+NqS/lekjmLFDXv06WEhdyxHD106i7LJ/1DwFwe +ynA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=3bBnFYE38v4iYUauZym0AvNMX+umItaoTOkSCRN5UnI=; b=k+q/nvCiJ7JaXVkLxqPQzV0Ri0xvDeGT9cFlaCJHi4aPJqe4b9AI5rqLBsb1kaElFv NDWPDGD3BPaxV0c5lojt8rf/q90HdrU7xKP+pjG4/058qUn0X3SaFHy6nGRIxJX9xAtp ONaV+lI41kmp32CgiSZuz+xh8NIxPR/Vn4X0GDYIQHHnGyuBdY76A5rbpHeZ0fM3O+RI ns/ftBDJEBH4z5jimhm6slWBOzsZXfiWGqniJhJa/IYhBX6gsnx2jeZYbSe0B7aN+0dB T0+7FsMARJpnrP3AkG5pzLHKGWLkO3Y7vsmtRQ1sJ0zA7bgTUV8C5mcus5Lnjx7sIL5f 17Sg== X-Gm-Message-State: AKS2vOxw67p2KVze92g3yUymAHWOaCQ0Tyeg9FbS2UlqfWZrZdxh2wmU /zVH2Dt+xIRdJC6P/ZICVVVfjC35M+ts X-Received: by 10.36.161.67 with SMTP id n3mr11029610iti.7.1497299097734; Mon, 12 Jun 2017 13:24:57 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.10.86 with HTTP; Mon, 12 Jun 2017 13:24:37 -0700 (PDT) In-Reply-To: <201706121722.v5CHMNNo000648@repo.freebsd.org> References: <201706121722.v5CHMNNo000648@repo.freebsd.org> From: Ed Maste Date: Mon, 12 Jun 2017 16:24:37 -0400 X-Google-Sender-Auth: Tr2kqxDafy5n9I_ZeQH9dA7TuA4 Message-ID: Subject: Re: svn commit: r319859 - head To: Ian Lepore Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 20:24:58 -0000 On 12 June 2017 at 13:22, Ian Lepore wrote: > > [*] Not all arches have a generic kernel (but they probably should for > test-building purposes, even if it can't boot on any real hardware). Or build GENERIC* + LINT*? From owner-svn-src-all@freebsd.org Mon Jun 12 20:30:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FB34C77583; Mon, 12 Jun 2017 20:30:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1B17D9B1; Mon, 12 Jun 2017 20:30:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v5CKTqMM013550 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 12 Jun 2017 23:29:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v5CKTqMM013550 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v5CKTqeb013549; Mon, 12 Jun 2017 23:29:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 12 Jun 2017 23:29:52 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319868 - in head/sys: kern sys Message-ID: <20170612202952.GU2088@kib.kiev.ua> References: <201706122014.v5CKEitK071089@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201706122014.v5CKEitK071089@repo.freebsd.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 20:30:03 -0000 On Mon, Jun 12, 2017 at 08:14:44PM +0000, Mark Johnston wrote: > +int > +uuidcmp(const struct uuid *uuid1, const struct uuid *uuid2) > +{ > + > + return (memcmp(uuid1, uuid2, sizeof(struct uuid))); > +} This is unsafe. The function operation depends on the ABI properties that there is no padding either between members, or at the end of the structure. Why not use by-member comparision ? From owner-svn-src-all@freebsd.org Mon Jun 12 20:42:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B375C77B65; Mon, 12 Jun 2017 20:42:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A72E7E3FF; Mon, 12 Jun 2017 20:42:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CKgGoh084002; Mon, 12 Jun 2017 20:42:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CKgGU4084001; Mon, 12 Jun 2017 20:42:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706122042.v5CKgGU4084001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Jun 2017 20:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319869 - head/tools/test/ptrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 20:42:17 -0000 Author: kib Date: Mon Jun 12 20:42:16 2017 New Revision: 319869 URL: https://svnweb.freebsd.org/changeset/base/319869 Log: Decode recently added flags. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/tools/test/ptrace/scescx.c Modified: head/tools/test/ptrace/scescx.c ============================================================================== --- head/tools/test/ptrace/scescx.c Mon Jun 12 20:14:44 2017 (r319868) +++ head/tools/test/ptrace/scescx.c Mon Jun 12 20:42:16 2017 (r319869) @@ -97,6 +97,11 @@ decode_pl_flags(struct ptrace_lwpinfo *lwpinfo) { PL_FLAG_EXEC, "EXEC" }, { PL_FLAG_SI, "SI" }, { PL_FLAG_FORKED, "FORKED" }, + { PL_FLAG_CHILD, "CHILD" }, + { PL_FLAG_BORN, "LWPBORN" }, + { PL_FLAG_EXITED, "LWPEXITED" }, + { PL_FLAG_VFORKED, "VFORKED" }, + { PL_FLAG_VFORK_DONE, "VFORKDONE" }, }; char de[32]; unsigned first, flags, i; From owner-svn-src-all@freebsd.org Mon Jun 12 20:42:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DFBDC77BC6; Mon, 12 Jun 2017 20:42:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59D217E55A; Mon, 12 Jun 2017 20:42:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CKgbjU084060; Mon, 12 Jun 2017 20:42:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CKgbHW084057; Mon, 12 Jun 2017 20:42:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706122042.v5CKgbHW084057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 12 Jun 2017 20:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319870 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 20:42:38 -0000 Author: emaste Date: Mon Jun 12 20:42:37 2017 New Revision: 319870 URL: https://svnweb.freebsd.org/changeset/base/319870 Log: msdosfs: adjust #ifdefs to be similar to NetBSD - Add header guards where missing - Make parts available for use in makefs Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/msdosfs/denode.h head/sys/fs/msdosfs/direntry.h head/sys/fs/msdosfs/fat.h Modified: head/sys/fs/msdosfs/denode.h ============================================================================== --- head/sys/fs/msdosfs/denode.h Mon Jun 12 20:42:16 2017 (r319869) +++ head/sys/fs/msdosfs/denode.h Mon Jun 12 20:42:37 2017 (r319870) @@ -47,6 +47,8 @@ * * October 1992 */ +#ifndef _FS_MSDOSFS_DENODE_H_ +#define _FS_MSDOSFS_DENODE_H_ /* * This is the pc filesystem specific portion of the vnode structure. @@ -207,7 +209,7 @@ struct denode { ((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \ putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)) -#ifdef _KERNEL +#if defined(_KERNEL) || defined(MAKEFS) #define VTODE(vp) ((struct denode *)(vp)->v_data) #define DETOV(de) ((de)->de_vnode) @@ -277,4 +279,6 @@ int deupdat(struct denode *dep, int waitfor); int removede(struct denode *pdep, struct denode *dep); int detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred); int doscheckpath( struct denode *source, struct denode *target); -#endif /* _KERNEL */ +#endif /* _KERNEL || MAKEFS */ +#endif /* !_FS_MSDOSFS_DENODE_H_ */ + Modified: head/sys/fs/msdosfs/direntry.h ============================================================================== --- head/sys/fs/msdosfs/direntry.h Mon Jun 12 20:42:16 2017 (r319869) +++ head/sys/fs/msdosfs/direntry.h Mon Jun 12 20:42:37 2017 (r319870) @@ -133,7 +133,7 @@ struct winentry { #define DD_YEAR_MASK 0xFE00 /* year - 1980 */ #define DD_YEAR_SHIFT 9 -#ifdef _KERNEL +#if defined(_KERNEL) || defined(MAKEFS) struct mbnambuf { size_t nb_len; int nb_last_id; @@ -159,5 +159,5 @@ int win2unixfn(struct mbnambuf *nbp, struct winentry * uint8_t winChksum(uint8_t *name); int winSlotCnt(const u_char *un, size_t unlen, struct msdosfsmount *pmp); size_t winLenFixup(const u_char *un, size_t unlen); -#endif /* _KERNEL */ +#endif /* _KERNEL || MAKEFS */ #endif /* !_FS_MSDOSFS_DIRENTRY_H_ */ Modified: head/sys/fs/msdosfs/fat.h ============================================================================== --- head/sys/fs/msdosfs/fat.h Mon Jun 12 20:42:16 2017 (r319869) +++ head/sys/fs/msdosfs/fat.h Mon Jun 12 20:42:37 2017 (r319870) @@ -48,6 +48,8 @@ * October 1992 */ +#ifndef _FS_MSDOSFS_FAT_H_ +#define _FS_MSDOSFS_FAT_H_ /* * Some useful cluster numbers. */ @@ -78,7 +80,7 @@ #define MSDOSFSEOF(pmp, cn) ((((cn) | ~(pmp)->pm_fatmask) & CLUST_EOFS) == CLUST_EOFS) -#ifdef _KERNEL +#if defined(_KERNEL) || defined(MAKEFS) /* * These are the values for the function argument to the function * fatentry(). @@ -101,4 +103,5 @@ int extendfile(struct denode *dep, u_long count, struc void fc_purge(struct denode *dep, u_int frcn); int markvoldirty(struct msdosfsmount *pmp, int dirty); -#endif /* _KERNEL */ +#endif /* _KERNEL || MAKEFS */ +#endif /* !_FS_MSDOSFS_FAT_H_ */ From owner-svn-src-all@freebsd.org Mon Jun 12 20:47:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63261C77CD8; Mon, 12 Jun 2017 20:47:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4BB7E7F4; Mon, 12 Jun 2017 20:47:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x22a.google.com with SMTP id w1so142139740qtg.2; Mon, 12 Jun 2017 13:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DeuwvrVF/8AyruPsQ2BRPmeVE7jFMCIZMGXpTtXtpG4=; b=AglSIL5CR1tc5XXFegg4Acp/zIqcph65kPHP24VZi+mv8REtG9MfHY1ts/uu4M4mlM 5khk1MBvKAytaxkMQTuIUF9iVRzeLIpaTeDBW8/VtmgUCv+Fh5JDhxSEF5+ZE3pby7du cO7nH5mmLiSvo2Cj+3I4y5c0NeNN+ger8wlDjaFyGustlY9PPe4fKCuyqyp0JBGY2IO/ iU5adKR4iJiYCYQbbKO2gKz3+2BkPXX2v8jELWq+fx6GehA2pJRQiTKYe3tkmMuNPKaf 5Qo4oJqTpUH2sksgvgB88JY9vk/RDO9bQ2qzt/2SNXNcp3sJwZU8WaNFRP4XO6J/djSW lj9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=DeuwvrVF/8AyruPsQ2BRPmeVE7jFMCIZMGXpTtXtpG4=; b=FQVdFLymsNozFQHtlYt4S2iSiesuFFX+RCjEopMF7EdFK59Ib60k5z/18/c5oJpfgK 8yt9a2zDG1v9GdH2+X9D89GoR8NSv5l2lzVFpKvrJd08XzaDBi2j2fwimljoa/FcbvCD eYUtCWePljyO7tNcrMYbo+hSjZS2rFwCbWi23DXfKgTwXo6bThhx9IfgmHu8xWHzW8r0 /J/5v919fNwMM7KPfSzTKLoGogGNU7P8lYBSKDMZoyDEDF4o5sTepnVk9sy122dZC200 8kazq8mlQ3A7is8mtbS3gaDiig4pGl1TDmHucrDUKy7tvaunPVQi8n7DcWSvBRJnv+We ipcA== X-Gm-Message-State: AKS2vOwTW8MUvThPgC4puA9cpQ2H6fIaAO44efgxeS2bUxCmAQd/KqCE MJsWWiFg/2W7+FHF X-Received: by 10.55.88.194 with SMTP id m185mr70346839qkb.230.1497300437259; Mon, 12 Jun 2017 13:47:17 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id e32sm6336076qte.1.2017.06.12.13.47.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 13:47:16 -0700 (PDT) Sender: Mark Johnston Date: Mon, 12 Jun 2017 13:47:05 -0700 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319868 - in head/sys: kern sys Message-ID: <20170612204704.GA73695@wkstn-mjohnston.west.isilon.com> References: <201706122014.v5CKEitK071089@repo.freebsd.org> <20170612202952.GU2088@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170612202952.GU2088@kib.kiev.ua> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 20:47:18 -0000 On Mon, Jun 12, 2017 at 11:29:52PM +0300, Konstantin Belousov wrote: > On Mon, Jun 12, 2017 at 08:14:44PM +0000, Mark Johnston wrote: > > +int > > +uuidcmp(const struct uuid *uuid1, const struct uuid *uuid2) > > +{ > > + > > + return (memcmp(uuid1, uuid2, sizeof(struct uuid))); > > +} > > This is unsafe. The function operation depends on the ABI properties > that there is no padding either between members, or at the end of > the structure. Why not use by-member comparision ? I interpreted the CTASSERT at the beginning of kern_uuid.c as a guarantee that no such padding will be present. kern_uuid.c also defines an alternate representation, struct uuid_private, and casts between the two. From owner-svn-src-all@freebsd.org Mon Jun 12 20:53:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAE2AC77FC4; Mon, 12 Jun 2017 20:53:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B34C17ECA8; Mon, 12 Jun 2017 20:53:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CKrj1L088108; Mon, 12 Jun 2017 20:53:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CKrjFq088101; Mon, 12 Jun 2017 20:53:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706122053.v5CKrjFq088101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Jun 2017 20:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319871 - in head/sys: amd64/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 20:53:47 -0000 Author: kib Date: Mon Jun 12 20:53:44 2017 New Revision: 319871 URL: https://svnweb.freebsd.org/changeset/base/319871 Log: Make struct syscall_args visible to userspace compilation environment from machine/proc.h, consistently on all architectures. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 3 weeks X-Differential revision: https://reviews.freebsd.org/D11080 Modified: head/sys/amd64/include/proc.h head/sys/arm64/include/proc.h head/sys/i386/include/proc.h head/sys/mips/include/proc.h head/sys/powerpc/include/proc.h head/sys/riscv/include/proc.h head/sys/sparc64/include/proc.h Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Mon Jun 12 20:42:37 2017 (r319870) +++ head/sys/amd64/include/proc.h Mon Jun 12 20:53:44 2017 (r319871) @@ -70,6 +70,13 @@ struct mdproc { #define KINFO_PROC_SIZE 1088 #define KINFO_PROC32_SIZE 768 +struct syscall_args { + u_int code; + struct sysent *callp; + register_t args[8]; + int narg; +}; + #ifdef _KERNEL /* Get the current kernel thread stack usage. */ @@ -92,13 +99,6 @@ int amd64_set_ldt_data(struct thread *td, int start, i extern struct mtx dt_lock; extern int max_ldt_segment; - -struct syscall_args { - u_int code; - struct sysent *callp; - register_t args[8]; - int narg; -}; #endif /* _KERNEL */ #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/arm64/include/proc.h ============================================================================== --- head/sys/arm64/include/proc.h Mon Jun 12 20:42:37 2017 (r319870) +++ head/sys/arm64/include/proc.h Mon Jun 12 20:53:44 2017 (r319871) @@ -45,8 +45,6 @@ struct mdproc { #define KINFO_PROC_SIZE 1088 -#ifdef _KERNEL - #define MAXARGS 8 struct syscall_args { u_int code; @@ -54,7 +52,5 @@ struct syscall_args { register_t args[MAXARGS]; int narg; }; - -#endif #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/i386/include/proc.h ============================================================================== --- head/sys/i386/include/proc.h Mon Jun 12 20:42:37 2017 (r319870) +++ head/sys/i386/include/proc.h Mon Jun 12 20:53:44 2017 (r319871) @@ -60,6 +60,13 @@ struct mdproc { #define KINFO_PROC_SIZE 768 +struct syscall_args { + u_int code; + struct sysent *callp; + register_t args[8]; + int narg; +}; + #ifdef _KERNEL /* Get the current kernel thread stack usage. */ @@ -77,13 +84,6 @@ void user_ldt_free(struct thread *); void user_ldt_deref(struct proc_ldt *pldt); extern struct mtx dt_lock; - -struct syscall_args { - u_int code; - struct sysent *callp; - register_t args[8]; - int narg; -}; #endif /* _KERNEL */ #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/mips/include/proc.h ============================================================================== --- head/sys/mips/include/proc.h Mon Jun 12 20:42:37 2017 (r319870) +++ head/sys/mips/include/proc.h Mon Jun 12 20:53:44 2017 (r319871) @@ -80,7 +80,6 @@ struct mdproc { /* empty */ }; -#ifdef _KERNEL struct syscall_args { u_int code; struct sysent *callp; @@ -88,7 +87,6 @@ struct syscall_args { int narg; struct trapframe *trapframe; }; -#endif #ifdef __mips_n64 #define KINFO_PROC_SIZE 1088 Modified: head/sys/powerpc/include/proc.h ============================================================================== --- head/sys/powerpc/include/proc.h Mon Jun 12 20:42:37 2017 (r319870) +++ head/sys/powerpc/include/proc.h Mon Jun 12 20:53:44 2017 (r319871) @@ -53,6 +53,13 @@ struct mdproc { #define KINFO_PROC_SIZE 768 #endif +struct syscall_args { + u_int code; + struct sysent *callp; + register_t args[10]; + int narg; +}; + #ifdef _KERNEL #include @@ -65,13 +72,6 @@ struct mdproc { td->td_kstack_pages * PAGE_SIZE - \ (char *)&td; \ } while (0) - -struct syscall_args { - u_int code; - struct sysent *callp; - register_t args[10]; - int narg; -}; #endif #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/riscv/include/proc.h ============================================================================== --- head/sys/riscv/include/proc.h Mon Jun 12 20:42:37 2017 (r319870) +++ head/sys/riscv/include/proc.h Mon Jun 12 20:53:44 2017 (r319871) @@ -45,8 +45,6 @@ struct mdproc { #define KINFO_PROC_SIZE 1088 -#ifdef _KERNEL - #define MAXARGS 8 struct syscall_args { u_int code; @@ -54,7 +52,5 @@ struct syscall_args { register_t args[MAXARGS]; int narg; }; - -#endif #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/sparc64/include/proc.h ============================================================================== --- head/sys/sparc64/include/proc.h Mon Jun 12 20:42:37 2017 (r319870) +++ head/sys/sparc64/include/proc.h Mon Jun 12 20:53:44 2017 (r319871) @@ -53,6 +53,13 @@ struct mdproc { #define KINFO_PROC_SIZE 1088 +struct syscall_args { + u_int code; + struct sysent *callp; + register_t args[8]; + int narg; +}; + #ifdef _KERNEL #include @@ -65,13 +72,6 @@ struct mdproc { td->td_kstack_pages * PAGE_SIZE - \ (char *)&td; \ } while (0) - -struct syscall_args { - u_int code; - struct sysent *callp; - register_t args[8]; - int narg; -}; #endif From owner-svn-src-all@freebsd.org Mon Jun 12 20:55:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D439AC7807B; Mon, 12 Jun 2017 20:55:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A400E7EE1E; Mon, 12 Jun 2017 20:55:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CKtKkr088223; Mon, 12 Jun 2017 20:55:20 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CKtK9p088222; Mon, 12 Jun 2017 20:55:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <201706122055.v5CKtK9p088222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 12 Jun 2017 20:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319872 - head/sys/dev/cxgbe/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 20:55:21 -0000 Author: np Date: Mon Jun 12 20:55:20 2017 New Revision: 319872 URL: https://svnweb.freebsd.org/changeset/base/319872 Log: cxgbe(4): Do not request an FEC setting that the port does not support. MFC after: 3 days. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Jun 12 20:53:44 2017 (r319871) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Jun 12 20:55:20 2017 (r319872) @@ -7595,6 +7595,7 @@ static void init_link_config(struct link_config *lc, u fec |= FEC_BASER_RS; if (acaps & FW_PORT_CAP_FEC_RESERVED) fec |= FEC_RESERVED; + fec &= G_FW_PORT_CAP_FEC(lc->supported); lc->requested_fec = lc->fec = fec; if (lc->supported & FW_PORT_CAP_ANEG) { From owner-svn-src-all@freebsd.org Mon Jun 12 21:03:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECC36C78384; Mon, 12 Jun 2017 21:03:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A32537F34F; Mon, 12 Jun 2017 21:03:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CL3PEo092278; Mon, 12 Jun 2017 21:03:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CL3N1M092252; Mon, 12 Jun 2017 21:03:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706122103.v5CL3N1M092252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Jun 2017 21:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319873 - in head/sys: amd64/amd64 amd64/cloudabi32 amd64/cloudabi64 amd64/ia32 amd64/linux amd64/linux32 arm/arm arm/cloudabi32 arm64/arm64 arm64/cloudabi64 compat/ia32 i386/cloudabi32... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 21:03:27 -0000 Author: kib Date: Mon Jun 12 21:03:23 2017 New Revision: 319873 URL: https://svnweb.freebsd.org/changeset/base/319873 Log: Move struct syscall_args syscall arguments parameters container into struct thread. For all architectures, the syscall trap handlers have to allocate the structure on the stack. The structure takes 88 bytes on 64bit arches which is not negligible. Also, it cannot be easily found by other code, which e.g. caused duplication of some members of the structure to struct thread already. The change removes td_dbg_sc_code and td_dbg_sc_nargs which were directly copied from syscall_args. The structure is put into the copied on fork part of the struct thread to make the syscall arguments information correct in the child after fork. This move will also allow several more uses shortly. Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation MFC after: 3 weeks X-Differential revision: https://reviews.freebsd.org/D11080 Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/cloudabi32/cloudabi32_sysvec.c head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/amd64/ia32/ia32_syscall.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/syscall.c head/sys/arm/cloudabi32/cloudabi32_sysvec.c head/sys/arm64/arm64/trap.c head/sys/arm64/cloudabi64/cloudabi64_sysvec.c head/sys/compat/ia32/ia32_util.h head/sys/i386/cloudabi32/cloudabi32_sysvec.c head/sys/i386/i386/trap.c head/sys/i386/linux/linux_sysvec.c head/sys/kern/init_main.c head/sys/kern/kern_fork.c head/sys/kern/kern_thread.c head/sys/kern/subr_syscall.c head/sys/kern/sys_process.c head/sys/mips/mips/trap.c head/sys/powerpc/powerpc/trap.c head/sys/riscv/riscv/trap.c head/sys/sparc64/sparc64/trap.c head/sys/sys/proc.h head/sys/sys/sysent.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/amd64/amd64/trap.c Mon Jun 12 21:03:23 2017 (r319873) @@ -829,16 +829,18 @@ dblfault_handler(struct trapframe *frame) } int -cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cpu_fetch_syscall_args(struct thread *td) { struct proc *p; struct trapframe *frame; register_t *argp; + struct syscall_args *sa; caddr_t params; int reg, regcnt, error; p = td->td_proc; frame = td->td_frame; + sa = &td->td_sa; reg = 0; regcnt = 6; @@ -889,7 +891,6 @@ cpu_fetch_syscall_args(struct thread *td, struct sysca void amd64_syscall(struct thread *td, int traced) { - struct syscall_args sa; int error; ksiginfo_t ksi; @@ -899,7 +900,7 @@ amd64_syscall(struct thread *td, int traced) /* NOT REACHED */ } #endif - error = syscallenter(td, &sa); + error = syscallenter(td); /* * Traced syscall. @@ -915,15 +916,16 @@ amd64_syscall(struct thread *td, int traced) KASSERT(PCB_USER_FPU(td->td_pcb), ("System call %s returning with kernel FPU ctx leaked", - syscallname(td->td_proc, sa.code))); + syscallname(td->td_proc, td->td_sa.code))); KASSERT(td->td_pcb->pcb_save == get_pcb_user_save_td(td), ("System call %s returning with mangled pcb_save", - syscallname(td->td_proc, sa.code))); + syscallname(td->td_proc, td->td_sa.code))); KASSERT(td->td_md.md_invl_gen.gen == 0, ("System call %s returning with leaked invl_gen %lu", - syscallname(td->td_proc, sa.code), td->td_md.md_invl_gen.gen)); + syscallname(td->td_proc, td->td_sa.code), + td->td_md.md_invl_gen.gen)); - syscallret(td, error, &sa); + syscallret(td, error); /* * If the user-supplied value of %rip is not a canonical Modified: head/sys/amd64/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi32/cloudabi32_sysvec.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/amd64/cloudabi32/cloudabi32_sysvec.c Mon Jun 12 21:03:23 2017 (r319873) @@ -90,10 +90,14 @@ cloudabi32_proc_setregs(struct thread *td, struct imag } static int -cloudabi32_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cloudabi32_fetch_syscall_args(struct thread *td) { - struct trapframe *frame = td->td_frame; + struct trapframe *frame; + struct syscall_args *sa; int error; + + frame = td->td_frame; + sa = &td->td_sa; /* Obtain system call number. */ sa->code = frame->tf_rax; Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Jun 12 21:03:23 2017 (r319873) @@ -87,9 +87,13 @@ cloudabi64_proc_setregs(struct thread *td, struct imag } static int -cloudabi64_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cloudabi64_fetch_syscall_args(struct thread *td) { - struct trapframe *frame = td->td_frame; + struct trapframe *frame; + struct syscall_args *sa; + + frame = td->td_frame; + sa = &td->td_sa; /* Obtain system call number. */ sa->code = frame->tf_rax; Modified: head/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- head/sys/amd64/ia32/ia32_syscall.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/amd64/ia32/ia32_syscall.c Mon Jun 12 21:03:23 2017 (r319873) @@ -105,16 +105,18 @@ ia32_set_syscall_retval(struct thread *td, int error) } int -ia32_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +ia32_fetch_syscall_args(struct thread *td) { struct proc *p; struct trapframe *frame; + struct syscall_args *sa; caddr_t params; u_int32_t args[8], tmp; int error, i; p = td->td_proc; frame = td->td_frame; + sa = &td->td_sa; params = (caddr_t)frame->tf_rsp + sizeof(u_int32_t); sa->code = frame->tf_rax; @@ -175,7 +177,6 @@ void ia32_syscall(struct trapframe *frame) { struct thread *td; - struct syscall_args sa; register_t orig_tf_rflags; int error; ksiginfo_t ksi; @@ -184,7 +185,7 @@ ia32_syscall(struct trapframe *frame) td = curthread; td->td_frame = frame; - error = syscallenter(td, &sa); + error = syscallenter(td); /* * Traced syscall. @@ -198,7 +199,7 @@ ia32_syscall(struct trapframe *frame) trapsignal(td, &ksi); } - syscallret(td, error, &sa); + syscallret(td, error); } static void Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/amd64/linux/linux_sysvec.c Mon Jun 12 21:03:23 2017 (r319873) @@ -126,7 +126,7 @@ static boolean_t linux_trans_osrel(const Elf_Note *not static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); static void linux_set_syscall_retval(struct thread *td, int error); -static int linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa); +static int linux_fetch_syscall_args(struct thread *td); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static int linux_vsyscall(struct thread *td); @@ -217,13 +217,15 @@ translate_traps(int signal, int trap_code) } static int -linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +linux_fetch_syscall_args(struct thread *td) { struct proc *p; struct trapframe *frame; + struct syscall_args *sa; p = td->td_proc; frame = td->td_frame; + sa = &td->td_sa; sa->args[0] = frame->tf_rdi; sa->args[1] = frame->tf_rsi; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon Jun 12 21:03:23 2017 (r319873) @@ -725,13 +725,15 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_ } static int -linux32_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +linux32_fetch_syscall_args(struct thread *td) { struct proc *p; struct trapframe *frame; + struct syscall_args *sa; p = td->td_proc; frame = td->td_frame; + sa = &td->td_sa; sa->args[0] = frame->tf_rbx; sa->args[1] = frame->tf_rcx; Modified: head/sys/arm/arm/syscall.c ============================================================================== --- head/sys/arm/arm/syscall.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/arm/arm/syscall.c Mon Jun 12 21:03:23 2017 (r319873) @@ -99,12 +99,14 @@ __FBSDID("$FreeBSD$"); void swi_handler(struct trapframe *); int -cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cpu_fetch_syscall_args(struct thread *td) { struct proc *p; register_t *ap; + struct syscall_args *sa; int error; + sa = &td->td_sa; sa->code = td->td_frame->tf_r7; ap = &td->td_frame->tf_r0; if (sa->code == SYS_syscall) { @@ -141,15 +143,14 @@ cpu_fetch_syscall_args(struct thread *td, struct sysca static void syscall(struct thread *td, struct trapframe *frame) { - struct syscall_args sa; int error; - sa.nap = 4; + td->td_sa.nap = 4; - error = syscallenter(td, &sa); + error = syscallenter(td); KASSERT(error != 0 || td->td_ar == NULL, ("returning from syscall with td_ar set!")); - syscallret(td, error, &sa); + syscallret(td, error); } void Modified: head/sys/arm/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/arm/cloudabi32/cloudabi32_sysvec.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/arm/cloudabi32/cloudabi32_sysvec.c Mon Jun 12 21:03:23 2017 (r319873) @@ -67,10 +67,14 @@ cloudabi32_proc_setregs(struct thread *td, struct imag } static int -cloudabi32_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cloudabi32_fetch_syscall_args(struct thread *td) { - struct trapframe *frame = td->td_frame; + struct trapframe *frame; + struct syscall_args *sa; int error; + + frame = td->td_frame; + sa = &td->td_sa; /* Obtain system call number. */ sa->code = frame->tf_r12; Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/arm64/arm64/trap.c Mon Jun 12 21:03:23 2017 (r319873) @@ -92,15 +92,17 @@ call_trapsignal(struct thread *td, int sig, int code, } int -cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cpu_fetch_syscall_args(struct thread *td) { struct proc *p; register_t *ap; + struct syscall_args *sa; int nap; nap = 8; p = td->td_proc; ap = td->td_frame->tf_x; + sa = &td->td_sa; sa->code = td->td_frame->tf_x[8]; @@ -132,12 +134,11 @@ cpu_fetch_syscall_args(struct thread *td, struct sysca static void svc_handler(struct thread *td, struct trapframe *frame) { - struct syscall_args sa; int error; if ((frame->tf_esr & ESR_ELx_ISS_MASK) == 0) { - error = syscallenter(td, &sa); - syscallret(td, error, &sa); + error = syscallenter(td); + syscallret(td, error); } else { call_trapsignal(td, SIGILL, ILL_ILLOPN, (void *)frame->tf_elr); userret(td, frame); Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Mon Jun 12 21:03:23 2017 (r319873) @@ -67,10 +67,14 @@ cloudabi64_proc_setregs(struct thread *td, struct imag } static int -cloudabi64_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cloudabi64_fetch_syscall_args(struct thread *td) { - struct trapframe *frame = td->td_frame; + struct trapframe *frame; + struct syscall_args *sa; int i; + + frame = td->td_frame; + sa = &td->td_sa; /* Obtain system call number. */ sa->code = frame->tf_x[8]; Modified: head/sys/compat/ia32/ia32_util.h ============================================================================== --- head/sys/compat/ia32/ia32_util.h Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/compat/ia32/ia32_util.h Mon Jun 12 21:03:23 2017 (r319873) @@ -50,7 +50,7 @@ #define IA32_MAXVMEM 0 /* Unlimited */ struct syscall_args; -int ia32_fetch_syscall_args(struct thread *td, struct syscall_args *sa); +int ia32_fetch_syscall_args(struct thread *td); void ia32_set_syscall_retval(struct thread *, int); void ia32_fixlimit(struct rlimit *rl, int which); Modified: head/sys/i386/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/i386/cloudabi32/cloudabi32_sysvec.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/i386/cloudabi32/cloudabi32_sysvec.c Mon Jun 12 21:03:23 2017 (r319873) @@ -85,10 +85,14 @@ cloudabi32_proc_setregs(struct thread *td, struct imag } static int -cloudabi32_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cloudabi32_fetch_syscall_args(struct thread *td) { - struct trapframe *frame = td->td_frame; + struct trapframe *frame; + struct syscall_args *sa; int error; + + frame = td->td_frame; + sa = &td->td_sa; /* Obtain system call number. */ sa->code = frame->tf_eax; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/i386/i386/trap.c Mon Jun 12 21:03:23 2017 (r319873) @@ -1012,16 +1012,18 @@ dblfault_handler() } int -cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cpu_fetch_syscall_args(struct thread *td) { struct proc *p; struct trapframe *frame; + struct syscall_args *sa; caddr_t params; long tmp; int error; p = td->td_proc; frame = td->td_frame; + sa = &td->td_sa; params = (caddr_t)frame->tf_esp + sizeof(int); sa->code = frame->tf_eax; @@ -1082,7 +1084,6 @@ void syscall(struct trapframe *frame) { struct thread *td; - struct syscall_args sa; register_t orig_tf_eflags; int error; ksiginfo_t ksi; @@ -1099,7 +1100,7 @@ syscall(struct trapframe *frame) td = curthread; td->td_frame = frame; - error = syscallenter(td, &sa); + error = syscallenter(td); /* * Traced syscall. @@ -1115,10 +1116,10 @@ syscall(struct trapframe *frame) KASSERT(PCB_USER_FPU(td->td_pcb), ("System call %s returning with kernel FPU ctx leaked", - syscallname(td->td_proc, sa.code))); + syscallname(td->td_proc, td->td_sa.code))); KASSERT(td->td_pcb->pcb_save == get_pcb_user_save_td(td), ("System call %s returning with mangled pcb_save", - syscallname(td->td_proc, sa.code))); + syscallname(td->td_proc, td->td_sa.code))); - syscallret(td, error, &sa); + syscallret(td, error); } Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/i386/linux/linux_sysvec.c Mon Jun 12 21:03:23 2017 (r319873) @@ -850,13 +850,15 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_ } static int -linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +linux_fetch_syscall_args(struct thread *td) { struct proc *p; struct trapframe *frame; + struct syscall_args *sa; p = td->td_proc; frame = td->td_frame; + sa = &td->td_sa; sa->code = frame->tf_eax; sa->args[0] = frame->tf_ebx; Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/kern/init_main.c Mon Jun 12 21:03:23 2017 (r319873) @@ -360,8 +360,7 @@ SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 2, #endif static int -null_fetch_syscall_args(struct thread *td __unused, - struct syscall_args *sa __unused) +null_fetch_syscall_args(struct thread *td __unused) { panic("null_fetch_syscall_args"); Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/kern/kern_fork.c Mon Jun 12 21:03:23 2017 (r319873) @@ -1099,7 +1099,7 @@ fork_return(struct thread *td, struct trapframe *frame */ PROC_LOCK(p); td->td_dbgflags |= TDB_SCX; - _STOPEVENT(p, S_SCX, td->td_dbg_sc_code); + _STOPEVENT(p, S_SCX, td->td_sa.code); if ((p->p_ptevents & PTRACE_SCX) != 0 || (td->td_dbgflags & TDB_BORN) != 0) ptracestop(td, SIGTRAP, NULL); Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/kern/kern_thread.c Mon Jun 12 21:03:23 2017 (r319873) @@ -80,9 +80,9 @@ _Static_assert(offsetof(struct thread, td_flags) == 0x "struct thread KBI td_flags"); _Static_assert(offsetof(struct thread, td_pflags) == 0xfc, "struct thread KBI td_pflags"); -_Static_assert(offsetof(struct thread, td_frame) == 0x410, +_Static_assert(offsetof(struct thread, td_frame) == 0x460, "struct thread KBI td_frame"); -_Static_assert(offsetof(struct thread, td_emuldata) == 0x4b8, +_Static_assert(offsetof(struct thread, td_emuldata) == 0x508, "struct thread KBI td_emuldata"); _Static_assert(offsetof(struct proc, p_flag) == 0xb0, "struct proc KBI p_flag"); @@ -100,9 +100,9 @@ _Static_assert(offsetof(struct thread, td_flags) == 0x "struct thread KBI td_flags"); _Static_assert(offsetof(struct thread, td_pflags) == 0xa4, "struct thread KBI td_pflags"); -_Static_assert(offsetof(struct thread, td_frame) == 0x2c8, +_Static_assert(offsetof(struct thread, td_frame) == 0x2ec, "struct thread KBI td_frame"); -_Static_assert(offsetof(struct thread, td_emuldata) == 0x314, +_Static_assert(offsetof(struct thread, td_emuldata) == 0x338, "struct thread KBI td_emuldata"); _Static_assert(offsetof(struct proc, p_flag) == 0x68, "struct proc KBI p_flag"); Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/kern/subr_syscall.c Mon Jun 12 21:03:23 2017 (r319873) @@ -53,13 +53,15 @@ __FBSDID("$FreeBSD$"); #include static inline int -syscallenter(struct thread *td, struct syscall_args *sa) +syscallenter(struct thread *td) { struct proc *p; + struct syscall_args *sa; int error, traced; VM_CNT_INC(v_syscall); p = td->td_proc; + sa = &td->td_sa; td->td_pticks = 0; if (td->td_cowgen != p->p_cowgen) @@ -72,7 +74,7 @@ syscallenter(struct thread *td, struct syscall_args *s td->td_dbgflags |= TDB_SCE; PROC_UNLOCK(p); } - error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); + error = (p->p_sysent->sv_fetch_syscall_args)(td); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(sa->code, sa->narg, sa->args); @@ -86,8 +88,6 @@ syscallenter(struct thread *td, struct syscall_args *s STOPEVENT(p, S_SCE, sa->narg); if (p->p_flag & P_TRACED) { PROC_LOCK(p); - td->td_dbg_sc_code = sa->code; - td->td_dbg_sc_narg = sa->narg; if (p->p_ptevents & PTRACE_SCE) ptracestop((td), SIGTRAP, NULL); PROC_UNLOCK(p); @@ -97,11 +97,7 @@ syscallenter(struct thread *td, struct syscall_args *s * Reread syscall number and arguments if * debugger modified registers or memory. */ - error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); - PROC_LOCK(p); - td->td_dbg_sc_code = sa->code; - td->td_dbg_sc_narg = sa->narg; - PROC_UNLOCK(p); + error = (p->p_sysent->sv_fetch_syscall_args)(td); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(sa->code, sa->narg, sa->args); @@ -163,9 +159,10 @@ syscallenter(struct thread *td, struct syscall_args *s } static inline void -syscallret(struct thread *td, int error, struct syscall_args *sa) +syscallret(struct thread *td, int error) { struct proc *p, *p2; + struct syscall_args *sa; ksiginfo_t ksi; int traced, error1; @@ -173,6 +170,7 @@ syscallret(struct thread *td, int error, struct syscal ("fork() did not clear TDP_FORKING upon completion")); p = td->td_proc; + sa = &td->td_sa; if ((trap_enotcap || (p->p_flag2 & P2_TRAPCAP) != 0) && IN_CAPABILITY_MODE(td)) { error1 = (td->td_pflags & TDP_NERRNO) == 0 ? error : Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/kern/sys_process.c Mon Jun 12 21:03:23 2017 (r319873) @@ -1347,8 +1347,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi pl->pl_siglist = td2->td_siglist; strcpy(pl->pl_tdname, td2->td_name); if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) != 0) { - pl->pl_syscall_code = td2->td_dbg_sc_code; - pl->pl_syscall_narg = td2->td_dbg_sc_narg; + pl->pl_syscall_code = td2->td_sa.code; + pl->pl_syscall_narg = td2->td_sa.narg; } else { pl->pl_syscall_code = 0; pl->pl_syscall_narg = 0; Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/mips/mips/trap.c Mon Jun 12 21:03:23 2017 (r319873) @@ -334,12 +334,16 @@ static int emulate_unaligned_access(struct trapframe * extern void fswintrberr(void); /* XXX */ int -cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cpu_fetch_syscall_args(struct thread *td) { - struct trapframe *locr0 = td->td_frame; + struct trapframe *locr0; struct sysentvec *se; + struct syscall_args *sa; int error, nsaved; + locr0 = td->td_frame; + sa = &td->td_sa; + bzero(sa->args, sizeof(sa->args)); /* compute next PC after syscall instruction */ @@ -785,19 +789,18 @@ dofault: case T_SYSCALL + T_USER: { - struct syscall_args sa; int error; - sa.trapframe = trapframe; - error = syscallenter(td, &sa); + td->td_sa.trapframe = trapframe; + error = syscallenter(td); #if !defined(SMP) && (defined(DDB) || defined(DEBUG)) if (trp == trapdebug) - trapdebug[TRAPSIZE - 1].code = sa.code; + trapdebug[TRAPSIZE - 1].code = td->td_sa.code; else - trp[-1].code = sa.code; + trp[-1].code = td->td_sa.code; #endif - trapdebug_enter(td->td_frame, -sa.code); + trapdebug_enter(td->td_frame, -td->td_sa.code); /* * The sync'ing of I & D caches for SYS_ptrace() is @@ -805,7 +808,7 @@ dofault: * instead of being done here under a special check * for SYS_ptrace(). */ - syscallret(td, error, &sa); + syscallret(td, error); return (trapframe->pc); } Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/powerpc/powerpc/trap.c Mon Jun 12 21:03:23 2017 (r319873) @@ -496,16 +496,18 @@ handle_onfault(struct trapframe *frame) } int -cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cpu_fetch_syscall_args(struct thread *td) { struct proc *p; struct trapframe *frame; + struct syscall_args *sa; caddr_t params; size_t argsz; int error, n, i; p = td->td_proc; frame = td->td_frame; + sa = &td->td_sa; sa->code = frame->fixreg[0]; params = (caddr_t)(frame->fixreg + FIRSTARG); @@ -587,7 +589,6 @@ void syscall(struct trapframe *frame) { struct thread *td; - struct syscall_args sa; int error; td = curthread; @@ -602,8 +603,8 @@ syscall(struct trapframe *frame) "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), "r"(USER_SLB_SLBE)); #endif - error = syscallenter(td, &sa); - syscallret(td, error, &sa); + error = syscallenter(td); + syscallret(td, error); } #if defined(__powerpc64__) && defined(AIM) Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/riscv/riscv/trap.c Mon Jun 12 21:03:23 2017 (r319873) @@ -89,14 +89,16 @@ call_trapsignal(struct thread *td, int sig, int code, } int -cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cpu_fetch_syscall_args(struct thread *td) { struct proc *p; register_t *ap; + struct syscall_args *sa; int nap; nap = NARGREG; p = td->td_proc; + sa = &td->td_sa; ap = &td->td_frame->tf_a[0]; sa->code = td->td_frame->tf_t[0]; @@ -151,15 +153,14 @@ dump_regs(struct trapframe *frame) static void svc_handler(struct trapframe *frame) { - struct syscall_args sa; struct thread *td; int error; td = curthread; td->td_frame = frame; - error = syscallenter(td, &sa); - syscallret(td, error, &sa); + error = syscallenter(td); + syscallret(td, error); } static void Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/sparc64/sparc64/trap.c Mon Jun 12 21:03:23 2017 (r319873) @@ -538,17 +538,19 @@ trap_pfault(struct thread *td, struct trapframe *tf) #define REG_MAXARGS 6 int -cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cpu_fetch_syscall_args(struct thread *td) { struct trapframe *tf; struct proc *p; register_t *argp; + struct syscall_args *sa; int reg; int regcnt; int error; p = td->td_proc; tf = td->td_frame; + sa = &td->td_sa; reg = 0; regcnt = REG_MAXARGS; @@ -596,7 +598,6 @@ void syscall(struct trapframe *tf) { struct thread *td; - struct syscall_args sa; int error; td = curthread; @@ -612,6 +613,6 @@ syscall(struct trapframe *tf) td->td_pcb->pcb_tpc = tf->tf_tpc; TF_DONE(tf); - error = syscallenter(td, &sa); - syscallret(td, error, &sa); + error = syscallenter(td); + syscallret(td, error); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/sys/proc.h Mon Jun 12 21:03:23 2017 (r319873) @@ -142,6 +142,7 @@ struct pargs { * j - locked by proc slock * k - only accessed by curthread * k*- only accessed by curthread and from an interrupt + * kx- only accessed by curthread and by debugger * l - the attaching proc or attaching proc parent * m - Giant * n - not locked, lazy @@ -296,11 +297,11 @@ struct thread { u_char td_pri_class; /* (t) Scheduling class. */ u_char td_user_pri; /* (t) User pri from estcpu and nice. */ u_char td_base_user_pri; /* (t) Base user pri */ - u_int td_dbg_sc_code; /* (c) Syscall code to debugger. */ - u_int td_dbg_sc_narg; /* (c) Syscall arg count to debugger.*/ uintptr_t td_rb_list; /* (k) Robust list head. */ uintptr_t td_rbp_list; /* (k) Robust priv list head. */ uintptr_t td_rb_inact; /* (k) Current in-action mutex loc. */ + struct syscall_args td_sa; /* (kx) Syscall parameters. Copied on + fork for child tracing. */ #define td_endcopy td_pcb /* @@ -1053,7 +1054,7 @@ void userret(struct thread *, struct trapframe *); void cpu_exit(struct thread *); void exit1(struct thread *, int, int) __dead2; void cpu_copy_thread(struct thread *td, struct thread *td0); -int cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa); +int cpu_fetch_syscall_args(struct thread *td); void cpu_fork(struct thread *, struct proc *, struct thread *, int); void cpu_fork_kthread_handler(struct thread *, void (*)(void *), void *); void cpu_set_syscall_retval(struct thread *, int); Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Mon Jun 12 20:55:20 2017 (r319872) +++ head/sys/sys/sysent.h Mon Jun 12 21:03:23 2017 (r319873) @@ -119,8 +119,7 @@ struct sysentvec { u_long *sv_maxssiz; u_int sv_flags; void (*sv_set_syscall_retval)(struct thread *, int); - int (*sv_fetch_syscall_args)(struct thread *, struct - syscall_args *); + int (*sv_fetch_syscall_args)(struct thread *); const char **sv_syscallnames; vm_offset_t sv_timekeep_base; vm_offset_t sv_shared_page_base; From owner-svn-src-all@freebsd.org Mon Jun 12 21:11:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9A7AC78662; Mon, 12 Jun 2017 21:11:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FCBA7F7C7; Mon, 12 Jun 2017 21:11:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CLBBQA092607; Mon, 12 Jun 2017 21:11:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CLBBUT092606; Mon, 12 Jun 2017 21:11:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706122111.v5CLBBUT092606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Jun 2017 21:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319874 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 21:11:13 -0000 Author: kib Date: Mon Jun 12 21:11:11 2017 New Revision: 319874 URL: https://svnweb.freebsd.org/changeset/base/319874 Log: Print unimplemented syscall number to the ctty on SIGSYS, if enabled by the knob kern.lognosys. Discussed with: imp Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 3 weeks X-Differential revision: https://reviews.freebsd.org/D11080 Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon Jun 12 21:03:23 2017 (r319873) +++ head/sys/kern/kern_sig.c Mon Jun 12 21:11:11 2017 (r319874) @@ -150,6 +150,10 @@ static int signal_alloc_fail = 0; SYSCTL_INT(_kern_sigqueue, OID_AUTO, alloc_fail, CTLFLAG_RD, &signal_alloc_fail, 0, "signals failed to be allocated"); +static int kern_lognosys = 0; +SYSCTL_INT(_kern, OID_AUTO, lognosys, CTLFLAG_RWTUN, &kern_lognosys, 0, + "Log invalid syscalls"); + SYSINIT(signal, SI_SUB_P1003_1B, SI_ORDER_FIRST+3, sigqueue_start, NULL); /* @@ -3568,11 +3572,16 @@ struct nosys_args { int nosys(struct thread *td, struct nosys_args *args) { - struct proc *p = td->td_proc; + struct proc *p; + p = td->td_proc; + PROC_LOCK(p); tdsignal(td, SIGSYS); PROC_UNLOCK(p); + if (kern_lognosys) + uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, + td->td_sa.code); return (ENOSYS); } From owner-svn-src-all@freebsd.org Mon Jun 12 21:15:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBEC1C787F2; Mon, 12 Jun 2017 21:15:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A25107FB39; Mon, 12 Jun 2017 21:15:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CLFh3u096496; Mon, 12 Jun 2017 21:15:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CLFhcr096493; Mon, 12 Jun 2017 21:15:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706122115.v5CLFhcr096493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Jun 2017 21:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319875 - in head: lib/libc/sys sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 21:15:44 -0000 Author: kib Date: Mon Jun 12 21:15:43 2017 New Revision: 319875 URL: https://svnweb.freebsd.org/changeset/base/319875 Log: Add ptrace(PT_GET_SC_ARGS) command to return debuggee' current syscall arguments. Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D11080 Modified: head/lib/libc/sys/ptrace.2 head/sys/kern/sys_process.c head/sys/sys/ptrace.h Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Mon Jun 12 21:11:11 2017 (r319874) +++ head/lib/libc/sys/ptrace.2 Mon Jun 12 21:15:43 2017 (r319875) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd August 29, 2016 +.Dd June 11, 2017 .Dt PTRACE 2 .Os .Sh NAME @@ -643,6 +643,26 @@ and .Fa data arguments are used the same as for .Dv PT_CONTINUE. +.It Dv PT_GET_SC_ARGS +For the thread which is stopped in either +.Dv PL_FLAG_SCE +or +.Dv PL_FLAG_SCX +state, that is, on entry or exit to a syscall, +this request fetches the syscall arguments. +.Pp +The arguments are copied out into the buffer pointed to by the +.Fa addr +pointer, sequentially. +Each syscall argument is stored as the machine word. +Kernel copies out as many arguments as the syscall accepts, +see the +.Va pl_syscall_narg +member of the +.Vt struct ptrace_lwpinfo , +but not more than the +.Fa data +bytes in total are copied. .It Dv PT_FOLLOW_FORK This request controls tracing for new child processes of a traced process. If Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Jun 12 21:11:11 2017 (r319874) +++ head/sys/kern/sys_process.c Mon Jun 12 21:15:43 2017 (r319875) @@ -586,6 +586,7 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) struct ptrace_lwpinfo32 pl32; struct ptrace_vm_entry32 pve32; #endif + char args[nitems(td->td_sa.args) * sizeof(register_t)]; int ptevents; } r; void *addr; @@ -606,6 +607,7 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) case PT_GETFPREGS: case PT_GETDBREGS: case PT_LWPINFO: + case PT_GET_SC_ARGS: break; case PT_SETREGS: error = COPYIN(uap->addr, &r.reg, sizeof r.reg); @@ -663,6 +665,10 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) /* NB: The size in uap->data is validated in kern_ptrace(). */ error = copyout(&r.pl, uap->addr, uap->data); break; + case PT_GET_SC_ARGS: + error = copyout(r.args, uap->addr, MIN(uap->data, + sizeof(r.args))); + break; } return (error); @@ -739,6 +745,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi case PT_GET_EVENT_MASK: case PT_SET_EVENT_MASK: case PT_DETACH: + case PT_GET_SC_ARGS: sx_xlock(&proctree_lock); proctree_locked = 1; break; @@ -1008,6 +1015,28 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi CTR3(KTR_PTRACE, "PT_SET_EVENT_MASK: pid %d mask %#x -> %#x", p->p_pid, p->p_ptevents, tmp); p->p_ptevents = tmp; + break; + + case PT_GET_SC_ARGS: + CTR1(KTR_PTRACE, "PT_GET_SC_ARGS: pid %d", p->p_pid); + if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 +#ifdef COMPAT_FREEBSD32 + || (wrap32 && !safe) +#endif + ) { + error = EINVAL; + break; + } + bzero(addr, sizeof(td2->td_sa.args)); +#ifdef COMPAT_FREEBSD32 + if (wrap32) + for (num = 0; num < nitems(td2->td_sa.args); num++) + ((uint32_t *)addr)[num] = (uint32_t) + td2->td_sa.args[num]; + else +#endif + bcopy(td2->td_sa.args, addr, td2->td_sa.narg * + sizeof(register_t)); break; case PT_STEP: Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Mon Jun 12 21:11:11 2017 (r319874) +++ head/sys/sys/ptrace.h Mon Jun 12 21:15:43 2017 (r319875) @@ -69,6 +69,8 @@ #define PT_GET_EVENT_MASK 25 /* get mask of optional events */ #define PT_SET_EVENT_MASK 26 /* set mask of optional events */ +#define PT_GET_SC_ARGS 27 /* fetch syscall args */ + #define PT_GETREGS 33 /* get general-purpose registers */ #define PT_SETREGS 34 /* set general-purpose registers */ #define PT_GETFPREGS 35 /* get floating-point registers */ From owner-svn-src-all@freebsd.org Mon Jun 12 21:16:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E295C7885A; Mon, 12 Jun 2017 21:16:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EE6D7FCA5; Mon, 12 Jun 2017 21:16:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CLGbaP096573; Mon, 12 Jun 2017 21:16:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CLGbPx096572; Mon, 12 Jun 2017 21:16:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706122116.v5CLGbPx096572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Jun 2017 21:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319876 - head/tools/test/ptrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 21:16:38 -0000 Author: kib Date: Mon Jun 12 21:16:37 2017 New Revision: 319876 URL: https://svnweb.freebsd.org/changeset/base/319876 Log: Update scescx test to print syscall number and arguments. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/tools/test/ptrace/scescx.c Modified: head/tools/test/ptrace/scescx.c ============================================================================== --- head/tools/test/ptrace/scescx.c Mon Jun 12 21:15:43 2017 (r319875) +++ head/tools/test/ptrace/scescx.c Mon Jun 12 21:16:37 2017 (r319876) @@ -181,12 +181,33 @@ get_pathname(pid_t pid) static void wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo) { + long *args; + int error, i; printf(TRACE "pid %d wait %s", pid, decode_wait_status(status)); if (lwpinfo != NULL) { printf(" event %s flags %s", decode_pl_event(lwpinfo), decode_pl_flags(lwpinfo)); + if ((lwpinfo->pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)) != 0) { + printf(" sc%d", lwpinfo->pl_syscall_code); + args = calloc(lwpinfo->pl_syscall_narg, sizeof(long)); + error = ptrace(PT_GET_SC_ARGS, lwpinfo->pl_lwpid, + (caddr_t)args, lwpinfo->pl_syscall_narg * + sizeof(long)); + if (error == 0) { + for (i = 0; i < (int)lwpinfo->pl_syscall_narg; + i++) { + printf("%c%#lx", i == 0 ? '(' : ',', + args[i]); + } + } else { + fprintf(stderr, "PT_GET_SC_ARGS failed: %s", + strerror(errno)); + } + printf(")"); + free(args); + } } printf("\n"); } From owner-svn-src-all@freebsd.org Mon Jun 12 21:30:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DBA0C78BA2; Mon, 12 Jun 2017 21:30:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 682C880438; Mon, 12 Jun 2017 21:30:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CLUbli001066; Mon, 12 Jun 2017 21:30:37 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CLUbCG001065; Mon, 12 Jun 2017 21:30:37 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706122130.v5CLUbCG001065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 12 Jun 2017 21:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r319878 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 21:30:38 -0000 Author: glebius Date: Mon Jun 12 21:30:37 2017 New Revision: 319878 URL: https://svnweb.freebsd.org/changeset/base/319878 Log: Going to commit large patches to user/cperciva/freebsd-update-build. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Mon Jun 12 21:26:39 2017 (r319877) +++ svnadmin/conf/sizelimit.conf Mon Jun 12 21:30:37 2017 (r319878) @@ -27,3 +27,4 @@ np obrien peter rwatson +glebius From owner-svn-src-all@freebsd.org Mon Jun 12 21:31:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3FD2C78C14; Mon, 12 Jun 2017 21:31:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5924C806C1; Mon, 12 Jun 2017 21:31:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CLVQiT001876; Mon, 12 Jun 2017 21:31:26 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CLVQRL001875; Mon, 12 Jun 2017 21:31:26 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706122131.v5CLVQRL001875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 12 Jun 2017 21:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r319880 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 21:31:27 -0000 Author: glebius Date: Mon Jun 12 21:31:26 2017 New Revision: 319880 URL: https://svnweb.freebsd.org/changeset/base/319880 Log: Remove myself. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Mon Jun 12 21:30:55 2017 (r319879) +++ svnadmin/conf/sizelimit.conf Mon Jun 12 21:31:26 2017 (r319880) @@ -27,4 +27,3 @@ np obrien peter rwatson -glebius From owner-svn-src-all@freebsd.org Mon Jun 12 21:33:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13D80C78DCB; Mon, 12 Jun 2017 21:33:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BF94809CB; Mon, 12 Jun 2017 21:33:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v5CLX0uX028193 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 13 Jun 2017 00:33:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v5CLX0uX028193 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v5CLX06I028192; Tue, 13 Jun 2017 00:33:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Jun 2017 00:33:00 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319868 - in head/sys: kern sys Message-ID: <20170612213300.GV2088@kib.kiev.ua> References: <201706122014.v5CKEitK071089@repo.freebsd.org> <20170612202952.GU2088@kib.kiev.ua> <20170612204704.GA73695@wkstn-mjohnston.west.isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170612204704.GA73695@wkstn-mjohnston.west.isilon.com> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 21:33:06 -0000 On Mon, Jun 12, 2017 at 01:47:05PM -0700, Mark Johnston wrote: > On Mon, Jun 12, 2017 at 11:29:52PM +0300, Konstantin Belousov wrote: > > On Mon, Jun 12, 2017 at 08:14:44PM +0000, Mark Johnston wrote: > > > +int > > > +uuidcmp(const struct uuid *uuid1, const struct uuid *uuid2) > > > +{ > > > + > > > + return (memcmp(uuid1, uuid2, sizeof(struct uuid))); > > > +} > > > > This is unsafe. The function operation depends on the ABI properties > > that there is no padding either between members, or at the end of > > the structure. Why not use by-member comparision ? > > I interpreted the CTASSERT at the beginning of kern_uuid.c as a > guarantee that no such padding will be present. kern_uuid.c also defines > an alternate representation, struct uuid_private, and casts between the > two. I agree, your addition is consistent with the other code in kern_uuid.c, which already depends on these features. At least it contradicts to what compiler authors try to teach C language users. BTW, does uuid_private low/mid/hi union split of ll depend on endianess ? From owner-svn-src-all@freebsd.org Mon Jun 12 22:53:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5697DC79F63; Mon, 12 Jun 2017 22:53:20 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5DD1833BF; Mon, 12 Jun 2017 22:53:19 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CMrJbr038572; Mon, 12 Jun 2017 22:53:19 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CMrJBB038568; Mon, 12 Jun 2017 22:53:19 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201706122253.v5CMrJBB038568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 12 Jun 2017 22:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319881 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 22:53:20 -0000 Author: loos Date: Mon Jun 12 22:53:18 2017 New Revision: 319881 URL: https://svnweb.freebsd.org/changeset/base/319881 Log: Update the current version of netmap to bring it in sync with the github version. This commit contains mostly refactoring, a few fixes and minor added functionality. Submitted by: Vincenzo Maffione Requested by: many Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/netmap/if_ixl_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mbq.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/netmap/netmap_mem2.h head/sys/dev/netmap/netmap_monitor.c head/sys/dev/netmap/netmap_pipe.c head/sys/dev/netmap/netmap_pt.c head/sys/dev/netmap/netmap_vale.c Modified: head/sys/dev/netmap/if_ixl_netmap.h ============================================================================== --- head/sys/dev/netmap/if_ixl_netmap.h Mon Jun 12 21:31:26 2017 (r319880) +++ head/sys/dev/netmap/if_ixl_netmap.h Mon Jun 12 22:53:18 2017 (r319881) @@ -129,7 +129,7 @@ ixl_netmap_attach(struct ixl_vsi *vsi) na.ifp = vsi->ifp; na.na_flags = NAF_BDG_MAYSLEEP; // XXX check that queues is set. - printf("queues is %p\n", vsi->queues); + nm_prinf("queues is %p\n", vsi->queues); if (vsi->queues) { na.num_tx_desc = vsi->queues[0].num_desc; na.num_rx_desc = vsi->queues[0].num_desc; Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Mon Jun 12 21:31:26 2017 (r319880) +++ head/sys/dev/netmap/netmap.c Mon Jun 12 22:53:18 2017 (r319881) @@ -388,7 +388,7 @@ ports attached to the switch) * * - VALE ports: * concurrently: - * 1) ioctlNIOCRXSYNC)/netmap_poll() in process context + * 1) ioctl(NIOCRXSYNC)/netmap_poll() in process context * kring->nm_sync() == netmap_vp_rxsync() * 2) from nm_bdg_flush() * na->nm_notify() == netmap_notify() @@ -484,7 +484,7 @@ int netmap_mitigate = 1; int netmap_no_pendintr = 1; int netmap_txsync_retry = 2; int netmap_flags = 0; /* debug flags */ -static int netmap_fwd = 0; /* force transparent mode */ +static int netmap_fwd = 0; /* force transparent forwarding */ /* * netmap_admode selects the netmap mode to use. @@ -522,6 +522,9 @@ int netmap_generic_rings = 1; /* Non-zero if ptnet devices are allowed to use virtio-net headers. */ int ptnet_vnet_hdr = 1; +/* 0 if ptnetmap should not use worker threads for TX processing */ +int ptnetmap_tx_workers = 1; + /* * SYSCTL calls are grouped between SYSBEGIN and SYSEND to be emulated * in some other operating systems @@ -548,6 +551,7 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, generic_ringsize, CT SYSCTL_INT(_dev_netmap, OID_AUTO, generic_rings, CTLFLAG_RW, &netmap_generic_rings, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, generic_txqdisc, CTLFLAG_RW, &netmap_generic_txqdisc, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, ptnet_vnet_hdr, CTLFLAG_RW, &ptnet_vnet_hdr, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, ptnetmap_tx_workers, CTLFLAG_RW, &ptnetmap_tx_workers, 0 , ""); SYSEND; @@ -669,7 +673,7 @@ nm_bound_var(u_int *v, u_int dflt, u_int lo, u_int hi, op = "Clamp"; } if (op && msg) - printf("%s %s to %d (was %d)\n", op, msg, *v, oldv); + nm_prinf("%s %s to %d (was %d)\n", op, msg, *v, oldv); return *v; } @@ -801,13 +805,18 @@ netmap_krings_create(struct netmap_adapter *na, u_int u_int n[NR_TXRX]; enum txrx t; + if (na->tx_rings != NULL) { + D("warning: krings were already created"); + return 0; + } + /* account for the (possibly fake) host rings */ n[NR_TX] = na->num_tx_rings + 1; n[NR_RX] = na->num_rx_rings + 1; len = (n[NR_TX] + n[NR_RX]) * sizeof(struct netmap_kring) + tailroom; - na->tx_rings = malloc((size_t)len, M_DEVBUF, M_NOWAIT | M_ZERO); + na->tx_rings = nm_os_malloc((size_t)len); if (na->tx_rings == NULL) { D("Cannot allocate krings"); return ENOMEM; @@ -866,6 +875,11 @@ netmap_krings_delete(struct netmap_adapter *na) struct netmap_kring *kring = na->tx_rings; enum txrx t; + if (na->tx_rings == NULL) { + D("warning: krings were already deleted"); + return; + } + for_rx_tx(t) nm_os_selinfo_uninit(&na->si[t]); @@ -874,7 +888,7 @@ netmap_krings_delete(struct netmap_adapter *na) mtx_destroy(&kring->q_lock); nm_os_selinfo_uninit(&kring->si); } - free(na->tx_rings, M_DEVBUF); + nm_os_free(na->tx_rings); na->tx_rings = na->rx_rings = na->tailroom = NULL; } @@ -983,8 +997,7 @@ netmap_priv_new(void) { struct netmap_priv_d *priv; - priv = malloc(sizeof(struct netmap_priv_d), M_DEVBUF, - M_NOWAIT | M_ZERO); + priv = nm_os_malloc(sizeof(struct netmap_priv_d)); if (priv == NULL) return NULL; priv->np_refs = 1; @@ -1016,7 +1029,7 @@ netmap_priv_delete(struct netmap_priv_d *priv) } netmap_unget_na(na, priv->np_ifp); bzero(priv, sizeof(*priv)); /* for safety */ - free(priv, M_DEVBUF); + nm_os_free(priv); } @@ -1032,20 +1045,27 @@ netmap_dtor(void *data) } - - /* - * Handlers for synchronization of the queues from/to the host. - * Netmap has two operating modes: - * - in the default mode, the rings connected to the host stack are - * just another ring pair managed by userspace; - * - in transparent mode (XXX to be defined) incoming packets - * (from the host or the NIC) are marked as NS_FORWARD upon - * arrival, and the user application has a chance to reset the - * flag for packets that should be dropped. - * On the RXSYNC or poll(), packets in RX rings between - * kring->nr_kcur and ring->cur with NS_FORWARD still set are moved - * to the other side. + * Handlers for synchronization of the rings from/to the host stack. + * These are associated to a network interface and are just another + * ring pair managed by userspace. + * + * Netmap also supports transparent forwarding (NS_FORWARD and NR_FORWARD + * flags): + * + * - Before releasing buffers on hw RX rings, the application can mark + * them with the NS_FORWARD flag. During the next RXSYNC or poll(), they + * will be forwarded to the host stack, similarly to what happened if + * the application moved them to the host TX ring. + * + * - Before releasing buffers on the host RX ring, the application can + * mark them with the NS_FORWARD flag. During the next RXSYNC or poll(), + * they will be forwarded to the hw TX rings, saving the application + * from doing the same task in user-space. + * + * Transparent fowarding can be enabled per-ring, by setting the NR_FORWARD + * flag, or globally with the netmap_fwd sysctl. + * * The transfer NIC --> host is relatively easy, just encapsulate * into mbufs and we are done. The host --> NIC side is slightly * harder because there might not be room in the tx ring so it @@ -1054,8 +1074,9 @@ netmap_dtor(void *data) /* - * pass a chain of buffers to the host stack as coming from 'dst' + * Pass a whole queue of mbufs to the host stack as coming from 'dst' * We do not need to lock because the queue is private. + * After this call the queue is empty. */ static void netmap_send_up(struct ifnet *dst, struct mbq *q) @@ -1063,7 +1084,8 @@ netmap_send_up(struct ifnet *dst, struct mbq *q) struct mbuf *m; struct mbuf *head = NULL, *prev = NULL; - /* send packets up, outside the lock */ + /* Send packets up, outside the lock; head/prev machinery + * is only useful for Windows. */ while ((m = mbq_dequeue(q)) != NULL) { if (netmap_verbose & NM_VERB_HOST) D("sending up pkt %p size %d", m, MBUF_LEN(m)); @@ -1078,9 +1100,9 @@ netmap_send_up(struct ifnet *dst, struct mbq *q) /* - * put a copy of the buffers marked NS_FORWARD into an mbuf chain. - * Take packets from hwcur to ring->head marked NS_FORWARD (or forced) - * and pass them up. Drop remaining packets in the unlikely event + * Scan the buffers from hwcur to ring->head, and put a copy of those + * marked NS_FORWARD (or all of them if forced) into a queue of mbufs. + * Drop remaining packets in the unlikely event * of an mbuf shortage. */ static void @@ -1127,16 +1149,24 @@ nm_may_forward_up(struct netmap_kring *kring) } static inline int -nm_may_forward_down(struct netmap_kring *kring) +nm_may_forward_down(struct netmap_kring *kring, int sync_flags) { return _nm_may_forward(kring) && + (sync_flags & NAF_CAN_FORWARD_DOWN) && kring->ring_id == kring->na->num_rx_rings; } /* * Send to the NIC rings packets marked NS_FORWARD between - * kring->nr_hwcur and kring->rhead - * Called under kring->rx_queue.lock on the sw rx ring, + * kring->nr_hwcur and kring->rhead. + * Called under kring->rx_queue.lock on the sw rx ring. + * + * It can only be called if the user opened all the TX hw rings, + * see NAF_CAN_FORWARD_DOWN flag. + * We can touch the TX netmap rings (slots, head and cur) since + * we are in poll/ioctl system call context, and the application + * is not supposed to touch the ring (using a different thread) + * during the execution of the system call. */ static u_int netmap_sw_to_nic(struct netmap_adapter *na) @@ -1179,7 +1209,7 @@ netmap_sw_to_nic(struct netmap_adapter *na) rdst->head = rdst->cur = nm_next(dst_head, dst_lim); } - /* if (sent) XXX txsync ? */ + /* if (sent) XXX txsync ? it would be just an optimization */ } return sent; } @@ -1200,9 +1230,7 @@ netmap_txsync_to_host(struct netmap_kring *kring, int struct mbq q; /* Take packets from hwcur to head and pass them up. - * force head = cur since netmap_grab_packets() stops at head - * In case of no buffers we give up. At the end of the loop, - * the queue is drained in all cases. + * Force hwcur = head since netmap_grab_packets() stops at head */ mbq_init(&q); netmap_grab_packets(kring, &q, 1 /* force */); @@ -1222,11 +1250,9 @@ netmap_txsync_to_host(struct netmap_kring *kring, int * They have been put in kring->rx_queue by netmap_transmit(). * We protect access to the kring using kring->rx_queue.lock * - * This routine also does the selrecord if called from the poll handler - * (we know because sr != NULL). - * - * returns the number of packets delivered to tx queues in - * transparent mode, or a negative value if error + * also moves to the nic hw rings any packet the user has marked + * for transparent-mode forwarding, then sets the NR_FORWARD + * flag in the kring to let the caller push them out */ static int netmap_rxsync_from_host(struct netmap_kring *kring, int flags) @@ -1250,7 +1276,7 @@ netmap_rxsync_from_host(struct netmap_kring *kring, in uint32_t stop_i; nm_i = kring->nr_hwtail; - stop_i = nm_prev(nm_i, lim); + stop_i = nm_prev(kring->nr_hwcur, lim); while ( nm_i != stop_i && (m = mbq_dequeue(q)) != NULL ) { int len = MBUF_LEN(m); struct netmap_slot *slot = &ring->slot[nm_i]; @@ -1273,7 +1299,7 @@ netmap_rxsync_from_host(struct netmap_kring *kring, in */ nm_i = kring->nr_hwcur; if (nm_i != head) { /* something was released */ - if (nm_may_forward_down(kring)) { + if (nm_may_forward_down(kring, flags)) { ret = netmap_sw_to_nic(na); if (ret > 0) { kring->nr_kflags |= NR_FORWARD; @@ -1317,7 +1343,7 @@ netmap_rxsync_from_host(struct netmap_kring *kring, in */ static void netmap_hw_dtor(struct netmap_adapter *); /* needed by NM_IS_NATIVE() */ int -netmap_get_hw_na(struct ifnet *ifp, struct netmap_adapter **na) +netmap_get_hw_na(struct ifnet *ifp, struct netmap_mem_d *nmd, struct netmap_adapter **na) { /* generic support */ int i = netmap_admode; /* Take a snapshot. */ @@ -1348,7 +1374,7 @@ netmap_get_hw_na(struct ifnet *ifp, struct netmap_adap #endif ) { *na = prev_na; - return 0; + goto assign_mem; } } @@ -1377,10 +1403,17 @@ netmap_get_hw_na(struct ifnet *ifp, struct netmap_adap return error; *na = NA(ifp); + +assign_mem: + if (nmd != NULL && !((*na)->na_flags & NAF_MEM_OWNER) && + (*na)->active_fds == 0 && ((*na)->nm_mem != nmd)) { + netmap_mem_put((*na)->nm_mem); + (*na)->nm_mem = netmap_mem_get(nmd); + } + return 0; } - /* * MUST BE CALLED UNDER NMG_LOCK() * @@ -1400,16 +1433,28 @@ netmap_get_hw_na(struct ifnet *ifp, struct netmap_adap */ int netmap_get_na(struct nmreq *nmr, struct netmap_adapter **na, - struct ifnet **ifp, int create) + struct ifnet **ifp, struct netmap_mem_d *nmd, int create) { int error = 0; struct netmap_adapter *ret = NULL; + int nmd_ref = 0; *na = NULL; /* default return value */ *ifp = NULL; NMG_LOCK_ASSERT(); + /* if the request contain a memid, try to find the + * corresponding memory region + */ + if (nmd == NULL && nmr->nr_arg2) { + nmd = netmap_mem_find(nmr->nr_arg2); + if (nmd == NULL) + return EINVAL; + /* keep the rereference */ + nmd_ref = 1; + } + /* We cascade through all possible types of netmap adapter. * All netmap_get_*_na() functions return an error and an na, * with the following combinations: @@ -1422,24 +1467,24 @@ netmap_get_na(struct nmreq *nmr, struct netmap_adapter */ /* try to see if this is a ptnetmap port */ - error = netmap_get_pt_host_na(nmr, na, create); + error = netmap_get_pt_host_na(nmr, na, nmd, create); if (error || *na != NULL) - return error; + goto out; /* try to see if this is a monitor port */ - error = netmap_get_monitor_na(nmr, na, create); + error = netmap_get_monitor_na(nmr, na, nmd, create); if (error || *na != NULL) - return error; + goto out; /* try to see if this is a pipe port */ - error = netmap_get_pipe_na(nmr, na, create); + error = netmap_get_pipe_na(nmr, na, nmd, create); if (error || *na != NULL) - return error; + goto out; /* try to see if this is a bridge port */ - error = netmap_get_bdg_na(nmr, na, create); + error = netmap_get_bdg_na(nmr, na, nmd, create); if (error) - return error; + goto out; if (*na != NULL) /* valid match in netmap_get_bdg_na() */ goto out; @@ -1452,10 +1497,11 @@ netmap_get_na(struct nmreq *nmr, struct netmap_adapter */ *ifp = ifunit_ref(nmr->nr_name); if (*ifp == NULL) { - return ENXIO; + error = ENXIO; + goto out; } - error = netmap_get_hw_na(*ifp, &ret); + error = netmap_get_hw_na(*ifp, nmd, &ret); if (error) goto out; @@ -1471,6 +1517,8 @@ out: *ifp = NULL; } } + if (nmd_ref) + netmap_mem_put(nmd); return error; } @@ -1712,7 +1760,8 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint1 D("deprecated API, old ringid 0x%x -> ringid %x reg %d", ringid, i, reg); } - if ((flags & NR_PTNETMAP_HOST) && (reg != NR_REG_ALL_NIC || + if ((flags & NR_PTNETMAP_HOST) && ((reg != NR_REG_ALL_NIC && + reg != NR_REG_PIPE_MASTER && reg != NR_REG_PIPE_SLAVE) || flags & (NR_RX_RINGS_ONLY|NR_TX_RINGS_ONLY))) { D("Error: only NR_REG_ALL_NIC supported with netmap passthrough"); return EINVAL; @@ -1766,6 +1815,13 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint1 } priv->np_flags = (flags & ~NR_REG_MASK) | reg; + /* Allow transparent forwarding mode in the host --> nic + * direction only if all the TX hw rings have been opened. */ + if (priv->np_qfirst[NR_TX] == 0 && + priv->np_qlast[NR_TX] >= na->num_tx_rings) { + priv->np_sync_flags |= NAF_CAN_FORWARD_DOWN; + } + if (netmap_verbose) { D("%s: tx [%d,%d) rx [%d,%d) id %d", na->name, @@ -2029,7 +2085,7 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net goto err_rel_excl; /* in all cases, create a new netmap if */ - nifp = netmap_mem_if_new(na); + nifp = netmap_mem_if_new(na, priv); if (nifp == NULL) { error = ENOMEM; goto err_del_rings; @@ -2103,6 +2159,16 @@ nm_sync_finalize(struct netmap_kring *kring) kring->rhead, kring->rcur, kring->rtail); } +/* set ring timestamp */ +static inline void +ring_timestamp_set(struct netmap_ring *ring) +{ + if (netmap_no_timestamp == 0 || ring->flags & NR_TIMESTAMP) { + microtime(&ring->ts); + } +} + + /* * ioctl(2) support for the "netmap" device. * @@ -2118,13 +2184,16 @@ nm_sync_finalize(struct netmap_kring *kring) int netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data, struct thread *td) { + struct mbq q; /* packets from RX hw queues to host stack */ struct nmreq *nmr = (struct nmreq *) data; struct netmap_adapter *na = NULL; + struct netmap_mem_d *nmd = NULL; struct ifnet *ifp = NULL; int error = 0; u_int i, qfirst, qlast; struct netmap_if *nifp; struct netmap_kring *krings; + int sync_flags; enum txrx t; if (cmd == NIOCGINFO || cmd == NIOCREGIF) { @@ -2152,19 +2221,24 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c NMG_LOCK(); do { /* memsize is always valid */ - struct netmap_mem_d *nmd = &nm_mem; u_int memflags; if (nmr->nr_name[0] != '\0') { /* get a refcount */ - error = netmap_get_na(nmr, &na, &ifp, 1 /* create */); + error = netmap_get_na(nmr, &na, &ifp, NULL, 1 /* create */); if (error) { na = NULL; ifp = NULL; break; } nmd = na->nm_mem; /* get memory allocator */ + } else { + nmd = netmap_mem_find(nmr->nr_arg2 ? nmr->nr_arg2 : 1); + if (nmd == NULL) { + error = EINVAL; + break; + } } error = netmap_mem_get_info(nmd, &nmr->nr_memsize, &memflags, @@ -2210,7 +2284,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c struct ifnet *ifp; NMG_LOCK(); - error = netmap_get_na(nmr, &na, &ifp, 0); + error = netmap_get_na(nmr, &na, &ifp, NULL, 0); if (na && !error) { nmr->nr_arg1 = na->virt_hdr_len; } @@ -2219,7 +2293,14 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c break; } else if (i == NETMAP_POOLS_INFO_GET) { /* get information from the memory allocator */ - error = netmap_mem_pools_info_get(nmr, priv->np_na); + NMG_LOCK(); + if (priv->np_na && priv->np_na->nm_mem) { + struct netmap_mem_d *nmd = priv->np_na->nm_mem; + error = netmap_mem_pools_info_get(nmr, nmd); + } else { + error = EINVAL; + } + NMG_UNLOCK(); break; } else if (i != 0) { D("nr_cmd must be 0 not %d", i); @@ -2237,26 +2318,32 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c error = EBUSY; break; } + + if (nmr->nr_arg2) { + /* find the allocator and get a reference */ + nmd = netmap_mem_find(nmr->nr_arg2); + if (nmd == NULL) { + error = EINVAL; + break; + } + } /* find the interface and a reference */ - error = netmap_get_na(nmr, &na, &ifp, + error = netmap_get_na(nmr, &na, &ifp, nmd, 1 /* create */); /* keep reference */ if (error) break; if (NETMAP_OWNED_BY_KERN(na)) { - netmap_unget_na(na, ifp); error = EBUSY; break; } if (na->virt_hdr_len && !(nmr->nr_flags & NR_ACCEPT_VNET_HDR)) { - netmap_unget_na(na, ifp); error = EIO; break; } error = netmap_do_regif(priv, na, nmr->nr_ringid, nmr->nr_flags); if (error) { /* reg. failed, release priv and ref */ - netmap_unget_na(na, ifp); break; } nifp = priv->np_nifp; @@ -2271,7 +2358,6 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c &nmr->nr_arg2); if (error) { netmap_do_unregif(priv); - netmap_unget_na(na, ifp); break; } if (memflags & NETMAP_MEM_PRIVATE) { @@ -2295,6 +2381,14 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c /* store ifp reference so that priv destructor may release it */ priv->np_ifp = ifp; } while (0); + if (error) { + netmap_unget_na(na, ifp); + } + /* release the reference from netmap_mem_find() or + * netmap_mem_ext_create() + */ + if (nmd) + netmap_mem_put(nmd); NMG_UNLOCK(); break; @@ -2316,10 +2410,12 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c break; } + mbq_init(&q); t = (cmd == NIOCTXSYNC ? NR_TX : NR_RX); krings = NMR(na, t); qfirst = priv->np_qfirst[t]; qlast = priv->np_qlast[t]; + sync_flags = priv->np_sync_flags; for (i = qfirst; i < qlast; i++) { struct netmap_kring *kring = krings + i; @@ -2337,7 +2433,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c kring->nr_hwcur); if (nm_txsync_prologue(kring, ring) >= kring->nkr_num_slots) { netmap_ring_reinit(kring); - } else if (kring->nm_sync(kring, NAF_FORCE_RECLAIM) == 0) { + } else if (kring->nm_sync(kring, sync_flags | NAF_FORCE_RECLAIM) == 0) { nm_sync_finalize(kring); } if (netmap_verbose & NM_VERB_TXSYNC) @@ -2347,14 +2443,23 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c } else { if (nm_rxsync_prologue(kring, ring) >= kring->nkr_num_slots) { netmap_ring_reinit(kring); - } else if (kring->nm_sync(kring, NAF_FORCE_READ) == 0) { + } + if (nm_may_forward_up(kring)) { + /* transparent forwarding, see netmap_poll() */ + netmap_grab_packets(kring, &q, netmap_fwd); + } + if (kring->nm_sync(kring, sync_flags | NAF_FORCE_READ) == 0) { nm_sync_finalize(kring); } - microtime(&ring->ts); + ring_timestamp_set(ring); } nm_kr_put(kring); } + if (mbq_peek(&q)) { + netmap_send_up(na->ifp, &q); + } + break; #ifdef WITH_VALE @@ -2425,7 +2530,7 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM u_int i, check_all_tx, check_all_rx, want[NR_TXRX], revents = 0; #define want_tx want[NR_TX] #define want_rx want[NR_RX] - struct mbq q; /* packets from hw queues to host stack */ + struct mbq q; /* packets from RX hw queues to host stack */ enum txrx t; /* @@ -2435,11 +2540,14 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM */ int retry_tx = 1, retry_rx = 1; - /* transparent mode: send_down is 1 if we have found some - * packets to forward during the rx scan and we have not - * sent them down to the nic yet + /* Transparent mode: send_down is 1 if we have found some + * packets to forward (host RX ring --> NIC) during the rx + * scan and we have not sent them down to the NIC yet. + * Transparent mode requires to bind all rings to a single + * file descriptor. */ int send_down = 0; + int sync_flags = priv->np_sync_flags; mbq_init(&q); @@ -2549,7 +2657,7 @@ flush_tx: netmap_ring_reinit(kring); revents |= POLLERR; } else { - if (kring->nm_sync(kring, 0)) + if (kring->nm_sync(kring, sync_flags)) revents |= POLLERR; else nm_sync_finalize(kring); @@ -2602,25 +2710,23 @@ do_retry_rx: /* now we can use kring->rcur, rtail */ /* - * transparent mode support: collect packets - * from the rxring(s). + * transparent mode support: collect packets from + * hw rxring(s) that have been released by the user */ if (nm_may_forward_up(kring)) { - ND(10, "forwarding some buffers up %d to %d", - kring->nr_hwcur, ring->cur); netmap_grab_packets(kring, &q, netmap_fwd); } + /* Clear the NR_FORWARD flag anyway, it may be set by + * the nm_sync() below only on for the host RX ring (see + * netmap_rxsync_from_host()). */ kring->nr_kflags &= ~NR_FORWARD; - if (kring->nm_sync(kring, 0)) + if (kring->nm_sync(kring, sync_flags)) revents |= POLLERR; else nm_sync_finalize(kring); - send_down |= (kring->nr_kflags & NR_FORWARD); /* host ring only */ - if (netmap_no_timestamp == 0 || - ring->flags & NR_TIMESTAMP) { - microtime(&ring->ts); - } + send_down |= (kring->nr_kflags & NR_FORWARD); + ring_timestamp_set(ring); found = kring->rcur != kring->rtail; nm_kr_put(kring); if (found) { @@ -2634,7 +2740,7 @@ do_retry_rx: nm_os_selrecord(sr, check_all_rx ? &na->si[NR_RX] : &na->rx_rings[priv->np_qfirst[NR_RX]].si); } - if (send_down > 0 || retry_rx) { + if (send_down || retry_rx) { retry_rx = 0; if (send_down) goto flush_tx; /* and retry_rx */ @@ -2644,17 +2750,13 @@ do_retry_rx: } /* - * Transparent mode: marked bufs on rx rings between - * kring->nr_hwcur and ring->head - * are passed to the other endpoint. - * - * Transparent mode requires to bind all - * rings to a single file descriptor. + * Transparent mode: released bufs (i.e. between kring->nr_hwcur and + * ring->head) marked with NS_FORWARD on hw rx rings are passed up + * to the host stack. */ - if (q.head && !nm_kr_tryget(&na->tx_rings[na->num_tx_rings], 1, &revents)) { + if (mbq_peek(&q)) { netmap_send_up(na->ifp, &q); - nm_kr_put(&na->tx_rings[na->num_tx_rings]); } return (revents); @@ -2683,22 +2785,6 @@ netmap_notify(struct netmap_kring *kring, int flags) return NM_IRQ_COMPLETED; } -#if 0 -static int -netmap_notify(struct netmap_adapter *na, u_int n_ring, -enum txrx tx, int flags) -{ - if (tx == NR_TX) { - KeSetEvent(notes->TX_EVENT, 0, FALSE); - } - else - { - KeSetEvent(notes->RX_EVENT, 0, FALSE); - } - return 0; -} -#endif - /* called by all routines that create netmap_adapters. * provide some defaults and get a reference to the * memory allocator @@ -2729,10 +2815,10 @@ netmap_attach_common(struct netmap_adapter *na) na->nm_notify = netmap_notify; na->active_fds = 0; - if (na->nm_mem == NULL) + if (na->nm_mem == NULL) { /* use the global allocator */ - na->nm_mem = &nm_mem; - netmap_mem_get(na->nm_mem); + na->nm_mem = netmap_mem_get(&nm_mem); + } #ifdef WITH_VALE if (na->nm_bdg_attach == NULL) /* no special nm_bdg_attach callback. On VALE @@ -2757,7 +2843,7 @@ netmap_detach_common(struct netmap_adapter *na) if (na->nm_mem) netmap_mem_put(na->nm_mem); bzero(na, sizeof(*na)); - free(na, M_DEVBUF); + nm_os_free(na); } /* Wrapper for the register callback provided netmap-enabled @@ -2804,26 +2890,28 @@ netmap_hw_dtor(struct netmap_adapter *na) /* - * Allocate a ``netmap_adapter`` object, and initialize it from the + * Allocate a netmap_adapter object, and initialize it from the * 'arg' passed by the driver on attach. - * We allocate a block of memory with room for a struct netmap_adapter - * plus two sets of N+2 struct netmap_kring (where N is the number - * of hardware rings): - * krings 0..N-1 are for the hardware queues. - * kring N is for the host stack queue - * kring N+1 is only used for the selinfo for all queues. // XXX still true ? + * We allocate a block of memory of 'size' bytes, which has room + * for struct netmap_adapter plus additional room private to + * the caller. * Return 0 on success, ENOMEM otherwise. */ -static int -_netmap_attach(struct netmap_adapter *arg, size_t size) +int +netmap_attach_ext(struct netmap_adapter *arg, size_t size) { struct netmap_hw_adapter *hwna = NULL; struct ifnet *ifp = NULL; + if (size < sizeof(struct netmap_hw_adapter)) { + D("Invalid netmap adapter size %d", (int)size); + return EINVAL; + } + if (arg == NULL || arg->ifp == NULL) goto fail; ifp = arg->ifp; - hwna = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); + hwna = nm_os_malloc(size); if (hwna == NULL) goto fail; hwna->up = *arg; @@ -2832,7 +2920,7 @@ _netmap_attach(struct netmap_adapter *arg, size_t size hwna->nm_hw_register = hwna->up.nm_register; hwna->up.nm_register = netmap_hw_reg; if (netmap_attach_common(&hwna->up)) { - free(hwna, M_DEVBUF); + nm_os_free(hwna); goto fail; } netmap_adapter_get(&hwna->up); @@ -2878,48 +2966,10 @@ fail: int netmap_attach(struct netmap_adapter *arg) { - return _netmap_attach(arg, sizeof(struct netmap_hw_adapter)); + return netmap_attach_ext(arg, sizeof(struct netmap_hw_adapter)); } -#ifdef WITH_PTNETMAP_GUEST -int -netmap_pt_guest_attach(struct netmap_adapter *arg, void *csb, - unsigned int nifp_offset, unsigned int memid) -{ - struct netmap_pt_guest_adapter *ptna; - struct ifnet *ifp = arg ? arg->ifp : NULL; - int error; - - /* get allocator */ - arg->nm_mem = netmap_mem_pt_guest_new(ifp, nifp_offset, memid); - if (arg->nm_mem == NULL) - return ENOMEM; - arg->na_flags |= NAF_MEM_OWNER; - error = _netmap_attach(arg, sizeof(struct netmap_pt_guest_adapter)); - if (error) - return error; - - /* get the netmap_pt_guest_adapter */ - ptna = (struct netmap_pt_guest_adapter *) NA(ifp); - ptna->csb = csb; - - /* Initialize a separate pass-through netmap adapter that is going to - * be used by the ptnet driver only, and so never exposed to netmap - * applications. We only need a subset of the available fields. */ - memset(&ptna->dr, 0, sizeof(ptna->dr)); - ptna->dr.up.ifp = ifp; - ptna->dr.up.nm_mem = ptna->hwup.up.nm_mem; - netmap_mem_get(ptna->dr.up.nm_mem); - ptna->dr.up.nm_config = ptna->hwup.up.nm_config; - - ptna->backend_regifs = 0; - - return 0; -} -#endif /* WITH_PTNETMAP_GUEST */ - - void NM_DBG(netmap_adapter_get)(struct netmap_adapter *na) { @@ -3019,7 +3069,7 @@ netmap_transmit(struct ifnet *ifp, struct mbuf *m) u_int error = ENOBUFS; unsigned int txr; struct mbq *q; - int space; + int busy; kring = &na->rx_rings[na->num_rx_rings]; // XXX [Linux] we do not need this lock @@ -3052,28 +3102,27 @@ netmap_transmit(struct ifnet *ifp, struct mbuf *m) } if (nm_os_mbuf_has_offld(m)) { - RD(1, "%s drop mbuf requiring offloadings", na->name); + RD(1, "%s drop mbuf that needs offloadings", na->name); goto done; } - /* protect against rxsync_from_host(), netmap_sw_to_nic() + /* protect against netmap_rxsync_from_host(), netmap_sw_to_nic() * and maybe other instances of netmap_transmit (the latter * not possible on Linux). - * Also avoid overflowing the queue. + * We enqueue the mbuf only if we are sure there is going to be + * enough room in the host RX ring, otherwise we drop it. */ mbq_lock(q); - space = kring->nr_hwtail - kring->nr_hwcur; - if (space < 0) - space += kring->nkr_num_slots; - if (space + mbq_len(q) >= kring->nkr_num_slots - 1) { // XXX - RD(10, "%s full hwcur %d hwtail %d qlen %d len %d m %p", - na->name, kring->nr_hwcur, kring->nr_hwtail, mbq_len(q), - len, m); + busy = kring->nr_hwtail - kring->nr_hwcur; + if (busy < 0) + busy += kring->nkr_num_slots; + if (busy + mbq_len(q) >= kring->nkr_num_slots - 1) { + RD(2, "%s full hwcur %d hwtail %d qlen %d", na->name, + kring->nr_hwcur, kring->nr_hwtail, mbq_len(q)); } else { mbq_enqueue(q, m); - ND(10, "%s %d bufs in queue len %d m %p", - na->name, mbq_len(q), len, m); + ND(2, "%s %d bufs in queue", na->name, mbq_len(q)); /* notify outside the lock */ m = NULL; error = 0; @@ -3293,7 +3342,7 @@ netmap_fini(void) netmap_uninit_bridges(); netmap_mem_fini(); NMG_LOCK_DESTROY(); - printf("netmap: unloaded module.\n"); + nm_prinf("netmap: unloaded module.\n"); } @@ -3330,7 +3379,7 @@ netmap_init(void) if (error) goto fail; - printf("netmap: loaded module\n"); + nm_prinf("netmap: loaded module\n"); return (0); fail: netmap_fini(); Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Mon Jun 12 21:31:26 2017 (r319880) +++ head/sys/dev/netmap/netmap_freebsd.c Mon Jun 12 22:53:18 2017 (r319881) @@ -89,7 +89,25 @@ nm_os_selinfo_uninit(NM_SELINFO_T *si) mtx_destroy(&si->m); } +void * +nm_os_malloc(size_t size) +{ + return malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); +} + +void * +nm_os_realloc(void *addr, size_t new_size, size_t old_size __unused) +{ + return realloc(addr, new_size, M_DEVBUF, M_NOWAIT | M_ZERO); +} + void +nm_os_free(void *addr) +{ + free(addr, M_DEVBUF); +} + +void nm_os_ifnet_lock(void) { IFNET_RLOCK(); @@ -235,7 +253,6 @@ nm_os_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void * void * nm_os_send_up(struct ifnet *ifp, struct mbuf *m, struct mbuf *prev) { - NA(ifp)->if_input(ifp, m); return NULL; } @@ -251,11 +268,17 @@ nm_os_mbuf_has_offld(struct mbuf *m) static void freebsd_generic_rx_handler(struct ifnet *ifp, struct mbuf *m) { - struct netmap_generic_adapter *gna = - (struct netmap_generic_adapter *)NA(ifp); - int stolen = generic_rx_handler(ifp, m); + int stolen; + if (!NM_NA_VALID(ifp)) { + RD(1, "Warning: got RX packet for invalid emulated adapter"); + return; + } + + stolen = generic_rx_handler(ifp, m); if (!stolen) { + struct netmap_generic_adapter *gna = + (struct netmap_generic_adapter *)NA(ifp); gna->save_if_input(ifp, m); } } @@ -386,7 +409,6 @@ netmap_getna(if_t ifp) int nm_os_generic_find_num_desc(struct ifnet *ifp, unsigned int *tx, unsigned int *rx) { - D("called, in tx %d rx %d", *tx, *rx); return 0; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 12 23:41:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D6B2D8692C; Mon, 12 Jun 2017 23:41:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BE1B8460C; Mon, 12 Jun 2017 23:41:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CNfKlt055552; Mon, 12 Jun 2017 23:41:20 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CNfKQa055551; Mon, 12 Jun 2017 23:41:20 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201706122341.v5CNfKQa055551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 12 Jun 2017 23:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319882 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 23:41:21 -0000 Author: rmacklem Date: Mon Jun 12 23:41:20 2017 New Revision: 319882 URL: https://svnweb.freebsd.org/changeset/base/319882 Log: Define NFS_MAXXDR as the upper bound on XDR overhead in an NFS RPC. This definition is a part of the maxiotune2 patch that will be committed soon. It is being committed separately to ease merging with the pNFS projects subversion trees. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10991 Modified: head/sys/fs/nfs/nfsproto.h Modified: head/sys/fs/nfs/nfsproto.h ============================================================================== --- head/sys/fs/nfs/nfsproto.h Mon Jun 12 22:53:18 2017 (r319881) +++ head/sys/fs/nfs/nfsproto.h Mon Jun 12 23:41:20 2017 (r319882) @@ -56,8 +56,22 @@ #define NFS_MAXDGRAMDATA 16384 #define NFS_MAXPATHLEN 1024 #define NFS_MAXNAMLEN 255 +/* + * Calculating the maximum XDR overhead for an NFS RPC isn't easy. + * NFS_MAXPKTHDR is antiquated and assumes AUTH_SYS over UDP. + * NFS_MAXXDR should be sufficient for all NFS versions over TCP. + * It includes: + * - Maximum RPC message header. It can include 2 400byte authenticators plus + * a machine name of unlimited length, although it is usually relatively + * small. + * - XDR overheads for the NFSv4 compound. This can include Owner and + * Owner_group strings, which are usually fairly small, but are allowed + * to be up to 1024 bytes each. + * 4096 is overkill, but should always be sufficient. + */ #define NFS_MAXPKTHDR 404 -#define NFS_MAXPACKET (NFS_SRVMAXIO + 2048) +#define NFS_MAXXDR 4096 +#define NFS_MAXPACKET (NFS_SRVMAXIO + NFS_MAXXDR) #define NFS_MINPACKET 20 #define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */ #define NFSV4_MINORVERSION 0 /* V4 Minor version */ From owner-svn-src-all@freebsd.org Mon Jun 12 23:41:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1913CD86928; Mon, 12 Jun 2017 23:41:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 01AEC84608; Mon, 12 Jun 2017 23:41:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v5CNfHJa047439 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 12 Jun 2017 16:41:18 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v5CNfHI1047438; Mon, 12 Jun 2017 16:41:17 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 12 Jun 2017 16:41:17 -0700 From: Gleb Smirnoff To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319859 - head Message-ID: <20170612234117.GC50023@FreeBSD.org> References: <201706121722.v5CHMNNo000648@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201706121722.v5CHMNNo000648@repo.freebsd.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 23:41:20 -0000 On Mon, Jun 12, 2017 at 05:22:23PM +0000, Ian Lepore wrote: I> Author: ian I> Date: Mon Jun 12 17:22:23 2017 I> New Revision: 319859 I> URL: https://svnweb.freebsd.org/changeset/base/319859 I> I> Log: I> Add support for "make universe_kernels -DMAKE_GENERIC_KERNELS" to build I> just the GENERIC kernels for each arch (including variations such as I> GENERIC-NODEBUG, GENERIC64, etc). I> I> This helps with quickly doing a test build for all[*] arches without I> building dozens of variant kernels for the arches that have lots of I> hardware/board/system variations. I> I> [*] Not all arches have a generic kernel (but they probably should for I> test-building purposes, even if it can't boot on any real hardware). For this purpose there is LINT. Imho, feature should be -DMAKE_LINT_KERNELS. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Mon Jun 12 23:43:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EEC5D86AFC; Mon, 12 Jun 2017 23:43:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 21E4C84A6C; Mon, 12 Jun 2017 23:43:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v5CNhuu0047466 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 12 Jun 2017 16:43:57 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v5CNhuQU047465; Mon, 12 Jun 2017 16:43:56 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 12 Jun 2017 16:43:56 -0700 From: Gleb Smirnoff To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319874 - head/sys/kern Message-ID: <20170612234356.GD50023@FreeBSD.org> References: <201706122111.v5CLBBUT092606@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201706122111.v5CLBBUT092606@repo.freebsd.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Jun 2017 23:43:58 -0000 On Mon, Jun 12, 2017 at 09:11:11PM +0000, Konstantin Belousov wrote: K> Author: kib K> Date: Mon Jun 12 21:11:11 2017 K> New Revision: 319874 K> URL: https://svnweb.freebsd.org/changeset/base/319874 K> K> Log: K> Print unimplemented syscall number to the ctty on SIGSYS, if enabled K> by the knob kern.lognosys. Why is it off by default? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Tue Jun 13 00:21:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D137D874B2; Tue, 13 Jun 2017 00:21:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x22e.google.com (mail-qt0-x22e.google.com [IPv6:2607:f8b0:400d:c0d::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA587AFC; Tue, 13 Jun 2017 00:21:02 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x22e.google.com with SMTP id u12so149170002qth.0; Mon, 12 Jun 2017 17:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4ERK1Bvr2gBWQukTrvm87HrP0QsrGSZqAofVg28wSfM=; b=dbwP5gSb939aD6kMsuhLzmqun2qKAkkHmWOH5vFbcytdLZ9/+Ct/0tTvYoYS6XXt4Y WciZYwc3qAQTQUSuz9MqhrexAna36WghovPvSAkn8sR2Wm+B2lZABUa40f51xr6M71Ad 1s8OdE2U82KgPc9AzG+Rx421nYEdR8F2a9TAULcgTAdbbrDOo2j5fW049/eP3QLiwMsQ LxhTtZLcFVJwkiA1Zi/69kjxQIF8+F+smgKOajk+jxRuOQ6yfF2HMQgACCFYg2lweQH5 IYSr6YlTXWphL5h9MMtdBQTrLdiWKIfw5s5I28CXRbLl2lA85EA5kp3GrGJRH56m9kSD zJjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=4ERK1Bvr2gBWQukTrvm87HrP0QsrGSZqAofVg28wSfM=; b=TbstLFRk5FYPCMpHE0CML9V5xcuMjESZekqr2cJwTYbYaGcqKM/PK3xxPD8jsqzezd f5qQ78Y7T4ekp7Z0aXi8I+uo1H/9LNpVYzTLyT2aGpxGesAAqNjlrW0xLptlVJd2XPQ7 96exI46AofACCDjWV6hmu22XjgtpkdIJBipVjeBsySRrYv/HzU/+APx+nGzCMQ2+kueV 1rVLHKDDLZVlA0IppPnnuTIW7vND4L/JTkkjdjdNhG6H8o0d1euSpXo1qQCYseZToTPq Ry+CwzGw8WXtQ0wol0Y+QhSNGjCAOhqcMTLd8k8/Zdr9rj9fm3TYH2W1xE82VgvEvgy9 yZ1Q== X-Gm-Message-State: AKS2vOx2lLDt02oTMEicIeLguBASfGvj0sZDUjTqG9LVTf+4xMlOeVMm 0mlrSAyWmpQRYQ== X-Received: by 10.200.41.213 with SMTP id 21mr11922242qtt.168.1497313261912; Mon, 12 Jun 2017 17:21:01 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id t42sm7601265qtg.43.2017.06.12.17.21.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 17:21:01 -0700 (PDT) Sender: Mark Johnston Date: Mon, 12 Jun 2017 17:20:52 -0700 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319868 - in head/sys: kern sys Message-ID: <20170613002052.GC73695@wkstn-mjohnston.west.isilon.com> References: <201706122014.v5CKEitK071089@repo.freebsd.org> <20170612202952.GU2088@kib.kiev.ua> <20170612204704.GA73695@wkstn-mjohnston.west.isilon.com> <20170612213300.GV2088@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170612213300.GV2088@kib.kiev.ua> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 00:21:03 -0000 On Tue, Jun 13, 2017 at 12:33:00AM +0300, Konstantin Belousov wrote: > On Mon, Jun 12, 2017 at 01:47:05PM -0700, Mark Johnston wrote: > > On Mon, Jun 12, 2017 at 11:29:52PM +0300, Konstantin Belousov wrote: > > > On Mon, Jun 12, 2017 at 08:14:44PM +0000, Mark Johnston wrote: > > > > +int > > > > +uuidcmp(const struct uuid *uuid1, const struct uuid *uuid2) > > > > +{ > > > > + > > > > + return (memcmp(uuid1, uuid2, sizeof(struct uuid))); > > > > +} > > > > > > This is unsafe. The function operation depends on the ABI properties > > > that there is no padding either between members, or at the end of > > > the structure. Why not use by-member comparision ? > > > > I interpreted the CTASSERT at the beginning of kern_uuid.c as a > > guarantee that no such padding will be present. kern_uuid.c also defines > > an alternate representation, struct uuid_private, and casts between the > > two. > > I agree, your addition is consistent with the other code in kern_uuid.c, > which already depends on these features. At least it contradicts > to what compiler authors try to teach C language users. > > BTW, does uuid_private low/mid/hi union split of ll depend on endianess ? It seems so. The current usage is ok because the two representations aren't mixed. That is, ll is only used to access the time fields of the global uuid_last, and the low/mid/hi fields are never used with uuid_last. It does look like a bit of a landmine though; I think it would be worth adding a small hint: diff --git a/sys/kern/kern_uuid.c b/sys/kern/kern_uuid.c index 0953d901a592..78088e1c6f32 100644 --- a/sys/kern/kern_uuid.c +++ b/sys/kern/kern_uuid.c @@ -58,7 +58,7 @@ CTASSERT(sizeof(struct uuid) == 16); /* We use an alternative, more convenient representation in the generator. */ struct uuid_private { union { - uint64_t ll; /* internal. */ + uint64_t ll; /* internal, for uuid_last only */ struct { uint32_t low; uint16_t mid; From owner-svn-src-all@freebsd.org Tue Jun 13 00:22:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1F42D8765D; Tue, 13 Jun 2017 00:22:17 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69C65E68; Tue, 13 Jun 2017 00:22:17 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5D0MGgG073955; Tue, 13 Jun 2017 00:22:16 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5D0MFHe073943; Tue, 13 Jun 2017 00:22:15 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201706130022.v5D0MFHe073943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 13 Jun 2017 00:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319884 - in stable/11: contrib/bmake contrib/bmake/PSD.doc contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 00:22:17 -0000 Author: sjg Date: Tue Jun 13 00:22:15 2017 New Revision: 319884 URL: https://svnweb.freebsd.org/changeset/base/319884 Log: Update bmake to 20170510 Approved by: re@ Added: stable/11/contrib/bmake/mk/files.mk - copied unchanged from r318163, head/contrib/bmake/mk/files.mk stable/11/contrib/bmake/mk/sys.debug.mk - copied unchanged from r310304, head/contrib/bmake/mk/sys.debug.mk stable/11/contrib/bmake/mk/sys.vars.mk - copied, changed from r310304, head/contrib/bmake/mk/sys.vars.mk Modified: stable/11/contrib/bmake/ChangeLog stable/11/contrib/bmake/Makefile stable/11/contrib/bmake/PSD.doc/tutorial.ms stable/11/contrib/bmake/arch.c stable/11/contrib/bmake/bmake.1 stable/11/contrib/bmake/bmake.cat1 stable/11/contrib/bmake/compat.c stable/11/contrib/bmake/cond.c stable/11/contrib/bmake/dir.c stable/11/contrib/bmake/for.c stable/11/contrib/bmake/job.c stable/11/contrib/bmake/main.c stable/11/contrib/bmake/make.1 stable/11/contrib/bmake/make.c stable/11/contrib/bmake/make.h stable/11/contrib/bmake/make_malloc.c stable/11/contrib/bmake/meta.c stable/11/contrib/bmake/mk/ChangeLog stable/11/contrib/bmake/mk/FILES stable/11/contrib/bmake/mk/auto.obj.mk stable/11/contrib/bmake/mk/dirdeps.mk stable/11/contrib/bmake/mk/doc.mk stable/11/contrib/bmake/mk/dpadd.mk stable/11/contrib/bmake/mk/final.mk stable/11/contrib/bmake/mk/gendirdeps.mk stable/11/contrib/bmake/mk/inc.mk stable/11/contrib/bmake/mk/init.mk stable/11/contrib/bmake/mk/install-mk stable/11/contrib/bmake/mk/lib.mk stable/11/contrib/bmake/mk/meta.stage.mk stable/11/contrib/bmake/mk/meta.sys.mk stable/11/contrib/bmake/mk/meta2deps.py stable/11/contrib/bmake/mk/meta2deps.sh stable/11/contrib/bmake/mk/mkopt.sh stable/11/contrib/bmake/mk/own.mk stable/11/contrib/bmake/mk/prog.mk stable/11/contrib/bmake/mk/scripts.mk stable/11/contrib/bmake/mk/subdir.mk stable/11/contrib/bmake/mk/sys.mk stable/11/contrib/bmake/mk/sys/AIX.mk stable/11/contrib/bmake/mk/sys/Darwin.mk stable/11/contrib/bmake/mk/sys/Generic.mk stable/11/contrib/bmake/mk/sys/HP-UX.mk stable/11/contrib/bmake/mk/sys/IRIX.mk stable/11/contrib/bmake/mk/sys/Linux.mk stable/11/contrib/bmake/mk/sys/NetBSD.mk stable/11/contrib/bmake/mk/sys/OSF1.mk stable/11/contrib/bmake/mk/sys/OpenBSD.mk stable/11/contrib/bmake/mk/sys/SunOS.mk stable/11/contrib/bmake/mk/sys/UnixWare.mk stable/11/contrib/bmake/nonints.h stable/11/contrib/bmake/os.sh stable/11/contrib/bmake/parse.c stable/11/contrib/bmake/str.c stable/11/contrib/bmake/suff.c stable/11/contrib/bmake/targ.c stable/11/contrib/bmake/unit-tests/modmatch.exp stable/11/contrib/bmake/unit-tests/modmatch.mk stable/11/contrib/bmake/unit-tests/varmisc.exp stable/11/contrib/bmake/unit-tests/varmisc.mk stable/11/contrib/bmake/var.c stable/11/usr.bin/bmake/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bmake/ChangeLog ============================================================================== --- stable/11/contrib/bmake/ChangeLog Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/ChangeLog Tue Jun 13 00:22:15 2017 (r319884) @@ -1,3 +1,169 @@ +2017-05-10 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170510 + Merge with NetBSD make, pick up + o main.c: Main_SetObjdir: ensure buf2 is in scope + +2017-05-08 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170505 + see mk/ChangeLog + +2017-05-05 Simon J. Gerraty + + * parse.c: not everyone has stdint.h + +2017-05-01 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170501 + see mk/ChangeLog + +2017-04-21 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170421 + Merge with NetBSD make, pick up + o str.c: Str_Match: fix closure tests for [^] and add unit-test. + +2017-04-20 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170420 + Merge with NetBSD make, pick up + o main.c: only use -C arg "as is" if it contains no + relative component. + +2017-04-18 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170418 + Merge with NetBSD make, pick up + o main.c: fix Main_SetObjdir() for relative paths (eg obj). + +2017-04-17 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170417 + Merge with NetBSD make, pick up + o fixes a number of coverity complaints + - check return value of fseek, fcntl + - plug memory leak in Dir_FindFile, Var_LoopExpand, + JobPrintCommand, ParseTraditionalInclude + - use bmake_malloc() where NULL is not tollerated + - use MAKE_ATTR_UNUSED rather that kludges like + return(unused ? 0 : 0) + - use purge_cached_realpaths() rather than abuse cached_realpath() + +2017-04-13 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170413 + Merge with NetBSD make, pick up + o main.c: when setting .OBJDIR ignore '$' in paths. + + * job.c: use MALLOC_OPTIONS to set malloc_options. + +2017-04-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170411 + Merge with NetBSD make, pick up + o str.c: Str_Match: allow [^a-z] to behave as expected. + +2017-03-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170326 + Merge with NetBSD make, pick up + o main.c: purge relative paths from realpath cache when .OBJDIR + is changed. + +2017-03-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170311 + Merge with NetBSD make, pick up + o main.c: only use -C arg "as is" if it starts with '/'. + +2017-03-01 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170301 + Merge with NetBSD make, pick up + o main.c: use -C arg "as is" rather than getcwd() + if they identify the same directory. + o parse.c: ensure loadfile buffer is \n terminated in non-mmap case + +2017-02-01 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170201 + Merge with NetBSD make, pick up + o var.c: allow :_=var and avoid use of special context. + +2017-01-30 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170130 + Merge with NetBSD make, pick up + o var.c: add :range and :_ + o main.c: partially initialize Dir_* before MainParseArgs() + can be called. + If -V, skip Main_ExportMAKEFLAGS() + +2017-01-14 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170114 + Merge with NetBSD make, pick up + o var.c: allow specifying the utc value used by :{gm,local}time + +2016-12-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161212 + Merge with NetBSD make, pick up + o main.c: look for obj.${MACHINE}-${MACHINE_ARCH} too. + +2016-12-09 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161209 + Merge with NetBSD make, pick up + o main.c: cleanup setting of .OBJDIR + o parse.c: avoid coredump from (var)=val + +2016-11-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161126 + Merge with NetBSD make, pick up + o make.c: Make_OODate: report src node name if path not set + +2016-09-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160926 + Merge with NetBSD make, pick up + o support for .DELETE_ON_ERROR: (remove targets that fail) + +2016-09-26 Simon J. Gerraty + + * Makefile MAN: tweak .Dt to match ${PROG} + +2016-08-18 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160818 + its a neater number; pick up whitespace fixes to man page. + +2016-08-17 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160817 + Merge with NetBSD make, pick up + o meta.c: move handling of .MAKE.META.IGNORE_* to meta_ignore() + so we can call it before adding entries to missingFiles. + Thus we do not track files we have been told to ignore. + +2016-08-15 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160815 + Merge with NetBSD make, pick up + o meta_oodate: apply .MAKE.META.IGNORE_FILTER (if defined) to + pathnames, and skip if the expansion is empty. + Useful for dirdeps.mk when checking DIRDEPS_CACHE. + +2016-08-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160812 + Merge with NetBSD make, pick up + o meta.c: remove all missingFiles entries that match a deleted + dir. + o main.c: set .ERROR_CMD if possible. + 2016-06-06 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160606 Modified: stable/11/contrib/bmake/Makefile ============================================================================== --- stable/11/contrib/bmake/Makefile Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/Makefile Tue Jun 13 00:22:15 2017 (r319884) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.67 2016/06/07 00:46:12 sjg Exp $ +# $Id: Makefile,v 1.92 2017/05/10 22:29:04 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160606 +_MAKE_VERSION= 20170510 PROG= bmake @@ -156,7 +156,10 @@ my.history: ${MAKEFILE} .NOPATH: ${MAN} ${MAN}: make.1 my.history @echo making $@ - @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \ + @sed \ + -e '/^.Dt/s/MAKE/${PROG:tu}/' \ + -e 's/^.Nx/NetBSD/' \ + -e '/^.Nm/s/make/${PROG}/' \ -e '/^.Sh HISTORY/rmy.history' \ -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@ Modified: stable/11/contrib/bmake/PSD.doc/tutorial.ms ============================================================================== --- stable/11/contrib/bmake/PSD.doc/tutorial.ms Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/PSD.doc/tutorial.ms Tue Jun 13 00:22:15 2017 (r319884) @@ -1,4 +1,4 @@ -.\" $NetBSD: tutorial.ms,v 1.12 2014/09/30 21:33:14 christos Exp $ +.\" $NetBSD: tutorial.ms,v 1.13 2017/03/01 13:05:11 kre Exp $ .\" Copyright (c) 1988, 1989, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -117,6 +117,15 @@ .de No .br .ne 0.5i +.ie n \{\ +.nr g3 \w'NOTE ' +.po -\\n(g3u +.br +NOTE +.br +.po +\\n(g3u +.\} +.el \{\ .po -0.5i .br .mk @@ -148,12 +157,14 @@ .rt .ft \\n(g3 .ps \\n(g4 +.\} .. .de Bp .ie !\\n(.$ .IP \(bu 2 .el .IP "\&" 2 .. -.po +.3i +.ie n .po +\w'NOTE 'u +.el .po +.3i .TL PMake \*- A Tutorial .AU Modified: stable/11/contrib/bmake/arch.c ============================================================================== --- stable/11/contrib/bmake/arch.c Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/arch.c Tue Jun 13 00:22:15 2017 (r319884) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $ */ +/* $NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $"); +__RCSID("$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -726,7 +726,8 @@ ArchStatMember(char *archive, char *member, Boolean ha if (fread(memName, elen, 1, arch) != 1) goto badarch; memName[elen] = '\0'; - fseek(arch, -elen, SEEK_CUR); + if (fseek(arch, -elen, SEEK_CUR) != 0) + goto badarch; if (DEBUG(ARCH) || DEBUG(MAKE)) { fprintf(debug_file, "ArchStat: Extended format entry for %s\n", memName); } @@ -737,7 +738,8 @@ ArchStatMember(char *archive, char *member, Boolean ha Hash_SetValue(he, bmake_malloc(sizeof(struct ar_hdr))); memcpy(Hash_GetValue(he), &arh, sizeof(struct ar_hdr)); } - fseek(arch, (size + 1) & ~1, SEEK_CUR); + if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) + goto badarch; } fclose(arch); @@ -956,7 +958,10 @@ ArchFindMember(char *archive, char *member, struct ar_ * the file at the actual member, rather than its header, but * not here... */ - fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR); + if (fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } return (arch); } } else @@ -986,10 +991,17 @@ ArchFindMember(char *archive, char *member, struct ar_ } if (strncmp(ename, member, len) == 0) { /* Found as extended name */ - fseek(arch, -sizeof(struct ar_hdr) - elen, SEEK_CUR); + if (fseek(arch, -sizeof(struct ar_hdr) - elen, + SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } return (arch); } - fseek(arch, -elen, SEEK_CUR); + if (fseek(arch, -elen, SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } goto skip; } else #endif @@ -1002,9 +1014,12 @@ skip: * extract the size of the file from the 'size' field of the * header and round it up during the seek. */ - arhPtr->ar_size[sizeof(arhPtr->AR_SIZE)-1] = '\0'; + arhPtr->AR_SIZE[sizeof(arhPtr->AR_SIZE)-1] = '\0'; size = (int)strtol(arhPtr->AR_SIZE, NULL, 10); - fseek(arch, (size + 1) & ~1, SEEK_CUR); + if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } } } Modified: stable/11/contrib/bmake/bmake.1 ============================================================================== --- stable/11/contrib/bmake/bmake.1 Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/bmake.1 Tue Jun 13 00:22:15 2017 (r319884) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.259 2016/06/03 07:07:37 wiz Exp $ +.\" $NetBSD: make.1,v 1.266 2017/02/01 18:39:27 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,8 +29,8 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd June 2, 2016 -.Dt MAKE 1 +.Dd February 1, 2017 +.Dt BMAKE 1 .Os .Sh NAME .Nm bmake @@ -927,6 +927,9 @@ The default list includes: .It Va .MAKE.META.IGNORE_PATTERNS Provides a list of patterns to match against pathnames. Ignore any that match. +.It Va .MAKE.META.IGNORE_FILTER +Provides a list of variable modifiers to apply to each pathname. +Ignore if the expansion is an empty string. .It Va .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: @@ -974,7 +977,19 @@ per normal evaluation rules. .It Va MAKE_PRINT_VAR_ON_ERROR When .Nm -stops due to an error, it prints its name and the value of +stops due to an error, it sets +.Ql Va .ERROR_TARGET +to the name of the target that failed, +.Ql Va .ERROR_CMD +to the commands of the failed target, +and in "meta" mode, it also sets +.Ql Va .ERROR_CWD +to the +.Xr getcwd 3 , +and +.Ql Va .ERROR_META_FILE +to the path of the meta file (if any) describing the failed target. +It then prints its name and the value of .Ql Va .CURDIR as well as the value of any variables named in .Ql Va MAKE_PRINT_VAR_ON_ERROR . @@ -1190,18 +1205,28 @@ safely through recursive invocations of .Nm . .It Cm \&:R Replaces each word in the variable with everything but its suffix. -.It Cm \&:gmtime +.It Cm \&:range[=count] +The value is an integer sequence representing the words of the original +value, or the supplied +.Va count . +.It Cm \&:gmtime[=utc] The value is a format string for .Xr strftime 3 , -using the current +using .Xr gmtime 3 . +If a +.Va utc +value is not provided or is 0, the current time is used. .It Cm \&:hash Compute a 32-bit hash of the value and encode it as hex digits. -.It Cm \&:localtime +.It Cm \&:localtime[=utc] The value is a format string for .Xr strftime 3 , -using the current +using .Xr localtime 3 . +If a +.Va utc +value is not provided or is 0, the current time is used. .It Cm \&:tA Attempt to convert variable to an absolute path using .Xr realpath 3 , @@ -1401,6 +1426,27 @@ For example. .Pp However a single character variable is often more readable: .Dl ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@} +.It Cm \&:_[=var] +Save the current variable value in +.Ql $_ +or the named +.Va var +for later reference. +Example usage: +.Bd -literal -offset indent +M_cmpv.units = 1 1000 1000000 +M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \&\\ +\\* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh + +.Dv .if ${VERSION:${M_cmpv}} < ${3.1.12:L:${M_cmpv}} + +.Ed +Here +.Ql $_ +is used to save the result of the +.Ql :S +modifier which is later referenced using the index values from +.Ql :range . .It Cm \&:U Ns Ar newval If the variable is undefined .Ar newval @@ -1996,6 +2042,14 @@ variable of a target that inherits .Ic .DEFAULT Ns 's commands is set to the target's own name. +.It Ic .DELETE_ON_ERROR +If this target is present in the makefile, it globally causes make to +delete targets whose commands fail. +(By default, only targets whose commands are interrupted during +execution are deleted. +This is the historical behavior.) +This setting can be used to help prevent half-finished or malformed +targets from being left around and corrupting future rebuilds. .It Ic .END Any command lines attached to this target are executed after everything else is done. Modified: stable/11/contrib/bmake/bmake.cat1 ============================================================================== --- stable/11/contrib/bmake/bmake.cat1 Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/bmake.cat1 Tue Jun 13 00:22:15 2017 (r319884) @@ -1,4 +1,4 @@ -MAKE(1) NetBSD General Commands Manual MAKE(1) +BMAKE(1) NetBSD General Commands Manual BMAKE(1) NNAAMMEE bbmmaakkee -- maintain program dependencies @@ -604,6 +604,10 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT Provides a list of patterns to match against pathnames. Ignore any that match. + _._M_A_K_E_._M_E_T_A_._I_G_N_O_R_E___F_I_L_T_E_R + Provides a list of variable modifiers to apply to each + pathname. Ignore if the expansion is an empty string. + _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: @@ -635,9 +639,14 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT becomes `$' per normal evaluation rules. _M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R - When bbmmaakkee stops due to an error, it prints its name and - the value of `_._C_U_R_D_I_R' as well as the value of any vari- - ables named in `_M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R'. + When bbmmaakkee stops due to an error, it sets `_._E_R_R_O_R___T_A_R_G_E_T' + to the name of the target that failed, `_._E_R_R_O_R___C_M_D' to + the commands of the failed target, and in "meta" mode, it + also sets `_._E_R_R_O_R___C_W_D' to the getcwd(3), and + `_._E_R_R_O_R___M_E_T_A___F_I_L_E' to the path of the meta file (if any) + describing the failed target. It then prints its name + and the value of `_._C_U_R_D_I_R' as well as the value of any + variables named in `_M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R'. _._n_e_w_l_i_n_e This variable is simply assigned a newline character as its value. This allows expansions using the ::@@ modifier @@ -780,16 +789,20 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT ::RR Replaces each word in the variable with everything but its suffix. - ::ggmmttiimmee - The value is a format string for strftime(3), using the current - gmtime(3). + ::rraannggee[[==ccoouunntt]] + The value is an integer sequence representing the words of the orig- + inal value, or the supplied _c_o_u_n_t. + ::ggmmttiimmee[[==uuttcc]] + The value is a format string for strftime(3), using gmtime(3). If a + _u_t_c value is not provided or is 0, the current time is used. + ::hhaasshh Compute a 32-bit hash of the value and encode it as hex digits. - ::llooccaallttiimmee - The value is a format string for strftime(3), using the current - localtime(3). + ::llooccaallttiimmee[[==uuttcc]] + The value is a format string for strftime(3), using localtime(3). + If a _u_t_c value is not provided or is 0, the current time is used. ::ttAA Attempt to convert variable to an absolute path using realpath(3), if that fails, the value is unchanged. @@ -890,6 +903,19 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT However a single character variable is often more readable: ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@} + ::__[[==vvaarr]] + Save the current variable value in `$_' or the named _v_a_r for later + reference. Example usage: + + M_cmpv.units = 1 1000 1000000 + M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \ + \* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh + + .if ${VERSION:${M_cmpv}} < ${3.1.12:L:${M_cmpv}} + + Here `$_' is used to save the result of the `:S' modifier which is + later referenced using the index values from `:range'. + ::UU_n_e_w_v_a_l If the variable is undefined _n_e_w_v_a_l is the value. If the variable is defined, the existing value is returned. This is another ODE @@ -1276,6 +1302,14 @@ SSPPEECCIIAALL TTAARRGGEETTSS target that inherits ..DDEEFFAAUULLTT's commands is set to the target's own name. + ..DDEELLEETTEE__OONN__EERRRROORR + If this target is present in the makefile, it globally causes + make to delete targets whose commands fail. (By default, only + targets whose commands are interrupted during execution are + deleted. This is the historical behavior.) This setting can be + used to help prevent half-finished or malformed targets from + being left around and corrupting future rebuilds. + ..EENNDD Any command lines attached to this target are executed after everything else is done. @@ -1489,4 +1523,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 June 2, 2016 NetBSD 5.1 +NetBSD 7.1_RC1 February 1, 2017 NetBSD 7.1_RC1 Modified: stable/11/contrib/bmake/compat.c ============================================================================== --- stable/11/contrib/bmake/compat.c Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/compat.c Tue Jun 13 00:22:15 2017 (r319884) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $ */ +/* $NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $"); #endif #endif /* not lint */ #endif @@ -119,6 +119,25 @@ static GNode *curTarg = NULL; static GNode *ENDNode; static void CompatInterrupt(int); +/* + * CompatDeleteTarget -- delete a failed, interrupted, or otherwise + * duffed target if not inhibited by .PRECIOUS. + */ +static void +CompatDeleteTarget(GNode *gn) +{ + if ((gn != NULL) && !Targ_Precious (gn)) { + char *p1; + char *file = Var_Value(TARGET, gn, &p1); + + if (!noExecute && eunlink(file) != -1) { + Error("*** %s removed", file); + } + + free(p1); + } +} + /*- *----------------------------------------------------------------------- * CompatInterrupt -- @@ -132,6 +151,9 @@ static void CompatInterrupt(int); * The target is removed and the process exits. If .INTERRUPT exists, * its commands are run first WITH INTERRUPTS IGNORED.. * + * XXX: is .PRECIOUS supposed to inhibit .INTERRUPT? I doubt it, but I've + * left the logic alone for now. - dholland 20160826 + * *----------------------------------------------------------------------- */ static void @@ -139,16 +161,9 @@ CompatInterrupt(int signo) { GNode *gn; - if ((curTarg != NULL) && !Targ_Precious (curTarg)) { - char *p1; - char *file = Var_Value(TARGET, curTarg, &p1); + CompatDeleteTarget(curTarg); - if (!noExecute && eunlink(file) != -1) { - Error("*** %s removed", file); - } - - free(p1); - + if ((curTarg != NULL) && !Targ_Precious (curTarg)) { /* * Run .INTERRUPT only if hit with interrupt signal */ @@ -158,7 +173,6 @@ CompatInterrupt(int signo) Compat_Make(gn, gn); } } - } if (signo == SIGQUIT) _exit(signo); @@ -447,7 +461,12 @@ again: * continue. */ printf(" (continuing)\n"); + } else { + printf("\n"); } + if (deleteOnError) { + CompatDeleteTarget(gn); + } } else { /* * Continue executing commands for this target. @@ -607,7 +626,7 @@ Compat_Make(void *gnp, void *pgnp) } else if (keepgoing) { pgn->flags &= ~REMAKE; } else { - PrintOnError(gn, "\n\nStop."); + PrintOnError(gn, "\nStop."); exit(1); } } else if (gn->made == ERROR) { @@ -698,7 +717,7 @@ Compat_Run(Lst targs) if (gn != NULL) { Compat_Make(gn, gn); if (gn->made == ERROR) { - PrintOnError(gn, "\n\nStop."); + PrintOnError(gn, "\nStop."); exit(1); } } @@ -739,7 +758,7 @@ Compat_Run(Lst targs) if (errors == 0) { Compat_Make(ENDNode, ENDNode); if (gn->made == ERROR) { - PrintOnError(gn, "\n\nStop."); + PrintOnError(gn, "\nStop."); exit(1); } } Modified: stable/11/contrib/bmake/cond.c ============================================================================== --- stable/11/contrib/bmake/cond.c Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/cond.c Tue Jun 13 00:22:15 2017 (r319884) @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -91,6 +91,7 @@ __RCSID("$NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 ch * */ +#include #include #include /* For strtoul() error checking */ @@ -1174,8 +1175,9 @@ Cond_EvalExpression(const struct If *info, char *line, break; dflt_info = info; } + assert(info != NULL); - if_info = info != NULL ? info : ifs + 4; + if_info = info; condExpr = line; condPushBack = TOK_NONE; Modified: stable/11/contrib/bmake/dir.c ============================================================================== --- stable/11/contrib/bmake/dir.c Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/dir.c Tue Jun 13 00:22:15 2017 (r319884) @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $ */ +/* $NetBSD: dir.c,v 1.71 2017/04/16 21:14:47 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.71 2017/04/16 21:14:47 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $"); +__RCSID("$NetBSD: dir.c,v 1.71 2017/04/16 21:14:47 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -346,11 +346,13 @@ cached_lstat(const char *pathname, void *st) void Dir_Init(const char *cdname) { - dirSearchPath = Lst_Init(FALSE); - openDirectories = Lst_Init(FALSE); - Hash_InitTable(&mtimes, 0); - Hash_InitTable(&lmtimes, 0); - + if (!cdname) { + dirSearchPath = Lst_Init(FALSE); + openDirectories = Lst_Init(FALSE); + Hash_InitTable(&mtimes, 0); + Hash_InitTable(&lmtimes, 0); + return; + } Dir_InitCur(cdname); dotLast = bmake_malloc(sizeof(Path)); @@ -801,11 +803,11 @@ DirExpandInt(const char *word, Lst path, Lst expansion *----------------------------------------------------------------------- */ static int -DirPrintWord(void *word, void *dummy) +DirPrintWord(void *word, void *dummy MAKE_ATTR_UNUSED) { fprintf(debug_file, "%s ", (char *)word); - return(dummy ? 0 : 0); + return 0; } /*- @@ -1313,8 +1315,14 @@ Dir_FindFile(const char *name, Lst path) fprintf(debug_file, " Trying exact path matches...\n"); } - if (!hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL) - return *file?file:NULL; + if (!hasLastDot && cur && ((file = DirLookupAbs(cur, name, cp)) + != NULL)) { + if (file[0] == '\0') { + free(file); + return NULL; + } + return file; + } (void)Lst_Open(path); while ((ln = Lst_Next(path)) != NULL) { @@ -1323,13 +1331,23 @@ Dir_FindFile(const char *name, Lst path) continue; if ((file = DirLookupAbs(p, name, cp)) != NULL) { Lst_Close(path); - return *file?file:NULL; + if (file[0] == '\0') { + free(file); + return NULL; + } + return file; } } Lst_Close(path); - if (hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL) - return *file?file:NULL; + if (hasLastDot && cur && ((file = DirLookupAbs(cur, name, cp)) + != NULL)) { + if (file[0] == '\0') { + free(file); + return NULL; + } + return file; + } } /* @@ -1849,10 +1867,10 @@ Dir_PrintDirectories(void) } static int -DirPrintDir(void *p, void *dummy) +DirPrintDir(void *p, void *dummy MAKE_ATTR_UNUSED) { fprintf(debug_file, "%s ", ((Path *)p)->name); - return (dummy ? 0 : 0); + return 0; } void Modified: stable/11/contrib/bmake/for.c ============================================================================== --- stable/11/contrib/bmake/for.c Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/for.c Tue Jun 13 00:22:15 2017 (r319884) @@ -1,4 +1,4 @@ -/* $NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $ */ /* * Copyright (c) 1992, The Regents of the University of California. @@ -30,14 +30,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -427,7 +427,7 @@ For_Iterate(void *v_arg, size_t *ret_len) for (cp = cmd_cp; (cp = strchr(cp, '$')) != NULL;) { char ech; ch = *++cp; - if ((ch == '(' && (ech = ')')) || (ch == '{' && (ech = '}'))) { + if ((ch == '(' && (ech = ')', 1)) || (ch == '{' && (ech = '}', 1))) { cp++; /* Check variable name against the .for loop variables */ STRLIST_FOREACH(var, &arg->vars, i) { Modified: stable/11/contrib/bmake/job.c ============================================================================== --- stable/11/contrib/bmake/job.c Mon Jun 12 23:50:30 2017 (r319883) +++ stable/11/contrib/bmake/job.c Tue Jun 13 00:22:15 2017 (r319884) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $ */ +/* $NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $"); +__RCSID("$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -389,7 +389,10 @@ static void JobSigLock(sigset_t *); static void JobSigUnlock(sigset_t *); static void JobSigReset(void); -const char *malloc_options="A"; +#if !defined(MALLOC_OPTIONS) +# define MALLOC_OPTIONS "A" +#endif +const char *malloc_options= MALLOC_OPTIONS; static void job_table_dump(const char *where) @@ -404,6 +407,21 @@ job_table_dump(const char *where) } /* + * Delete the target of a failed, interrupted, or otherwise + * unsuccessful job unless inhibited by .PRECIOUS. + */ +static void +JobDeleteTarget(GNode *gn) +{ + if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) { + char *file = (gn->path == NULL ? gn->name : gn->path); + if (!noExecute && eunlink(file) != -1) { + Error("*** %s removed", file); + } + } +} + +/* * JobSigLock/JobSigUnlock * * Signal lock routines to get exclusive access. Currently used to @@ -425,7 +443,7 @@ static void JobSigUnlock(sigset_t *omaskp) static void JobCreatePipe(Job *job, int minfd) { - int i, fd; + int i, fd, flags; if (pipe(job->jobPipe) == -1) Punt("Cannot create pipe: %s", strerror(errno)); @@ -440,8 +458,10 @@ JobCreatePipe(Job *job, int minfd) } /* Set close-on-exec flag for both */ - (void)fcntl(job->jobPipe[0], F_SETFD, FD_CLOEXEC); - (void)fcntl(job->jobPipe[1], F_SETFD, FD_CLOEXEC); + if (fcntl(job->jobPipe[0], F_SETFD, FD_CLOEXEC) == -1) + Punt("Cannot set close-on-exec: %s", strerror(errno)); + if (fcntl(job->jobPipe[1], F_SETFD, FD_CLOEXEC) == -1) + Punt("Cannot set close-on-exec: %s", strerror(errno)); /* * We mark the input side of the pipe non-blocking; we poll(2) the @@ -449,8 +469,12 @@ JobCreatePipe(Job *job, int minfd) * race for the token when a new one becomes available, so the read * from the pipe should not block. */ - fcntl(job->jobPipe[0], F_SETFL, - fcntl(job->jobPipe[0], F_GETFL, 0) | O_NONBLOCK); + flags = fcntl(job->jobPipe[0], F_GETFL, 0); + if (flags == -1) + Punt("Cannot get flags: %s", strerror(errno)); + flags |= O_NONBLOCK; + if (fcntl(job->jobPipe[0], F_SETFL, flags) == -1) + Punt("Cannot set flags: %s", strerror(errno)); } /*- @@ -752,6 +776,7 @@ JobPrintCommand(void *cmdp, void *jobp) * but this one needs to be - use compat mode just for it. */ CompatRunCommand(cmdp, job->node); + free(cmdStart); return 0; } break; @@ -1049,6 +1074,9 @@ JobFinish (Job *job, WAIT_T status) if (job->flags & JOB_IGNERR) { WAIT_STATUS(status) = 0; } else { + if (deleteOnError) { + JobDeleteTarget(job->node); + } PrintOnError(job->node, NULL); } } else if (DEBUG(JOB)) { @@ -1066,6 +1094,9 @@ JobFinish (Job *job, WAIT_T status) } (void)printf("*** [%s] Signal %d\n", job->node->name, WTERMSIG(status)); + if (deleteOnError) { + JobDeleteTarget(job->node); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 13 00:31:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C20AAD877A2; Tue, 13 Jun 2017 00:31:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82743115D; Tue, 13 Jun 2017 00:31:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5D0VGuA078006; Tue, 13 Jun 2017 00:31:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5D0VGZ3078005; Tue, 13 Jun 2017 00:31:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706130031.v5D0VGZ3078005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Jun 2017 00:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319885 - head/contrib/llvm/tools/lld/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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 00:31:17 -0000 Author: emaste Date: Tue Jun 13 00:31:16 2017 New Revision: 319885 URL: https://svnweb.freebsd.org/changeset/base/319885 Log: lld: ELF: Fix ICF crash on absolute symbol relocations. If two sections contained relocations to absolute symbols with the same value we would crash when trying to access their sections. Add a check that both symbols point to sections before accessing their sections, and treat absolute symbols as equal if their values are equal. Obtained from: LLD commit r292578 MFC after: 3 days Modified: head/contrib/llvm/tools/lld/ELF/ICF.cpp Modified: head/contrib/llvm/tools/lld/ELF/ICF.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/ICF.cpp Tue Jun 13 00:22:15 2017 (r319884) +++ head/contrib/llvm/tools/lld/ELF/ICF.cpp Tue Jun 13 00:31:16 2017 (r319885) @@ -245,7 +245,6 @@ bool ICF::variableEq(const InputSection *A if (&SA == &SB) return true; - // Or, the two sections must be in the same equivalence class. auto *DA = dyn_cast>(&SA); auto *DB = dyn_cast>(&SB); if (!DA || !DB) @@ -253,6 +252,11 @@ bool ICF::variableEq(const InputSection *A if (DA->Value != DB->Value) return false; + // Either both symbols must be absolute... + if (!DA->Section || !DB->Section) + return !DA->Section && !DB->Section; + + // Or the two sections must be in the same equivalence class. auto *X = dyn_cast>(DA->Section); auto *Y = dyn_cast>(DB->Section); if (!X || !Y) From owner-svn-src-all@freebsd.org Tue Jun 13 00:33:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D24D8793E; Tue, 13 Jun 2017 00:33:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x22b.google.com (mail-qt0-x22b.google.com [IPv6:2607:f8b0:400d:c0d::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97C3E1571; Tue, 13 Jun 2017 00:33:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x22b.google.com with SMTP id u12so149477209qth.0; Mon, 12 Jun 2017 17:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OHpZj7RXVhVHMr/oiUdwuJKqs3srnmBLG3fEkL/WrAY=; b=keGQyHat9yCTfBvo/ZC0WD6jsIeWm4kjDeyZUDtLFixI87jwSZbgUp7xRwbXTPKCzs OzohuAnsP8mRWDYAoUUBPFOzu0daBBqtOAjGCdFh5K4AEIU928vV8gBi2ssYvKrqfMq2 FNKGnzHZcgBYsbqlv2hJtaXECYW5Kdyjy5VD6Im14QBoPmjn6Eomw6wjENa3SsJFzpmx fdu0giBlZxz8piXMzCUCFfdbtVjs9JDPfophgeh0V7/45IgnpaUkwogmLeH2Kh/DV4pk Y5s04VjyQq/uHaBLPJeKL4lXjQFwu7LuTGudcupPBwrUkdINARDLVCU4sqrIxL6Hgjp3 GQBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OHpZj7RXVhVHMr/oiUdwuJKqs3srnmBLG3fEkL/WrAY=; b=OQhVubOc+UmW127AzpE9W5joj2MDevKMzGhWocNlNNjjKSCpO16AWQ9OsRrJDolPNP 8HNWP5bFTGaMR+yFLHkoUzxoAOCSqHwE6FjeQuZ269hi551VwhO3okhy0Q3yNm0diyKC J1LajDmWoxZNGY1pg9yhRmQR7PDye21mGu7cpMLvaQdhz1l2RUxcyAYKLwNuakquSwN1 OnzsSaVLDqB5J0RRbLJEYEbGk6QklbdP4phqEJwczMOjdwQzLGCAZ1WVhH/n2/jEd2zP Zaw5068YIO0Vm9E/qUHRQ1uAzcq11Wz+tjDVwyEEH/Xa8Zg6UsOaHkJdvw361p0MTr6X hiQg== X-Gm-Message-State: AKS2vOzbNI0nrs1b4zC393lhdrEE07sUVM4BtQ2ynOhSwwKWoT17H7Xq 1sStW34Ryn4/dzf9wWemeJuwsOOGtAxy X-Received: by 10.55.165.200 with SMTP id o191mr7514009qke.47.1497314038405; Mon, 12 Jun 2017 17:33:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.92.214 with HTTP; Mon, 12 Jun 2017 17:33:57 -0700 (PDT) In-Reply-To: <20170612234356.GD50023@FreeBSD.org> References: <201706122111.v5CLBBUT092606@repo.freebsd.org> <20170612234356.GD50023@FreeBSD.org> From: Ngie Cooper Date: Mon, 12 Jun 2017 17:33:57 -0700 Message-ID: Subject: Re: svn commit: r319874 - head/sys/kern To: Gleb Smirnoff Cc: Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 00:34:00 -0000 On Mon, Jun 12, 2017 at 4:43 PM, Gleb Smirnoff wrote: > On Mon, Jun 12, 2017 at 09:11:11PM +0000, Konstantin Belousov wrote: > K> Author: kib > K> Date: Mon Jun 12 21:11:11 2017 > K> New Revision: 319874 > K> URL: https://svnweb.freebsd.org/changeset/base/319874 > K> > K> Log: > K> Print unimplemented syscall number to the ctty on SIGSYS, if enabled > K> by the knob kern.lognosys. > > Why is it off by default? I'm guessing: - POLA - Infinite console spam -- we have a similar feature at $work that results in a crap ton of console spam with unknown syscalls -- it was implemented a bit differently. Cheers, -Ngie From owner-svn-src-all@freebsd.org Tue Jun 13 00:42:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96E6BD87B6A; Tue, 13 Jun 2017 00:42:24 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57AE41AAB; Tue, 13 Jun 2017 00:42:24 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5D0gN2G082963; Tue, 13 Jun 2017 00:42:23 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5D0gN5d082962; Tue, 13 Jun 2017 00:42:23 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201706130042.v5D0gN5d082962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 13 Jun 2017 00:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319886 - head/sys/dev/etherswitch/e6000sw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 00:42:24 -0000 Author: loos Date: Tue Jun 13 00:42:23 2017 New Revision: 319886 URL: https://svnweb.freebsd.org/changeset/base/319886 Log: Add the initial support for the Marvell 88E6141 and 88E6341 switches. Right now the driver only supports port VLANs, so make sure etherswitch_getinfo() return the proper switch capabilities. Handle the cases where not all ports are in use (that will also require etherswitch cooperation). Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Tue Jun 13 00:31:16 2017 (r319885) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Tue Jun 13 00:42:23 2017 (r319886) @@ -73,6 +73,8 @@ typedef struct e6000sw_softc { uint32_t cpuports_mask; uint32_t fixed_mask; + uint32_t ports_mask; + int phy_base; int sw_addr; int num_ports; boolean_t multi_chip; @@ -85,6 +87,7 @@ typedef struct e6000sw_softc { static etherswitch_info_t etherswitch_info = { .es_nports = 0, .es_nvlangroups = E6000SW_NUM_VGROUPS, + .es_vlan_caps = ETHERSWITCH_VLAN_PORT, .es_name = "Marvell 6000 series switch" }; @@ -95,6 +98,7 @@ static int e6000sw_detach(device_t); static int e6000sw_readphy(device_t, int, int); static int e6000sw_writephy(device_t, int, int, int); static etherswitch_info_t* e6000sw_getinfo(device_t); +static int e6000sw_getconf(device_t, etherswitch_conf_t *); static void e6000sw_lock(device_t); static void e6000sw_unlock(device_t); static int e6000sw_getport(device_t, etherswitch_port_t *); @@ -123,6 +127,7 @@ static int e6000sw_set_pvid(e6000sw_softc_t *, int, in static __inline bool e6000sw_is_cpuport(e6000sw_softc_t *, int); static __inline bool e6000sw_is_fixedport(e6000sw_softc_t *, int); static __inline bool e6000sw_is_phyport(e6000sw_softc_t *, int); +static __inline bool e6000sw_is_portenabled(e6000sw_softc_t *, int); static __inline struct mii_data *e6000sw_miiforphy(e6000sw_softc_t *, unsigned int); @@ -142,6 +147,7 @@ static device_method_t e6000sw_methods[] = { /* etherswitch interface */ DEVMETHOD(etherswitch_getinfo, e6000sw_getinfo), + DEVMETHOD(etherswitch_getconf, e6000sw_getconf), DEVMETHOD(etherswitch_lock, e6000sw_lock), DEVMETHOD(etherswitch_unlock, e6000sw_unlock), DEVMETHOD(etherswitch_getport, e6000sw_getport), @@ -202,7 +208,6 @@ e6000sw_probe(device_t dev) return (ENXIO); sc = device_get_softc(dev); - bzero(sc, sizeof(e6000sw_softc_t)); sc->dev = dev; sc->node = switch_node; @@ -219,14 +224,27 @@ e6000sw_probe(device_t dev) E6000SW_UNLOCK(sc); switch (id & 0xfff0) { + case 0x3400: + description = "Marvell 88E6141"; + sc->phy_base = 0x10; + sc->num_ports = 6; + break; + case 0x3410: + description = "Marvell 88E6341"; + sc->phy_base = 0x10; + sc->num_ports = 6; + break; case 0x3520: description = "Marvell 88E6352"; + sc->num_ports = 7; break; case 0x1720: description = "Marvell 88E6172"; + sc->num_ports = 7; break; case 0x1760: description = "Marvell 88E6176"; + sc->num_ports = 7; break; default: sx_destroy(&sc->sx); @@ -240,17 +258,17 @@ e6000sw_probe(device_t dev) } static int -e6000sw_parse_child_fdt(device_t dev, phandle_t child, uint32_t *fixed_mask, - uint32_t *cpu_mask, int *pport, int *pvlangroup) +e6000sw_parse_child_fdt(e6000sw_softc_t *sc, phandle_t child, + uint32_t *fixed_mask, uint32_t *cpu_mask, int *pport, int *pvlangroup) { + boolean_t fixed_link; char portlabel[100]; uint32_t port, vlangroup; - boolean_t fixed_link; if (fixed_mask == NULL || cpu_mask == NULL || pport == NULL) return (ENXIO); - OF_getprop(child, "label", (void *)portlabel, 100); + OF_getprop(child, "label", (void *)portlabel, sizeof(portlabel)); OF_getencprop(child, "reg", (void *)&port, sizeof(port)); if (OF_getencprop(child, "vlangroup", (void *)&vlangroup, @@ -262,22 +280,21 @@ e6000sw_parse_child_fdt(device_t dev, phandle_t child, *pvlangroup = -1; } - if (port >= E6000SW_MAX_PORTS) + if (port >= sc->num_ports) return (ENXIO); *pport = port; if (strncmp(portlabel, "cpu", 3) == 0) { - device_printf(dev, "CPU port at %d\n", port); + device_printf(sc->dev, "CPU port at %d\n", port); *cpu_mask |= (1 << port); - return (0); } fixed_link = OF_child(child); if (fixed_link) { *fixed_mask |= (1 << port); - device_printf(dev, "fixed port at %d\n", port); + device_printf(sc->dev, "fixed port at %d\n", port); } else { - device_printf(dev, "PHY at port %d\n", port); + device_printf(sc->dev, "PHY at port %d\n", port); } return (0); @@ -314,7 +331,7 @@ e6000sw_attach_miibus(e6000sw_softc_t *sc, int port) err = mii_attach(sc->dev, &sc->miibus[port], sc->ifp[port], e6000sw_ifmedia_upd, e6000sw_ifmedia_sts, BMSR_DEFCAPMASK, - port, MII_OFFSET_ANY, 0); + port + sc->phy_base, MII_OFFSET_ANY, 0); if (err != 0) return (err); @@ -343,7 +360,7 @@ e6000sw_attach(device_t dev) bzero(member_ports, sizeof(member_ports)); for (child = OF_child(sc->node); child != 0; child = OF_peer(child)) { - err = e6000sw_parse_child_fdt(dev, child, &sc->fixed_mask, + err = e6000sw_parse_child_fdt(sc, child, &sc->fixed_mask, &sc->cpuports_mask, &port, &vlangroup); if (err != 0) { device_printf(sc->dev, "failed to parse DTS\n"); @@ -353,7 +370,8 @@ e6000sw_attach(device_t dev) if (vlangroup != -1) member_ports[vlangroup] |= (1 << port); - sc->num_ports++; + /* Port is in use. */ + sc->ports_mask |= (1 << port); err = e6000sw_init_interface(sc, port); if (err != 0) { @@ -529,6 +547,17 @@ e6000sw_getinfo(device_t dev) return (ðerswitch_info); } +static int +e6000sw_getconf(device_t dev __unused, etherswitch_conf_t *conf) +{ + + /* Return the VLAN mode. */ + conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; + conf->vlan_mode = ETHERSWITCH_VLAN_PORT; + + return (0); +} + static void e6000sw_lock(device_t dev) { @@ -563,6 +592,8 @@ e6000sw_getport(device_t dev, etherswitch_port_t *p) if (p->es_port >= sc->num_ports || p->es_port < 0) return (EINVAL); + if (!e6000sw_is_portenabled(sc, p->es_port)) + return (0); err = 0; E6000SW_LOCK(sc); @@ -605,12 +636,15 @@ e6000sw_setport(device_t dev, etherswitch_port_t *p) if (p->es_port >= sc->num_ports || p->es_port < 0) return (EINVAL); + if (!e6000sw_is_portenabled(sc, p->es_port)) + return (0); err = 0; E6000SW_LOCK(sc); if (p->es_pvid != 0) e6000sw_set_pvid(sc, p->es_port, p->es_pvid); - if (!e6000sw_is_cpuport(sc, p->es_port)) { + if (!e6000sw_is_cpuport(sc, p->es_port) && + !e6000sw_is_fixedport(sc, p->es_port)) { mii = e6000sw_miiforphy(sc, p->es_port); err = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, &mii->mii_media, SIOCSIFMEDIA); @@ -780,8 +814,7 @@ e6000sw_setvgroup(device_t dev, etherswitch_vlangroup_ vg->es_untagged_ports &= PORT_VLAN_MAP_TABLE_MASK; fid = vg->es_vlangroup + 1; for (port = 0; port < sc->num_ports; port++) { - if ((sc->members[vg->es_vlangroup] & (1 << port)) || - (vg->es_untagged_ports & (1 << port))) + if ((sc->members[sc->vgroup[port]] & (1 << port))) e6000sw_flush_port(sc, port); if (vg->es_untagged_ports & (1 << port)) e6000sw_port_assign_vgroup(sc, port, fid, @@ -805,7 +838,8 @@ e6000sw_getvgroup(device_t dev, etherswitch_vlangroup_ return (EINVAL); vg->es_untagged_ports = vg->es_member_ports = sc->members[vg->es_vlangroup]; - vg->es_vid = ETHERSWITCH_VID_VALID; + if (vg->es_untagged_ports != 0) + vg->es_vid = ETHERSWITCH_VID_VALID; return (0); } @@ -936,6 +970,13 @@ e6000sw_is_phyport(e6000sw_softc_t *sc, int port) return ((phy_mask & (1 << port)) ? true : false); } +static __inline bool +e6000sw_is_portenabled(e6000sw_softc_t *sc, int port) +{ + + return ((sc->ports_mask & (1 << port)) ? true : false); +} + static __inline int e6000sw_set_pvid(e6000sw_softc_t *sc, int port, int pvid) { @@ -1010,7 +1051,8 @@ e6000sw_tick (void *arg) E6000SW_LOCK(sc); for (port = 0; port < sc->num_ports; port++) { /* Tick only on PHY ports */ - if (!e6000sw_is_phyport(sc, port)) + if (!e6000sw_is_portenabled(sc, port) || + !e6000sw_is_phyport(sc, port)) continue; mii = e6000sw_miiforphy(sc, port); @@ -1090,6 +1132,8 @@ e6000sw_port_vlan_conf(e6000sw_softc_t *sc) /* Set port priority */ for (port = 0; port < sc->num_ports; port++) { + if (!e6000sw_is_portenabled(sc, port)) + continue; ret = e6000sw_readreg(sc, REG_PORT(port), PORT_VID); ret &= ~PORT_VID_PRIORITY_MASK; e6000sw_writereg(sc, REG_PORT(port), PORT_VID, ret); @@ -1097,6 +1141,8 @@ e6000sw_port_vlan_conf(e6000sw_softc_t *sc) /* Set VID map */ for (port = 0; port < sc->num_ports; port++) { + if (!e6000sw_is_portenabled(sc, port)) + continue; ret = e6000sw_readreg(sc, REG_PORT(port), PORT_VID); ret &= ~PORT_VID_DEF_VID_MASK; ret |= (port + 1); @@ -1105,6 +1151,8 @@ e6000sw_port_vlan_conf(e6000sw_softc_t *sc) /* Enable all ports */ for (port = 0; port < sc->num_ports; port++) { + if (!e6000sw_is_portenabled(sc, port)) + continue; ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL); e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL, (ret | PORT_CONTROL_ENABLE)); From owner-svn-src-all@freebsd.org Tue Jun 13 01:05:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C255AD88308; Tue, 13 Jun 2017 01:05:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B94C2745; Tue, 13 Jun 2017 01:05:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5D15tFq091048; Tue, 13 Jun 2017 01:05:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5D15t1C091046; Tue, 13 Jun 2017 01:05:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706130105.v5D15t1C091046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Jun 2017 01:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319887 - in head: contrib/llvm/tools/lld/ELF 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 01:05:56 -0000 Author: emaste Date: Tue Jun 13 01:05:55 2017 New Revision: 319887 URL: https://svnweb.freebsd.org/changeset/base/319887 Log: hexdump: actually enter capability mode on last file Reviewed by: cem, Kyle Evans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10897 Modified: head/contrib/llvm/tools/lld/ELF/InputSection.cpp head/usr.bin/hexdump/display.c Modified: head/contrib/llvm/tools/lld/ELF/InputSection.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/InputSection.cpp Tue Jun 13 00:42:23 2017 (r319886) +++ head/contrib/llvm/tools/lld/ELF/InputSection.cpp Tue Jun 13 01:05:55 2017 (r319887) @@ -255,7 +255,7 @@ static uint32_t getARMUndefinedRelativeWeakVA(uint32_t uint32_t P) { switch (Type) { case R_ARM_THM_JUMP11: - return P + 2; + return P + 2 + A; case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_PC24: @@ -263,12 +263,12 @@ static uint32_t getARMUndefinedRelativeWeakVA(uint32_t case R_ARM_PREL31: case R_ARM_THM_JUMP19: case R_ARM_THM_JUMP24: - return P + 4; + return P + 4 + A; case R_ARM_THM_CALL: // We don't want an interworking BLX to ARM - return P + 5; + return P + 5 + A; default: - return A; + return P + A; } } @@ -279,9 +279,9 @@ static uint64_t getAArch64UndefinedRelativeWeakVA(uint case R_AARCH64_CONDBR19: case R_AARCH64_JUMP26: case R_AARCH64_TSTBR14: - return P + 4; + return P + 4 + A; default: - return A; + return P + A; } } Modified: head/usr.bin/hexdump/display.c ============================================================================== --- head/usr.bin/hexdump/display.c Tue Jun 13 00:42:23 2017 (r319886) +++ head/usr.bin/hexdump/display.c Tue Jun 13 01:05:55 2017 (r319887) @@ -361,12 +361,12 @@ next(char **argv) if (caph_limit_stream(fileno(stdin), CAPH_READ) < 0) err(1, "unable to restrict %s", - statok ? _argv[-1] : "stdin"); + statok ? *_argv : "stdin"); /* * We've opened our last input file; enter capsicum sandbox. */ - if (*_argv == NULL) { + if (statok == 0 || *(_argv + 1) == NULL) { if (cap_enter() < 0 && errno != ENOSYS) err(1, "unable to enter capability mode"); } From owner-svn-src-all@freebsd.org Tue Jun 13 01:12:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C164D8874F; Tue, 13 Jun 2017 01:12:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A5F12CB2; Tue, 13 Jun 2017 01:12:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5D1Cbb8094936; Tue, 13 Jun 2017 01:12:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5D1CbDZ094935; Tue, 13 Jun 2017 01:12:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201706130112.v5D1CbDZ094935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 13 Jun 2017 01:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319888 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 01:12:38 -0000 Author: ian Date: Tue Jun 13 01:12:37 2017 New Revision: 319888 URL: https://svnweb.freebsd.org/changeset/base/319888 Log: By popular demand: change MAKE_GENERIC_KERNELS to MAKE_LINT_KERNELS. It appears that the same arches that lack GENERIC kernel configs also lack LINT. But enough different arches get built to ensure a kernel change should build everywhere (32 and 64 bit, clang and old gcc, little and big endian). Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jun 13 01:05:55 2017 (r319887) +++ head/Makefile Tue Jun 13 01:12:37 2017 (r319888) @@ -522,8 +522,8 @@ TARGET!= uname -m .endif .if defined(MAKE_ALL_KERNELS) _THINNER=cat -.elif defined(MAKE_GENERIC_KERNELS) -_THINNER=grep "GENERIC" || true +.elif defined(MAKE_LINT_KERNELS) +_THINNER=grep 'LINT' || true .else _THINNER=xargs grep -L "^.NO_UNIVERSE" || true .endif From owner-svn-src-all@freebsd.org Tue Jun 13 01:13:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FD8FD88837; Tue, 13 Jun 2017 01:13:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F25E92E0D; Tue, 13 Jun 2017 01:13:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5D1DAYK095002; Tue, 13 Jun 2017 01:13:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5D1DALO095001; Tue, 13 Jun 2017 01:13:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201706130113.v5D1DALO095001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 13 Jun 2017 01:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319889 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 01:13:11 -0000 Author: gjb Date: Tue Jun 13 01:13:09 2017 New Revision: 319889 URL: https://svnweb.freebsd.org/changeset/base/319889 Log: Document r319884, make(1) version 20170510. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 13 01:12:37 2017 (r319888) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 13 01:13:09 2017 (r319889) @@ -362,6 +362,9 @@ &man.byacc.1; has been updated to version 20170201. + + bmake has + been updated to version 20170510. From owner-svn-src-all@freebsd.org Tue Jun 13 01:18:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D582D88CD8; Tue, 13 Jun 2017 01:18:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1E5430F5; Tue, 13 Jun 2017 01:17:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5D1HxFW095202; Tue, 13 Jun 2017 01:17:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5D1HxE5095201; Tue, 13 Jun 2017 01:17:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706130117.v5D1HxE5095201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Jun 2017 01:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319890 - head/sys/security/mac_bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 01:18:00 -0000 Author: emaste Date: Tue Jun 13 01:17:58 2017 New Revision: 319890 URL: https://svnweb.freebsd.org/changeset/base/319890 Log: Correct bitwise test in mac_bsdextended ugidfw_rule_valid() PR: 218039 CID: 1008934 Reported by: Coverity, PVS-Studio Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10300 Modified: head/sys/security/mac_bsdextended/mac_bsdextended.c Modified: head/sys/security/mac_bsdextended/mac_bsdextended.c ============================================================================== --- head/sys/security/mac_bsdextended/mac_bsdextended.c Tue Jun 13 01:13:09 2017 (r319889) +++ head/sys/security/mac_bsdextended/mac_bsdextended.c Tue Jun 13 01:17:58 2017 (r319890) @@ -125,7 +125,7 @@ ugidfw_rule_valid(struct mac_bsdextended_rule *rule) return (EINVAL); if ((rule->mbr_object.mbo_neg | MBO_ALL_FLAGS) != MBO_ALL_FLAGS) return (EINVAL); - if ((rule->mbr_object.mbo_neg | MBO_TYPE_DEFINED) && + if (((rule->mbr_object.mbo_flags & MBO_TYPE_DEFINED) != 0) && (rule->mbr_object.mbo_type | MBO_ALL_TYPE) != MBO_ALL_TYPE) return (EINVAL); if ((rule->mbr_mode | MBI_ALLPERM) != MBI_ALLPERM) From owner-svn-src-all@freebsd.org Tue Jun 13 01:25:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFEE1D891B1; Tue, 13 Jun 2017 01:25:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB29937BA; Tue, 13 Jun 2017 01:25:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5D1PJO0099316; Tue, 13 Jun 2017 01:25:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5D1PJxv099315; Tue, 13 Jun 2017 01:25:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706130125.v5D1PJxv099315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Jun 2017 01:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319891 - head/contrib/llvm/tools/lld/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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 01:25:21 -0000 Author: emaste Date: Tue Jun 13 01:25:19 2017 New Revision: 319891 URL: https://svnweb.freebsd.org/changeset/base/319891 Log: lld: revert accidentally committed change from r319887 This change is a portion of LLD rev 305212 which accidentally ended up in my svn tree. We do want to backport the change to LLD 4.0, but it needs additional work and was not supposed to be included in r319887. Modified: head/contrib/llvm/tools/lld/ELF/InputSection.cpp Modified: head/contrib/llvm/tools/lld/ELF/InputSection.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/InputSection.cpp Tue Jun 13 01:17:58 2017 (r319890) +++ head/contrib/llvm/tools/lld/ELF/InputSection.cpp Tue Jun 13 01:25:19 2017 (r319891) @@ -255,7 +255,7 @@ static uint32_t getARMUndefinedRelativeWeakVA(uint32_t uint32_t P) { switch (Type) { case R_ARM_THM_JUMP11: - return P + 2 + A; + return P + 2; case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_PC24: @@ -263,12 +263,12 @@ static uint32_t getARMUndefinedRelativeWeakVA(uint32_t case R_ARM_PREL31: case R_ARM_THM_JUMP19: case R_ARM_THM_JUMP24: - return P + 4 + A; + return P + 4; case R_ARM_THM_CALL: // We don't want an interworking BLX to ARM - return P + 5 + A; + return P + 5; default: - return P + A; + return A; } } @@ -279,9 +279,9 @@ static uint64_t getAArch64UndefinedRelativeWeakVA(uint case R_AARCH64_CONDBR19: case R_AARCH64_JUMP26: case R_AARCH64_TSTBR14: - return P + 4 + A; + return P + 4; default: - return P + A; + return A; } } From owner-svn-src-all@freebsd.org Tue Jun 13 05:38:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE077D8E9AD; Tue, 13 Jun 2017 05:38:41 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D5B16E4CE; Tue, 13 Jun 2017 05:38:41 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5D5ceP6003712; Tue, 13 Jun 2017 05:38:40 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5D5ceLC003711; Tue, 13 Jun 2017 05:38:40 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201706130538.v5D5ceLC003711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Tue, 13 Jun 2017 05:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319892 - head/bin/df X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 05:38:41 -0000 Author: phil Date: Tue Jun 13 05:38:40 2017 New Revision: 319892 URL: https://svnweb.freebsd.org/changeset/base/319892 Log: Use {T:Capacity} for header so html output looks tidy Submitted by: phil Approved by: sjg Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Tue Jun 13 01:25:19 2017 (r319891) +++ head/bin/df/df.c Tue Jun 13 05:38:40 2017 (r319892) @@ -490,7 +490,7 @@ prtstat(struct statfs *sfsp, struct maxwidths *mwp) xo_emit("{T:/%-*s}", mwp->mntfrom, "Filesystem"); if (Tflag) xo_emit(" {T:/%-*s}", mwp->fstype, "Type"); - xo_emit(" {T:/%*s} {T:/%*s} {T:/%*s} Capacity", + xo_emit(" {T:/%*s} {T:/%*s} {T:/%*s} {T:Capacity}", mwp->total, header, mwp->used, "Used", mwp->avail, "Avail"); if (iflag) { From owner-svn-src-all@freebsd.org Tue Jun 13 08:56:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F94BEE525 for ; Tue, 13 Jun 2017 08:56:38 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82F2173826; Tue, 13 Jun 2017 08:56:38 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id v5D8uaGk030499; Tue, 13 Jun 2017 10:56:36 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id B6BFD923; Tue, 13 Jun 2017 10:56:36 +0200 (CEST) Message-ID: <593FA8B7.3030805@omnilan.de> Date: Tue, 13 Jun 2017 10:56:23 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Warner Losh CC: svn-src-all@freebsd.org Subject: Re: svn commit: r304443 - head/sys/cam References: <201608190430.u7J4UTqU025924@repo.freebsd.org> <5818AE02.60502@omnilan.de> In-Reply-To: <5818AE02.60502@omnilan.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Tue, 13 Jun 2017 10:56:36 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 08:56:39 -0000 Bezüglich Harry Schmalzbauer's Nachricht vom 01.11.2016 16:00 (localtime): > Bezüglich Warner Losh's Nachricht vom 19.08.2016 06:30 (localtime): >> Author: imp >> Date: Fri Aug 19 04:30:29 2016 >> New Revision: 304443 >> URL: https://svnweb.freebsd.org/changeset/base/304443 >> >> Log: >> Improve the pattern matching so that internal *'s work, as well as >> [set] notation. This fixes pattern matching for recently added drives >> that would set the NCQ Trim being broken incorrectly. >> >> PR: 210686 >> Tested-by: Tomoaki AOKI >> MFC After: 3 days > Hasn't made it into 11.0, but also not in stable/11 yet? Just found a reminder at stable@: https://lists.freebsd.org/pipermail/freebsd-stable/2017-June/087240.html Is there any strong reason not to MFC? Thanks, -harry From owner-svn-src-all@freebsd.org Tue Jun 13 10:52:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 758F2BF0AE7; Tue, 13 Jun 2017 10:52:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47CCB76DFC; Tue, 13 Jun 2017 10:52:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DAqV7m036706; Tue, 13 Jun 2017 10:52:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DAqVnF036704; Tue, 13 Jun 2017 10:52:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201706131052.v5DAqVnF036704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 13 Jun 2017 10:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319895 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 10:52:32 -0000 Author: ae Date: Tue Jun 13 10:52:31 2017 New Revision: 319895 URL: https://svnweb.freebsd.org/changeset/base/319895 Log: Resurrect RTF_RNH_LOCKED flag and restore ability to call rtalloc1_fib() with acquired RIB lock. This fixes a possible panic due to trying to acquire RIB rlock when it is already exclusive locked. PR: 215963, 215122 MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Jun 13 10:38:28 2017 (r319894) +++ head/sys/net/route.c Tue Jun 13 10:52:31 2017 (r319895) @@ -454,18 +454,23 @@ rtalloc1_fib(struct sockaddr *dst, int report, u_long /* * Look up the address in the table for that Address Family */ - RIB_RLOCK(rh); + if ((ignflags & RTF_RNH_LOCKED) == 0) + RIB_RLOCK(rh); +#ifdef INVARIANTS + else + RIB_LOCK_ASSERT(rh); +#endif rn = rh->rnh_matchaddr(dst, &rh->head); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { newrt = RNTORT(rn); RT_LOCK(newrt); RT_ADDREF(newrt); - RIB_RUNLOCK(rh); + if ((ignflags & RTF_RNH_LOCKED) == 0) + RIB_RUNLOCK(rh); return (newrt); - } else + } else if ((ignflags & RTF_RNH_LOCKED) == 0) RIB_RUNLOCK(rh); - /* * Either we hit the root or could not find any match, * which basically means: "cannot get there from here". @@ -748,7 +753,9 @@ ifa_ifwithroute(int flags, const struct sockaddr *dst, if (ifa == NULL) ifa = ifa_ifwithnet(gateway, 0, fibnum); if (ifa == NULL) { - struct rtentry *rt = rtalloc1_fib(gateway, 0, 0, fibnum); + struct rtentry *rt; + + rt = rtalloc1_fib(gateway, 0, flags, fibnum); if (rt == NULL) return (NULL); /* @@ -1838,8 +1845,13 @@ rtrequest1_fib_change(struct rib_head *rnh, struct rt_ info->rti_info[RTAX_IFP] != NULL || (info->rti_info[RTAX_IFA] != NULL && !sa_equal(info->rti_info[RTAX_IFA], rt->rt_ifa->ifa_addr))) { - + /* + * XXX: Temporarily set RTF_RNH_LOCKED flag in the rti_flags + * to avoid rlock in the ifa_ifwithroute(). + */ + info->rti_flags |= RTF_RNH_LOCKED; error = rt_getifa_fib(info, fibnum); + info->rti_flags &= ~RTF_RNH_LOCKED; if (info->rti_ifa != NULL) free_ifa = 1; Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Tue Jun 13 10:38:28 2017 (r319894) +++ head/sys/net/route.h Tue Jun 13 10:52:31 2017 (r319895) @@ -189,7 +189,7 @@ struct rtentry { /* 0x8000000 and up unassigned */ #define RTF_STICKY 0x10000000 /* always route dst->src */ -#define RTF_RNH_LOCKED 0x40000000 /* unused */ +#define RTF_RNH_LOCKED 0x40000000 /* radix node head is locked */ #define RTF_GWFLAG_COMPAT 0x80000000 /* a compatibility bit for interacting with existing routing apps */ From owner-svn-src-all@freebsd.org Tue Jun 13 12:06:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBAA8BF2A44; Tue, 13 Jun 2017 12:06:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 509DB7920C; Tue, 13 Jun 2017 12:06:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v5DC6h0j024586 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 13 Jun 2017 15:06:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v5DC6h0j024586 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v5DC6hDT024585; Tue, 13 Jun 2017 15:06:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Jun 2017 15:06:43 +0300 From: Konstantin Belousov To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319874 - head/sys/kern Message-ID: <20170613120643.GX2088@kib.kiev.ua> References: <201706122111.v5CLBBUT092606@repo.freebsd.org> <20170612234356.GD50023@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170612234356.GD50023@FreeBSD.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 12:06:52 -0000 On Mon, Jun 12, 2017 at 04:43:56PM -0700, Gleb Smirnoff wrote: > On Mon, Jun 12, 2017 at 09:11:11PM +0000, Konstantin Belousov wrote: > K> Author: kib > K> Date: Mon Jun 12 21:11:11 2017 > K> New Revision: 319874 > K> URL: https://svnweb.freebsd.org/changeset/base/319874 > K> > K> Log: > K> Print unimplemented syscall number to the ctty on SIGSYS, if enabled > K> by the knob kern.lognosys. > > Why is it off by default? In some (non-default) situation it may cause lot of ctty output. I made the knob tunable to allow it to be set very early (init) if needed. From owner-svn-src-all@freebsd.org Tue Jun 13 12:07:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B86FBF2ABA; Tue, 13 Jun 2017 12:07:20 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45F6679350; Tue, 13 Jun 2017 12:07:20 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DC7JLC065382; Tue, 13 Jun 2017 12:07:19 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DC7Ih7065377; Tue, 13 Jun 2017 12:07:18 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201706131207.v5DC7Ih7065377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 13 Jun 2017 12:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319896 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 12:07:20 -0000 Author: mmel Date: Tue Jun 13 12:07:18 2017 New Revision: 319896 URL: https://svnweb.freebsd.org/changeset/base/319896 Log: Implement tunable CPU quirks. These quirks are intended for optimizing CPU performance, not for applying errata workarounds. Nobody can expect that CPU with unfixed errata is stable enough to execute the kernel until quirks are applied. MFC after: 3 weeks Modified: head/sys/arm/arm/cpuinfo.c head/sys/arm/arm/mp_machdep.c head/sys/arm/arm/pmap-v6.c head/sys/arm/include/cpuinfo.h head/sys/arm/include/pmap-v6.h Modified: head/sys/arm/arm/cpuinfo.c ============================================================================== --- head/sys/arm/arm/cpuinfo.c Tue Jun 13 10:52:31 2017 (r319895) +++ head/sys/arm/arm/cpuinfo.c Tue Jun 13 12:07:18 2017 (r319896) @@ -30,10 +30,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#if __ARM_ARCH >= 6 +void reinit_mmu(uint32_t ttb, uint32_t aux_clr, uint32_t aux_set); +#endif + struct cpuinfo cpuinfo = { /* Use safe defaults for start */ @@ -43,6 +48,30 @@ struct cpuinfo cpuinfo = .icache_line_mask = 31, }; +static SYSCTL_NODE(_hw, OID_AUTO, cpu, CTLFLAG_RD, 0, + "CPU"); +static SYSCTL_NODE(_hw_cpu, OID_AUTO, quirks, CTLFLAG_RD, 0, + "CPU quirks"); + +/* + * Tunable CPU quirks. + * Be careful, ACTRL cannot be changed if CPU is started in secure + * mode(world) and write to ACTRL can cause exception! + * These quirks are intended for optimizing CPU performance, not for + * applying errata workarounds. Nobody can expect that CPU with unfixed + * errata is stable enough to execute the kernel until quirks are applied. + */ +static uint32_t cpu_quirks_actlr_mask; +SYSCTL_INT(_hw_cpu_quirks, OID_AUTO, actlr_mask, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &cpu_quirks_actlr_mask, 0, + "Bits to be masked in ACTLR"); + +static uint32_t cpu_quirks_actlr_set; +SYSCTL_INT(_hw_cpu_quirks, OID_AUTO, actlr_set, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &cpu_quirks_actlr_set, 0, + "Bits to be set in ACTLR"); + + /* Read and parse CPU id scheme */ void cpuinfo_init(void) @@ -155,15 +184,17 @@ cpuinfo_init(void) #endif } +#if __ARM_ARCH >= 6 /* * Get bits that must be set or cleared in ACLR register. * Note: Bits in ACLR register are IMPLEMENTATION DEFINED. * Its expected that SCU is in operational state before this * function is called. */ -void +static void cpuinfo_get_actlr_modifier(uint32_t *actlr_mask, uint32_t *actlr_set) { + *actlr_mask = 0; *actlr_set = 0; @@ -238,3 +269,18 @@ cpuinfo_get_actlr_modifier(uint32_t *actlr_mask, uint3 return; } } + +/* Reinitialize MMU to final kernel mapping and apply all CPU quirks. */ +void +cpuinfo_reinit_mmu(uint32_t ttb) +{ + uint32_t actlr_mask; + uint32_t actlr_set; + + cpuinfo_get_actlr_modifier(&actlr_mask, &actlr_set); + actlr_mask |= cpu_quirks_actlr_mask; + actlr_set |= cpu_quirks_actlr_set; + reinit_mmu(ttb, actlr_mask, actlr_set); +} + +#endif /* __ARM_ARCH >= 6 */ Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Tue Jun 13 10:52:31 2017 (r319895) +++ head/sys/arm/arm/mp_machdep.c Tue Jun 13 12:07:18 2017 (r319896) @@ -154,11 +154,9 @@ init_secondary(int cpu) #ifndef INTRNG int start = 0, end = 0; #endif - uint32_t actlr_mask, actlr_set; pmap_set_tex(); - cpuinfo_get_actlr_modifier(&actlr_mask, &actlr_set); - reinit_mmu(pmap_kern_ttb, actlr_mask, actlr_set); + cpuinfo_reinit_mmu(pmap_kern_ttb); cpu_setup(); /* Provide stack pointers for other processor modes. */ Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Tue Jun 13 10:52:31 2017 (r319895) +++ head/sys/arm/arm/pmap-v6.c Tue Jun 13 12:07:18 2017 (r319896) @@ -763,7 +763,7 @@ pmap_bootstrap_prepare(vm_paddr_t last) pt1_entry_t *pte1p; pt2_entry_t *pte2p; u_int i; - uint32_t actlr_mask, actlr_set, l1_attr; + uint32_t l1_attr; /* * Now, we are going to make real kernel mapping. Note that we are @@ -880,8 +880,7 @@ pmap_bootstrap_prepare(vm_paddr_t last) /* Finally, switch from 'boot_pt1' to 'kern_pt1'. */ pmap_kern_ttb = base_pt1 | ttb_flags; - cpuinfo_get_actlr_modifier(&actlr_mask, &actlr_set); - reinit_mmu(pmap_kern_ttb, actlr_mask, actlr_set); + cpuinfo_reinit_mmu(pmap_kern_ttb); /* * Initialize the first available KVA. As kernel image is mapped by * sections, we are leaving some gap behind. Modified: head/sys/arm/include/cpuinfo.h ============================================================================== --- head/sys/arm/include/cpuinfo.h Tue Jun 13 10:52:31 2017 (r319895) +++ head/sys/arm/include/cpuinfo.h Tue Jun 13 12:07:18 2017 (r319896) @@ -124,5 +124,7 @@ struct cpuinfo { extern struct cpuinfo cpuinfo; void cpuinfo_init(void); -void cpuinfo_get_actlr_modifier(uint32_t *actlr_mask, uint32_t *actlr_set); +#if __ARM_ARCH >= 6 +void cpuinfo_reinit_mmu(uint32_t ttb); +#endif #endif /* _MACHINE_CPUINFO_H_ */ Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Tue Jun 13 10:52:31 2017 (r319895) +++ head/sys/arm/include/pmap-v6.h Tue Jun 13 12:07:18 2017 (r319896) @@ -176,7 +176,6 @@ vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t int pmap_fault(pmap_t, vm_offset_t, uint32_t, int, bool); void pmap_set_tex(void); -void reinit_mmu(ttb_entry_t ttb, u_int aux_clr, u_int aux_set); /* * Pre-bootstrap epoch functions set. From owner-svn-src-all@freebsd.org Tue Jun 13 12:08:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 416CFBF2B57; Tue, 13 Jun 2017 12:08:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAA3F794D5; Tue, 13 Jun 2017 12:08:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v5DC83g9024642 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 13 Jun 2017 15:08:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v5DC83g9024642 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v5DC83NP024641; Tue, 13 Jun 2017 15:08:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Jun 2017 15:08:03 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319868 - in head/sys: kern sys Message-ID: <20170613120803.GY2088@kib.kiev.ua> References: <201706122014.v5CKEitK071089@repo.freebsd.org> <20170612202952.GU2088@kib.kiev.ua> <20170612204704.GA73695@wkstn-mjohnston.west.isilon.com> <20170612213300.GV2088@kib.kiev.ua> <20170613002052.GC73695@wkstn-mjohnston.west.isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170613002052.GC73695@wkstn-mjohnston.west.isilon.com> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 12:08:09 -0000 On Mon, Jun 12, 2017 at 05:20:52PM -0700, Mark Johnston wrote: > On Tue, Jun 13, 2017 at 12:33:00AM +0300, Konstantin Belousov wrote: > > On Mon, Jun 12, 2017 at 01:47:05PM -0700, Mark Johnston wrote: > > > On Mon, Jun 12, 2017 at 11:29:52PM +0300, Konstantin Belousov wrote: > > > > On Mon, Jun 12, 2017 at 08:14:44PM +0000, Mark Johnston wrote: > > > > > +int > > > > > +uuidcmp(const struct uuid *uuid1, const struct uuid *uuid2) > > > > > +{ > > > > > + > > > > > + return (memcmp(uuid1, uuid2, sizeof(struct uuid))); > > > > > +} > > > > > > > > This is unsafe. The function operation depends on the ABI properties > > > > that there is no padding either between members, or at the end of > > > > the structure. Why not use by-member comparision ? > > > > > > I interpreted the CTASSERT at the beginning of kern_uuid.c as a > > > guarantee that no such padding will be present. kern_uuid.c also defines > > > an alternate representation, struct uuid_private, and casts between the > > > two. > > > > I agree, your addition is consistent with the other code in kern_uuid.c, > > which already depends on these features. At least it contradicts > > to what compiler authors try to teach C language users. > > > > BTW, does uuid_private low/mid/hi union split of ll depend on endianess ? > > It seems so. The current usage is ok because the two representations > aren't mixed. That is, ll is only used to access the time fields of the > global uuid_last, and the low/mid/hi fields are never used with > uuid_last. It does look like a bit of a landmine though; I think it > would be worth adding a small hint: > > diff --git a/sys/kern/kern_uuid.c b/sys/kern/kern_uuid.c > index 0953d901a592..78088e1c6f32 100644 > --- a/sys/kern/kern_uuid.c > +++ b/sys/kern/kern_uuid.c > @@ -58,7 +58,7 @@ CTASSERT(sizeof(struct uuid) == 16); > /* We use an alternative, more convenient representation in the generator. */ > struct uuid_private { > union { > - uint64_t ll; /* internal. */ > + uint64_t ll; /* internal, for uuid_last only */ > struct { > uint32_t low; > uint16_t mid; Indeed helpful, IMO. From owner-svn-src-all@freebsd.org Tue Jun 13 12:35:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2950CBF3432; Tue, 13 Jun 2017 12:35:02 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDD557A311; Tue, 13 Jun 2017 12:35:01 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DCZ1Ym077438; Tue, 13 Jun 2017 12:35:01 GMT (envelope-from gahr@FreeBSD.org) Received: (from gahr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DCZ1aR077437; Tue, 13 Jun 2017 12:35:01 GMT (envelope-from gahr@FreeBSD.org) Message-Id: <201706131235.v5DCZ1aR077437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gahr set sender to gahr@FreeBSD.org using -f From: Pietro Cerutti Date: Tue, 13 Jun 2017 12:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319897 - head/usr.bin/yes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 12:35:02 -0000 Author: gahr (ports committer) Date: Tue Jun 13 12:35:01 2017 New Revision: 319897 URL: https://svnweb.freebsd.org/changeset/base/319897 Log: Improve yes' throughput On my system, this brings up the throughput from ~20 to ~600 MiB/s. Inspired by: https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/ Reviewed by: cognet Approved by: cognet Modified: head/usr.bin/yes/yes.c Modified: head/usr.bin/yes/yes.c ============================================================================== --- head/usr.bin/yes/yes.c Tue Jun 13 12:07:18 2017 (r319896) +++ head/usr.bin/yes/yes.c Tue Jun 13 12:35:01 2017 (r319897) @@ -44,20 +44,42 @@ static const char rcsid[] = "$FreeBSD$"; #include #include #include +#include +#include int main(int argc, char **argv) { + char buf[8192]; + char y[2] = { 'y', '\n' }; + char * exp = y; + size_t buflen = 0; + size_t explen = sizeof(y); if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) err(1, "capsicum"); if (argc > 1) - while (puts(argv[1]) != EOF) - ; - else - while (puts("y") != EOF) - ; + { + exp = argv[1]; + explen = strlen(exp) + 1; + exp[explen - 1] = '\n'; + } + + if (explen <= sizeof(buf)) + { + while (buflen < sizeof(buf) - explen) + { + memcpy(buf + buflen, exp, explen); + buflen += explen; + } + exp = buf; + explen = buflen; + } + + while (write(STDOUT_FILENO, exp, explen) > 0) + ; + err(1, "stdout"); /*NOTREACHED*/ } From owner-svn-src-all@freebsd.org Tue Jun 13 12:44:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71261BF3683 for ; Tue, 13 Jun 2017 12:44:44 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x236.google.com (mail-yb0-x236.google.com [IPv6:2607:f8b0:4002:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 325867A7A6 for ; Tue, 13 Jun 2017 12:44:44 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x236.google.com with SMTP id f192so35221863yba.2 for ; Tue, 13 Jun 2017 05:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kIQz4RkVNKk5HfJ0RM5CeSEVQee0THgKvhq0CCMiL3A=; b=H/fPP8kZdLhHOvHCASn70hsNHp0ROu7spPrdp+w1CpA93Z267FsuJr2yVw6TGw5hcs ArJ6nOTBgr1kJ1Ivje5s3M/bE2LIdE6TIGguUioalvBFcCMmAdetVErk2XAGU+A7wD+M 60MKm8XLjCjC/R9u8+E6X8AhA4n9GwuIMjKKeQzrLBKGnu5YWjKuFTbmrWXm2uha4ZQE zb3KnzoauDuQ2tbjYLjhoSVXBuKHAwCW24imItASyioQeUJXZKsXMzpMmLHnVVTnIxc/ CtAO5foZhDdeQCL+rD5COJnuLKoetWzVF5NO/L4AIWMCrX7a61jyZVigMj6fYWJfQJnK pqLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kIQz4RkVNKk5HfJ0RM5CeSEVQee0THgKvhq0CCMiL3A=; b=Nq+jWolslvv35rZLEU9TmFz6jBf5IJBw0ofVbk1lMSnbBnVjeGr0eCqWBZtgFFYamB TFKn749BlFKJJ2ko+Ps3TrxCme0yDLOh2olCCgIo78Q7iYQIOxKI14Rcpze2a67BddCa nTmz17OjdDqrOOKqlUN+Ywo3sKak4UXXoFdz2yWiDAhS5w2deiRT6KaZh1RH9CuGc5jZ HlmfsIuYn7ZjTwqEmlLdIDx9pQmP85WlbDdUneOG4J4Wez+w+WKjhmBQAAD4WMBbiOHA CHSKjghTjOxI216P+jGnuHA1XhZBVuMflrbrTS8ImcoQnIhqDhhk5K6LUvZ1JXev8mIf Dm7w== X-Gm-Message-State: AKS2vOw/Q6FbVsNZ7cuUqu0uDXWMgi3R7jHxt6ww+t7JpeBCCnfzxsyY BxIx4IyEia5otKttkwo/NuuHwUOVNDH0 X-Received: by 10.37.128.198 with SMTP id c6mr2847935ybm.223.1497357883191; Tue, 13 Jun 2017 05:44:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.50.194 with HTTP; Tue, 13 Jun 2017 05:44:12 -0700 (PDT) In-Reply-To: <201706131235.v5DCZ1aR077437@repo.freebsd.org> References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> From: Ed Schouten Date: Tue, 13 Jun 2017 14:44:12 +0200 Message-ID: Subject: Re: svn commit: r319897 - head/usr.bin/yes To: Pietro Cerutti Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 12:44:44 -0000 2017-06-13 14:35 GMT+02:00 Pietro Cerutti : > + while (write(STDOUT_FILENO, exp, explen) > 0) > + ; How does this deal with partial writes? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-all@freebsd.org Tue Jun 13 13:26:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48FDBBF4734; Tue, 13 Jun 2017 13:26:51 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 102487BBCA; Tue, 13 Jun 2017 13:26:50 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DDQokf097492; Tue, 13 Jun 2017 13:26:50 GMT (envelope-from gahr@FreeBSD.org) Received: (from gahr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DDQorC097491; Tue, 13 Jun 2017 13:26:50 GMT (envelope-from gahr@FreeBSD.org) Message-Id: <201706131326.v5DDQorC097491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gahr set sender to gahr@FreeBSD.org using -f From: Pietro Cerutti Date: Tue, 13 Jun 2017 13:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319898 - head/usr.bin/yes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 13:26:51 -0000 Author: gahr (ports committer) Date: Tue Jun 13 13:26:50 2017 New Revision: 319898 URL: https://svnweb.freebsd.org/changeset/base/319898 Log: Handle partial writes Reported by: ed Reviewed by: cognet Approved by: cognet Modified: head/usr.bin/yes/yes.c Modified: head/usr.bin/yes/yes.c ============================================================================== --- head/usr.bin/yes/yes.c Tue Jun 13 12:35:01 2017 (r319897) +++ head/usr.bin/yes/yes.c Tue Jun 13 13:26:50 2017 (r319898) @@ -55,6 +55,8 @@ main(int argc, char **argv) char * exp = y; size_t buflen = 0; size_t explen = sizeof(y); + size_t more; + ssize_t ret; if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) err(1, "capsicum"); @@ -77,8 +79,10 @@ main(int argc, char **argv) explen = buflen; } - while (write(STDOUT_FILENO, exp, explen) > 0) - ; + more = explen; + while ((ret = write(STDOUT_FILENO, exp + (explen - more), more)) > 0) + if ((more -= ret) == 0) + more = explen; err(1, "stdout"); /*NOTREACHED*/ From owner-svn-src-all@freebsd.org Tue Jun 13 13:37:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82AEABF4B47; Tue, 13 Jun 2017 13:37:28 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from mail.ptrcrt.ch (gahr.cloud.tilaa.com [IPv6:2a02:2770:8:0:21a:4aff:fe7e:c6be]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA22D7C378; Tue, 13 Jun 2017 13:37:27 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from ptrcrt.ch (mail.ptrcrt.ch [192.168.1.1]) by mail.ptrcrt.ch (OpenSMTPD) with ESMTPS id 1c7e97da TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Tue, 13 Jun 2017 13:37:26 +0000 (UTC) Date: Tue, 13 Jun 2017 13:37:25 +0000 From: Pietro Cerutti To: Ed Schouten Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319897 - head/usr.bin/yes Message-ID: <20170613133725.olwxyq4dof6eln4y@ptrcrt.ch> Reply-To: Pietro Cerutti References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="k5v466r6adf3il3s" Content-Disposition: inline In-Reply-To: X-PGP-Key: fp="DA6D E106 A5B8 54B8 5DD8 6D49 ADD0 D38E A192 089E"; id="0xA192089E"; get=; get=; get=; get= OpenPGP: id=A192089E; url=https://gahr.ch/pgp/0xADD0D38EA192089E.txt; url=https://keybase.io/gahr/key.asc User-Agent: NeoMutt/20170609-19-442e59-dirty (1.8.3) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 13:37:28 -0000 --k5v466r6adf3il3s Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jun 13 17 14:44, Ed Schouten wrote: > 2017-06-13 14:35 GMT+02:00 Pietro Cerutti : > > + while (write(STDOUT_FILENO, exp, explen) > 0) > > + ; >=20 > How does this deal with partial writes? Thanks, that should be fixed in r319898. -- Pietro Cerutti The FreeBSD Project gahr@FreeBSD.org --k5v466r6adf3il3s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQLCBAABCgCsFiEE2m3hBqW4VLhd2G1JrdDTjqGSCJ4FAlk/6pEuFIAAAAAAFQAQ cGthLWFkZHJlc3NAZ251cGcub3JnZ2FockBGcmVlQlNELm9yZ18UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0REE2 REUxMDZBNUI4NTRCODVERDg2RDQ5QUREMEQzOEVBMTkyMDg5RQAKCRCt0NOOoZII ntyrD/9JpoBBOYxwCw7GjE1VLqoH5xEeu9u2qPQdZ+5plrFfF/0mlq6gN+izN4Oh SBfYydB0WifcFNRteVU/NJSUoSgHe6wlzyqJG6T2j3gfwXKZUfa2f5j73pG7kJC1 8UESJctfqvHZNTUhGH7bl0BG5x0sPhv5bRualCOE6HUMCBy1pCGhLdTXrLaZpdxT r5TvnJfJ7YENiioxgQJnufYuKbeV5qfT9gFnkT8DllWhUyWKvP8gLDQTp7cdbMFk 826oxbO3Nh9/z/QyJcZXrCuxzPahuzcHa3p+IvqG9GyQJyaImJGeSUMyJbqx/4gP qxxiZ6Gog/EMwya1fEvcP54jfhO2f+SZdSQ9xq3+H2kqxwYyht00O6q7WnMUdYW8 Ten+GboJcs85awb3DFMP5iSNDlg7pa5rhu9TZ7c9uMSFK/Hz19OrA7vyvhDYfF7O oCkt4uGlwgaf996VTUbf8VV1Eal+8f5ZjbX3cnlaIFcZZShmoIVVH0enscr+XoJG VVtFzH6TOC2ib+nSh/LLpzp8dkmyZipQvSdEyQe2EqDsRiQkKebd0XegvrPNf8Cm TYfQZTTTb8ICiCUxjjK+WhzYW0Bi0SzxvolI25/FlNqi9pX8ziZy5MjysQXFgjC9 ujlJBSiXy3Svv48WLkq1j1E/e5FW1L9NTvvr02qFf0HzRnaphw== =tHGC -----END PGP SIGNATURE----- --k5v466r6adf3il3s-- From owner-svn-src-all@freebsd.org Tue Jun 13 14:07:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96F63BF5975; Tue, 13 Jun 2017 14:07:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 620177D338; Tue, 13 Jun 2017 14:07:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DE7DHU014261; Tue, 13 Jun 2017 14:07:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DE7DYI014260; Tue, 13 Jun 2017 14:07:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201706131407.v5DE7DYI014260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 13 Jun 2017 14:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319899 - head/sys/modules/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 14:07:14 -0000 Author: ian Date: Tue Jun 13 14:07:13 2017 New Revision: 319899 URL: https://svnweb.freebsd.org/changeset/base/319899 Log: Add missing header dependencies (based on looking in the .depend file). Reported by: gjb Modified: head/sys/modules/ffec/Makefile Modified: head/sys/modules/ffec/Makefile ============================================================================== --- head/sys/modules/ffec/Makefile Tue Jun 13 13:26:50 2017 (r319898) +++ head/sys/modules/ffec/Makefile Tue Jun 13 14:07:13 2017 (r319899) @@ -3,6 +3,6 @@ .PATH: ${SRCTOP}/sys/dev/ffec KMOD= if_ffec -SRCS= if_ffec.c miibus_if.h device_if.h bus_if.h pci_if.h +SRCS= if_ffec.c miibus_if.h device_if.h bus_if.h pci_if.h ofw_bus_if.h opt_global.h .include From owner-svn-src-all@freebsd.org Tue Jun 13 14:57:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3730ABF6BD4; Tue, 13 Jun 2017 14:57:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 117607EE5A; Tue, 13 Jun 2017 14:57:48 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DEvmTV034966; Tue, 13 Jun 2017 14:57:48 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DEvmiu034965; Tue, 13 Jun 2017 14:57:48 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201706131457.v5DEvmiu034965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 13 Jun 2017 14:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319900 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 14:57:49 -0000 Author: asomers Date: Tue Jun 13 14:57:48 2017 New Revision: 319900 URL: https://svnweb.freebsd.org/changeset/base/319900 Log: sbin/ipfw: strcpy, strncpy => strlcpy Reported by: Coverity CID: 1356162, 1356166 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D10662 Modified: head/sbin/ipfw/dummynet.c Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Tue Jun 13 14:07:13 2017 (r319899) +++ head/sbin/ipfw/dummynet.c Tue Jun 13 14:57:48 2017 (r319900) @@ -805,8 +805,7 @@ read_bandwidth(char *arg, int *bandwidth, char *if_nam warn("interface name truncated"); namelen--; /* interface name */ - strncpy(if_name, arg, namelen); - if_name[namelen] = '\0'; + strlcpy(if_name, arg, namelen); *bandwidth = 0; } else { /* read bandwidth value */ int bw; @@ -933,8 +932,7 @@ load_extra_delays(const char *filename, struct dn_prof } else if (!strcasecmp(name, ED_TOK_NAME)) { if (profile_name[0] != '\0') errx(ED_EFMT("duplicated token: %s"), name); - strncpy(profile_name, arg, sizeof(profile_name) - 1); - profile_name[sizeof(profile_name)-1] = '\0'; + strlcpy(profile_name, arg, sizeof(profile_name)); do_points = 0; } else if (!strcasecmp(name, ED_TOK_DELAY)) { if (do_points) @@ -1005,7 +1003,7 @@ load_extra_delays(const char *filename, struct dn_prof } p->samples_no = samples; p->loss_level = loss * samples; - strncpy(p->name, profile_name, sizeof(p->name)); + strlcpy(p->name, profile_name, sizeof(p->name)); } #ifdef NEW_AQM @@ -1568,7 +1566,8 @@ end_mask: fs->flags &= ~(DN_IS_RED|DN_IS_GENTLE_RED); fs->flags |= DN_IS_AQM; - strcpy(aqm_extra->name,av[-1]); + strlcpy(aqm_extra->name, av[-1], + sizeof(aqm_extra->name)); aqm_extra->oid.subtype = DN_AQM_PARAMS; process_extra_parms(&ac, av, aqm_extra, tok); @@ -1580,7 +1579,8 @@ end_mask: errx(EX_DATAERR, "use type before fq_codel/fq_pie"); NEED(sch, "fq_codel/fq_pie is only for schd"); - strcpy(sch_extra->name,av[-1]); + strlcpy(sch_extra->name, av[-1], + sizeof(sch_extra->name)); sch_extra->oid.subtype = DN_SCH_PARAMS; process_extra_parms(&ac, av, sch_extra, tok); break; @@ -1649,14 +1649,15 @@ end_mask: l = strlen(av[0]); if (l == 0 || l > 15) errx(1, "type %s too long\n", av[0]); - strcpy(sch->name, av[0]); + strlcpy(sch->name, av[0], sizeof(sch->name)); sch->oid.subtype = 0; /* use string */ #ifdef NEW_AQM /* if fq_codel is selected, consider all tokens after it * as parameters */ if (!strcasecmp(av[0],"fq_codel") || !strcasecmp(av[0],"fq_pie")){ - strcpy(sch_extra->name,av[0]); + strlcpy(sch_extra->name, av[0], + sizeof(sch_extra->name)); sch_extra->oid.subtype = DN_SCH_PARAMS; process_extra_parms(&ac, av, sch_extra, tok); } else { From owner-svn-src-all@freebsd.org Tue Jun 13 15:23:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83458BF769B; Tue, 13 Jun 2017 15:23:50 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 532837FE3C; Tue, 13 Jun 2017 15:23:50 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DFNnZ9047054; Tue, 13 Jun 2017 15:23:49 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DFNnm3047053; Tue, 13 Jun 2017 15:23:49 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201706131523.v5DFNnm3047053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 13 Jun 2017 15:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319901 - stable/11/usr.sbin/sesutil X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 15:23:50 -0000 Author: allanjude Date: Tue Jun 13 15:23:49 2017 New Revision: 319901 URL: https://svnweb.freebsd.org/changeset/base/319901 Log: MFC r319610: usr.sbin/sesutil: correct 'locate all off' to deactivate empty slot LEDs PR: 217409 Approved by: re (marius) Modified: stable/11/usr.sbin/sesutil/sesutil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/sesutil/sesutil.c ============================================================================== --- stable/11/usr.sbin/sesutil/sesutil.c Tue Jun 13 14:57:48 2017 (r319900) +++ stable/11/usr.sbin/sesutil/sesutil.c Tue Jun 13 15:23:49 2017 (r319901) @@ -252,6 +252,10 @@ sesled(int argc, char **argv, bool setfault) break; } for (j = 0; j < nobj; j++) { + if (all) { + do_led(fd, objp[j].elm_idx, onoff, setfault); + continue; + } memset(&objdn, 0, sizeof(objdn)); objdn.elm_idx = objp[j].elm_idx; objdn.elm_names_size = 128; @@ -265,11 +269,6 @@ sesled(int argc, char **argv, bool setfault) continue; } if (objdn.elm_names_len > 0) { - if (all) { - do_led(fd, objdn.elm_idx, - onoff, setfault); - continue; - } if (disk_match(objdn.elm_devnames, disk, len)) { do_led(fd, objdn.elm_idx, onoff, setfault); From owner-svn-src-all@freebsd.org Tue Jun 13 15:37:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9C69BF7A6D; Tue, 13 Jun 2017 15:37:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 885878049D; Tue, 13 Jun 2017 15:37:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DFb4kS051261; Tue, 13 Jun 2017 15:37:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DFb4Pc051260; Tue, 13 Jun 2017 15:37:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706131537.v5DFb4Pc051260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Jun 2017 15:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319902 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 15:37:05 -0000 Author: markj Date: Tue Jun 13 15:37:04 2017 New Revision: 319902 URL: https://svnweb.freebsd.org/changeset/base/319902 Log: Hint at the intended usage for the "ll" field of struct uuid_private. Discussed with: kib MFC after: 1 week Modified: head/sys/kern/kern_uuid.c Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Tue Jun 13 15:23:49 2017 (r319901) +++ head/sys/kern/kern_uuid.c Tue Jun 13 15:37:04 2017 (r319902) @@ -58,7 +58,7 @@ CTASSERT(sizeof(struct uuid) == 16); /* We use an alternative, more convenient representation in the generator. */ struct uuid_private { union { - uint64_t ll; /* internal. */ + uint64_t ll; /* internal, for uuid_last only */ struct { uint32_t low; uint16_t mid; From owner-svn-src-all@freebsd.org Tue Jun 13 15:50:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB433BF7F8C; Tue, 13 Jun 2017 15:50:17 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BB6080B34; Tue, 13 Jun 2017 15:50:17 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DFoGVF055274; Tue, 13 Jun 2017 15:50:16 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DFoGTU055273; Tue, 13 Jun 2017 15:50:16 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201706131550.v5DFoGTU055273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Tue, 13 Jun 2017 15:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319903 - head/usr.bin/finger X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 15:50:17 -0000 Author: stevek Date: Tue Jun 13 15:50:16 2017 New Revision: 319903 URL: https://svnweb.freebsd.org/changeset/base/319903 Log: The variable nargv is allocated but never freed, so free it when the it is no longer used. Submitted by: Thomas Rix Reviewed by: ed Approved by: sjg (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9652 Modified: head/usr.bin/finger/finger.c Modified: head/usr.bin/finger/finger.c ============================================================================== --- head/usr.bin/finger/finger.c Tue Jun 13 15:37:04 2017 (r319902) +++ head/usr.bin/finger/finger.c Tue Jun 13 15:50:16 2017 (r319903) @@ -371,6 +371,7 @@ net: for (p = nargv; *p;) { printf("\n"); } + free(nargv); free(used); if (entries == 0) return; From owner-svn-src-all@freebsd.org Tue Jun 13 16:19:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6CB5BF8914; Tue, 13 Jun 2017 16:19:33 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96E6081C77; Tue, 13 Jun 2017 16:19:33 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DGJWRn067836; Tue, 13 Jun 2017 16:19:32 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DGJWlK067835; Tue, 13 Jun 2017 16:19:32 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201706131619.v5DGJWlK067835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 13 Jun 2017 16:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319904 - head/usr.bin/yes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 16:19:33 -0000 Author: cognet Date: Tue Jun 13 16:19:32 2017 New Revision: 319904 URL: https://svnweb.freebsd.org/changeset/base/319904 Log: style(9) fixes. Reported by: cem Modified: head/usr.bin/yes/yes.c Modified: head/usr.bin/yes/yes.c ============================================================================== --- head/usr.bin/yes/yes.c Tue Jun 13 15:50:16 2017 (r319903) +++ head/usr.bin/yes/yes.c Tue Jun 13 16:19:32 2017 (r319904) @@ -61,17 +61,14 @@ main(int argc, char **argv) if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) err(1, "capsicum"); - if (argc > 1) - { + if (argc > 1) { exp = argv[1]; explen = strlen(exp) + 1; exp[explen - 1] = '\n'; } - if (explen <= sizeof(buf)) - { - while (buflen < sizeof(buf) - explen) - { + if (explen <= sizeof(buf)) { + while (buflen < sizeof(buf) - explen) { memcpy(buf + buflen, exp, explen); buflen += explen; } From owner-svn-src-all@freebsd.org Tue Jun 13 16:37:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 918C9BF92AE; Tue, 13 Jun 2017 16:37:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62BA18279D; Tue, 13 Jun 2017 16:37:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 56AB01B676; Tue, 13 Jun 2017 16:37:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id EF9FD1FD3; Tue, 13 Jun 2017 16:37:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id JDb1w4nWf20Q; Tue, 13 Jun 2017 16:37:48 +0000 (UTC) Subject: Re: svn commit: r319897 - head/usr.bin/yes DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 6A3CE1FCE To: Pietro Cerutti , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Tue, 13 Jun 2017 09:37:40 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <201706131235.v5DCZ1aR077437@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G9ANrb6WwfJ1XQQi8UuiLlBP5PfoW50QW" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 16:37:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --G9ANrb6WwfJ1XQQi8UuiLlBP5PfoW50QW Content-Type: multipart/mixed; boundary="pL7vgUXcv4VdRfEKgBqD352ivvo7hXnN6"; protected-headers="v1" From: Bryan Drewery To: Pietro Cerutti , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r319897 - head/usr.bin/yes References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> In-Reply-To: <201706131235.v5DCZ1aR077437@repo.freebsd.org> --pL7vgUXcv4VdRfEKgBqD352ivvo7hXnN6 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/13/2017 5:35 AM, Pietro Cerutti wrote: > Author: gahr (ports committer) > Date: Tue Jun 13 12:35:01 2017 > New Revision: 319897 > URL: https://svnweb.freebsd.org/changeset/base/319897 >=20 > Log: > Improve yes' throughput > =20 > On my system, this brings up the throughput from ~20 to ~600 MiB/s. > =20 > Inspired by: https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu= _yes_so_fast/ > =20 > Reviewed by: cognet > Approved by: cognet >=20 > Modified: > head/usr.bin/yes/yes.c >=20 > Modified: head/usr.bin/yes/yes.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/yes/yes.c Tue Jun 13 12:07:18 2017 (r319896) > +++ head/usr.bin/yes/yes.c Tue Jun 13 12:35:01 2017 (r319897) > @@ -44,20 +44,42 @@ static const char rcsid[] =3D "$FreeBSD$"; > #include > #include > #include > +#include > +#include > =20 > int > main(int argc, char **argv) > { > + char buf[8192]; 8192 feels arbitrary but it has a purpose. Shouldn't it be based on PAGE_SIZE or something? > + char y[2] =3D { 'y', '\n' }; > + char * exp =3D y; > + size_t buflen =3D 0; > + size_t explen =3D sizeof(y); More style bugs here > =20 > if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno !=3D ENOSYS))= > err(1, "capsicum"); > =20 > if (argc > 1) > - while (puts(argv[1]) !=3D EOF) > - ; > - else > - while (puts("y") !=3D EOF) > - ; > + { > + exp =3D argv[1]; > + explen =3D strlen(exp) + 1; > + exp[explen - 1] =3D '\n'; > + } > + > + if (explen <=3D sizeof(buf)) > + { > + while (buflen < sizeof(buf) - explen) > + { > + memcpy(buf + buflen, exp, explen); > + buflen +=3D explen; > + } > + exp =3D buf; > + explen =3D buflen; > + } > + > + while (write(STDOUT_FILENO, exp, explen) > 0) > + ; > + > err(1, "stdout"); > /*NOTREACHED*/ > } >=20 --=20 Regards, Bryan Drewery --pL7vgUXcv4VdRfEKgBqD352ivvo7hXnN6-- --G9ANrb6WwfJ1XQQi8UuiLlBP5PfoW50QW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZQBTbAAoJEDXXcbtuRpfPE+sH/0v+v1ZatSCHsuIQHQQjfUEZ 5xXgWjASh686BsjcU/K5An0Gmg/WeKk0Jkk0CUUWW7omZ2Ufobq5vnzzdriqqwgt eeL9gr8sXFmiRzhGzrCAYK7lRRrj+bEM1f/Tj5IInO+1hDm7r0VQP5pHnyFRmmtR hIjb8Lq5s4PZa2VpK09euj47VlB3wloylm686vt+sLgB6TUcaNXcLuWpkP5BgbvR I+7aLut5S02Lewt+kU+jpmFhVaT/c3kHJBJbXGr1ZBTTgvKSB4dru/Yg8K0/SDG3 bWgYTRj3299le2SSFLbCJeY3IUqTHr6QjEuzfn1M2Sa2Wko6DuYdW3zxxHmMZlQ= =FS2V -----END PGP SIGNATURE----- --G9ANrb6WwfJ1XQQi8UuiLlBP5PfoW50QW-- From owner-svn-src-all@freebsd.org Tue Jun 13 17:49:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 423E8BFAAE0; Tue, 13 Jun 2017 17:49:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F120B8C0; Tue, 13 Jun 2017 17:49:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DHno8C006487; Tue, 13 Jun 2017 17:49:50 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DHnnVm006485; Tue, 13 Jun 2017 17:49:49 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706131749.v5DHnnVm006485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 13 Jun 2017 17:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319905 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 17:49:51 -0000 Author: alc Date: Tue Jun 13 17:49:49 2017 New Revision: 319905 URL: https://svnweb.freebsd.org/changeset/base/319905 Log: Reduce the frequency of hint updates on allocation without incurring additional allocation overhead. Previously, blst_meta_alloc() updated the hint after every successful allocation. However, these "eager" hint updates are of no actual benefit if, instead, the "lazy" hint update at the start of blst_meta_alloc() is generalized to handle all cases where the number of available blocks is less than the requested allocation. Previously, the lazy hint update at the start of blst_meta_alloc() only handled the ALL-FULL case. (I would also note that this change provides consistency between blist_alloc() and blist_fill() in that their hint maintenance is now entirely lazy.) Eliminate unnecessary checks for terminators in blst_meta_alloc() and blst_meta_fill() when handling ALL-FREE meta nodes. Eliminate the field "bl_free" from struct blist. It is redundant. Unless the entire radix tree is a single leaf, the count of free blocks is stored in the root node. Instead, provide a function blist_avail() for obtaining the number of free blocks. In blst_meta_alloc(), perform a sanity check on the allocation once rather than repeating it in a loop over the meta node's children. In blst_leaf_fill(), use the optimized bitcount*() function instead of a loop to count the blocks being allocated. Add or improve several comments. Address some nearby style errors. Reviewed by: kib MFC after: 6 weeks Differential Revision: https://reviews.freebsd.org/D11146 Modified: head/sys/kern/subr_blist.c head/sys/sys/blist.h Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Tue Jun 13 16:19:32 2017 (r319904) +++ head/sys/kern/subr_blist.c Tue Jun 13 17:49:49 2017 (r319905) @@ -106,6 +106,7 @@ __FBSDID("$FreeBSD$"); #include #include +#define bitcount64(x) __bitcount64((uint64_t)(x)) #define malloc(a,b,c) calloc(a, 1) #define free(a,b) free(a) @@ -169,7 +170,7 @@ blist_create(daddr_t blocks, int flags) skip = (skip + 1) * BLIST_META_RADIX; } - bl = malloc(sizeof(struct blist), M_SWAP, flags | M_ZERO); + bl = malloc(sizeof(struct blist), M_SWAP, flags); if (bl == NULL) return (NULL); @@ -207,7 +208,7 @@ blist_destroy(blist_t bl) } /* - * blist_alloc() - reserve space in the block bitmap. Return the base + * blist_alloc() - reserve space in the block bitmap. Return the base * of a contiguous region or SWAPBLK_NONE if space could * not be allocated. */ @@ -215,20 +216,34 @@ blist_destroy(blist_t bl) daddr_t blist_alloc(blist_t bl, daddr_t count) { - daddr_t blk = SWAPBLK_NONE; + daddr_t blk; - if (bl) { + if (bl != NULL && count <= bl->bl_root->bm_bighint) { if (bl->bl_radix == BLIST_BMAP_RADIX) blk = blst_leaf_alloc(bl->bl_root, 0, count); else - blk = blst_meta_alloc(bl->bl_root, 0, count, bl->bl_radix, bl->bl_skip); - if (blk != SWAPBLK_NONE) - bl->bl_free -= count; + blk = blst_meta_alloc(bl->bl_root, 0, count, + bl->bl_radix, bl->bl_skip); + return (blk); } - return(blk); + return (SWAPBLK_NONE); } /* + * blist_avail() - return the number of free blocks. + */ + +daddr_t +blist_avail(blist_t bl) +{ + + if (bl->bl_radix == BLIST_BMAP_RADIX) + return (bitcount64(bl->bl_root->u.bmu_bitmap)); + else + return (bl->bl_root->u.bmu_avail); +} + +/* * blist_free() - free up space in the block bitmap. Return the base * of a contiguous region. Panic if an inconsistancy is * found. @@ -241,8 +256,8 @@ blist_free(blist_t bl, daddr_t blkno, daddr_t count) if (bl->bl_radix == BLIST_BMAP_RADIX) blst_leaf_free(bl->bl_root, blkno, count); else - blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix, bl->bl_skip, 0); - bl->bl_free += count; + blst_meta_free(bl->bl_root, blkno, count, + bl->bl_radix, bl->bl_skip, 0); } } @@ -264,10 +279,9 @@ blist_fill(blist_t bl, daddr_t blkno, daddr_t count) else filled = blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix, bl->bl_skip, 0); - bl->bl_free -= filled; - return filled; - } else - return 0; + return (filled); + } + return (0); } /* @@ -417,27 +431,32 @@ blst_meta_alloc( daddr_t radix, int skip ) { + daddr_t r; int i; int next_skip = ((u_int)skip / BLIST_META_RADIX); - if (scan->u.bmu_avail == 0) { + if (scan->u.bmu_avail < count) { /* - * ALL-ALLOCATED special case + * The meta node's hint must be too large if the allocation + * exceeds the number of free blocks. Reduce the hint, and + * return failure. */ - scan->bm_bighint = 0; - return(SWAPBLK_NONE); + scan->bm_bighint = scan->u.bmu_avail; + return (SWAPBLK_NONE); } + /* + * An ALL-FREE meta node requires special handling before allocating + * any of its blocks. + */ if (scan->u.bmu_avail == radix) { radix /= BLIST_META_RADIX; /* - * ALL-FREE special case, initialize uninitialize - * sublevel. + * Reinitialize each of the meta node's children. An ALL-FREE + * meta node cannot have a terminator in any subtree. */ for (i = 1; i <= skip; i += next_skip) { - if (scan[i].bm_bighint == (daddr_t)-1) - break; if (next_skip == 1) { scan[i].u.bmu_bitmap = (u_daddr_t)-1; scan[i].bm_bighint = BLIST_BMAP_RADIX; @@ -450,34 +469,33 @@ blst_meta_alloc( radix /= BLIST_META_RADIX; } + if (count > radix) { + /* + * The allocation exceeds the number of blocks that are + * managed by a subtree of this meta node. + */ + panic("allocation too large"); + } for (i = 1; i <= skip; i += next_skip) { if (count <= scan[i].bm_bighint) { /* - * count fits in object + * The allocation might fit in the i'th subtree. */ - daddr_t r; if (next_skip == 1) { r = blst_leaf_alloc(&scan[i], blk, count); } else { - r = blst_meta_alloc(&scan[i], blk, count, radix, next_skip - 1); + r = blst_meta_alloc(&scan[i], blk, count, + radix, next_skip - 1); } if (r != SWAPBLK_NONE) { scan->u.bmu_avail -= count; - if (scan->bm_bighint > scan->u.bmu_avail) - scan->bm_bighint = scan->u.bmu_avail; - return(r); + return (r); } } else if (scan[i].bm_bighint == (daddr_t)-1) { /* * Terminator */ break; - } else if (count > radix) { - /* - * count does not fit in object even if it were - * complete free. - */ - panic("blist_meta_alloc: allocation too large"); } blk += radix; } @@ -736,18 +754,16 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count) { int n = blk & (BLIST_BMAP_RADIX - 1); daddr_t nblks; - u_daddr_t mask, bitmap; + u_daddr_t mask; mask = ((u_daddr_t)-1 << n) & ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - count - n)); - /* Count the number of blocks we're about to allocate */ - bitmap = scan->u.bmu_bitmap & mask; - for (nblks = 0; bitmap != 0; nblks++) - bitmap &= bitmap - 1; + /* Count the number of blocks that we are allocating. */ + nblks = bitcount64(scan->u.bmu_bitmap & mask); scan->u.bmu_bitmap &= ~mask; - return nblks; + return (nblks); } /* @@ -771,8 +787,13 @@ blst_meta_fill( int next_skip = ((u_int)skip / BLIST_META_RADIX); daddr_t nblks = 0; - if (count > radix) - panic("blist_meta_fill: allocation too large"); + if (count > radix) { + /* + * The allocation exceeds the number of blocks that are + * managed by this meta node. + */ + panic("allocation too large"); + } if (count == radix || scan->u.bmu_avail == 0) { /* * ALL-ALLOCATED special case @@ -783,15 +804,18 @@ blst_meta_fill( return nblks; } + /* + * An ALL-FREE meta node requires special handling before allocating + * any of its blocks. + */ if (scan->u.bmu_avail == radix) { radix /= BLIST_META_RADIX; /* - * ALL-FREE special case, initialize sublevel + * Reinitialize each of the meta node's children. An ALL-FREE + * meta node cannot have a terminator in any subtree. */ for (i = 1; i <= skip; i += next_skip) { - if (scan[i].bm_bighint == (daddr_t)-1) - break; if (next_skip == 1) { scan[i].u.bmu_bitmap = (u_daddr_t)-1; scan[i].bm_bighint = BLIST_BMAP_RADIX; @@ -1020,7 +1044,7 @@ main(int ac, char **av) long long da = 0; long long count = 0; - printf("%lld/%lld/%lld> ", (long long)bl->bl_free, + printf("%lld/%lld/%lld> ", (long long)blist_avail(bl), (long long)size, (long long)bl->bl_radix); fflush(stdout); if (fgets(buf, sizeof(buf), stdin) == NULL) Modified: head/sys/sys/blist.h ============================================================================== --- head/sys/sys/blist.h Tue Jun 13 16:19:32 2017 (r319904) +++ head/sys/sys/blist.h Tue Jun 13 17:49:49 2017 (r319905) @@ -82,7 +82,6 @@ typedef struct blist { daddr_t bl_blocks; /* area of coverage */ daddr_t bl_radix; /* coverage radix */ daddr_t bl_skip; /* starting skip */ - daddr_t bl_free; /* number of free blocks */ blmeta_t *bl_root; /* root of radix tree */ } *blist_t; @@ -92,6 +91,7 @@ typedef struct blist { #define BLIST_MAX_ALLOC BLIST_BMAP_RADIX daddr_t blist_alloc(blist_t blist, daddr_t count); +daddr_t blist_avail(blist_t blist); blist_t blist_create(daddr_t blocks, int flags); void blist_destroy(blist_t blist); daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count); From owner-svn-src-all@freebsd.org Tue Jun 13 18:35:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A547BFB81B; Tue, 13 Jun 2017 18:35:16 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDB4A207D; Tue, 13 Jun 2017 18:35:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DIZFtc026620; Tue, 13 Jun 2017 18:35:15 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DIZFLA026619; Tue, 13 Jun 2017 18:35:15 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706131835.v5DIZFLA026619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 13 Jun 2017 18:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319906 - head/sys/dev/etherswitch/e6000sw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 18:35:16 -0000 Author: zbb Date: Tue Jun 13 18:35:14 2017 New Revision: 319906 URL: https://svnweb.freebsd.org/changeset/base/319906 Log: Prevent multiple lock initialization in e6000sw probe r319886 ("Add the initial support for the Marvell 88E6141 and 88E6341 switches.") unveiled a problem with possible multiple lock creation. Move its initialization to the driver attach and for obtaining the switch ID create a temprorary one, which is immediately destroyed after the check. Submitted by: Zbigniew Bodek Marcin Wojtas Obtained from: Semihalf Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Tue Jun 13 17:49:49 2017 (r319905) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Tue Jun 13 18:35:14 2017 (r319906) @@ -217,11 +217,15 @@ e6000sw_probe(device_t dev) if (sc->sw_addr != 0 && (sc->sw_addr % 2) == 0) sc->multi_chip = true; - /* Lock is necessary due to assertions. */ - sx_init(&sc->sx, "e6000sw"); + /* + * Create temporary lock, just to satisfy assertions, + * when obtaining the switch ID. Destroy immediately afterwards. + */ + sx_init(&sc->sx, "e6000sw_tmp"); E6000SW_LOCK(sc); id = e6000sw_readreg(sc, REG_PORT(0), SWITCH_ID); E6000SW_UNLOCK(sc); + sx_destroy(&sc->sx); switch (id & 0xfff0) { case 0x3400: @@ -247,7 +251,6 @@ e6000sw_probe(device_t dev) sc->num_ports = 7; break; default: - sx_destroy(&sc->sx); device_printf(dev, "Unrecognized device, id 0x%x.\n", id); return (ENXIO); } @@ -354,6 +357,8 @@ e6000sw_attach(device_t dev) device_printf(dev, "multi-chip addressing mode\n"); else device_printf(dev, "single-chip addressing mode\n"); + + sx_init(&sc->sx, "e6000sw"); E6000SW_LOCK(sc); e6000sw_setup(dev, sc); From owner-svn-src-all@freebsd.org Tue Jun 13 18:46:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C8DBFBCB2; Tue, 13 Jun 2017 18:46:30 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92E6E27AD; Tue, 13 Jun 2017 18:46:30 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DIkTjd030603; Tue, 13 Jun 2017 18:46:29 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DIkTA7030597; Tue, 13 Jun 2017 18:46:29 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706131846.v5DIkTA7030597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 13 Jun 2017 18:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319907 - in head/sys: arm/mv conf dev/neta X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 18:46:31 -0000 Author: zbb Date: Tue Jun 13 18:46:29 2017 New Revision: 319907 URL: https://svnweb.freebsd.org/changeset/base/319907 Log: Introduce Armada 38x/XP network controller support This patch contains a new driver for the network unit of Marvell Armada 38x/XP SoCs, called NETA. This support was thoroughly tested and optimised in terms of stability and performance. Additional hardware features, like Buffer Management (BM) or Parser and Classifier (PnC) will be progressively supported as needed. Submitted by: Fabien Thomas Arnaud Ysmal Zbigniew Bodek Michal Mazur Bartosz Szczepanek Marcin Wojtas Obtained from: Semihalf Sponsored by: Stormshield (main development) Netgate (cleanup and upstreaming) Differential revision: https://reviews.freebsd.org/D10706 Added: head/sys/dev/neta/ head/sys/dev/neta/if_mvneta.c (contents, props changed) head/sys/dev/neta/if_mvneta_fdt.c (contents, props changed) head/sys/dev/neta/if_mvnetareg.h (contents, props changed) head/sys/dev/neta/if_mvnetavar.h (contents, props changed) Modified: head/sys/arm/mv/files.mv head/sys/arm/mv/mv_common.c head/sys/arm/mv/mvwin.h head/sys/conf/options Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Tue Jun 13 18:35:14 2017 (r319906) +++ head/sys/arm/mv/files.mv Tue Jun 13 18:46:29 2017 (r319907) @@ -24,6 +24,8 @@ arm/mv/timer.c optional !soc_mv_armada38x dev/cesa/cesa.c optional cesa dev/iicbus/twsi/mv_twsi.c optional twsi dev/mge/if_mge.c optional mge +dev/neta/if_mvneta_fdt.c optional neta fdt +dev/neta/if_mvneta.c optional neta mdio mii dev/nand/nfc_mv.c optional nand dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Tue Jun 13 18:35:14 2017 (r319906) +++ head/sys/arm/mv/mv_common.c Tue Jun 13 18:46:29 2017 (r319907) @@ -96,6 +96,7 @@ static void decode_win_cesa_setup(u_long); static void decode_win_usb_setup(u_long); static void decode_win_usb3_setup(u_long); static void decode_win_eth_setup(u_long); +static void decode_win_neta_setup(u_long); static void decode_win_sata_setup(u_long); static void decode_win_ahci_setup(u_long); static void decode_win_sdhci_setup(u_long); @@ -107,6 +108,7 @@ static void decode_win_cesa_dump(u_long); static void decode_win_usb_dump(u_long); static void decode_win_usb3_dump(u_long); static void decode_win_eth_dump(u_long base); +static void decode_win_neta_dump(u_long base); static void decode_win_idma_dump(u_long base); static void decode_win_xor_dump(u_long base); static void decode_win_ahci_dump(u_long base); @@ -152,6 +154,7 @@ struct soc_node_spec { static struct soc_node_spec soc_nodes[] = { { "mrvl,ge", &decode_win_eth_setup, &decode_win_eth_dump }, + { "marvell,armada-370-neta", &decode_win_neta_setup, &decode_win_neta_dump }, { "mrvl,usb-ehci", &decode_win_usb_setup, &decode_win_usb_dump }, { "marvell,orion-ehci", &decode_win_usb_setup, &decode_win_usb_dump }, { "marvell,armada-380-xhci", &decode_win_usb3_setup, &decode_win_usb3_dump }, @@ -1431,6 +1434,20 @@ decode_win_eth_setup(u_long base) break; } } +} + +static void +decode_win_neta_dump(u_long base) +{ + + decode_win_eth_dump(base + MV_WIN_NETA_OFFSET); +} + +static void +decode_win_neta_setup(u_long base) +{ + + decode_win_eth_setup(base + MV_WIN_NETA_OFFSET); } static int Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Tue Jun 13 18:35:14 2017 (r319906) +++ head/sys/arm/mv/mvwin.h Tue Jun 13 18:46:29 2017 (r319907) @@ -229,6 +229,9 @@ #define MV_WIN_USB3_BASE(n) (0x8 * (n) + 0x4004) #define MV_WIN_USB3_MAX 8 +#define MV_WIN_NETA_OFFSET 0x2000 +#define MV_WIN_NETA_BASE(n) MV_WIN_ETH_BASE(n) + MV_WIN_NETA_OFFSET + #define MV_WIN_ETH_BASE(n) (0x8 * (n) + 0x200) #define MV_WIN_ETH_SIZE(n) (0x8 * (n) + 0x204) #define MV_WIN_ETH_REMAP(n) (0x4 * (n) + 0x280) @@ -325,6 +328,7 @@ /* IO Window Control Register fields */ #define IO_WIN_SIZE_SHIFT 16 #define IO_WIN_SIZE_MASK 0xFFFF +#define IO_WIN_COH_ATTR_MASK (0xF << 12) #define IO_WIN_ATTR_SHIFT 8 #define IO_WIN_ATTR_MASK 0xFF #define IO_WIN_TGT_SHIFT 4 Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Jun 13 18:35:14 2017 (r319906) +++ head/sys/conf/options Tue Jun 13 18:46:29 2017 (r319907) @@ -872,6 +872,10 @@ MWL_DIAGAPI opt_mwl.h MWL_AGGR_SIZE opt_mwl.h MWL_TX_NODROP opt_mwl.h +# Options for the Marvell NETA driver +MVNETA_MULTIQUEUE opt_mvneta.h +MVNETA_KTR opt_mvneta.h + # Options for the Intel 802.11ac wireless driver IWM_DEBUG opt_iwm.h Added: head/sys/dev/neta/if_mvneta.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/neta/if_mvneta.c Tue Jun 13 18:46:29 2017 (r319907) @@ -0,0 +1,3570 @@ +/* + * Copyright (c) 2017 Stormshield. + * Copyright (c) 2017 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "opt_platform.h" +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef MVNETA_KTR +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include "if_mvnetareg.h" +#include "if_mvnetavar.h" + +#include "miibus_if.h" +#include "mdio_if.h" + +#ifdef MVNETA_DEBUG +#define STATIC /* nothing */ +#else +#define STATIC static +#endif + +#define DASSERT(x) KASSERT((x), (#x)) + +/* Device Register Initialization */ +STATIC int mvneta_initreg(struct ifnet *); + +/* Descriptor Ring Control for each of queues */ +STATIC int mvneta_ring_alloc_rx_queue(struct mvneta_softc *, int); +STATIC int mvneta_ring_alloc_tx_queue(struct mvneta_softc *, int); +STATIC void mvneta_ring_dealloc_rx_queue(struct mvneta_softc *, int); +STATIC void mvneta_ring_dealloc_tx_queue(struct mvneta_softc *, int); +STATIC int mvneta_ring_init_rx_queue(struct mvneta_softc *, int); +STATIC int mvneta_ring_init_tx_queue(struct mvneta_softc *, int); +STATIC void mvneta_ring_flush_rx_queue(struct mvneta_softc *, int); +STATIC void mvneta_ring_flush_tx_queue(struct mvneta_softc *, int); +STATIC void mvneta_dmamap_cb(void *, bus_dma_segment_t *, int, int); +STATIC int mvneta_dma_create(struct mvneta_softc *); + +/* Rx/Tx Queue Control */ +STATIC int mvneta_rx_queue_init(struct ifnet *, int); +STATIC int mvneta_tx_queue_init(struct ifnet *, int); +STATIC int mvneta_rx_queue_enable(struct ifnet *, int); +STATIC int mvneta_tx_queue_enable(struct ifnet *, int); +STATIC void mvneta_rx_lockq(struct mvneta_softc *, int); +STATIC void mvneta_rx_unlockq(struct mvneta_softc *, int); +STATIC void mvneta_tx_lockq(struct mvneta_softc *, int); +STATIC void mvneta_tx_unlockq(struct mvneta_softc *, int); + +/* Interrupt Handlers */ +STATIC void mvneta_disable_intr(struct mvneta_softc *); +STATIC void mvneta_enable_intr(struct mvneta_softc *); +STATIC void mvneta_rxtxth_intr(void *); +STATIC int mvneta_misc_intr(struct mvneta_softc *); +STATIC void mvneta_tick(void *); +/* struct ifnet and mii callbacks*/ +STATIC int mvneta_xmitfast_locked(struct mvneta_softc *, int, struct mbuf **); +STATIC int mvneta_xmit_locked(struct mvneta_softc *, int); +#ifdef MVNETA_MULTIQUEUE +STATIC int mvneta_transmit(struct ifnet *, struct mbuf *); +#else /* !MVNETA_MULTIQUEUE */ +STATIC void mvneta_start(struct ifnet *); +#endif +STATIC void mvneta_qflush(struct ifnet *); +STATIC void mvneta_tx_task(void *, int); +STATIC int mvneta_ioctl(struct ifnet *, u_long, caddr_t); +STATIC void mvneta_init(void *); +STATIC void mvneta_init_locked(void *); +STATIC void mvneta_stop(struct mvneta_softc *); +STATIC void mvneta_stop_locked(struct mvneta_softc *); +STATIC int mvneta_mediachange(struct ifnet *); +STATIC void mvneta_mediastatus(struct ifnet *, struct ifmediareq *); +STATIC void mvneta_portup(struct mvneta_softc *); +STATIC void mvneta_portdown(struct mvneta_softc *); + +/* Link State Notify */ +STATIC void mvneta_update_autoneg(struct mvneta_softc *, int); +STATIC int mvneta_update_media(struct mvneta_softc *, int); +STATIC void mvneta_adjust_link(struct mvneta_softc *); +STATIC void mvneta_update_eee(struct mvneta_softc *); +STATIC void mvneta_update_fc(struct mvneta_softc *); +STATIC void mvneta_link_isr(struct mvneta_softc *); +STATIC void mvneta_linkupdate(struct mvneta_softc *, boolean_t); +STATIC void mvneta_linkup(struct mvneta_softc *); +STATIC void mvneta_linkdown(struct mvneta_softc *); +STATIC void mvneta_linkreset(struct mvneta_softc *); + +/* Tx Subroutines */ +STATIC int mvneta_tx_queue(struct mvneta_softc *, struct mbuf **, int); +STATIC void mvneta_tx_set_csumflag(struct ifnet *, + struct mvneta_tx_desc *, struct mbuf *); +STATIC void mvneta_tx_queue_complete(struct mvneta_softc *, int); +STATIC void mvneta_tx_drain(struct mvneta_softc *); + +/* Rx Subroutines */ +STATIC int mvneta_rx(struct mvneta_softc *, int, int); +STATIC void mvneta_rx_queue(struct mvneta_softc *, int, int); +STATIC void mvneta_rx_queue_refill(struct mvneta_softc *, int); +STATIC void mvneta_rx_set_csumflag(struct ifnet *, + struct mvneta_rx_desc *, struct mbuf *); +STATIC void mvneta_rx_buf_free(struct mvneta_softc *, struct mvneta_buf *); + +/* MAC address filter */ +STATIC void mvneta_filter_setup(struct mvneta_softc *); + +/* sysctl(9) */ +STATIC int sysctl_read_mib(SYSCTL_HANDLER_ARGS); +STATIC int sysctl_clear_mib(SYSCTL_HANDLER_ARGS); +STATIC int sysctl_set_queue_rxthtime(SYSCTL_HANDLER_ARGS); +STATIC void sysctl_mvneta_init(struct mvneta_softc *); + +/* MIB */ +STATIC void mvneta_clear_mib(struct mvneta_softc *); +STATIC void mvneta_update_mib(struct mvneta_softc *); + +/* Switch */ +STATIC boolean_t mvneta_has_switch(device_t); + +#define mvneta_sc_lock(sc) mtx_lock(&sc->mtx) +#define mvneta_sc_unlock(sc) mtx_unlock(&sc->mtx) + +STATIC struct mtx mii_mutex; +STATIC int mii_init = 0; + +/* Device */ +STATIC int mvneta_detach(device_t); +/* MII */ +STATIC int mvneta_miibus_readreg(device_t, int, int); +STATIC int mvneta_miibus_writereg(device_t, int, int, int); + +static device_method_t mvneta_methods[] = { + /* Device interface */ + DEVMETHOD(device_detach, mvneta_detach), + /* MII interface */ + DEVMETHOD(miibus_readreg, mvneta_miibus_readreg), + DEVMETHOD(miibus_writereg, mvneta_miibus_writereg), + /* MDIO interface */ + DEVMETHOD(mdio_readreg, mvneta_miibus_readreg), + DEVMETHOD(mdio_writereg, mvneta_miibus_writereg), + + /* End */ + DEVMETHOD_END +}; + +DEFINE_CLASS_0(mvneta, mvneta_driver, mvneta_methods, sizeof(struct mvneta_softc)); + +DRIVER_MODULE(miibus, mvneta, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(mdio, mvneta, mdio_driver, mdio_devclass, 0, 0); +MODULE_DEPEND(mvneta, mdio, 1, 1, 1); +MODULE_DEPEND(mvneta, ether, 1, 1, 1); +MODULE_DEPEND(mvneta, miibus, 1, 1, 1); +MODULE_DEPEND(mvneta, mvxpbm, 1, 1, 1); + +/* + * List of MIB register and names + */ +enum mvneta_mib_idx +{ + MVNETA_MIB_RX_GOOD_OCT_IDX, + MVNETA_MIB_RX_BAD_OCT_IDX, + MVNETA_MIB_TX_MAC_TRNS_ERR_IDX, + MVNETA_MIB_RX_GOOD_FRAME_IDX, + MVNETA_MIB_RX_BAD_FRAME_IDX, + MVNETA_MIB_RX_BCAST_FRAME_IDX, + MVNETA_MIB_RX_MCAST_FRAME_IDX, + MVNETA_MIB_RX_FRAME64_OCT_IDX, + MVNETA_MIB_RX_FRAME127_OCT_IDX, + MVNETA_MIB_RX_FRAME255_OCT_IDX, + MVNETA_MIB_RX_FRAME511_OCT_IDX, + MVNETA_MIB_RX_FRAME1023_OCT_IDX, + MVNETA_MIB_RX_FRAMEMAX_OCT_IDX, + MVNETA_MIB_TX_GOOD_OCT_IDX, + MVNETA_MIB_TX_GOOD_FRAME_IDX, + MVNETA_MIB_TX_EXCES_COL_IDX, + MVNETA_MIB_TX_MCAST_FRAME_IDX, + MVNETA_MIB_TX_BCAST_FRAME_IDX, + MVNETA_MIB_TX_MAC_CTL_ERR_IDX, + MVNETA_MIB_FC_SENT_IDX, + MVNETA_MIB_FC_GOOD_IDX, + MVNETA_MIB_FC_BAD_IDX, + MVNETA_MIB_PKT_UNDERSIZE_IDX, + MVNETA_MIB_PKT_FRAGMENT_IDX, + MVNETA_MIB_PKT_OVERSIZE_IDX, + MVNETA_MIB_PKT_JABBER_IDX, + MVNETA_MIB_MAC_RX_ERR_IDX, + MVNETA_MIB_MAC_CRC_ERR_IDX, + MVNETA_MIB_MAC_COL_IDX, + MVNETA_MIB_MAC_LATE_COL_IDX, +}; + +STATIC struct mvneta_mib_def { + uint32_t regnum; + int reg64; + const char *sysctl_name; + const char *desc; +} mvneta_mib_list[] = { + [MVNETA_MIB_RX_GOOD_OCT_IDX] = {MVNETA_MIB_RX_GOOD_OCT, 1, + "rx_good_oct", "Good Octets Rx"}, + [MVNETA_MIB_RX_BAD_OCT_IDX] = {MVNETA_MIB_RX_BAD_OCT, 0, + "rx_bad_oct", "Bad Octets Rx"}, + [MVNETA_MIB_TX_MAC_TRNS_ERR_IDX] = {MVNETA_MIB_TX_MAC_TRNS_ERR, 0, + "tx_mac_err", "MAC Transmit Error"}, + [MVNETA_MIB_RX_GOOD_FRAME_IDX] = {MVNETA_MIB_RX_GOOD_FRAME, 0, + "rx_good_frame", "Good Frames Rx"}, + [MVNETA_MIB_RX_BAD_FRAME_IDX] = {MVNETA_MIB_RX_BAD_FRAME, 0, + "rx_bad_frame", "Bad Frames Rx"}, + [MVNETA_MIB_RX_BCAST_FRAME_IDX] = {MVNETA_MIB_RX_BCAST_FRAME, 0, + "rx_bcast_frame", "Broadcast Frames Rx"}, + [MVNETA_MIB_RX_MCAST_FRAME_IDX] = {MVNETA_MIB_RX_MCAST_FRAME, 0, + "rx_mcast_frame", "Multicast Frames Rx"}, + [MVNETA_MIB_RX_FRAME64_OCT_IDX] = {MVNETA_MIB_RX_FRAME64_OCT, 0, + "rx_frame_1_64", "Frame Size 1 - 64"}, + [MVNETA_MIB_RX_FRAME127_OCT_IDX] = {MVNETA_MIB_RX_FRAME127_OCT, 0, + "rx_frame_65_127", "Frame Size 65 - 127"}, + [MVNETA_MIB_RX_FRAME255_OCT_IDX] = {MVNETA_MIB_RX_FRAME255_OCT, 0, + "rx_frame_128_255", "Frame Size 128 - 255"}, + [MVNETA_MIB_RX_FRAME511_OCT_IDX] = {MVNETA_MIB_RX_FRAME511_OCT, 0, + "rx_frame_256_511", "Frame Size 256 - 511"}, + [MVNETA_MIB_RX_FRAME1023_OCT_IDX] = {MVNETA_MIB_RX_FRAME1023_OCT, 0, + "rx_frame_512_1023", "Frame Size 512 - 1023"}, + [MVNETA_MIB_RX_FRAMEMAX_OCT_IDX] = {MVNETA_MIB_RX_FRAMEMAX_OCT, 0, + "rx_fame_1024_max", "Frame Size 1024 - Max"}, + [MVNETA_MIB_TX_GOOD_OCT_IDX] = {MVNETA_MIB_TX_GOOD_OCT, 1, + "tx_good_oct", "Good Octets Tx"}, + [MVNETA_MIB_TX_GOOD_FRAME_IDX] = {MVNETA_MIB_TX_GOOD_FRAME, 0, + "tx_good_frame", "Good Frames Tx"}, + [MVNETA_MIB_TX_EXCES_COL_IDX] = {MVNETA_MIB_TX_EXCES_COL, 0, + "tx_exces_collision", "Excessive Collision"}, + [MVNETA_MIB_TX_MCAST_FRAME_IDX] = {MVNETA_MIB_TX_MCAST_FRAME, 0, + "tx_mcast_frame", "Multicast Frames Tx"}, + [MVNETA_MIB_TX_BCAST_FRAME_IDX] = {MVNETA_MIB_TX_BCAST_FRAME, 0, + "tx_bcast_frame", "Broadcast Frames Tx"}, + [MVNETA_MIB_TX_MAC_CTL_ERR_IDX] = {MVNETA_MIB_TX_MAC_CTL_ERR, 0, + "tx_mac_ctl_err", "Unknown MAC Control"}, + [MVNETA_MIB_FC_SENT_IDX] = {MVNETA_MIB_FC_SENT, 0, + "fc_tx", "Flow Control Tx"}, + [MVNETA_MIB_FC_GOOD_IDX] = {MVNETA_MIB_FC_GOOD, 0, + "fc_rx_good", "Good Flow Control Rx"}, + [MVNETA_MIB_FC_BAD_IDX] = {MVNETA_MIB_FC_BAD, 0, + "fc_rx_bad", "Bad Flow Control Rx"}, + [MVNETA_MIB_PKT_UNDERSIZE_IDX] = {MVNETA_MIB_PKT_UNDERSIZE, 0, + "pkt_undersize", "Undersized Packets Rx"}, + [MVNETA_MIB_PKT_FRAGMENT_IDX] = {MVNETA_MIB_PKT_FRAGMENT, 0, + "pkt_fragment", "Fragmented Packets Rx"}, + [MVNETA_MIB_PKT_OVERSIZE_IDX] = {MVNETA_MIB_PKT_OVERSIZE, 0, + "pkt_oversize", "Oversized Packets Rx"}, + [MVNETA_MIB_PKT_JABBER_IDX] = {MVNETA_MIB_PKT_JABBER, 0, + "pkt_jabber", "Jabber Packets Rx"}, + [MVNETA_MIB_MAC_RX_ERR_IDX] = {MVNETA_MIB_MAC_RX_ERR, 0, + "mac_rx_err", "MAC Rx Errors"}, + [MVNETA_MIB_MAC_CRC_ERR_IDX] = {MVNETA_MIB_MAC_CRC_ERR, 0, + "mac_crc_err", "MAC CRC Errors"}, + [MVNETA_MIB_MAC_COL_IDX] = {MVNETA_MIB_MAC_COL, 0, + "mac_collision", "MAC Collision"}, + [MVNETA_MIB_MAC_LATE_COL_IDX] = {MVNETA_MIB_MAC_LATE_COL, 0, + "mac_late_collision", "MAC Late Collision"}, +}; + +static struct resource_spec res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0} +}; + +static struct { + driver_intr_t *handler; + char * description; +} mvneta_intrs[] = { + { mvneta_rxtxth_intr, "MVNETA aggregated interrupt" }, +}; + +static int +mvneta_set_mac_address(struct mvneta_softc *sc, uint8_t *addr) +{ + unsigned int mac_h; + unsigned int mac_l; + + mac_l = (addr[4] << 8) | (addr[5]); + mac_h = (addr[0] << 24) | (addr[1] << 16) | + (addr[2] << 8) | (addr[3] << 0); + + MVNETA_WRITE(sc, MVNETA_MACAL, mac_l); + MVNETA_WRITE(sc, MVNETA_MACAH, mac_h); + return (0); +} + +static int +mvneta_get_mac_address(struct mvneta_softc *sc, uint8_t *addr) +{ + uint32_t mac_l, mac_h; + +#ifdef FDT + if (mvneta_fdt_mac_address(sc, addr) == 0) + return (0); +#endif + /* + * Fall back -- use the currently programmed address. + */ + mac_l = MVNETA_READ(sc, MVNETA_MACAL); + mac_h = MVNETA_READ(sc, MVNETA_MACAH); + if (mac_l == 0 && mac_h == 0) { + /* + * Generate pseudo-random MAC. + * Set lower part to random number | unit number. + */ + mac_l = arc4random() & ~0xff; + mac_l |= device_get_unit(sc->dev) & 0xff; + mac_h = arc4random(); + mac_h &= ~(3 << 24); /* Clear multicast and LAA bits */ + if (bootverbose) { + device_printf(sc->dev, + "Could not acquire MAC address. " + "Using randomized one.\n"); + } + } + + addr[0] = (mac_h & 0xff000000) >> 24; + addr[1] = (mac_h & 0x00ff0000) >> 16; + addr[2] = (mac_h & 0x0000ff00) >> 8; + addr[3] = (mac_h & 0x000000ff); + addr[4] = (mac_l & 0x0000ff00) >> 8; + addr[5] = (mac_l & 0x000000ff); + return (0); +} + +STATIC boolean_t +mvneta_has_switch(device_t self) +{ + phandle_t node, switch_node, switch_eth, switch_eth_handle; + + node = ofw_bus_get_node(self); + switch_node = + ofw_bus_find_compatible(OF_finddevice("/"), "marvell,dsa"); + switch_eth = 0; + + OF_getencprop(switch_node, "dsa,ethernet", + (void*)&switch_eth_handle, sizeof(switch_eth_handle)); + + if (switch_eth_handle > 0) + switch_eth = OF_node_from_xref(switch_eth_handle); + + /* Return true if dsa,ethernet cell points to us */ + return (node == switch_eth); +} + +STATIC int +mvneta_dma_create(struct mvneta_softc *sc) +{ + size_t maxsize, maxsegsz; + size_t q; + int error; + + /* + * Create Tx DMA + */ + maxsize = maxsegsz = sizeof(struct mvneta_tx_desc) * MVNETA_TX_RING_CNT; + + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* parent */ + 16, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + maxsize, /* maxsize */ + 1, /* nsegments */ + maxsegsz, /* maxsegsz */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &sc->tx_dtag); /* dmat */ + if (error != 0) { + device_printf(sc->dev, + "Failed to create DMA tag for Tx descriptors.\n"); + goto fail; + } + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + MVNETA_PACKET_SIZE, /* maxsize */ + MVNETA_TX_SEGLIMIT, /* nsegments */ + MVNETA_PACKET_SIZE, /* maxsegsz */ + BUS_DMA_ALLOCNOW, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &sc->txmbuf_dtag); + if (error != 0) { + device_printf(sc->dev, + "Failed to create DMA tag for Tx mbufs.\n"); + goto fail; + } + + for (q = 0; q < MVNETA_TX_QNUM_MAX; q++) { + error = mvneta_ring_alloc_tx_queue(sc, q); + if (error != 0) { + device_printf(sc->dev, + "Failed to allocate DMA safe memory for TxQ: %d\n", q); + goto fail; + } + } + + /* + * Create Rx DMA. + */ + /* Create tag for Rx descripors */ + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* parent */ + 32, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + sizeof(struct mvneta_rx_desc) * MVNETA_RX_RING_CNT, /* maxsize */ + 1, /* nsegments */ + sizeof(struct mvneta_rx_desc) * MVNETA_RX_RING_CNT, /* maxsegsz */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &sc->rx_dtag); /* dmat */ + if (error != 0) { + device_printf(sc->dev, + "Failed to create DMA tag for Rx descriptors.\n"); + goto fail; + } + + /* Create tag for Rx buffers */ + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* parent */ + 32, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + MVNETA_PACKET_SIZE, 1, /* maxsize, nsegments */ + MVNETA_PACKET_SIZE, /* maxsegsz */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &sc->rxbuf_dtag); /* dmat */ + if (error != 0) { + device_printf(sc->dev, + "Failed to create DMA tag for Rx buffers.\n"); + goto fail; + } + + for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) { + if (mvneta_ring_alloc_rx_queue(sc, q) != 0) { + device_printf(sc->dev, + "Failed to allocate DMA safe memory for RxQ: %d\n", q); + goto fail; + } + } + + return (0); +fail: + mvneta_detach(sc->dev); + + return (error); +} + +/* ARGSUSED */ +int +mvneta_attach(device_t self) +{ + struct mvneta_softc *sc; + struct ifnet *ifp; + device_t child; + int ifm_target; + int q, error; + uint32_t reg; + + sc = device_get_softc(self); + sc->dev = self; + + mtx_init(&sc->mtx, "mvneta_sc", NULL, MTX_DEF); + + error = bus_alloc_resources(self, res_spec, sc->res); + if (error) { + device_printf(self, "could not allocate resources\n"); + return (ENXIO); + } + + sc->version = MVNETA_READ(sc, MVNETA_PV); + device_printf(self, "version is %x\n", sc->version); + callout_init(&sc->tick_ch, 0); + + /* + * make sure DMA engines are in reset state + */ + MVNETA_WRITE(sc, MVNETA_PRXINIT, 0x00000001); + MVNETA_WRITE(sc, MVNETA_PTXINIT, 0x00000001); + + /* + * Disable port snoop for buffers and descriptors + * to avoid L2 caching of both without DRAM copy. + * Obtain coherency settings from the first MBUS + * window attribute. + */ + if ((MVNETA_READ(sc, MV_WIN_NETA_BASE(0)) & IO_WIN_COH_ATTR_MASK) == 0) { + reg = MVNETA_READ(sc, MVNETA_PSNPCFG); + reg &= ~MVNETA_PSNPCFG_DESCSNP_MASK; + reg &= ~MVNETA_PSNPCFG_BUFSNP_MASK; + MVNETA_WRITE(sc, MVNETA_PSNPCFG, reg); + } + + /* + * MAC address + */ + if (mvneta_get_mac_address(sc, sc->enaddr)) { + device_printf(self, "no mac address.\n"); + return (ENXIO); + } + mvneta_set_mac_address(sc, sc->enaddr); + + mvneta_disable_intr(sc); + + /* Allocate network interface */ + ifp = sc->ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(self, "if_alloc() failed\n"); + mvneta_detach(self); + return (ENOMEM); + } + if_initname(ifp, device_get_name(self), device_get_unit(self)); + + /* + * We can support 802.1Q VLAN-sized frames and jumbo + * Ethernet frames. + */ + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_JUMBO_MTU; + + ifp->if_softc = sc; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; +#ifdef MVNETA_MULTIQUEUE + ifp->if_transmit = mvneta_transmit; + ifp->if_qflush = mvneta_qflush; +#else /* !MVNETA_MULTIQUEUE */ + ifp->if_start = mvneta_start; + ifp->if_snd.ifq_drv_maxlen = MVNETA_TX_RING_CNT - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); + IFQ_SET_READY(&ifp->if_snd); +#endif + ifp->if_init = mvneta_init; + ifp->if_ioctl = mvneta_ioctl; + + /* + * We can do IPv4/TCPv4/UDPv4/TCPv6/UDPv6 checksums in hardware. + */ + ifp->if_capabilities |= IFCAP_HWCSUM; + + /* + * As VLAN hardware tagging is not supported + * but is necessary to perform VLAN hardware checksums, + * it is done in the driver + */ + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + + /* + * Currently IPv6 HW checksum is broken, so make sure it is disabled. + */ + ifp->if_capabilities &= ~IFCAP_HWCSUM_IPV6; + ifp->if_capenable = ifp->if_capabilities; + + /* + * Disabled option(s): + * - Support for Large Receive Offload + */ + ifp->if_capabilities |= IFCAP_LRO; + + ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + + /* + * Device DMA Buffer allocation. + * Handles resource deallocation in case of failure. + */ + error = mvneta_dma_create(sc); + if (error != 0) { + mvneta_detach(self); + return (error); + } + + /* Initialize queues */ + for (q = 0; q < MVNETA_TX_QNUM_MAX; q++) { + error = mvneta_ring_init_tx_queue(sc, q); + if (error != 0) { + mvneta_detach(self); + return (error); + } + } + + for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) { + error = mvneta_ring_init_rx_queue(sc, q); + if (error != 0) { + mvneta_detach(self); + return (error); + } + } + + ether_ifattach(ifp, sc->enaddr); + + /* + * Enable DMA engines and Initialize Device Registers. + */ + MVNETA_WRITE(sc, MVNETA_PRXINIT, 0x00000000); + MVNETA_WRITE(sc, MVNETA_PTXINIT, 0x00000000); + MVNETA_WRITE(sc, MVNETA_PACC, MVNETA_PACC_ACCELERATIONMODE_EDM); + mvneta_sc_lock(sc); + mvneta_filter_setup(sc); + mvneta_sc_unlock(sc); + mvneta_initreg(ifp); + + /* + * Now MAC is working, setup MII. + */ + if (mii_init == 0) { + /* + * MII bus is shared by all MACs and all PHYs in SoC. + * serializing the bus access should be safe. + */ + mtx_init(&mii_mutex, "mvneta_mii", NULL, MTX_DEF); + mii_init = 1; + } + + /* Attach PHY(s) */ + if ((sc->phy_addr != MII_PHY_ANY) && (!sc->use_inband_status)) { + error = mii_attach(self, &sc->miibus, ifp, mvneta_mediachange, + mvneta_mediastatus, BMSR_DEFCAPMASK, sc->phy_addr, + MII_OFFSET_ANY, 0); + if (error != 0) { + if (bootverbose) { + device_printf(self, + "MII attach failed, error: %d\n", error); + } + ether_ifdetach(sc->ifp); + mvneta_detach(self); + return (error); + } + sc->mii = device_get_softc(sc->miibus); + sc->phy_attached = 1; + + /* Disable auto-negotiation in MAC - rely on PHY layer */ + mvneta_update_autoneg(sc, FALSE); + } else if (sc->use_inband_status == TRUE) { + /* In-band link status */ + ifmedia_init(&sc->mvneta_ifmedia, 0, mvneta_mediachange, + mvneta_mediastatus); + + /* Configure media */ + ifmedia_add(&sc->mvneta_ifmedia, IFM_ETHER | IFM_1000_T | IFM_FDX, + 0, NULL); + ifmedia_add(&sc->mvneta_ifmedia, IFM_ETHER | IFM_100_TX, 0, NULL); + ifmedia_add(&sc->mvneta_ifmedia, IFM_ETHER | IFM_100_TX | IFM_FDX, + 0, NULL); + ifmedia_add(&sc->mvneta_ifmedia, IFM_ETHER | IFM_10_T, 0, NULL); + ifmedia_add(&sc->mvneta_ifmedia, IFM_ETHER | IFM_10_T | IFM_FDX, + 0, NULL); + ifmedia_add(&sc->mvneta_ifmedia, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&sc->mvneta_ifmedia, IFM_ETHER | IFM_AUTO); + + /* Enable auto-negotiation */ + mvneta_update_autoneg(sc, TRUE); + + mvneta_sc_lock(sc); + if (MVNETA_IS_LINKUP(sc)) + mvneta_linkup(sc); + else + mvneta_linkdown(sc); + mvneta_sc_unlock(sc); + + } else { + /* Fixed-link, use predefined values */ + ifmedia_init(&sc->mvneta_ifmedia, 0, mvneta_mediachange, + mvneta_mediastatus); + + ifm_target = IFM_ETHER; + switch (sc->phy_speed) { + case 2500: + if (sc->phy_mode != MVNETA_PHY_SGMII && + sc->phy_mode != MVNETA_PHY_QSGMII) { + device_printf(self, + "2.5G speed can work only in (Q)SGMII mode\n"); + ether_ifdetach(sc->ifp); + mvneta_detach(self); + return (ENXIO); + } + ifm_target |= IFM_2500_T; + break; + case 1000: + ifm_target |= IFM_1000_T; + break; + case 100: + ifm_target |= IFM_100_TX; + break; + case 10: + ifm_target |= IFM_10_T; + break; + default: + ether_ifdetach(sc->ifp); + mvneta_detach(self); + return (ENXIO); + } + + if (sc->phy_fdx) + ifm_target |= IFM_FDX; + else + ifm_target |= IFM_HDX; + + ifmedia_add(&sc->mvneta_ifmedia, ifm_target, 0, NULL); + ifmedia_set(&sc->mvneta_ifmedia, ifm_target); + if_link_state_change(sc->ifp, LINK_STATE_UP); + + if (mvneta_has_switch(self)) { + child = device_add_child(sc->dev, "mdio", -1); + if (child == NULL) { + ether_ifdetach(sc->ifp); + mvneta_detach(self); + return (ENXIO); + } + bus_generic_attach(sc->dev); + bus_generic_attach(child); + } + + /* Configure MAC media */ + mvneta_update_media(sc, ifm_target); + } + + sysctl_mvneta_init(sc); + + callout_reset(&sc->tick_ch, 0, mvneta_tick, sc); + + error = bus_setup_intr(self, sc->res[1], + INTR_TYPE_NET | INTR_MPSAFE, NULL, mvneta_intrs[0].handler, sc, + &sc->ih_cookie[0]); + if (error) { + device_printf(self, "could not setup %s\n", + mvneta_intrs[0].description); + ether_ifdetach(sc->ifp); + mvneta_detach(self); + return (error); + } + + return (0); +} + +STATIC int +mvneta_detach(device_t dev) +{ + struct mvneta_softc *sc; + struct ifnet *ifp; + int q; + + sc = device_get_softc(dev); + ifp = sc->ifp; + + mvneta_stop(sc); + /* Detach network interface */ + if (sc->ifp) + if_free(sc->ifp); + + for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) + mvneta_ring_dealloc_rx_queue(sc, q); + for (q = 0; q < MVNETA_TX_QNUM_MAX; q++) + mvneta_ring_dealloc_tx_queue(sc, q); + + if (sc->tx_dtag != NULL) + bus_dma_tag_destroy(sc->tx_dtag); + if (sc->rx_dtag != NULL) + bus_dma_tag_destroy(sc->rx_dtag); + if (sc->txmbuf_dtag != NULL) + bus_dma_tag_destroy(sc->txmbuf_dtag); + + bus_release_resources(dev, res_spec, sc->res); + return (0); +} + +/* + * MII + */ +STATIC int +mvneta_miibus_readreg(device_t dev, int phy, int reg) +{ + struct mvneta_softc *sc; + struct ifnet *ifp; + uint32_t smi, val; + int i; + + sc = device_get_softc(dev); + ifp = sc->ifp; + + mtx_lock(&mii_mutex); + + for (i = 0; i < MVNETA_PHY_TIMEOUT; i++) { + if ((MVNETA_READ(sc, MVNETA_SMI) & MVNETA_SMI_BUSY) == 0) + break; + DELAY(1); + } + if (i == MVNETA_PHY_TIMEOUT) { + if_printf(ifp, "SMI busy timeout\n"); + mtx_unlock(&mii_mutex); + return (-1); + } + + smi = MVNETA_SMI_PHYAD(phy) | + MVNETA_SMI_REGAD(reg) | MVNETA_SMI_OPCODE_READ; + MVNETA_WRITE(sc, MVNETA_SMI, smi); + + for (i = 0; i < MVNETA_PHY_TIMEOUT; i++) { + if ((MVNETA_READ(sc, MVNETA_SMI) & MVNETA_SMI_BUSY) == 0) + break; + DELAY(1); + } + + if (i == MVNETA_PHY_TIMEOUT) { + if_printf(ifp, "SMI busy timeout\n"); + mtx_unlock(&mii_mutex); + return (-1); + } + for (i = 0; i < MVNETA_PHY_TIMEOUT; i++) { + smi = MVNETA_READ(sc, MVNETA_SMI); + if (smi & MVNETA_SMI_READVALID) + break; + DELAY(1); + } + + if (i == MVNETA_PHY_TIMEOUT) { + if_printf(ifp, "SMI busy timeout\n"); + mtx_unlock(&mii_mutex); + return (-1); + } + + mtx_unlock(&mii_mutex); + +#ifdef MVNETA_KTR + CTR3(KTR_SPARE2, "%s i=%d, timeout=%d\n", ifp->if_xname, i, + MVNETA_PHY_TIMEOUT); +#endif + + val = smi & MVNETA_SMI_DATA_MASK; + +#ifdef MVNETA_KTR *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 13 18:47:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8314DBFBDB1; Tue, 13 Jun 2017 18:47:43 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 510F5295F; Tue, 13 Jun 2017 18:47:43 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DIlgZs030682; Tue, 13 Jun 2017 18:47:42 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DIlg7B030681; Tue, 13 Jun 2017 18:47:42 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706131847.v5DIlg7B030681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 13 Jun 2017 18:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319908 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 18:47:43 -0000 Author: zbb Date: Tue Jun 13 18:47:42 2017 New Revision: 319908 URL: https://svnweb.freebsd.org/changeset/base/319908 Log: Enable neta controller support in ARMADA38X Submitted by: Marcin Wojtas Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D10707 Modified: head/sys/arm/conf/ARMADA38X Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Tue Jun 13 18:46:29 2017 (r319907) +++ head/sys/arm/conf/ARMADA38X Tue Jun 13 18:47:42 2017 (r319908) @@ -43,6 +43,7 @@ device re device mdio device etherswitch device e6000sw +device neta # PCI device pci From owner-svn-src-all@freebsd.org Tue Jun 13 18:48:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7500CBFBE84; Tue, 13 Jun 2017 18:48:52 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4295D2B97; Tue, 13 Jun 2017 18:48:52 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DImpjb030765; Tue, 13 Jun 2017 18:48:51 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DImpwc030764; Tue, 13 Jun 2017 18:48:51 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706131848.v5DImpwc030764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 13 Jun 2017 18:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319909 - head/sys/boot/fdt/dts/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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 18:48:52 -0000 Author: zbb Date: Tue Jun 13 18:48:51 2017 New Revision: 319909 URL: https://svnweb.freebsd.org/changeset/base/319909 Log: Enable in-band link management on A388-Clearfog board This patch adds in-band link management over SGMII of the SFP transceiver on Armada-388-Clearfog board. Submitted by: Marcin Wojtas Obtained from: Semihalf Sponsored by: Netgate Reviewed by: loos Differential revision: https://reviews.freebsd.org/D10708 Modified: head/sys/boot/fdt/dts/arm/armada-388-clearfog.dts Modified: head/sys/boot/fdt/dts/arm/armada-388-clearfog.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/armada-388-clearfog.dts Tue Jun 13 18:47:42 2017 (r319908) +++ head/sys/boot/fdt/dts/arm/armada-388-clearfog.dts Tue Jun 13 18:48:51 2017 (r319909) @@ -97,11 +97,7 @@ bm,pool-long = <3>; bm,pool-short = <1>; status = "okay"; - - fixed-link { - speed = <1000>; - full-duplex; - }; + managed = "in-band-status"; }; i2c@11000 { From owner-svn-src-all@freebsd.org Tue Jun 13 18:50:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E41DBFBF49; Tue, 13 Jun 2017 18:50:09 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AA3A2D48; Tue, 13 Jun 2017 18:50:09 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DIo87C030888; Tue, 13 Jun 2017 18:50:08 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DIo8qi030887; Tue, 13 Jun 2017 18:50:08 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706131850.v5DIo8qi030887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 13 Jun 2017 18:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319910 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 18:50:09 -0000 Author: zbb Date: Tue Jun 13 18:50:08 2017 New Revision: 319910 URL: https://svnweb.freebsd.org/changeset/base/319910 Log: Add detection of CPU class for ARMv6/v7 Submitted by: Michal Mazur Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: andrew Differential revision: https://reviews.freebsd.org/D10909 Modified: head/sys/arm/arm/identcpu-v6.c Modified: head/sys/arm/arm/identcpu-v6.c ============================================================================== --- head/sys/arm/arm/identcpu-v6.c Tue Jun 13 18:48:51 2017 (r319909) +++ head/sys/arm/arm/identcpu-v6.c Tue Jun 13 18:50:08 2017 (r319910) @@ -60,29 +60,47 @@ static char hw_buf[81]; static int hw_buf_idx; static bool hw_buf_newline; +enum cpu_class cpu_class = CPU_CLASS_NONE; + static struct { int implementer; int part_number; char *impl_name; char *core_name; + enum cpu_class cpu_class; } cpu_names[] = { - {CPU_IMPLEMENTER_ARM, CPU_ARCH_ARM1176, "ARM", "ARM1176"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A5 , "ARM", "Cortex-A5"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A7 , "ARM", "Cortex-A7"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A8 , "ARM", "Cortex-A8"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A9 , "ARM", "Cortex-A9"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A12, "ARM", "Cortex-A12"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A15, "ARM", "Cortex-A15"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A17, "ARM", "Cortex-A17"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A53, "ARM", "Cortex-A53"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A57, "ARM", "Cortex-A57"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A72, "ARM", "Cortex-A72"}, - {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A73, "ARM", "Cortex-A73"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_ARM1176, "ARM", "ARM1176", + CPU_CLASS_ARM11J}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A5 , "ARM", "Cortex-A5", + CPU_CLASS_CORTEXA}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A7 , "ARM", "Cortex-A7", + CPU_CLASS_CORTEXA}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A8 , "ARM", "Cortex-A8", + CPU_CLASS_CORTEXA}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A9 , "ARM", "Cortex-A9", + CPU_CLASS_CORTEXA}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A12, "ARM", "Cortex-A12", + CPU_CLASS_CORTEXA}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A15, "ARM", "Cortex-A15", + CPU_CLASS_CORTEXA}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A17, "ARM", "Cortex-A17", + CPU_CLASS_CORTEXA}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A53, "ARM", "Cortex-A53", + CPU_CLASS_CORTEXA}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A57, "ARM", "Cortex-A57", + CPU_CLASS_CORTEXA}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A72, "ARM", "Cortex-A72", + CPU_CLASS_CORTEXA}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A73, "ARM", "Cortex-A73", + CPU_CLASS_CORTEXA}, - {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_581, "Marwell", "PJ4 v7"}, - {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_584, "Marwell", "PJ4MP v7"}, + {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_581, "Marwell", "PJ4 v7", + CPU_CLASS_MARVELL}, + {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_584, "Marwell", "PJ4MP v7", + CPU_CLASS_MARVELL}, - {CPU_IMPLEMENTER_QCOM, CPU_ARCH_KRAIT_300, "Qualcomm", "Krait 300"}, + {CPU_IMPLEMENTER_QCOM, CPU_ARCH_KRAIT_300, "Qualcomm", "Krait 300", + CPU_CLASS_KRAIT}, }; @@ -266,6 +284,7 @@ identify_arm_cpu(void) for(i = 0; i < nitems(cpu_names); i++) { if (cpu_names[i].implementer == cpuinfo.implementer && cpu_names[i].part_number == cpuinfo.part_number) { + cpu_class = cpu_names[i].cpu_class; printf("CPU: %s %s r%dp%d (ECO: 0x%08X)\n", cpu_names[i].impl_name, cpu_names[i].core_name, cpuinfo.revision, cpuinfo.patch, From owner-svn-src-all@freebsd.org Tue Jun 13 18:51:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 486EBBFC0C5; Tue, 13 Jun 2017 18:51:25 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D0DA3069; Tue, 13 Jun 2017 18:51:24 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DIpOGa031651; Tue, 13 Jun 2017 18:51:24 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DIpOIF031649; Tue, 13 Jun 2017 18:51:24 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706131851.v5DIpOIF031649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 13 Jun 2017 18:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319911 - in head/sys: dev/hwpmc 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 18:51:25 -0000 Author: zbb Date: Tue Jun 13 18:51:23 2017 New Revision: 319911 URL: https://svnweb.freebsd.org/changeset/base/319911 Log: Fix HWPMC interrupt handling in Counting Mode Additionally: - Fix support for Cycle Counter (evsel == 0xFF) - Stop and mask interrupts from all counters on init and finish Submitted by: Michal Mazur Obtained from: Semihalf Sponsored by: Stormshield, Netgate Differential revision: https://reviews.freebsd.org/D10910 Modified: head/sys/dev/hwpmc/hwpmc_armv7.c head/sys/sys/pmc.h Modified: head/sys/dev/hwpmc/hwpmc_armv7.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_armv7.c Tue Jun 13 18:50:08 2017 (r319910) +++ head/sys/dev/hwpmc/hwpmc_armv7.c Tue Jun 13 18:51:23 2017 (r319911) @@ -46,6 +46,8 @@ struct armv7_event_code_map { uint8_t pe_code; }; +#define PMC_EV_CPU_CYCLES 0xFF + /* * Per-processor information. */ @@ -171,10 +173,11 @@ armv7_read_pmc(int cpu, int ri, pmc_value_t *v) pm = armv7_pcpu[cpu]->pc_armv7pmcs[ri].phw_pmc; - if (pm->pm_md.pm_armv7.pm_armv7_evsel == 0xFF) - tmp = cp15_pmccntr_get(); + if (pm->pm_md.pm_armv7.pm_armv7_evsel == PMC_EV_CPU_CYCLES) + tmp = (uint32_t)cp15_pmccntr_get(); else tmp = armv7_pmcn_read(ri); + tmp += 0x100000000llu * pm->pm_overflowcnt; PMCDBG2(MDP, REA, 2, "armv7-read id=%d -> %jd", ri, tmp); if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) @@ -202,7 +205,7 @@ armv7_write_pmc(int cpu, int ri, pmc_value_t v) PMCDBG3(MDP, WRI, 1, "armv7-write cpu=%d ri=%d v=%jx", cpu, ri, v); - if (pm->pm_md.pm_armv7.pm_armv7_evsel == 0xFF) + if (pm->pm_md.pm_armv7.pm_armv7_evsel == PMC_EV_CPU_CYCLES) cp15_pmccntr_set(v); else armv7_pmcn_write(ri, v); @@ -244,11 +247,16 @@ armv7_start_pmc(int cpu, int ri) pm = phw->phw_pmc; config = pm->pm_md.pm_armv7.pm_armv7_evsel; + pm->pm_overflowcnt = 0; + /* * Configure the event selection. */ - cp15_pmselr_set(ri); - cp15_pmxevtyper_set(config); + if (config != PMC_EV_CPU_CYCLES) { + cp15_pmselr_set(ri); + cp15_pmxevtyper_set(config); + } else + ri = 31; /* * Enable the PMC. @@ -264,9 +272,13 @@ armv7_stop_pmc(int cpu, int ri) { struct pmc_hw *phw; struct pmc *pm; + uint32_t config; phw = &armv7_pcpu[cpu]->pc_armv7pmcs[ri]; pm = phw->phw_pmc; + config = pm->pm_md.pm_armv7.pm_armv7_evsel; + if (config == PMC_EV_CPU_CYCLES) + ri = 31; /* * Disable the PMCs. @@ -313,11 +325,9 @@ armv7_intr(int cpu, struct trapframe *tf) pm = armv7_pcpu[cpu]->pc_armv7pmcs[ri].phw_pmc; if (pm == NULL) continue; - if (!PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) - continue; /* Check if counter has overflowed */ - if (pm->pm_md.pm_armv7.pm_armv7_evsel == 0xFF) + if (pm->pm_md.pm_armv7.pm_armv7_evsel == PMC_EV_CPU_CYCLES) reg = (1 << 31); else reg = (1 << ri); @@ -330,6 +340,11 @@ armv7_intr(int cpu, struct trapframe *tf) cp15_pmovsr_set(reg); retval = 1; /* Found an interrupting PMC. */ + + if (!PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) { + pm->pm_overflowcnt += 1; + continue; + } if (pm->pm_state != PMC_STATE_RUNNING) continue; @@ -430,6 +445,11 @@ armv7_pcpu_init(struct pmc_mdep *md, int cpu) pc->pc_hwpmcs[i + first_ri] = phw; } + pmnc = 0xffffffff; + cp15_pmcnten_clr(pmnc); + cp15_pminten_clr(pmnc); + cp15_pmovsr_set(pmnc); + /* Enable unit */ pmnc = cp15_pmcr_get(); pmnc |= ARMV7_PMNC_ENABLE; @@ -446,6 +466,11 @@ armv7_pcpu_fini(struct pmc_mdep *md, int cpu) pmnc = cp15_pmcr_get(); pmnc &= ~ARMV7_PMNC_ENABLE; cp15_pmcr_set(pmnc); + + pmnc = 0xffffffff; + cp15_pmcnten_clr(pmnc); + cp15_pminten_clr(pmnc); + cp15_pmovsr_set(pmnc); return 0; } Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Tue Jun 13 18:50:08 2017 (r319910) +++ head/sys/sys/pmc.h Tue Jun 13 18:51:23 2017 (r319911) @@ -741,6 +741,7 @@ struct pmc { struct pmc_owner *pm_owner; /* owner thread state */ int pm_runcount; /* #cpus currently on */ enum pmc_state pm_state; /* current PMC state */ + uint32_t pm_overflowcnt; /* count overflow interrupts */ /* * The PMC ID field encodes the row-index for the PMC, its From owner-svn-src-all@freebsd.org Tue Jun 13 18:52:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CCE0BFC1BE; Tue, 13 Jun 2017 18:52:41 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F28793427; Tue, 13 Jun 2017 18:52:40 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DIqd2U034872; Tue, 13 Jun 2017 18:52:39 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DIqdLu034871; Tue, 13 Jun 2017 18:52:39 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706131852.v5DIqdLu034871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 13 Jun 2017 18:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319912 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 18:52:41 -0000 Author: zbb Date: Tue Jun 13 18:52:39 2017 New Revision: 319912 URL: https://svnweb.freebsd.org/changeset/base/319912 Log: Fix event table for Cortex A9. Removed events 0x8 (INSTR_EXECUTED), 0xE (PC_PROC_RETURN) and 0x13-0x1d not supported on Cortex A9. Add events 0x68 and 0x6E which replaced 0x8 and 0xE. Submitted by: Michal Mazur Obtained from: Semihalf Sponsored by: Stormshield, Netgate Differential revision: https://reviews.freebsd.org/D10911 Modified: head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Tue Jun 13 18:51:23 2017 (r319911) +++ head/sys/dev/hwpmc/pmc_events.h Tue Jun 13 18:52:39 2017 (r319912) @@ -5624,7 +5624,7 @@ __PMC_EV_ALIAS("IMPC_C0H_TRK_REQUEST.ALL", UCP_EVENT_8 #define PMC_EV_ARMV7_FIRST PMC_EV_ARMV7_EVENT_00H #define PMC_EV_ARMV7_LAST PMC_EV_ARMV7_EVENT_FFH -#define __PMC_EV_ALIAS_ARMV7_COMMON_A8() \ +#define __PMC_EV_ALIAS_ARMV7_COMMON() \ __PMC_EV_ALIAS("PMNC_SW_INCR", ARMV7_EVENT_00H) \ __PMC_EV_ALIAS("L1_ICACHE_REFILL", ARMV7_EVENT_01H) \ __PMC_EV_ALIAS("ITLB_REFILL", ARMV7_EVENT_02H) \ @@ -5633,20 +5633,20 @@ __PMC_EV_ALIAS("IMPC_C0H_TRK_REQUEST.ALL", UCP_EVENT_8 __PMC_EV_ALIAS("DTLB_REFILL", ARMV7_EVENT_05H) \ __PMC_EV_ALIAS("MEM_READ", ARMV7_EVENT_06H) \ __PMC_EV_ALIAS("MEM_WRITE", ARMV7_EVENT_07H) \ - __PMC_EV_ALIAS("INSTR_EXECUTED", ARMV7_EVENT_08H) \ __PMC_EV_ALIAS("EXC_TAKEN", ARMV7_EVENT_09H) \ __PMC_EV_ALIAS("EXC_EXECUTED", ARMV7_EVENT_0AH) \ __PMC_EV_ALIAS("CID_WRITE", ARMV7_EVENT_0BH) \ __PMC_EV_ALIAS("PC_WRITE", ARMV7_EVENT_0CH) \ __PMC_EV_ALIAS("PC_IMM_BRANCH", ARMV7_EVENT_0DH) \ - __PMC_EV_ALIAS("PC_PROC_RETURN", ARMV7_EVENT_0EH) \ __PMC_EV_ALIAS("MEM_UNALIGNED_ACCESS", ARMV7_EVENT_0FH) \ __PMC_EV_ALIAS("PC_BRANCH_MIS_PRED", ARMV7_EVENT_10H) \ __PMC_EV_ALIAS("CLOCK_CYCLES", ARMV7_EVENT_11H) \ __PMC_EV_ALIAS("PC_BRANCH_PRED", ARMV7_EVENT_12H) -#define __PMC_EV_ALIAS_ARMV7_COMMON() \ - __PMC_EV_ALIAS_ARMV7_COMMON_A8() \ +#define __PMC_EV_ALIAS_ARMV7_COMMON_A8() \ + __PMC_EV_ALIAS_ARMV7_COMMON() \ + __PMC_EV_ALIAS("INSTR_EXECUTED", ARMV7_EVENT_08H) \ + __PMC_EV_ALIAS("PC_PROC_RETURN", ARMV7_EVENT_0EH) \ __PMC_EV_ALIAS("MEM_ACCESS", ARMV7_EVENT_13H) \ __PMC_EV_ALIAS("L1_ICACHE_ACCESS", ARMV7_EVENT_14H) \ __PMC_EV_ALIAS("L1_DCACHE_WB", ARMV7_EVENT_15H) \ @@ -5710,6 +5710,8 @@ __PMC_EV_ALIAS("IMPC_C0H_TRK_REQUEST.ALL", UCP_EVENT_8 __PMC_EV_ALIAS("DATA_EVICTION", ARMV7_EVENT_65H) \ __PMC_EV_ALIAS("ISSUE_DNOT_DISPATCH_ANY_INSTR", ARMV7_EVENT_66H) \ __PMC_EV_ALIAS("ISSUE_IS_EMPTY", ARMV7_EVENT_67H) \ + __PMC_EV_ALIAS("INSTR_RENAMED", ARMV7_EVENT_68H) \ + __PMC_EV_ALIAS("PREDICTABLE_FUNCTION_RETURN", ARMV7_EVENT_6EH) \ __PMC_EV_ALIAS("MAIN_EXECUTION_UNIT_PIPE", ARMV7_EVENT_70H) \ __PMC_EV_ALIAS("SECOND_EXECUTION_UNIT_PIPE", ARMV7_EVENT_71H) \ __PMC_EV_ALIAS("LOAD_STORE_PIPE", ARMV7_EVENT_72H) \ From owner-svn-src-all@freebsd.org Tue Jun 13 18:53:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82AF7BFC2EB; Tue, 13 Jun 2017 18:53:57 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50B8E3702; Tue, 13 Jun 2017 18:53:57 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DIruWW034955; Tue, 13 Jun 2017 18:53:56 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DIruKH034954; Tue, 13 Jun 2017 18:53:56 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706131853.v5DIruKH034954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 13 Jun 2017 18:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319913 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 18:53:57 -0000 Author: zbb Date: Tue Jun 13 18:53:56 2017 New Revision: 319913 URL: https://svnweb.freebsd.org/changeset/base/319913 Log: Fix INVARIANTS debug code in HWPMC When HWPMC stops sampling, ps_pmc may be freed before samples are processed. In such situation treat PMC as stopped. Add "ifdef" to fix build without INVARIANTS code. Submitted by: Michal Mazur Obtained from: Semihalf Sponsored by: Stormshield, Netgate Differential revision: https://reviews.freebsd.org/D10912 Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Jun 13 18:52:39 2017 (r319912) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Jun 13 18:53:56 2017 (r319913) @@ -4224,7 +4224,8 @@ pmc_capture_user_callchain(int cpu, int ring, struct t ps_end = psb->ps_write; do { #ifdef INVARIANTS - if (ps->ps_pmc->pm_state != PMC_STATE_RUNNING) + if ((ps->ps_pmc == NULL) || + (ps->ps_pmc->pm_state != PMC_STATE_RUNNING)) nfree++; #endif if (ps->ps_nsamples != PMC_SAMPLE_INUSE) @@ -4262,9 +4263,11 @@ next: ps = psb->ps_samples; } while (ps != ps_end); +#ifdef INVARIANTS KASSERT(ncallchains > 0 || nfree > 0, ("[pmc,%d] cpu %d didn't find a sample to collect", __LINE__, cpu)); +#endif KASSERT(td->td_pinned == 1, ("[pmc,%d] invalid td_pinned value", __LINE__)); From owner-svn-src-all@freebsd.org Tue Jun 13 18:55:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2ACABFC373; Tue, 13 Jun 2017 18:55:22 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99CD13871; Tue, 13 Jun 2017 18:55:22 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DItLgf035075; Tue, 13 Jun 2017 18:55:21 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DItLpT035073; Tue, 13 Jun 2017 18:55:21 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706131855.v5DItLpT035073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 13 Jun 2017 18:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319914 - in head/sys: arm/mv boot/fdt/dts/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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 18:55:22 -0000 Author: zbb Date: Tue Jun 13 18:55:21 2017 New Revision: 319914 URL: https://svnweb.freebsd.org/changeset/base/319914 Log: Enable HWPMC overflow IRQ on both CPUs in MPIC This commit enables usage of HWPMC interrupts for the Marvell SoCs, which use MPIC (Armada38x and ArmadaXP). Those interrupts require extra unmasking, comparing to others. Also, in order to process counters per-CPU, they are masked/unmasked using separate registers' sets for each core. Submitted by: Michal Mazur Marcin Wojtas Obtained from: Semihalf Sponsored by: Stormshield, Netgate Differential revision: https://reviews.freebsd.org/D10913 Modified: head/sys/arm/mv/mpic.c head/sys/boot/fdt/dts/arm/armada-38x.dtsi Modified: head/sys/arm/mv/mpic.c ============================================================================== --- head/sys/arm/mv/mpic.c Tue Jun 13 18:53:56 2017 (r319913) +++ head/sys/arm/mv/mpic.c Tue Jun 13 18:55:21 2017 (r319914) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif +#define MPIC_INT_LOCAL 3 #define MPIC_INT_ERR 4 #define MPIC_INT_MSI 96 @@ -93,7 +95,9 @@ __FBSDID("$FreeBSD$"); #define MPIC_IIACK 0x44 #define MPIC_ISM 0x48 #define MPIC_ICM 0x4c -#define MPIC_ERR_MASK 0xe50 +#define MPIC_ERR_MASK 0x50 +#define MPIC_LOCAL_MASK 0x54 +#define MPIC_CPU(n) (n) * 0x100 #define MPIC_PPI 32 @@ -223,6 +227,7 @@ mv_mpic_attach(device_t dev) struct mv_mpic_softc *sc; int error; uint32_t val; + int cpu; sc = (struct mv_mpic_softc *)device_get_softc(dev); @@ -283,6 +288,12 @@ mv_mpic_attach(device_t dev) mpic_unmask_msi(); + /* Unmask CPU performance counters overflow irq */ + for (cpu = 0; cpu < mp_ncpus; cpu++) + MPIC_CPU_WRITE(mv_mpic_sc, MPIC_CPU(cpu) + MPIC_LOCAL_MASK, + (1 << cpu) | MPIC_CPU_READ(mv_mpic_sc, + MPIC_CPU(cpu) + MPIC_LOCAL_MASK)); + return (0); } @@ -488,6 +499,16 @@ static void mpic_unmask_irq(uintptr_t nb) { +#ifdef SMP + int cpu; + + if (nb == MPIC_INT_LOCAL) { + for (cpu = 0; cpu < mp_ncpus; cpu++) + MPIC_CPU_WRITE(mv_mpic_sc, + MPIC_CPU(cpu) + MPIC_ICM, nb); + return; + } +#endif if (mpic_irq_is_percpu(nb)) MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ICM, nb); else if (nb < ERR_IRQ) @@ -503,6 +524,16 @@ static void mpic_mask_irq(uintptr_t nb) { +#ifdef SMP + int cpu; + + if (nb == MPIC_INT_LOCAL) { + for (cpu = 0; cpu < mp_ncpus; cpu++) + MPIC_CPU_WRITE(mv_mpic_sc, + MPIC_CPU(cpu) + MPIC_ISM, nb); + return; + } +#endif if (mpic_irq_is_percpu(nb)) MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ISM, nb); else if (nb < ERR_IRQ) Modified: head/sys/boot/fdt/dts/arm/armada-38x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/armada-38x.dtsi Tue Jun 13 18:53:56 2017 (r319913) +++ head/sys/boot/fdt/dts/arm/armada-38x.dtsi Tue Jun 13 18:55:21 2017 (r319914) @@ -419,7 +419,7 @@ mpic: interrupt-controller@20a00 { compatible = "marvell,mpic"; - reg = <0x20a00 0x2d0>, <0x21870 0x58>; + reg = <0x20a00 0x2d0>, <0x21870 0x300>; #interrupt-cells = <1>; #size-cells = <1>; interrupt-controller; From owner-svn-src-all@freebsd.org Tue Jun 13 18:59:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4325BFC46B; Tue, 13 Jun 2017 18:59:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B21393A53; Tue, 13 Jun 2017 18:59:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DIxY26035254; Tue, 13 Jun 2017 18:59:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DIxY1V035253; Tue, 13 Jun 2017 18:59:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706131859.v5DIxY1V035253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Jun 2017 18:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319915 - stable/11/sys/arm/arm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 18:59:36 -0000 Author: emaste Date: Tue Jun 13 18:59:34 2017 New Revision: 319915 URL: https://svnweb.freebsd.org/changeset/base/319915 Log: MFC r317428 (cognet): fix arm64 MSI In arm_gicv2m_alloc_msi(), if we found a suitable irq range, leave the loop before we increase irq again, or we'd end up choosing an irq, and then really using the next one, even if it's not available. Also in the inner loop, correct the end check so that we check every irq, even the last one. This makes the msk(4) adapter able to use MSI on Softiron Overdrive 1000. PR: 219956 Approved by: re (gjb) Modified: stable/11/sys/arm/arm/gic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/gic.c ============================================================================== --- stable/11/sys/arm/arm/gic.c Tue Jun 13 18:55:21 2017 (r319914) +++ stable/11/sys/arm/arm/gic.c Tue Jun 13 18:59:34 2017 (r319915) @@ -1640,7 +1640,7 @@ arm_gicv2m_alloc_msi(device_t dev, device_t child, int mtx_lock(&sc->sc_mutex); found = false; - for (irq = sc->sc_spi_start; irq < sc->sc_spi_end && !found; irq++) { + for (irq = sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { /* Start on an aligned interrupt */ if ((irq & (maxcount - 1)) != 0) continue; @@ -1649,7 +1649,7 @@ arm_gicv2m_alloc_msi(device_t dev, device_t child, int found = true; /* Check this range is valid */ - for (end_irq = irq; end_irq != irq + count - 1; end_irq++) { + for (end_irq = irq; end_irq != irq + count; end_irq++) { /* No free interrupts */ if (end_irq == sc->sc_spi_end) { found = false; @@ -1666,6 +1666,8 @@ arm_gicv2m_alloc_msi(device_t dev, device_t child, int break; } } + if (found) + break; } /* Not enough interrupts were found */ From owner-svn-src-all@freebsd.org Tue Jun 13 19:02:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B200BFC64D; Tue, 13 Jun 2017 19:02:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C1813EAF; Tue, 13 Jun 2017 19:02:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DJ2CGt039141; Tue, 13 Jun 2017 19:02:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DJ2CWj039140; Tue, 13 Jun 2017 19:02:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706131902.v5DJ2CWj039140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 13 Jun 2017 19:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319916 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 19:02:13 -0000 Author: kib Date: Tue Jun 13 19:02:12 2017 New Revision: 319916 URL: https://svnweb.freebsd.org/changeset/base/319916 Log: Remove stray return. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Tue Jun 13 18:59:34 2017 (r319915) +++ head/sys/kern/subr_prf.c Tue Jun 13 19:02:12 2017 (r319916) @@ -389,7 +389,6 @@ log_console(struct uio *uio) msgbuftrigger = 1; free(uio, M_IOV); free(consbuffer, M_TEMP); - return; } int From owner-svn-src-all@freebsd.org Tue Jun 13 19:32:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB691BFCD3D; Tue, 13 Jun 2017 19:32:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC13164B76; Tue, 13 Jun 2017 19:32:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DJWNLU051346; Tue, 13 Jun 2017 19:32:23 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DJWNQk051345; Tue, 13 Jun 2017 19:32:23 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201706131932.v5DJWNQk051345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 13 Jun 2017 19:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319917 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 19:32:25 -0000 Author: sbruno Date: Tue Jun 13 19:32:23 2017 New Revision: 319917 URL: https://svnweb.freebsd.org/changeset/base/319917 Log: Plug mbuf leak in the busdma path of iflib. Submitted by: Michael Tuexen Reported by: Drew Gallitin Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Jun 13 19:02:12 2017 (r319916) +++ head/sys/net/iflib.c Tue Jun 13 19:32:23 2017 (r319917) @@ -2880,8 +2880,8 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag if_ctx_t ctx; if_shared_ctx_t sctx; if_softc_ctx_t scctx; - int i, next, pidx, mask, err, maxsegsz, ntxd, count; - struct mbuf *m, *tmp, **ifsd_m, **mp; + int i, next, pidx, err, maxsegsz, ntxd, count; + struct mbuf *m, *tmp, **ifsd_m; m = *m0; @@ -2905,19 +2905,22 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag if (err) return (err); ifsd_flags[pidx] |= TX_SW_DESC_MAPPED; - i = 0; - next = pidx; - mask = (txq->ift_size-1); + count = 0; m = *m0; do { - mp = &ifsd_m[next]; - *mp = m; + if (__predict_false(m->m_len <= 0)) { + tmp = m; + m = m->m_next; + tmp->m_next = NULL; + m_free(tmp); + continue; + } + next = (pidx + count) & (ntxd-1); + MPASS(ifsd_m[next] == NULL); + ifsd_m[next] = m; + count++; + tmp = m; m = m->m_next; - if (__predict_false((*mp)->m_len == 0)) { - m_free(*mp); - *mp = NULL; - } else - next = (pidx + i) & (ntxd-1); } while (m != NULL); } else { int buflen, sgsize, max_sgsize; From owner-svn-src-all@freebsd.org Tue Jun 13 19:38:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FA92BFCEAF for ; Tue, 13 Jun 2017 19:38:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-x22c.google.com (mail-qt0-x22c.google.com [IPv6:2607:f8b0:400d:c0d::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C62F64F8E for ; Tue, 13 Jun 2017 19:38:37 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x22c.google.com with SMTP id w1so185995916qtg.2 for ; Tue, 13 Jun 2017 12:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TdgzOld8P2r9eByPI2mQ68ixwdg+w+Fq8UMRWdwk+mY=; b=jgcWjrhqYAn7b7ULfR1pJ35lz1TLqamAserl7bSnC/ckwARoN4p0tKIUw+/PrgYWmZ iTuSeg0MF4pIA42CotoWEYzegrL+uqfCQKx7w0NTkMiyrbfa8IYZtgLKpENtzEr6kv3L J07iFKkrC5eohyZ9jA3o1eH3QL24tQXwpSBP8T8O0IcGe9XWVsdmqdtK9/Zb/JSefSv0 gssg5NBbmrHoHVprAyecV4t6R/3XH4KOw3VT+YFG/oUHxgmChU4gGmRAhnKD2RyRtGcO Y9XjzMkM9OrGLmLBEs3RwxYa7j6C3XIdSuGDv60yQutILqvRYTVDHb7gVkc2LSqDaAW2 Hysw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TdgzOld8P2r9eByPI2mQ68ixwdg+w+Fq8UMRWdwk+mY=; b=klwVhaASbEtBNFdZptwVA6dAX63uk0keQFAd5YNTkO3x/E28sZZAwHyAgi7sijAcoo FibJfEaeL5j6p9A8bNB7ZnUV+lLEBUgo/fMo2XotrmDmZnec/oiRIyuwhyaT4T7Cx6gC 6MbvYENNoMs+VncbtsSv7P0bZ25TFHq8ZG5pcKmDUQQ8OJ82zSc5csCY0838idiVeQn3 FICBDD0mcrJcaL3WwVkB1kF6NfMFV9XFN0aR/ob8fdMOWkPWH2dv/7N1DZkHg7/FNM1x bsKYhDmorWUDphrKezbtAej5VjBzmYpnWM9soOOSfJPXFukbPRIPLIqrefkTpX9Q9mu7 OrCA== X-Gm-Message-State: AKS2vOy0Itpd3LTt9cOxIGPlXHJpLR6pSEQFHfIs2FjmwRLfWy3pgIHj QytmaR4T8zr2cbW7yETr0g== X-Received: by 10.237.54.131 with SMTP id f3mr2115689qtb.21.1497382716841; Tue, 13 Jun 2017 12:38:36 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id 63sm6317199qkb.60.2017.06.13.12.38.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2017 12:38:36 -0700 (PDT) Date: Tue, 13 Jun 2017 15:38:28 -0400 From: Shawn Webb To: Dimitry Andric Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319796 - in head/lib/clang: libclang liblldb libllvm Message-ID: <20170613193828.phcywbfmmpb5ul6c@mutt-hbsd> References: <201706101852.v5AIqDlU023869@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kwtgcyaszkeb6efl" Content-Disposition: inline In-Reply-To: <201706101852.v5AIqDlU023869@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20170428 (1.8.2) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 19:38:38 -0000 --kwtgcyaszkeb6efl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Dimitry, On Sat, Jun 10, 2017 at 06:52:13PM +0000, Dimitry Andric wrote: > Author: dim > Date: Sat Jun 10 18:52:13 2017 > New Revision: 319796 > URL: https://svnweb.freebsd.org/changeset/base/319796 >=20 > Log: > Remove a few unneeded files from libllvm, libclang and liblldb. > =20 > MFC after: 3 days >=20 This commit breaks buildworld when WITH_LLD_IS_LD, WITH_SYSTEM_COMPILER, WITH_SHARED_TOOLCHAIN are set. Reverting this commit fixes the build. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --kwtgcyaszkeb6efl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAllAPzEACgkQaoRlj1JF bu5sGw/+Khy73Ru6RMWacSGCa83tjYKAwtsy5pZFu7R8PHhnRxAayhp+Os2u59Zf cApXyTsBcjwD9hn4Rqol8sov2F5GjUOMa+xv22Go06c6fzsPRGqCWkomDC0PCD/t AVFk7FApNIasSzZuq2FaJFlT3jPxs1RGl2oImfC1e0cPC2LCgK4QAERePIsp/lkY 5mSN/FQ+4T+/6jiKf5wLfVp8uUQ4rNJ6ad6m8ab5kMqeseZDjJLV83HDAeEj9/07 8sjgb+uaoDCdGrO6t4cw7sK7RWdbiO56jCoEbE2mgyAnlIRLGOsSZ2/J7WqObhbp VtZCdhvlLBQSsWWxveuNNyU7M2xoNdA2lBD33FFlGlic0kb1qCsv4yIItksCd1de ffhaezq61d4uM1LK/6oNUzqXw2kwIyqgrOaCmL2LaB4/6U1POVrgK8iZyj+yze8f Np/qFRmSmWCYZTkHX2Ii0ADq8QaWuxCcXY7tmlB1dHz2ReFW9nd0eCNCF9CgBoZ8 t5IdgUlC39o+3a6pcAbeCMyTonqhFWPHs2KDLU2QF0vvjJjjXTcdg+i7jDQxj/iB ZgeE2Fl9O8/+K8O8W5bOwEeL7Tv3TUKLlqAbs7xPG7zDMnezY/8Y1xxlYG8BaTGP XSCkJqndteRfti2vbG2V2yhmXbVi6injNA4SomDbE+byTEhY7HM= =y5TD -----END PGP SIGNATURE----- --kwtgcyaszkeb6efl-- From owner-svn-src-all@freebsd.org Tue Jun 13 21:01:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35CBDBFE6A8; Tue, 13 Jun 2017 21:01:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D87467E44; Tue, 13 Jun 2017 21:01:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DL17ak085465; Tue, 13 Jun 2017 21:01:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DL17N1085463; Tue, 13 Jun 2017 21:01:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706132101.v5DL17N1085463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 13 Jun 2017 21:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319918 - in head/lib/clang: libclang liblldb libllvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 21:01:08 -0000 Author: dim Date: Tue Jun 13 21:01:06 2017 New Revision: 319918 URL: https://svnweb.freebsd.org/changeset/base/319918 Log: Revert r319796 for now, it can cause undefined references when linking in some circumstances. Reported by: Shawn Webb Modified: head/lib/clang/libclang/Makefile head/lib/clang/liblldb/Makefile head/lib/clang/libllvm/Makefile Modified: head/lib/clang/libclang/Makefile ============================================================================== --- head/lib/clang/libclang/Makefile Tue Jun 13 19:32:23 2017 (r319917) +++ head/lib/clang/libclang/Makefile Tue Jun 13 21:01:06 2017 (r319918) @@ -127,6 +127,7 @@ SRCS_MIN+= Analysis/ReachableCode.cpp SRCS_MIN+= Analysis/ScanfFormatString.cpp SRCS_MIN+= Analysis/ThreadSafety.cpp SRCS_MIN+= Analysis/ThreadSafetyCommon.cpp +SRCS_MIN+= Analysis/ThreadSafetyLogical.cpp SRCS_MIN+= Analysis/ThreadSafetyTIL.cpp SRCS_MIN+= Analysis/UninitializedValues.cpp SRCS_MIN+= Basic/Attributes.cpp @@ -271,6 +272,8 @@ SRCS_MIN+= Frontend/Rewrite/FrontendActions.cpp SRCS_MIN+= Frontend/Rewrite/HTMLPrint.cpp SRCS_MIN+= Frontend/Rewrite/InclusionRewriter.cpp SRCS_MIN+= Frontend/Rewrite/RewriteMacros.cpp +SRCS_MIN+= Frontend/Rewrite/RewriteModernObjC.cpp +SRCS_MIN+= Frontend/Rewrite/RewriteObjC.cpp SRCS_MIN+= Frontend/Rewrite/RewriteTest.cpp SRCS_MIN+= Frontend/SerializedDiagnosticPrinter.cpp SRCS_MIN+= Frontend/SerializedDiagnosticReader.cpp Modified: head/lib/clang/liblldb/Makefile ============================================================================== --- head/lib/clang/liblldb/Makefile Tue Jun 13 19:32:23 2017 (r319917) +++ head/lib/clang/liblldb/Makefile Tue Jun 13 21:01:06 2017 (r319918) @@ -31,6 +31,7 @@ SRCS+= API/SBEvent.cpp SRCS+= API/SBExecutionContext.cpp SRCS+= API/SBExpressionOptions.cpp SRCS+= API/SBFileSpec.cpp +SRCS+= API/SBFileSpecList.cpp SRCS+= API/SBFrame.cpp SRCS+= API/SBFunction.cpp SRCS+= API/SBHostOS.cpp @@ -41,6 +42,7 @@ SRCS+= API/SBLaunchInfo.cpp SRCS+= API/SBLineEntry.cpp SRCS+= API/SBListener.cpp SRCS+= API/SBMemoryRegionInfo.cpp +SRCS+= API/SBMemoryRegionInfoList.cpp SRCS+= API/SBModule.cpp SRCS+= API/SBModuleSpec.cpp SRCS+= API/SBPlatform.cpp @@ -69,6 +71,7 @@ SRCS+= API/SBTypeSummary.cpp SRCS+= API/SBUnixSignals.cpp SRCS+= API/SBValue.cpp SRCS+= API/SBValueList.cpp +SRCS+= API/SBVariablesOptions.cpp SRCS+= API/SBWatchpoint.cpp SRCS+= API/SystemInitializerFull.cpp SRCS+= Breakpoint/Breakpoint.cpp Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Tue Jun 13 19:32:23 2017 (r319917) +++ head/lib/clang/libllvm/Makefile Tue Jun 13 21:01:06 2017 (r319918) @@ -656,7 +656,7 @@ SRCS_MIN+= Support/Regex.cpp SRCS_MIN+= Support/SHA1.cpp SRCS_MIN+= Support/ScaledNumber.cpp SRCS_MIN+= Support/ScopedPrinter.cpp -SRCS_LDB+= Support/SearchForAddressOfSpecialSymbol.cpp +SRCS_MIN+= Support/SearchForAddressOfSpecialSymbol.cpp SRCS_MIN+= Support/Signals.cpp SRCS_MIN+= Support/SmallPtrSet.cpp SRCS_MIN+= Support/SmallVector.cpp @@ -1160,9 +1160,6 @@ SRCS_ALL+= ${SRCS_EXL} .endif .if ${MK_LLD} != "no" SRCS_ALL+= ${SRCS_LLD} -.endif -.if ${MK_LLDB} != "no" -SRCS_ALL+= ${SRCS_LDB} .endif .if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" SRCS_ALL+= ${SRCS_XDB} From owner-svn-src-all@freebsd.org Tue Jun 13 22:34:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDCDFC080BB; Tue, 13 Jun 2017 22:34:43 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C93666EAFD; Tue, 13 Jun 2017 22:34:43 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DMYgjG025880; Tue, 13 Jun 2017 22:34:42 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DMYgOa025879; Tue, 13 Jun 2017 22:34:42 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201706132234.v5DMYgOa025879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Tue, 13 Jun 2017 22:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319919 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 22:34:44 -0000 Author: rgrimes Date: Tue Jun 13 22:34:42 2017 New Revision: 319919 URL: https://svnweb.freebsd.org/changeset/base/319919 Log: MFC r307517, r314342, r316357, r317545, r317777: r307517: Typo fixed: arbitraty -> arbitrary. PR: 213559 r314342: bhyve: document virtio-console in the manpage r316357: Minor style improvements in bhyve.8 Replace "as of now" with "at present". As the change is a really minor one, don't bump .Dd. r317545: Document raw framebuffer device and XHCI device configurations. r317777: Improve documentation of fbuf device. Approved by: grehan (mentor) Approved by: re (gjb) Modified: stable/11/usr.sbin/bhyve/bhyve.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/11/usr.sbin/bhyve/bhyve.8 Tue Jun 13 21:01:06 2017 (r319918) +++ stable/11/usr.sbin/bhyve/bhyve.8 Tue Jun 13 22:34:42 2017 (r319919) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2016 +.Dd May 3, 2017 .Dt BHYVE 8 .Os .Sh NAME @@ -49,10 +49,13 @@ virtual machine. Parameters such as the number of virtual CPUs, amount of guest memory, and I/O connectivity can be specified with command-line parameters. .Pp -The guest operating system must be loaded with +If not using a boot ROM, the guest operating system must be loaded with .Xr bhyveload 8 or a similar boot loader before running -.Nm . +.Nm , +otherwise, it is enough to run +.Nm +with a boot ROM of choice. .Pp .Nm runs until the guest operating system reboots or an unhandled hypervisor @@ -171,8 +174,12 @@ Virtio network interface. Virtio block storage interface. .It Li virtio-rnd Virtio RNG interface. +.It Li virtio-console +Virtio console interface, which exposes multiple ports +to the guest in the form of simple char devices for simple IO +between the guest and host userspaces. .It Li ahci -AHCI controller attached to arbitraty devices. +AHCI controller attached to arbitrary devices. .It Li ahci-cd AHCI controller attached to an ATAPI CD/DVD. .It Li ahci-hd @@ -184,6 +191,10 @@ PCI 16550 serial device. .It Li lpc LPC PCI-ISA bridge with COM1 and COM2 16550 serial ports and a boot ROM. The LPC bridge emulation can only be configured on bus 0. +.It Li fbuf +Raw framebuffer device attached to VNC server. +.It Li xhci +eXtensible Host Controller Interface (xHCI) USB controller. .El .It Op Ar conf This optional parameter describes the backend for device emulations. @@ -270,7 +281,103 @@ The host device must have been reserved at boot-time u .Va pptdev loader variable as described in .Xr vmm 4 . +.Pp +Virtio console devices: +.Bl -tag -width 10n +.It Li port1= Ns Pa /path/to/port1.sock Ns ,anotherport= Ns Pa ... +A maximum of 16 ports per device can be created. +Every port is named and corresponds to a Unix domain socket created by +.Nm . +.Nm +accepts at most one connection per port at a time. +.Pp +Limitations: +.Bl -bullet -offset 2n +.It +Due to lack of destructors in +.Nm , +sockets on the filesystem must be cleaned up manually after +.Nm +exits. +.It +There is no way to use the "console port" feature, nor the console port +resize at present. +.It +Emergency write is advertised, but no-op at present. .El +.El +.Pp +Framebuffer devices: +.Bl -tag -width 10n +.It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc +.Bl -tag -width 8n +.It Ar IP:port +An +.Ar IP +address and a +.Ar port +VNC should listen on. +The default is to listen on localhost IPv4 address and default VNC port 5900. +Listening on an IPv6 address is not supported. +.It Ar width No and Ar height +A display resolution, width and height, respectively. +If not specified, a default resolution of 1024x768 pixels will be used. +Minimal supported resolution is 640x480 pixels, +and maximum is 1920x1200 pixels. +.It Ar vgaconf +Possible values for this option are +.Dq io +(default), +.Dq on +, and +.Dq off . +PCI graphics cards have a dual personality in that they are +standard PCI devices with BAR addressing, but may also +implicitly decode legacy VGA I/O space +.Pq Ad 0x3c0-3df +and memory space +.Pq 64KB at Ad 0xA0000 . +The default +.Dq io +option should be used for guests that attempt to issue BIOS +calls which result in I/O port queries, and fail to boot if I/O decode is disabled. +.Pp +The +.Dq on +option should be used along with the CSM BIOS capability in UEFI +to boot traditional BIOS guests that require the legacy VGA I/O and +memory regions to be available. +.Pp +The +.Dq off +option should be used for the UEFI guests that assume that +VGA adapter is present if they detect the I/O ports. +An example of such a guest is +.Ox +in UEFI mode. +.Pp +Please refer to the +.Nm +.Fx +wiki page +.Pq Lk https://wiki.freebsd.org/bhyve +for configuration notes of particular guests. +.It wait +Instruct +.Nm +to only boot upon the initiation of a VNC connection, simplifying the installation +of operating systems that require immediate keyboard input. +This can be removed for post-installation use. +.El +.El +.Pp +xHCI USB devices: +.Bl -tag -width 10n +.It Li tablet +A USB tablet device which provides precise cursor synchronization +when using VNC. +.El +.El .It Fl S Wire guest memory. .It Fl u @@ -318,11 +425,12 @@ halted triple fault .El .Sh EXAMPLES -The guest operating system must have been loaded with +If not using a boot ROM, the guest operating system must have been loaded with .Xr bhyveload 8 or a similar boot loader before .Xr bhyve 4 can be run. +Otherwise, the boot loader is not needed. .Pp To run a virtual machine with 1GB of memory, two virtual CPUs, a virtio block device backed by the @@ -359,6 +467,21 @@ cd:/images/install.iso \\ -s 3,virtio-net,tap0 \\ -l com1,/dev/nmdm0A \\ -A -H -P -m 8G +.Ed +.Pp +Run a UEFI virtual machine with a display resolution of 800 by 600 pixels +that can be accessed via VNC at: 0.0.0.0:5900. +.Bd -literal -offset indent +bhyve -c 2 -m 4G -w -H \\ + -s 0,hostbridge \\ + -s 3,ahci-cd,/path/to/uefi-OS-install.iso \\ + -s 4,ahci-hd,disk.img \\ + -s 5,virtio-net,tap0 \\ + -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\ + -s 30,xhci,tablet \\ + -s 31,lpc -l com1,stdio \\ + -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ + uefivm .Ed .Sh SEE ALSO .Xr bhyve 4 , From owner-svn-src-all@freebsd.org Tue Jun 13 22:57:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50A48C0888F; Tue, 13 Jun 2017 22:57:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FCD26F73C; Tue, 13 Jun 2017 22:57:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DMvwKM034677; Tue, 13 Jun 2017 22:57:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DMvwZ9034676; Tue, 13 Jun 2017 22:57:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706132257.v5DMvwZ9034676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Jun 2017 22:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r319920 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 22:57:59 -0000 Author: markj Date: Tue Jun 13 22:57:57 2017 New Revision: 319920 URL: https://svnweb.freebsd.org/changeset/base/319920 Log: Welcome Ryan Libby (rlibby) as a new src committer. He'll initially be upstreaming kernel bug fixes and improvements from Isilon. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Jun 13 22:34:42 2017 (r319919) +++ svnadmin/conf/access Tue Jun 13 22:57:57 2017 (r319920) @@ -171,6 +171,7 @@ qingli ray remko rgrimes +rlibby rmacklem roberto rodrigc Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Jun 13 22:34:42 2017 (r319919) +++ svnadmin/conf/mentors Tue Jun 13 22:57:57 2017 (r319920) @@ -23,6 +23,7 @@ kadesai ken Co-mentor: scottl, ambrisko mahrens mckusick peterj jhb Co-mentor: grog rgrimes grehan +rlibby markj slm ken Co-mentor: scottl, ambrisko stevek sjg wulf gonzo Co-mentor: bapt From owner-svn-src-all@freebsd.org Tue Jun 13 23:16:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A14CC08DF3; Tue, 13 Jun 2017 23:16:40 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E54E770117; Tue, 13 Jun 2017 23:16:39 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DNGdrC042726; Tue, 13 Jun 2017 23:16:39 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DNGdF2042725; Tue, 13 Jun 2017 23:16:39 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201706132316.v5DNGdF2042725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 13 Jun 2017 23:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319921 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 23:16:40 -0000 Author: sbruno Date: Tue Jun 13 23:16:38 2017 New Revision: 319921 URL: https://svnweb.freebsd.org/changeset/base/319921 Log: Add new sysctl to allow changing of timing of the txq timers. Add new sysctl to override use of busdma in the driver. Submitted by: Drew Gallitin Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Jun 13 22:57:57 2017 (r319920) +++ head/sys/net/iflib.c Tue Jun 13 23:16:38 2017 (r319921) @@ -520,6 +520,17 @@ rxd_info_zero(if_rxd_info_t ri) #define MAX_SINGLE_PACKET_FRACTION 12 #define IF_BAD_DMA (bus_addr_t)-1 +static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD, 0, + "iflib driver parameters"); + +static int iflib_timer_int; +SYSCTL_INT(_net_iflib, OID_AUTO, timer_int, CTLFLAG_RW, &iflib_timer_int, + 0, "interval at which to run per-queue timers (in ticks)"); + +static int force_busdma = 1; +SYSCTL_INT(_net_iflib, OID_AUTO, force_busdma, CTLFLAG_RDTUN, &force_busdma, + 1, "force busdma"); + #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING)) #define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx lock", MTX_DEF) @@ -559,9 +570,6 @@ TASKQGROUP_DEFINE(if_config_tqg, 1, 1); #endif /* !INVARIANTS */ #endif -static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD, 0, - "iflib driver parameters"); - /* * XXX need to ensure that this can't accidentally cause the head to be moved backwards */ @@ -1867,7 +1875,6 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun cb_arg.error = 0; q = fl->ifl_rxq; MPASS(sd_map != NULL); - MPASS(sd_map[idx] != NULL); err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[idx], cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, 0); bus_dmamap_sync(fl->ifl_desc_tag, sd_map[idx], BUS_DMASYNC_PREREAD); @@ -2110,7 +2117,8 @@ iflib_timer(void *arg) sctx->isc_pause_frames = 0; if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) - callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); + callout_reset_on(&txq->ift_timer, iflib_timer_int, iflib_timer, + txq, txq->ift_timer.c_cpu); return; hung: CTX_LOCK(ctx); @@ -2185,8 +2193,8 @@ iflib_init_locked(if_ctx_t ctx) IFDI_INTR_ENABLE(ctx); txq = ctx->ifc_txqs; for (i = 0; i < sctx->isc_ntxqsets; i++, txq++) - callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, - txq->ift_timer.c_cpu); + callout_reset_on(&txq->ift_timer, iflib_timer_int, iflib_timer, + txq, txq->ift_timer.c_cpu); } static int @@ -2897,7 +2905,7 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag ifsd_m = txq->ift_sds.ifsd_m; ntxd = txq->ift_size; pidx = txq->ift_pidx; - if (map != NULL) { + if (force_busdma || map != NULL) { uint8_t *ifsd_flags = txq->ift_sds.ifsd_flags; err = bus_dmamap_load_mbuf_sg(tag, map, @@ -3037,7 +3045,8 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) next = (cidx + CACHE_LINE_SIZE) & (ntxd-1); prefetch(&txq->ift_sds.ifsd_flags[next]); } - } else if (txq->ift_sds.ifsd_map != NULL) + } + if (txq->ift_sds.ifsd_map != NULL) map = txq->ift_sds.ifsd_map[pidx]; if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { @@ -3533,7 +3542,8 @@ _task_fn_admin(void *context) } IFDI_UPDATE_ADMIN_STATUS(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) - callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); + callout_reset_on(&txq->ift_timer, iflib_timer_int, iflib_timer, + txq, txq->ift_timer.c_cpu); IFDI_LINK_INTR_ENABLE(ctx); if (ctx->ifc_flags & IFC_DO_RESET) { ctx->ifc_flags &= ~IFC_DO_RESET; @@ -4087,6 +4097,8 @@ iflib_device_register(device_t dev, void *sc, if_share /* set unconditionally for !x86 */ ctx->ifc_flags |= IFC_DMAR; #endif + if (force_busdma) + ctx->ifc_flags |= IFC_DMAR; msix_bar = scctx->isc_msix_bar; main_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0; @@ -4409,6 +4421,9 @@ iflib_device_iov_add_vf(device_t dev, uint16_t vfnum, static int iflib_module_init(void) { + + iflib_timer_int = hz / 2; + TUNABLE_INT_FETCH("net.iflib.timer_int", &iflib_timer_int); return (0); } From owner-svn-src-all@freebsd.org Tue Jun 13 23:32:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FAFEC09356; Tue, 13 Jun 2017 23:32:23 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id F139A70855; Tue, 13 Jun 2017 23:32:22 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2a02:c7f:1e13:cf00:3c4a:423a:9e3f:34af] (unknown [IPv6:2a02:c7f:1e13:cf00:3c4a:423a:9e3f:34af]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id BEC7E4E6E1; Tue, 13 Jun 2017 23:32:21 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r319913 - head/sys/dev/hwpmc From: Andrew Turner In-Reply-To: <201706131853.v5DIruKH034954@repo.freebsd.org> Date: Wed, 14 Jun 2017 00:32:21 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8886277B-6036-41E8-819D-47AD6990F019@fubar.geek.nz> References: <201706131853.v5DIruKH034954@repo.freebsd.org> To: Zbigniew Bodek X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 23:32:23 -0000 > On 13 Jun 2017, at 19:53, Zbigniew Bodek wrote: >=20 > Author: zbb > Date: Tue Jun 13 18:53:56 2017 > New Revision: 319913 > URL: https://svnweb.freebsd.org/changeset/base/319913 >=20 > Log: > Fix INVARIANTS debug code in HWPMC >=20 > When HWPMC stops sampling, ps_pmc may be freed before samples > are processed. In such situation treat PMC as stopped. What is the sequence leading up to this? ... > Modified: head/sys/dev/hwpmc/hwpmc_mod.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Jun 13 18:52:39 2017 = (r319912) > +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Jun 13 18:53:56 2017 = (r319913) > @@ -4224,7 +4224,8 @@ pmc_capture_user_callchain(int cpu, int ring, = struct t > ps_end =3D psb->ps_write; > do { > #ifdef INVARIANTS > - if (ps->ps_pmc->pm_state !=3D PMC_STATE_RUNNING) > + if ((ps->ps_pmc =3D=3D NULL) || > + (ps->ps_pmc->pm_state !=3D PMC_STATE_RUNNING)) Isn=E2=80=99t this just moving the NULL pointer dereference later in the = function? I=E2=80=99m interested in knowing how the NULL pointer got = into this function. > nfree++; > #endif > if (ps->ps_nsamples !=3D PMC_SAMPLE_INUSE) > @@ -4262,9 +4263,11 @@ next: > ps =3D psb->ps_samples; > } while (ps !=3D ps_end); >=20 > +#ifdef INVARIANTS > KASSERT(ncallchains > 0 || nfree > 0, > ("[pmc,%d] cpu %d didn't find a sample to collect", = __LINE__, > cpu)); > +#endif Why is this needed? KASSERT is a top when INVARIANTS is undefined. Andrew From owner-svn-src-all@freebsd.org Tue Jun 13 23:49:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1F3CC0981E; Tue, 13 Jun 2017 23:49:50 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A26B370F2C; Tue, 13 Jun 2017 23:49:50 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DNnnO3054981; Tue, 13 Jun 2017 23:49:49 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DNnnV7054980; Tue, 13 Jun 2017 23:49:49 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201706132349.v5DNnnV7054980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 13 Jun 2017 23:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319922 - head/sys/dev/bnxt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 23:49:51 -0000 Author: sbruno Date: Tue Jun 13 23:49:49 2017 New Revision: 319922 URL: https://svnweb.freebsd.org/changeset/base/319922 Log: bnxt: In case of multi queues, have unique name for different IRQs. Submitted by: bhargava.marreddy@broadcom.com Differential Revision: https://reviews.freebsd.org/D11149 Modified: head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Tue Jun 13 23:16:38 2017 (r319921) +++ head/sys/dev/bnxt/if_bnxt.c Tue Jun 13 23:49:49 2017 (r319922) @@ -1500,6 +1500,7 @@ bnxt_msix_intr_assign(if_ctx_t ctx, int msix) struct bnxt_softc *softc = iflib_get_softc(ctx); int rc; int i; + char irq_name[16]; rc = iflib_irq_alloc_generic(ctx, &softc->def_cp_ring.irq, softc->def_cp_ring.ring.id + 1, IFLIB_INTR_ADMIN, @@ -1511,9 +1512,10 @@ bnxt_msix_intr_assign(if_ctx_t ctx, int msix) } for (i=0; iscctx->isc_nrxqsets; i++) { + snprintf(irq_name, sizeof(irq_name), "rxq%d", i); rc = iflib_irq_alloc_generic(ctx, &softc->rx_cp_rings[i].irq, softc->rx_cp_rings[i].ring.id + 1, IFLIB_INTR_RX, - bnxt_handle_rx_cp, &softc->rx_cp_rings[i], i, "rx_cp"); + bnxt_handle_rx_cp, &softc->rx_cp_rings[i], i, irq_name); if (rc) { device_printf(iflib_get_dev(ctx), "Failed to register RX completion ring handler\n"); From owner-svn-src-all@freebsd.org Tue Jun 13 23:50:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C97C09896; Tue, 13 Jun 2017 23:50:56 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3604710E1; Tue, 13 Jun 2017 23:50:56 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5DNotE9055744; Tue, 13 Jun 2017 23:50:55 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5DNotBh055743; Tue, 13 Jun 2017 23:50:55 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201706132350.v5DNotBh055743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 13 Jun 2017 23:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319923 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Jun 2017 23:50:57 -0000 Author: rlibby Date: Tue Jun 13 23:50:55 2017 New Revision: 319923 URL: https://svnweb.freebsd.org/changeset/base/319923 Log: Add myself (rlibby) as a src committer and markj as my mentor. Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D11189 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Jun 13 23:49:49 2017 (r319922) +++ head/share/misc/committers-src.dot Tue Jun 13 23:50:55 2017 (r319923) @@ -276,6 +276,7 @@ rdivacky [label="Roman Divacky\nrdivacky@FreeBSD.org\n remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"] rgrimes [label="Rodney W. Grimes\nrgrimes@FreeBSD.org\n1993/06/12\n2017/03/03"] rik [label="Roman Kurakin\nrik@FreeBSD.org\n2003/12/18"] +rlibby [label="Ryan Libby\nrlibby@FreeBSD.org\n2017/06/07"] rmacklem [label="Rick Macklem\nrmacklem@FreeBSD.org\n2009/03/27"] rmh [label="Robert Millan\nrmh@FreeBSD.org\n2011/09/18"] rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/09/15"] @@ -635,6 +636,7 @@ marcel -> nwhitehorn marcel -> sjg markj -> cem +markj -> rlibby markm -> jasone markm -> sheldonh From owner-svn-src-all@freebsd.org Wed Jun 14 02:28:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B136DC779AD; Wed, 14 Jun 2017 02:28:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FE907561F; Wed, 14 Jun 2017 02:28:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E2SAXD020439; Wed, 14 Jun 2017 02:28:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E2SAs4020438; Wed, 14 Jun 2017 02:28:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706140228.v5E2SAs4020438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 14 Jun 2017 02:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319928 - head/sys/dev/vt/hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 02:28:11 -0000 Author: ngie Date: Wed Jun 14 02:28:10 2017 New Revision: 319928 URL: https://svnweb.freebsd.org/changeset/base/319928 Log: Use nitems(..) when computing `max` instead of the longhand version of the same logic MFC after: 1 month Modified: head/sys/dev/vt/hw/vga/vt_vga.c Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Wed Jun 14 01:59:41 2017 (r319927) +++ head/sys/dev/vt/hw/vga/vt_vga.c Wed Jun 14 02:28:10 2017 (r319928) @@ -288,7 +288,7 @@ vga_get_cp437(term_char_t c) int min, mid, max; min = 0; - max = (sizeof(cp437table) / sizeof(struct unicp437)) - 1; + max = nitems(cp437table) - 1; if (c < cp437table[0].unicode_base || c > cp437table[max].unicode_base + cp437table[max].length) From owner-svn-src-all@freebsd.org Wed Jun 14 02:41:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA270C77C5B; Wed, 14 Jun 2017 02:41:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAA6675B1C; Wed, 14 Jun 2017 02:41:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E2fMNU025407; Wed, 14 Jun 2017 02:41:22 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E2fMGN025406; Wed, 14 Jun 2017 02:41:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201706140241.v5E2fMGN025406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 14 Jun 2017 02:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319929 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 02:41:24 -0000 Author: cy Date: Wed Jun 14 02:41:22 2017 New Revision: 319929 URL: https://svnweb.freebsd.org/changeset/base/319929 Log: -n (do nothing) is not a commmand option. Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Wed Jun 14 02:28:10 2017 (r319928) +++ head/contrib/ipfilter/tools/ippool.c Wed Jun 14 02:41:22 2017 (r319929) @@ -99,7 +99,7 @@ main(argc, argv) assigndefined(getenv("IPPOOL_PREDEFINED")); - switch (getopt(argc, argv, "aAf:FlnrRsv")) + switch (getopt(argc, argv, "aAf:FlrRsv")) { case 'a' : err = poolnodecommand(0, argc, argv); @@ -115,9 +115,6 @@ main(argc, argv) break; case 'l' : err = poollist(argc, argv); - break; - case 'n' : - opts |= OPT_DONOTHING|OPT_DONTOPEN; break; case 'r' : err = poolnodecommand(1, argc, argv); From owner-svn-src-all@freebsd.org Wed Jun 14 02:42:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC68FC77E2A; Wed, 14 Jun 2017 02:42:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACC0D75E1B; Wed, 14 Jun 2017 02:42:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E2gcRg028257; Wed, 14 Jun 2017 02:42:38 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E2gcQM028256; Wed, 14 Jun 2017 02:42:38 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201706140242.v5E2gcQM028256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 14 Jun 2017 02:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319930 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 02:42:40 -0000 Author: cy Date: Wed Jun 14 02:42:38 2017 New Revision: 319930 URL: https://svnweb.freebsd.org/changeset/base/319930 Log: Chase r319848: remove -v option from getopt() call. Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Wed Jun 14 02:41:22 2017 (r319929) +++ head/contrib/ipfilter/tools/ippool.c Wed Jun 14 02:42:38 2017 (r319930) @@ -99,7 +99,7 @@ main(argc, argv) assigndefined(getenv("IPPOOL_PREDEFINED")); - switch (getopt(argc, argv, "aAf:FlrRsv")) + switch (getopt(argc, argv, "aAf:FlrRs")) { case 'a' : err = poolnodecommand(0, argc, argv); From owner-svn-src-all@freebsd.org Wed Jun 14 03:45:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AC12C7905B; Wed, 14 Jun 2017 03:45:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39D7D77B2C; Wed, 14 Jun 2017 03:45:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E3jQmp053600; Wed, 14 Jun 2017 03:45:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E3jQnW053599; Wed, 14 Jun 2017 03:45:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706140345.v5E3jQnW053599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 14 Jun 2017 03:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319932 - head/sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 03:45:27 -0000 Author: markj Date: Wed Jun 14 03:45:26 2017 New Revision: 319932 URL: https://svnweb.freebsd.org/changeset/base/319932 Log: Fix handling of subpage BIO_WRITE and BIO_DELETE requests on swap MDs. Such requests would previously mark the entire page as valid, which was incorrect since nothing guaranteed that the page's contents had been initialized. This change also modifies subpage BIO_DELETEs so that the entire page is marked dirty, rather than only a subrange. There is no benefit to creating partially dirty swap pages. Reviewed by: alc, kib (previous version) MFC after: 3 days Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Jun 14 02:46:38 2017 (r319931) +++ head/sys/dev/md/md.c Wed Jun 14 03:45:26 2017 (r319932) @@ -972,6 +972,16 @@ unmapped_step: return (error); } +static void +md_swap_page_free(vm_page_t m) +{ + + vm_page_xunbusy(m); + vm_page_lock(m); + vm_page_free(m); + vm_page_unlock(m); +} + static int mdstart_swap(struct md_s *sc, struct bio *bp) { @@ -1044,15 +1054,17 @@ mdstart_swap(struct md_s *sc, struct bio *bp) cpu_flush_dcache(p, len); } } else if (bp->bio_cmd == BIO_WRITE) { - if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) + if (len == PAGE_SIZE || m->valid == VM_PAGE_BITS_ALL) + rv = VM_PAGER_OK; + else rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); - else - rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { vm_page_xunbusy(m); break; - } + } else if (rv == VM_PAGER_FAIL) + pmap_zero_page(m); + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { pmap_copy_pages(bp->bio_ma, ma_offs, &m, offs, len); @@ -1062,34 +1074,40 @@ mdstart_swap(struct md_s *sc, struct bio *bp) } else { physcopyin(p, VM_PAGE_TO_PHYS(m) + offs, len); } + m->valid = VM_PAGE_BITS_ALL; + vm_page_dirty(m); + vm_pager_page_unswapped(m); } else if (bp->bio_cmd == BIO_DELETE) { - if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) + if (len == PAGE_SIZE || m->valid == VM_PAGE_BITS_ALL) + rv = VM_PAGER_OK; + else rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); - else - rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { vm_page_xunbusy(m); break; - } - if (len != PAGE_SIZE) { - pmap_zero_page_area(m, offs, len); - vm_page_clear_dirty(m, offs, len); - m->valid = VM_PAGE_BITS_ALL; - } else + } else if (rv == VM_PAGER_FAIL) { + md_swap_page_free(m); + m = NULL; + } else { + /* Page is valid. */ + if (len != PAGE_SIZE) { + pmap_zero_page_area(m, offs, len); + vm_page_dirty(m); + } vm_pager_page_unswapped(m); + if (len == PAGE_SIZE) { + md_swap_page_free(m); + m = NULL; + } + } } - vm_page_xunbusy(m); - vm_page_lock(m); - if (bp->bio_cmd == BIO_DELETE && len == PAGE_SIZE) - vm_page_free(m); - else + if (m != NULL) { + vm_page_xunbusy(m); + vm_page_lock(m); vm_page_activate(m); - vm_page_unlock(m); - if (bp->bio_cmd == BIO_WRITE) { - vm_page_dirty(m); - vm_pager_page_unswapped(m); + vm_page_unlock(m); } /* Actions on further pages start at offset 0 */ From owner-svn-src-all@freebsd.org Wed Jun 14 03:50:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AED18C7912B; Wed, 14 Jun 2017 03:50:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A41D77CC1; Wed, 14 Jun 2017 03:50:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E3o2rt053812; Wed, 14 Jun 2017 03:50:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E3o2jA053811; Wed, 14 Jun 2017 03:50:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706140350.v5E3o2jA053811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 14 Jun 2017 03:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319933 - head/sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 03:50:03 -0000 Author: markj Date: Wed Jun 14 03:50:02 2017 New Revision: 319933 URL: https://svnweb.freebsd.org/changeset/base/319933 Log: Free the request page if an I/O error occurs while reading from swap. After such a failure, the page is invalid, so there's point in keeping it around. Moreover, such pages were not being inserted into the active queue, making them unreclaimable until a subsequent write or delete made them valid. Reported by: alc Reviewed by: alc (previous revision) MFC after: 1 week Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Jun 14 03:45:26 2017 (r319932) +++ head/sys/dev/md/md.c Wed Jun 14 03:50:02 2017 (r319933) @@ -1030,7 +1030,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp) rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); if (rv == VM_PAGER_ERROR) { - vm_page_xunbusy(m); + md_swap_page_free(m); break; } else if (rv == VM_PAGER_FAIL) { /* @@ -1060,7 +1060,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp) rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); if (rv == VM_PAGER_ERROR) { - vm_page_xunbusy(m); + md_swap_page_free(m); break; } else if (rv == VM_PAGER_FAIL) pmap_zero_page(m); @@ -1085,7 +1085,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp) rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); if (rv == VM_PAGER_ERROR) { - vm_page_xunbusy(m); + md_swap_page_free(m); break; } else if (rv == VM_PAGER_FAIL) { md_swap_page_free(m); From owner-svn-src-all@freebsd.org Wed Jun 14 03:55:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DA98C792D5; Wed, 14 Jun 2017 03:55:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC893780D9; Wed, 14 Jun 2017 03:55:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E3tBKA057539; Wed, 14 Jun 2017 03:55:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E3tBBm057538; Wed, 14 Jun 2017 03:55:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706140355.v5E3tBBm057538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 14 Jun 2017 03:55:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319934 - head/sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 03:55:13 -0000 Author: markj Date: Wed Jun 14 03:55:11 2017 New Revision: 319934 URL: https://svnweb.freebsd.org/changeset/base/319934 Log: Don't call vm_pager_page_unswapped() when writing or deleting a dirty page. The swap space backing a clean page is released when it is first dirtied, so there's no need to attempt to release swap space when the page is already dirty. Reviewed by: alc MFC after: 1 week Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Jun 14 03:50:02 2017 (r319933) +++ head/sys/dev/md/md.c Wed Jun 14 03:55:11 2017 (r319934) @@ -1076,8 +1076,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp) } m->valid = VM_PAGE_BITS_ALL; - vm_page_dirty(m); - vm_pager_page_unswapped(m); + if (m->dirty != VM_PAGE_BITS_ALL) { + vm_page_dirty(m); + vm_pager_page_unswapped(m); + } } else if (bp->bio_cmd == BIO_DELETE) { if (len == PAGE_SIZE || m->valid == VM_PAGE_BITS_ALL) rv = VM_PAGER_OK; @@ -1094,10 +1096,12 @@ mdstart_swap(struct md_s *sc, struct bio *bp) /* Page is valid. */ if (len != PAGE_SIZE) { pmap_zero_page_area(m, offs, len); - vm_page_dirty(m); - } - vm_pager_page_unswapped(m); - if (len == PAGE_SIZE) { + if (m->dirty != VM_PAGE_BITS_ALL) { + vm_page_dirty(m); + vm_pager_page_unswapped(m); + } + } else { + vm_pager_page_unswapped(m); md_swap_page_free(m); m = NULL; } From owner-svn-src-all@freebsd.org Wed Jun 14 04:16:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77D83C79762; Wed, 14 Jun 2017 04:16:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46BF4789EA; Wed, 14 Jun 2017 04:16:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E4Gb3C065902; Wed, 14 Jun 2017 04:16:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E4GbT1065901; Wed, 14 Jun 2017 04:16:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201706140416.v5E4GbT1065901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 14 Jun 2017 04:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319935 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 04:16:38 -0000 Author: jhibbits Date: Wed Jun 14 04:16:37 2017 New Revision: 319935 URL: https://svnweb.freebsd.org/changeset/base/319935 Log: Use mpc85xx_get_platform_clock() instead of rolling our own. Now that we have a single source for the platform clock, we don't need to roll our own in every user. Modified: head/sys/powerpc/mpc85xx/fsl_diu.c Modified: head/sys/powerpc/mpc85xx/fsl_diu.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_diu.c Wed Jun 14 03:55:11 2017 (r319934) +++ head/sys/powerpc/mpc85xx/fsl_diu.c Wed Jun 14 04:16:37 2017 (r319935) @@ -225,11 +225,9 @@ diu_set_pxclk(device_t dev, unsigned int freq) unsigned long bus_freq; uint32_t pxclk_set; uint32_t clkdvd; - int res; node = ofw_bus_get_node(device_get_parent(dev)); - if ((res = OF_getencprop(node, "bus-frequency", - (pcell_t *)&bus_freq, sizeof(bus_freq)) <= 0)) { + if ((bus_freq = mpc85xx_get_platform_clock()) <= 0) { device_printf(dev, "Unable to get bus frequency\n"); return (ENXIO); } From owner-svn-src-all@freebsd.org Wed Jun 14 04:26:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 236D9C7998C; Wed, 14 Jun 2017 04:26:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA6B178FB1; Wed, 14 Jun 2017 04:26:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E4QbvF069867; Wed, 14 Jun 2017 04:26:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E4QbVt069865; Wed, 14 Jun 2017 04:26:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201706140426.v5E4QbVt069865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 14 Jun 2017 04:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319936 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 04:26:39 -0000 Author: jhibbits Date: Wed Jun 14 04:26:37 2017 New Revision: 319936 URL: https://svnweb.freebsd.org/changeset/base/319936 Log: Actually add the mpc85xx_get_platform_clock() function. Follow up r319935 by actually committing the mpc85xx_get_platform_clock() function. This function was created to facilitate other development, and I thought I had committed it earlier. Some blocks depend on the platform clock rather than the system clock. The System clock is derived from the platform clock as one-half the platform clock. Rewrite mpc85xx_get_system_clock() to use the new function. Pointy-hat to: jhibbits Modified: head/sys/powerpc/mpc85xx/mpc85xx.c head/sys/powerpc/mpc85xx/mpc85xx.h Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Wed Jun 14 04:16:37 2017 (r319935) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Wed Jun 14 04:26:37 2017 (r319936) @@ -438,16 +438,28 @@ err: } uint32_t -mpc85xx_get_system_clock(void) +mpc85xx_get_platform_clock(void) { phandle_t soc; - uint32_t freq; + static uint32_t freq; + if (freq != 0) + return (freq); + soc = OF_finddevice("/soc"); - freq = 0; /* freq isn't modified on error. */ OF_getencprop(soc, "bus-frequency", (void *)&freq, sizeof(freq)); + + return (freq); +} + +uint32_t +mpc85xx_get_system_clock(void) +{ + uint32_t freq; + + freq = mpc85xx_get_platform_clock(); return (freq / 2); } Modified: head/sys/powerpc/mpc85xx/mpc85xx.h ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.h Wed Jun 14 04:16:37 2017 (r319935) +++ head/sys/powerpc/mpc85xx/mpc85xx.h Wed Jun 14 04:26:37 2017 (r319936) @@ -171,6 +171,7 @@ void mpc85xx_enable_l3_cache(void); void mpc85xx_fix_errata(vm_offset_t); void dataloss_erratum_access(vm_offset_t, uint32_t); int mpc85xx_is_qoriq(void); +uint32_t mpc85xx_get_platform_clock(void); uint32_t mpc85xx_get_system_clock(void); #endif /* _MPC85XX_H_ */ From owner-svn-src-all@freebsd.org Wed Jun 14 05:12:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6B6CD86009; Wed, 14 Jun 2017 05:12:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6B0D7A073; Wed, 14 Jun 2017 05:12:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E5C9kf089660; Wed, 14 Jun 2017 05:12:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E5C9jH089659; Wed, 14 Jun 2017 05:12:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706140512.v5E5C9jH089659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Jun 2017 05:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319937 - stable/11/sys/x86/acpica X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 05:12:10 -0000 Author: kib Date: Wed Jun 14 05:12:09 2017 New Revision: 319937 URL: https://svnweb.freebsd.org/changeset/base/319937 Log: MFC r319825: More accurately handle early EFER restoration on resume. Approved by: re (delphij) Modified: stable/11/sys/x86/acpica/acpi_wakeup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- stable/11/sys/x86/acpica/acpi_wakeup.c Wed Jun 14 04:26:37 2017 (r319936) +++ stable/11/sys/x86/acpica/acpi_wakeup.c Wed Jun 14 05:12:09 2017 (r319937) @@ -224,7 +224,8 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); #ifdef __amd64__ - WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER)); + WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER) & + ~(EFER_LMA)); #else WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); #endif From owner-svn-src-all@freebsd.org Wed Jun 14 07:46:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 838DBD87FAE; Wed, 14 Jun 2017 07:46:53 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 540047DD46; Wed, 14 Jun 2017 07:46:53 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E7kqH5050860; Wed, 14 Jun 2017 07:46:52 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E7kqUW050859; Wed, 14 Jun 2017 07:46:52 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201706140746.v5E7kqUW050859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Wed, 14 Jun 2017 07:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319938 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 07:46:53 -0000 Author: rlibby Date: Wed Jun 14 07:46:52 2017 New Revision: 319938 URL: https://svnweb.freebsd.org/changeset/base/319938 Log: ddb show files: fix up file types and whitespace This makes ddb show files more descriptive and also adjusts the whitespace to align the columns for non-32-bit architectures. Reviewed by: cem (previous version), jhb Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D11061 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Jun 14 05:12:09 2017 (r319937) +++ head/sys/kern/kern_descrip.c Wed Jun 14 07:46:52 2017 (r319938) @@ -3821,23 +3821,33 @@ file_type_to_name(short type) case 0: return ("zero"); case DTYPE_VNODE: - return ("vnod"); + return ("vnode"); case DTYPE_SOCKET: - return ("sock"); + return ("socket"); case DTYPE_PIPE: return ("pipe"); case DTYPE_FIFO: return ("fifo"); case DTYPE_KQUEUE: - return ("kque"); + return ("kqueue"); case DTYPE_CRYPTO: - return ("crpt"); + return ("crypto"); case DTYPE_MQUEUE: - return ("mque"); + return ("mqueue"); case DTYPE_SHM: return ("shm"); case DTYPE_SEM: return ("ksem"); + case DTYPE_PTS: + return ("pts"); + case DTYPE_DEV: + return ("dev"); + case DTYPE_PROCDESC: + return ("proc"); + case DTYPE_LINUXEFD: + return ("levent"); + case DTYPE_LINUXTFD: + return ("ltimer"); default: return ("unkn"); } @@ -3872,17 +3882,21 @@ file_to_first_proc(struct file *fp) static void db_print_file(struct file *fp, int header) { +#define XPTRWIDTH ((int)howmany(sizeof(void *) * NBBY, 4)) struct proc *p; if (header) - db_printf("%8s %4s %8s %8s %4s %5s %6s %8s %5s %12s\n", - "File", "Type", "Data", "Flag", "GCFl", "Count", - "MCount", "Vnode", "FPID", "FCmd"); + db_printf("%*s %6s %*s %8s %4s %5s %6s %*s %5s %s\n", + XPTRWIDTH, "File", "Type", XPTRWIDTH, "Data", "Flag", + "GCFl", "Count", "MCount", XPTRWIDTH, "Vnode", "FPID", + "FCmd"); p = file_to_first_proc(fp); - db_printf("%8p %4s %8p %08x %04x %5d %6d %8p %5d %12s\n", fp, - file_type_to_name(fp->f_type), fp->f_data, fp->f_flag, - 0, fp->f_count, 0, fp->f_vnode, + db_printf("%*p %6s %*p %08x %04x %5d %6d %*p %5d %s\n", XPTRWIDTH, + fp, file_type_to_name(fp->f_type), XPTRWIDTH, fp->f_data, + fp->f_flag, 0, fp->f_count, 0, XPTRWIDTH, fp->f_vnode, p != NULL ? p->p_pid : -1, p != NULL ? p->p_comm : "-"); + +#undef XPTRWIDTH } DB_SHOW_COMMAND(file, db_show_file) From owner-svn-src-all@freebsd.org Wed Jun 14 08:00:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89896D8845E; Wed, 14 Jun 2017 08:00:03 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.imp.ch (smtp.imp.ch [IPv6:2001:4060:1:1001::13:196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EC367E5D0; Wed, 14 Jun 2017 08:00:03 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from [172.29.4.124] (borderline21.nexus-ag.com [212.203.104.226]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id CAD79C9B65; Wed, 14 Jun 2017 09:59:50 +0200 (CEST) Subject: Re: svn commit: r319722 - in head: sys/cam/ctl sys/dev/iscsi sys/kern sys/netgraph sys/netgraph/bluetooth/socket sys/netinet sys/ofed/drivers/infiniband/core sys/ofed/drivers/infiniband/ulp/sdp sys/rpc... To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706082130.v58LUY0j095589@repo.freebsd.org> From: Andreas Tobler Message-ID: Date: Wed, 14 Jun 2017 09:59:50 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <201706082130.v58LUY0j095589@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-CH Content-Transfer-Encoding: 7bit X-Scanned-By: Idefix Submit on 127.0.1.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 08:00:03 -0000 Hi Gleb, with this revision I get either a kernel panic or a hang. This happens on powerpc (32-bit). The powerpc64 looks stable. Here you can see the backtrace in case of the panic: https://people.freebsd.org/~andreast/r319722_ppc32_1.jpg In the source code I see a comment with XXXGL... Is this powerpc specific or do you think that there are some issues in the uipc_socket.c code? Thanks, Andreas From owner-svn-src-all@freebsd.org Wed Jun 14 09:18:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B935FD89820; Wed, 14 Jun 2017 09:18:08 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9496680638; Wed, 14 Jun 2017 09:18:08 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 75847D00B16; Wed, 14 Jun 2017 05:18:00 -0400 (EDT) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id v5E9HwY2086445 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 14 Jun 2017 11:17:58 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id v5E9HwII086444; Wed, 14 Jun 2017 11:17:58 +0200 (CEST) (envelope-from pho) Date: Wed, 14 Jun 2017 11:17:58 +0200 From: Peter Holm To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319921 - head/sys/net Message-ID: <20170614091758.GA86374@x2.osted.lan> References: <201706132316.v5DNGdF2042725@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201706132316.v5DNGdF2042725@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 09:18:08 -0000 On Tue, Jun 13, 2017 at 11:16:39PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Tue Jun 13 23:16:38 2017 > New Revision: 319921 > URL: https://svnweb.freebsd.org/changeset/base/319921 > > Log: > Add new sysctl to allow changing of timing of the txq timers. > > Add new sysctl to override use of busdma in the driver. > > Submitted by: Drew Gallitin > > Modified: > head/sys/net/iflib.c > > Modified: head/sys/net/iflib.c > ============================================================================== > --- head/sys/net/iflib.c Tue Jun 13 22:57:57 2017 (r319920) Could this be yours? panic: Assertion ifsd_m[next] == NULL failed at ../../../net/iflib.c:2927 cpuid = 12 time = 1497431647 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe104fa993d0 vpanic() at vpanic+0x19c/frame 0xfffffe104fa99450 kassert_panic() at kassert_panic+0x126/frame 0xfffffe104fa994c0 iflib_txq_drain() at iflib_txq_drain+0xdf0/frame 0xfffffe104fa99640 drain_ring_lockless() at drain_ring_lockless+0xc0/frame 0xfffffe104fa996a0 ifmp_ring_enqueue() at ifmp_ring_enqueue+0x32e/frame 0xfffffe104fa99710 iflib_if_transmit() at iflib_if_transmit+0xb0/frame 0xfffffe104fa99750 ether_output() at ether_output+0x750/frame 0xfffffe104fa997f0 ip_output() at ip_output+0x14c3/frame 0xfffffe104fa99930 tcp_output() at tcp_output+0xf8c/frame 0xfffffe104fa99ad0 tcp_usr_send() at tcp_usr_send+0x3bd/frame 0xfffffe104fa99b40 sosend_generic() at sosend_generic+0x3ba/frame 0xfffffe104fa99bf0 clnt_vc_call() at clnt_vc_call+0x4b8/frame 0xfffffe104fa99d40 clnt_reconnect_call() at clnt_reconnect_call+0xe8/frame 0xfffffe104fa99de0 newnfs_request() at newnfs_request+0x1092/frame 0xfffffe104fa99f60 nfscl_request() at nfscl_request+0x5b/frame 0xfffffe104fa99fb0 nfsrpc_lookup() at nfsrpc_lookup+0x211/frame 0xfffffe104fa9a120 nfs_lookup() at nfs_lookup+0x463/frame 0xfffffe104fa9a460 VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0xfe/frame 0xfffffe104fa9a490 lookup() at lookup+0x6e2/frame 0xfffffe104fa9a530 namei() at namei+0x534/frame 0xfffffe104fa9a5f0 kern_statat() at kern_statat+0x9b/frame 0xfffffe104fa9a800 freebsd11_lstat() at freebsd11_lstat+0x33/frame 0xfffffe104fa9a980 amd64_syscall() at amd64_syscall+0x564/frame 0xfffffe104fa9aab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe104fa9aab0 --- syscall (190, FreeBSD ELF64, freebsd11_lstat), rip = 0x800910c7a, rsp = 0x7fffffffaed8, rbp = 0x7fffffffaf00 -- - Peter From owner-svn-src-all@freebsd.org Wed Jun 14 11:07:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05C53D8B089; Wed, 14 Jun 2017 11:07:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFB6583698; Wed, 14 Jun 2017 11:07:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A12EA260858; Wed, 14 Jun 2017 13:07:02 +0200 (CEST) Subject: Re: svn commit: r319905 - in head/sys: kern sys To: Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706131749.v5DHnnVm006485@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <39f386ba-2200-89ac-786b-6baf6c58c637@selasky.org> Date: Wed, 14 Jun 2017 13:04:59 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <201706131749.v5DHnnVm006485@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 11:07:05 -0000 On 06/13/17 19:49, Alan Cox wrote: > +#define bitcount64(x) __bitcount64((uint64_t)(x)) bitcount64() is already defined by sys/libkern.h - use that? --HPS From owner-svn-src-all@freebsd.org Wed Jun 14 13:23:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 365FED8DC3A; Wed, 14 Jun 2017 13:23:42 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF6F12E1E; Wed, 14 Jun 2017 13:23:41 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EDNfjO090558; Wed, 14 Jun 2017 13:23:41 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EDNf8W090557; Wed, 14 Jun 2017 13:23:41 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201706141323.v5EDNf8W090557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 14 Jun 2017 13:23:41 +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: r319941 - stable/10/sys/dev/hyperv/pcib 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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 13:23:42 -0000 Author: dexuan Date: Wed Jun 14 13:23:40 2017 New Revision: 319941 URL: https://svnweb.freebsd.org/changeset/base/319941 Log: MFC: 319690 r319690 hyperv/pcib: use the device serial number as PCI domain Currently the PCI domain is initialized with the instance GUID in vmbus_pcib_attach(). It turns out the GUID can change across VM reboot, while some users want a persistent value for PCI domain. The solution is that we can change to use the device serial number, which starts with 1 and is unique within a VM. Obtained from: Haiyang Zhang Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c ============================================================================== --- stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Wed Jun 14 08:01:53 2017 (r319940) +++ stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Wed Jun 14 13:23:40 2017 (r319941) @@ -574,6 +574,8 @@ new_pcichild_device(struct hv_pcibus *hbus, struct pci hpdev->desc = *desc; mtx_lock(&hbus->device_list_lock); + if (TAILQ_EMPTY(&hbus->children)) + hbus->pci_domain = desc->ser & 0xFFFF; TAILQ_INSERT_TAIL(&hbus->children, hpdev, link); mtx_unlock(&hbus->device_list_lock); return (hpdev); From owner-svn-src-all@freebsd.org Wed Jun 14 13:34:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A3B0D8DFD9; Wed, 14 Jun 2017 13:34:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 289DE33AB; Wed, 14 Jun 2017 13:34:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EDYA8M094467; Wed, 14 Jun 2017 13:34:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EDYAjG094466; Wed, 14 Jun 2017 13:34:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706141334.v5EDYAjG094466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 14 Jun 2017 13:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319942 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 13:34:11 -0000 Author: jhb Date: Wed Jun 14 13:34:09 2017 New Revision: 319942 URL: https://svnweb.freebsd.org/changeset/base/319942 Log: Don't try to assign interrupts to a CPU on single-CPU systems. All interrupts are routed to the sole CPU in that case implicitly. This is a regression in EARLY_AP_STARTUP. Previously the 'assign_cpu' variable was only set when a multi-CPU system finished booting, so it's value both meant that interrupts could be assigned and that there was more than one CPU. PR: 219882 Reported by: ota@j.email.ne.jp MFC after: 3 days Modified: head/sys/x86/x86/intr_machdep.c Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Wed Jun 14 13:23:40 2017 (r319941) +++ head/sys/x86/x86/intr_machdep.c Wed Jun 14 13:34:09 2017 (r319942) @@ -312,7 +312,9 @@ intr_assign_cpu(void *arg, int cpu) #ifdef EARLY_AP_STARTUP MPASS(mp_ncpus == 1 || smp_started); - if (cpu != NOCPU) { + + /* Nothing to do if there is only a single CPU. */ + if (mp_ncpus > 1 && cpu != NOCPU) { #else /* * Don't do anything during early boot. We will pick up the @@ -500,6 +502,8 @@ intr_next_cpu(void) #ifdef EARLY_AP_STARTUP MPASS(mp_ncpus == 1 || smp_started); + if (mp_ncpus == 1) + return (PCPU_GET(apic_id)); #else /* Leave all interrupts on the BSP during boot. */ if (!assign_cpu) From owner-svn-src-all@freebsd.org Wed Jun 14 13:44:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3FCBD8E2D6; Wed, 14 Jun 2017 13:44:33 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B37163974; Wed, 14 Jun 2017 13:44:33 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EDiW0c098773; Wed, 14 Jun 2017 13:44:32 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EDiWjT098772; Wed, 14 Jun 2017 13:44:32 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201706141344.v5EDiWjT098772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 14 Jun 2017 13:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319943 - stable/11/sys/dev/hyperv/pcib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 13:44:34 -0000 Author: dexuan Date: Wed Jun 14 13:44:32 2017 New Revision: 319943 URL: https://svnweb.freebsd.org/changeset/base/319943 Log: MFC: 319690 Approved by: re (marius) r319690 hyperv/pcib: use the device serial number as PCI domain Currently the PCI domain is initialized with the instance GUID in vmbus_pcib_attach(). It turns out the GUID can change across VM reboot, while some users want a persistent value for PCI domain. The solution is that we can change to use the device serial number, which starts with 1 and is unique within a VM. Obtained from: Haiyang Zhang Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c ============================================================================== --- stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c Wed Jun 14 13:34:09 2017 (r319942) +++ stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c Wed Jun 14 13:44:32 2017 (r319943) @@ -574,6 +574,8 @@ new_pcichild_device(struct hv_pcibus *hbus, struct pci hpdev->desc = *desc; mtx_lock(&hbus->device_list_lock); + if (TAILQ_EMPTY(&hbus->children)) + hbus->pci_domain = desc->ser & 0xFFFF; TAILQ_INSERT_TAIL(&hbus->children, hpdev, link); mtx_unlock(&hbus->device_list_lock); return (hpdev); From owner-svn-src-all@freebsd.org Wed Jun 14 14:19:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D99DD8ED40; Wed, 14 Jun 2017 14:19:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1002965173; Wed, 14 Jun 2017 14:19:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 437F4C41D; Wed, 14 Jun 2017 14:19:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 0266D2969; Wed, 14 Jun 2017 14:19:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id xVcubJ28J_8V; Wed, 14 Jun 2017 14:19:15 +0000 (UTC) Subject: Re: svn commit: r319897 - head/usr.bin/yes DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 796032963 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Wed, 14 Jun 2017 07:19:03 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <201706131235.v5DCZ1aR077437@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b50xE0XBHpP6Fi8ipLuAlVkslWEVIrvIp" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 14:19:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --b50xE0XBHpP6Fi8ipLuAlVkslWEVIrvIp Content-Type: multipart/mixed; boundary="1eDkbMBnkc2tLWoDVdQ1ffAlA2xxhA7uv"; protected-headers="v1" From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r319897 - head/usr.bin/yes References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> In-Reply-To: <201706131235.v5DCZ1aR077437@repo.freebsd.org> --1eDkbMBnkc2tLWoDVdQ1ffAlA2xxhA7uv Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/13/2017 5:35 AM, Pietro Cerutti wrote: > Author: gahr (ports committer) > Date: Tue Jun 13 12:35:01 2017 > New Revision: 319897 > URL: https://svnweb.freebsd.org/changeset/base/319897 >=20 > Log: > Improve yes' throughput > =20 > On my system, this brings up the throughput from ~20 to ~600 MiB/s. > =20 > Inspired by: https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu= _yes_so_fast/ > =20 > Reviewed by: cognet > Approved by: cognet >=20 > Modified: > head/usr.bin/yes/yes.c While here we should add libxo support. --=20 Regards, Bryan Drewery --1eDkbMBnkc2tLWoDVdQ1ffAlA2xxhA7uv-- --b50xE0XBHpP6Fi8ipLuAlVkslWEVIrvIp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZQUXkAAoJEDXXcbtuRpfP2LkIALTC8MHFt0xO35UHgiHoefPX HhFAMgEpMbnT1Vc9C/nwGWlLhgFw2rWfvqY4w7oBSKMDImkjQjhvvyT/73T1Mtuv eJSKSj+iaMPrIVHat71hoNWtA7jIvW/krx8HcPVEFbE9OwPdnqOieAy+giHf2aHd P/qsxHc735mcL9c7p+AAhCEUr25K5omWwfEOY2EwYFOS7F+//7BsrK0fLVRN/qRT BfeUnVFTM4h+W3joa9geTl7CrTqCwxbQW2N39fYiCaR7ynNV8w3J5wKRKk5zLhPr VWhfFhGokG4NniYmyCTvESPPgxpH3OFMrw0nR31mrBASgdLP5vI4pnZpb9gcQP0= =8tzG -----END PGP SIGNATURE----- --b50xE0XBHpP6Fi8ipLuAlVkslWEVIrvIp-- From owner-svn-src-all@freebsd.org Wed Jun 14 14:26:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E947ED8F168; Wed, 14 Jun 2017 14:26:09 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A15A26594B; Wed, 14 Jun 2017 14:26:09 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-qt0-x229.google.com with SMTP id u12so1900983qth.0; Wed, 14 Jun 2017 07:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GJRpSHBb5ss4Z4c3A0FRtxpic9joGAqicl8/IMopolQ=; b=B+Bx7mUijsuYRBArvPBO79rGzkfomaBtyA/FzwtXvlaO3XflJH+0czpxh/bSaC9WQ2 RlPKy29I73hO2HuvHd3vYmhqPmTWeOSeerQ3DoCNdumstCQtdW0V4z3yOAdnOEEvMUGK LJgmq7YWpzfpo0ZHr1b3qCOgS+umVeDyUytnj00opJPYeyygIO93SVhlikO0tkSV1yMi WnVlrh25WLrNi0x78kwNPfHzwQu6Y2z0BgdPeYYpe7FoYoL0vBY6ZUp4mDoTx64Bt2Nn UneUjBpkZAzncpOIlzGyKJ6NF/WLBpUxMNMrE7Btgwl9P7WiQWts3hZK31cl4U8pT33q FkUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GJRpSHBb5ss4Z4c3A0FRtxpic9joGAqicl8/IMopolQ=; b=T60PhbDXwBvmMtgOAluDZSc1DnSPeHg+sQGLQr6EZFIzlppJ3RS3e+d6CLr6rKe+/4 d9/iJ8m4GYVAMs4UzxLnB/k/RxMJ6sb+08VbKZ89Wb+pI8xRyRFyWJu89gNC6sSVRJMo 5/oYjPd0Son4cN9FC9HxDhvsPwVNhn3NjfydOKW8cHfskC0ss5ldrmAO6EoC0ycGlXef aSesNuqO0Yg+howPDwL40QdFBARgWb3r/ldZNPz8tGhykIFlmTdoYJ1BgJ4IJC7MzH6Y N+UtVMk/rlWbjY4IMiOcNQhxNrp+eqzzaUYGPNoIHaZS1jDDwD7Jr7SlclaVejDLBWwV idhw== X-Gm-Message-State: AKS2vOx99MP52Dvl0MJZeoR0B+8Mvcai8TIvWzXGSrP/qmdn5w3CPcqq mpaDE0pVbMqDSK+GKGVBd6oRn8T/7w== X-Received: by 10.200.50.68 with SMTP id y4mr450252qta.108.1497450368578; Wed, 14 Jun 2017 07:26:08 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.12.183.143 with HTTP; Wed, 14 Jun 2017 07:26:08 -0700 (PDT) In-Reply-To: References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> From: Justin Hibbits Date: Wed, 14 Jun 2017 09:26:08 -0500 X-Google-Sender-Auth: t7TwO1K64jFBWrKuRF4M0GOsMq0 Message-ID: Subject: Re: svn commit: r319897 - head/usr.bin/yes To: Bryan Drewery Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 14:26:10 -0000 On Wed, Jun 14, 2017 at 9:19 AM, Bryan Drewery wrote: > On 6/13/2017 5:35 AM, Pietro Cerutti wrote: >> Author: gahr (ports committer) >> Date: Tue Jun 13 12:35:01 2017 >> New Revision: 319897 >> URL: https://svnweb.freebsd.org/changeset/base/319897 >> >> Log: >> Improve yes' throughput >> >> On my system, this brings up the throughput from ~20 to ~600 MiB/s. >> >> Inspired by: https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/ >> >> Reviewed by: cognet >> Approved by: cognet >> >> Modified: >> head/usr.bin/yes/yes.c > > > While here we should add libxo support. > > -- > Regards, > Bryan Drewery > I think before we add libxo, we need to capsicumize it. After all, it does accept arbitrary arguments. - Justin From owner-svn-src-all@freebsd.org Wed Jun 14 14:28:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 678E9D8F29B; Wed, 14 Jun 2017 14:28:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3535F65B2B; Wed, 14 Jun 2017 14:28:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 67A12C8A8; Wed, 14 Jun 2017 14:28:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 82BCD29C0; Wed, 14 Jun 2017 14:28:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ri8ITJqtKevL; Wed, 14 Jun 2017 14:27:51 +0000 (UTC) Subject: Re: svn commit: r319897 - head/usr.bin/yes DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 6B98829BA To: Justin Hibbits Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <59cc8b64-0cba-70c7-68c8-53f48a3c1471@FreeBSD.org> Date: Wed, 14 Jun 2017 07:27:52 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Lr1kaO71U8FEll1dBBDDE7v5ErpO7t56J" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 14:28:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Lr1kaO71U8FEll1dBBDDE7v5ErpO7t56J Content-Type: multipart/mixed; boundary="wt26g00pDV7KoD3u92lA9UBBl1sHC7JMl"; protected-headers="v1" From: Bryan Drewery To: Justin Hibbits Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <59cc8b64-0cba-70c7-68c8-53f48a3c1471@FreeBSD.org> Subject: Re: svn commit: r319897 - head/usr.bin/yes References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> In-Reply-To: --wt26g00pDV7KoD3u92lA9UBBl1sHC7JMl Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/14/2017 7:26 AM, Justin Hibbits wrote: > On Wed, Jun 14, 2017 at 9:19 AM, Bryan Drewery w= rote: >> On 6/13/2017 5:35 AM, Pietro Cerutti wrote: >>> Author: gahr (ports committer) >>> Date: Tue Jun 13 12:35:01 2017 >>> New Revision: 319897 >>> URL: https://svnweb.freebsd.org/changeset/base/319897 >>> >>> Log: >>> Improve yes' throughput >>> >>> On my system, this brings up the throughput from ~20 to ~600 MiB/s.= >>> >>> Inspired by: https://www.reddit.com/r/unix/comments/6gxduc/how_is_g= nu_yes_so_fast/ >>> >>> Reviewed by: cognet >>> Approved by: cognet >>> >>> Modified: >>> head/usr.bin/yes/yes.c >> >> >> While here we should add libxo support. >> >> -- >> Regards, >> Bryan Drewery >> >=20 > I think before we add libxo, we need to capsicumize it. After all, it > does accept arbitrary arguments. The code has become more complex. I think capsicum does make sense now in case there is an unseen overflow in the new optimized code. --=20 Regards, Bryan Drewery --wt26g00pDV7KoD3u92lA9UBBl1sHC7JMl-- --Lr1kaO71U8FEll1dBBDDE7v5ErpO7t56J Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZQUfoAAoJEDXXcbtuRpfPnqQH/1/Cuff0Cj5R5wlcGBrvNY9R xoRA760pgWKprCkWNatbgbfMz7ovuHOUDDSQ/38Ubxzm09qg9L/pA1PLFYR3rdC/ y5wipMIXIhY7w6Tv2x5hRvYbWxinOTqfQ7J+R3U3D0goUPxTT4xLpohtRb41o40U ouWKA8YY83qrmDT+T59kA1T1HGPuVkp3ODsZnlK7NqSzXq5MSEM4VpeuAZHQ3oCW 2ccpL55ZuSkaxwRQI1j6VKmzjkugLy7IXFOoKfKtvP9pneZ8A5etHLlwVRzhGvND kz65XUDf+3pHcV97HAkhybfZx+D579BPMKE6AMaWKgOEufHESLun3r92F0nD5mY= =Ivhq -----END PGP SIGNATURE----- --Lr1kaO71U8FEll1dBBDDE7v5ErpO7t56J-- From owner-svn-src-all@freebsd.org Wed Jun 14 14:38:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E78ED8F579; Wed, 14 Jun 2017 14:38:48 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A69F663E8; Wed, 14 Jun 2017 14:38:48 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (97-123-31-18.albq.qwest.net [97.123.31.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 472B81928AB; Wed, 14 Jun 2017 14:38:40 +0000 (UTC) Subject: Re: svn commit: r319921 - head/sys/net To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706132316.v5DNGdF2042725@repo.freebsd.org> <20170614091758.GA86374@x2.osted.lan> From: Sean Bruno Message-ID: Date: Wed, 14 Jun 2017 08:38:36 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <20170614091758.GA86374@x2.osted.lan> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="55nAhhe45CI0s9CMLru7MlJqA0thKqh3a" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 14:38:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --55nAhhe45CI0s9CMLru7MlJqA0thKqh3a Content-Type: multipart/mixed; boundary="fhsdvdhWENAvee2TDsTco5XnKiaE1VC8n"; protected-headers="v1" From: Sean Bruno To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r319921 - head/sys/net References: <201706132316.v5DNGdF2042725@repo.freebsd.org> <20170614091758.GA86374@x2.osted.lan> In-Reply-To: <20170614091758.GA86374@x2.osted.lan> --fhsdvdhWENAvee2TDsTco5XnKiaE1VC8n Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 06/14/17 03:17, Peter Holm wrote: > On Tue, Jun 13, 2017 at 11:16:39PM +0000, Sean Bruno wrote: >> Author: sbruno >> Date: Tue Jun 13 23:16:38 2017 >> New Revision: 319921 >> URL: https://svnweb.freebsd.org/changeset/base/319921 >> >> Log: >> Add new sysctl to allow changing of timing of the txq timers. >> =20 >> Add new sysctl to override use of busdma in the driver. >> =20 >> Submitted by: Drew Gallitin >> >> Modified: >> head/sys/net/iflib.c >> >> Modified: head/sys/net/iflib.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/net/iflib.c Tue Jun 13 22:57:57 2017 (r319920) >=20 > Could this be yours? >=20 > panic: Assertion ifsd_m[next] =3D=3D NULL failed at ../../../net/iflib.= c:2927 > cpuid =3D 12 > time =3D 1497431647 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe104= fa993d0 > vpanic() at vpanic+0x19c/frame 0xfffffe104fa99450 > kassert_panic() at kassert_panic+0x126/frame 0xfffffe104fa994c0 > iflib_txq_drain() at iflib_txq_drain+0xdf0/frame 0xfffffe104fa99640 > drain_ring_lockless() at drain_ring_lockless+0xc0/frame 0xfffffe104fa99= 6a0 > ifmp_ring_enqueue() at ifmp_ring_enqueue+0x32e/frame 0xfffffe104fa99710= > iflib_if_transmit() at iflib_if_transmit+0xb0/frame 0xfffffe104fa99750 > ether_output() at ether_output+0x750/frame 0xfffffe104fa997f0 > ip_output() at ip_output+0x14c3/frame 0xfffffe104fa99930 > tcp_output() at tcp_output+0xf8c/frame 0xfffffe104fa99ad0 > tcp_usr_send() at tcp_usr_send+0x3bd/frame 0xfffffe104fa99b40 > sosend_generic() at sosend_generic+0x3ba/frame 0xfffffe104fa99bf0 > clnt_vc_call() at clnt_vc_call+0x4b8/frame 0xfffffe104fa99d40 > clnt_reconnect_call() at clnt_reconnect_call+0xe8/frame 0xfffffe104fa99= de0 > newnfs_request() at newnfs_request+0x1092/frame 0xfffffe104fa99f60 > nfscl_request() at nfscl_request+0x5b/frame 0xfffffe104fa99fb0 > nfsrpc_lookup() at nfsrpc_lookup+0x211/frame 0xfffffe104fa9a120 > nfs_lookup() at nfs_lookup+0x463/frame 0xfffffe104fa9a460 > VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0xfe/frame 0xfffffe104fa9a490 > lookup() at lookup+0x6e2/frame 0xfffffe104fa9a530 > namei() at namei+0x534/frame 0xfffffe104fa9a5f0 > kern_statat() at kern_statat+0x9b/frame 0xfffffe104fa9a800 > freebsd11_lstat() at freebsd11_lstat+0x33/frame 0xfffffe104fa9a980 > amd64_syscall() at amd64_syscall+0x564/frame 0xfffffe104fa9aab0 > Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe104fa9aab0 > --- syscall (190, FreeBSD ELF64, freebsd11_lstat), rip =3D 0x800910c7a,= rsp =3D 0x7fffffffaed8, rbp =3D 0x7fffffffaf00 -- >=20 > - Peter >=20 >=20 Is this new of this morning (after I committed updates yesterday)? sean --fhsdvdhWENAvee2TDsTco5XnKiaE1VC8n-- --55nAhhe45CI0s9CMLru7MlJqA0thKqh3a Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAllBSmxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LZuwQgAzxEtqYIKftudzB/Cbsek7pcMObafRnPgPRUse1Gra/ZQ+lcQuUAToLHD IB25pYhGSBexS2ezpB/dWu4aPAMAi8Sg0snehWJnzDI5X2cbOtHNxZS877YLLToD wXnq6hURhJF8g6d9/6z1gqhax66GkgsMPlfljUzqXutV/4r3PzzsTCrhM/exJFuc urbuQK1NELMVI75nVyXAzQ9WFvl1rMr+JilDci5Oa0lh0f8sPd7MGjnrXTpq+ddH zwpzRjz0ycF72T8evSpUpSDxvpEAWvfPuIoUK1UUX7Rf2ClHn3ZkXL8B4OIJ7bX2 ThQz8C3OMYivONmWp0q8y3ovdojwnA== =pB3N -----END PGP SIGNATURE----- --55nAhhe45CI0s9CMLru7MlJqA0thKqh3a-- From owner-svn-src-all@freebsd.org Wed Jun 14 14:46:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F5ED8F9BF; Wed, 14 Jun 2017 14:46:28 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 382BF669EC; Wed, 14 Jun 2017 14:46:28 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 4844ED00B2E; Wed, 14 Jun 2017 10:46:26 -0400 (EDT) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id v5EEkNKv096458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 14 Jun 2017 16:46:23 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id v5EEkNds096457; Wed, 14 Jun 2017 16:46:23 +0200 (CEST) (envelope-from pho) Date: Wed, 14 Jun 2017 16:46:23 +0200 From: Peter Holm To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319921 - head/sys/net Message-ID: <20170614144623.GA96234@x2.osted.lan> References: <201706132316.v5DNGdF2042725@repo.freebsd.org> <20170614091758.GA86374@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 14:46:28 -0000 On Wed, Jun 14, 2017 at 08:38:36AM -0600, Sean Bruno wrote: > > > On 06/14/17 03:17, Peter Holm wrote: > > On Tue, Jun 13, 2017 at 11:16:39PM +0000, Sean Bruno wrote: > >> Author: sbruno > >> Date: Tue Jun 13 23:16:38 2017 > >> New Revision: 319921 > >> URL: https://svnweb.freebsd.org/changeset/base/319921 > >> > >> Log: > >> Add new sysctl to allow changing of timing of the txq timers. > >> > >> Add new sysctl to override use of busdma in the driver. > >> > >> Submitted by: Drew Gallitin > >> > >> Modified: > >> head/sys/net/iflib.c > >> > >> Modified: head/sys/net/iflib.c > >> ============================================================================== > >> --- head/sys/net/iflib.c Tue Jun 13 22:57:57 2017 (r319920) > > > > Could this be yours? > > > > panic: Assertion ifsd_m[next] == NULL failed at ../../../net/iflib.c:2927 > > cpuid = 12 > > time = 1497431647 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe104fa993d0 > > vpanic() at vpanic+0x19c/frame 0xfffffe104fa99450 > > kassert_panic() at kassert_panic+0x126/frame 0xfffffe104fa994c0 > > iflib_txq_drain() at iflib_txq_drain+0xdf0/frame 0xfffffe104fa99640 > > drain_ring_lockless() at drain_ring_lockless+0xc0/frame 0xfffffe104fa996a0 > > ifmp_ring_enqueue() at ifmp_ring_enqueue+0x32e/frame 0xfffffe104fa99710 > > iflib_if_transmit() at iflib_if_transmit+0xb0/frame 0xfffffe104fa99750 > > ether_output() at ether_output+0x750/frame 0xfffffe104fa997f0 > > ip_output() at ip_output+0x14c3/frame 0xfffffe104fa99930 > > tcp_output() at tcp_output+0xf8c/frame 0xfffffe104fa99ad0 > > tcp_usr_send() at tcp_usr_send+0x3bd/frame 0xfffffe104fa99b40 > > sosend_generic() at sosend_generic+0x3ba/frame 0xfffffe104fa99bf0 > > clnt_vc_call() at clnt_vc_call+0x4b8/frame 0xfffffe104fa99d40 > > clnt_reconnect_call() at clnt_reconnect_call+0xe8/frame 0xfffffe104fa99de0 > > newnfs_request() at newnfs_request+0x1092/frame 0xfffffe104fa99f60 > > nfscl_request() at nfscl_request+0x5b/frame 0xfffffe104fa99fb0 > > nfsrpc_lookup() at nfsrpc_lookup+0x211/frame 0xfffffe104fa9a120 > > nfs_lookup() at nfs_lookup+0x463/frame 0xfffffe104fa9a460 > > VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0xfe/frame 0xfffffe104fa9a490 > > lookup() at lookup+0x6e2/frame 0xfffffe104fa9a530 > > namei() at namei+0x534/frame 0xfffffe104fa9a5f0 > > kern_statat() at kern_statat+0x9b/frame 0xfffffe104fa9a800 > > freebsd11_lstat() at freebsd11_lstat+0x33/frame 0xfffffe104fa9a980 > > amd64_syscall() at amd64_syscall+0x564/frame 0xfffffe104fa9aab0 > > Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe104fa9aab0 > > --- syscall (190, FreeBSD ELF64, freebsd11_lstat), rip = 0x800910c7a, rsp = 0x7fffffffaed8, rbp = 0x7fffffffaf00 -- > > > > - Peter > > > > > > > Is this new of this morning (after I committed updates yesterday)? > > sean > It's with r319940M. I'm now using r319919 without this issue. Here's the full boot log: https://people.freebsd.org/~pho/iflib.txt - Peter From owner-svn-src-all@freebsd.org Wed Jun 14 15:08:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D0B0D8FFF4; Wed, 14 Jun 2017 15:08:19 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A83367611; Wed, 14 Jun 2017 15:08:18 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.16.0.17/8.16.0.17) with SMTP id v5EF7qQv032219; Wed, 14 Jun 2017 10:08:10 -0500 Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by pp1.rice.edu with ESMTP id 2b361c82nv-1; Wed, 14 Jun 2017 10:08:09 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 8E75B4C0213; Wed, 14 Jun 2017 10:08:09 -0500 (CDT) Subject: Re: svn commit: r319905 - in head/sys: kern sys To: Hans Petter Selasky , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706131749.v5DHnnVm006485@repo.freebsd.org> <39f386ba-2200-89ac-786b-6baf6c58c637@selasky.org> From: Alan Cox Message-ID: Date: Wed, 14 Jun 2017 10:08:09 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <39f386ba-2200-89ac-786b-6baf6c58c637@selasky.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611190142 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 15:08:19 -0000 On 06/14/2017 06:04, Hans Petter Selasky wrote: > On 06/13/17 19:49, Alan Cox wrote: >> +#define bitcount64(x) __bitcount64((uint64_t)(x)) > > bitcount64() is already defined by sys/libkern.h - use that?=20 This snippet appears in code that is only used when compiling this file as a user-space application for testing. Attempting to use sys/libkern.h in the user-space compilation provoked warnings. Alan From owner-svn-src-all@freebsd.org Wed Jun 14 15:21:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E38AAB94592; Wed, 14 Jun 2017 15:21:35 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C057E6800B; Wed, 14 Jun 2017 15:21:34 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (97-123-31-18.albq.qwest.net [97.123.31.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 238901928AB; Wed, 14 Jun 2017 15:21:33 +0000 (UTC) Subject: Re: svn commit: r319921 - head/sys/net To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706132316.v5DNGdF2042725@repo.freebsd.org> <20170614091758.GA86374@x2.osted.lan> <20170614144623.GA96234@x2.osted.lan> From: Sean Bruno Message-ID: Date: Wed, 14 Jun 2017 09:21:30 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <20170614144623.GA96234@x2.osted.lan> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2bdAtFxw5the1028ifvOi2kGsKxrMSWOU" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 15:21:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2bdAtFxw5the1028ifvOi2kGsKxrMSWOU Content-Type: multipart/mixed; boundary="fGf3eet4tXrigb7NOMRilwgtOlvixcgmt"; protected-headers="v1" From: Sean Bruno To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r319921 - head/sys/net References: <201706132316.v5DNGdF2042725@repo.freebsd.org> <20170614091758.GA86374@x2.osted.lan> <20170614144623.GA96234@x2.osted.lan> In-Reply-To: <20170614144623.GA96234@x2.osted.lan> --fGf3eet4tXrigb7NOMRilwgtOlvixcgmt Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 06/14/17 08:46, Peter Holm wrote: > On Wed, Jun 14, 2017 at 08:38:36AM -0600, Sean Bruno wrote: >> >> >> On 06/14/17 03:17, Peter Holm wrote: >>> On Tue, Jun 13, 2017 at 11:16:39PM +0000, Sean Bruno wrote: >>>> Author: sbruno >>>> Date: Tue Jun 13 23:16:38 2017 >>>> New Revision: 319921 >>>> URL: https://svnweb.freebsd.org/changeset/base/319921 >>>> >>>> Log: >>>> Add new sysctl to allow changing of timing of the txq timers. >>>> =20 >>>> Add new sysctl to override use of busdma in the driver. >>>> =20 >>>> Submitted by: Drew Gallitin >>>> >>>> Modified: >>>> head/sys/net/iflib.c >>>> >>>> Modified: head/sys/net/iflib.c >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- head/sys/net/iflib.c Tue Jun 13 22:57:57 2017 (r319920) >>> >>> Could this be yours? >>> >>> panic: Assertion ifsd_m[next] =3D=3D NULL failed at ../../../net/ifli= b.c:2927 >>> cpuid =3D 12 >>> time =3D 1497431647 >>> KDB: stack backtrace: >>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe1= 04fa993d0 >>> vpanic() at vpanic+0x19c/frame 0xfffffe104fa99450 >>> kassert_panic() at kassert_panic+0x126/frame 0xfffffe104fa994c0 >>> iflib_txq_drain() at iflib_txq_drain+0xdf0/frame 0xfffffe104fa99640 >>> drain_ring_lockless() at drain_ring_lockless+0xc0/frame 0xfffffe104fa= 996a0 >>> ifmp_ring_enqueue() at ifmp_ring_enqueue+0x32e/frame 0xfffffe104fa997= 10 >>> iflib_if_transmit() at iflib_if_transmit+0xb0/frame 0xfffffe104fa9975= 0 >>> ether_output() at ether_output+0x750/frame 0xfffffe104fa997f0 >>> ip_output() at ip_output+0x14c3/frame 0xfffffe104fa99930 >>> tcp_output() at tcp_output+0xf8c/frame 0xfffffe104fa99ad0 >>> tcp_usr_send() at tcp_usr_send+0x3bd/frame 0xfffffe104fa99b40 >>> sosend_generic() at sosend_generic+0x3ba/frame 0xfffffe104fa99bf0 >>> clnt_vc_call() at clnt_vc_call+0x4b8/frame 0xfffffe104fa99d40 >>> clnt_reconnect_call() at clnt_reconnect_call+0xe8/frame 0xfffffe104fa= 99de0 >>> newnfs_request() at newnfs_request+0x1092/frame 0xfffffe104fa99f60 >>> nfscl_request() at nfscl_request+0x5b/frame 0xfffffe104fa99fb0 >>> nfsrpc_lookup() at nfsrpc_lookup+0x211/frame 0xfffffe104fa9a120 >>> nfs_lookup() at nfs_lookup+0x463/frame 0xfffffe104fa9a460 >>> VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0xfe/frame 0xfffffe104fa9a490 >>> lookup() at lookup+0x6e2/frame 0xfffffe104fa9a530 >>> namei() at namei+0x534/frame 0xfffffe104fa9a5f0 >>> kern_statat() at kern_statat+0x9b/frame 0xfffffe104fa9a800 >>> freebsd11_lstat() at freebsd11_lstat+0x33/frame 0xfffffe104fa9a980 >>> amd64_syscall() at amd64_syscall+0x564/frame 0xfffffe104fa9aab0 >>> Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe104fa9aab0 >>> --- syscall (190, FreeBSD ELF64, freebsd11_lstat), rip =3D 0x800910c7= a, rsp =3D 0x7fffffffaed8, rbp =3D 0x7fffffffaf00 -- >>> >>> - Peter >>> >>> >> >> >> Is this new of this morning (after I committed updates yesterday)? >> >> sean >> >=20 > It's with r319940M. I'm now using r319919 without this issue. >=20 > Here's the full boot log: https://people.freebsd.org/~pho/iflib.txt >=20 > - Peter >=20 Did you have to run any tests or anything to get this to happen? sean --fGf3eet4tXrigb7NOMRilwgtOlvixcgmt-- --2bdAtFxw5the1028ifvOi2kGsKxrMSWOU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAllBVHpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /Lb+XQgAy3jz/WG7MAbSqXSaRG9UGYXSCnLM34Hj8ncf1r8aq5RBGU5wao8T35Wx qOhy9UGPV1MvZxOOTuW+aeA8rOfGH6CX7bJDFsw2NoR5Axgx/xIYetnBc6DN5kvL 6JRmZ4zNgfpHzUzNC08wABO7d1SmfzTbV3K36SrHvT4gWsKaZzKyIq5ahqMMPo5u oSKGEDPpt9MJQlvi8DGMTJ6tNcV3bV13l4OEEV1377aUlqiDPnoWmsvBRktEmPSf n01I5ImGhs94/qn5TCQQMgZ1Rp0MIn7Kvgsvi4QvG6Khw3h24uDYNQNF6baIjZ/z YgzzeN811qwl3+hjQXi9fgcWsN+EIA== =DGIN -----END PGP SIGNATURE----- --2bdAtFxw5the1028ifvOi2kGsKxrMSWOU-- From owner-svn-src-all@freebsd.org Wed Jun 14 15:52:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00789B953A4; Wed, 14 Jun 2017 15:52:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B914D6A63F; Wed, 14 Jun 2017 15:52:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v5EFq53W062077; Wed, 14 Jun 2017 08:52:05 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v5EFq5rJ062076; Wed, 14 Jun 2017 08:52:05 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201706141552.v5EFq5rJ062076@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r319905 - in head/sys: kern sys In-Reply-To: To: Alan Cox Date: Wed, 14 Jun 2017 08:52:05 -0700 (PDT) CC: Hans Petter Selasky , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 15:52:16 -0000 [ Charset UTF-8 unsupported, converting... ] > On 06/14/2017 06:04, Hans Petter Selasky wrote: > > On 06/13/17 19:49, Alan Cox wrote: > >> +#define bitcount64(x) __bitcount64((uint64_t)(x)) > > > > bitcount64() is already defined by sys/libkern.h - use that? > > This snippet appears in code that is only used when compiling this file > as a user-space application for testing. Attempting to use > sys/libkern.h in the user-space compilation provoked warnings. Could we please add a comment to this define indicating this? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Jun 14 15:56:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83CFEB955C7; Wed, 14 Jun 2017 15:56:29 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4351B6A819; Wed, 14 Jun 2017 15:56:28 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 2BE62D00B93; Wed, 14 Jun 2017 11:56:27 -0400 (EDT) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id v5EFuPtb098550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 14 Jun 2017 17:56:25 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id v5EFuPlN098549; Wed, 14 Jun 2017 17:56:25 +0200 (CEST) (envelope-from pho) Date: Wed, 14 Jun 2017 17:56:25 +0200 From: Peter Holm To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319921 - head/sys/net Message-ID: <20170614155625.GA98459@x2.osted.lan> References: <201706132316.v5DNGdF2042725@repo.freebsd.org> <20170614091758.GA86374@x2.osted.lan> <20170614144623.GA96234@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 15:56:29 -0000 On Wed, Jun 14, 2017 at 09:21:30AM -0600, Sean Bruno wrote: > > > On 06/14/17 08:46, Peter Holm wrote: > > On Wed, Jun 14, 2017 at 08:38:36AM -0600, Sean Bruno wrote: > >> > >> > >> On 06/14/17 03:17, Peter Holm wrote: > >>> On Tue, Jun 13, 2017 at 11:16:39PM +0000, Sean Bruno wrote: > >>>> Author: sbruno > >>>> Date: Tue Jun 13 23:16:38 2017 > >>>> New Revision: 319921 > >>>> URL: https://svnweb.freebsd.org/changeset/base/319921 > >>>> > >>>> Log: > >>>> Add new sysctl to allow changing of timing of the txq timers. > >>>> > >>>> Add new sysctl to override use of busdma in the driver. > >>>> > >>>> Submitted by: Drew Gallitin > >>>> > >>>> Modified: > >>>> head/sys/net/iflib.c > >>>> > >>>> Modified: head/sys/net/iflib.c > >>>> ============================================================================== > >>>> --- head/sys/net/iflib.c Tue Jun 13 22:57:57 2017 (r319920) > >>> > >>> Could this be yours? > >>> > >>> panic: Assertion ifsd_m[next] == NULL failed at ../../../net/iflib.c:2927 > >>> cpuid = 12 > >>> time = 1497431647 > >>> KDB: stack backtrace: > >>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe104fa993d0 > >>> vpanic() at vpanic+0x19c/frame 0xfffffe104fa99450 > >>> kassert_panic() at kassert_panic+0x126/frame 0xfffffe104fa994c0 > >>> iflib_txq_drain() at iflib_txq_drain+0xdf0/frame 0xfffffe104fa99640 > >>> drain_ring_lockless() at drain_ring_lockless+0xc0/frame 0xfffffe104fa996a0 > >>> ifmp_ring_enqueue() at ifmp_ring_enqueue+0x32e/frame 0xfffffe104fa99710 > >>> iflib_if_transmit() at iflib_if_transmit+0xb0/frame 0xfffffe104fa99750 > >>> ether_output() at ether_output+0x750/frame 0xfffffe104fa997f0 > >>> ip_output() at ip_output+0x14c3/frame 0xfffffe104fa99930 > >>> tcp_output() at tcp_output+0xf8c/frame 0xfffffe104fa99ad0 > >>> tcp_usr_send() at tcp_usr_send+0x3bd/frame 0xfffffe104fa99b40 > >>> sosend_generic() at sosend_generic+0x3ba/frame 0xfffffe104fa99bf0 > >>> clnt_vc_call() at clnt_vc_call+0x4b8/frame 0xfffffe104fa99d40 > >>> clnt_reconnect_call() at clnt_reconnect_call+0xe8/frame 0xfffffe104fa99de0 > >>> newnfs_request() at newnfs_request+0x1092/frame 0xfffffe104fa99f60 > >>> nfscl_request() at nfscl_request+0x5b/frame 0xfffffe104fa99fb0 > >>> nfsrpc_lookup() at nfsrpc_lookup+0x211/frame 0xfffffe104fa9a120 > >>> nfs_lookup() at nfs_lookup+0x463/frame 0xfffffe104fa9a460 > >>> VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0xfe/frame 0xfffffe104fa9a490 > >>> lookup() at lookup+0x6e2/frame 0xfffffe104fa9a530 > >>> namei() at namei+0x534/frame 0xfffffe104fa9a5f0 > >>> kern_statat() at kern_statat+0x9b/frame 0xfffffe104fa9a800 > >>> freebsd11_lstat() at freebsd11_lstat+0x33/frame 0xfffffe104fa9a980 > >>> amd64_syscall() at amd64_syscall+0x564/frame 0xfffffe104fa9aab0 > >>> Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe104fa9aab0 > >>> --- syscall (190, FreeBSD ELF64, freebsd11_lstat), rip = 0x800910c7a, rsp = 0x7fffffffaed8, rbp = 0x7fffffffaf00 -- > >>> > >>> - Peter > >>> > >>> > >> > >> > >> Is this new of this morning (after I committed updates yesterday)? > >> > >> sean > >> > > > > It's with r319940M. I'm now using r319919 without this issue. > > > > Here's the full boot log: https://people.freebsd.org/~pho/iflib.txt > > > > - Peter > > > > > Did you have to run any tests or anything to get this to happen? > It varied slightly when I could get the panic. The one in the log was from just booting: Starting sshd. Starting sendmail_submit. Starting sendmail_msp_queue. Starting cron. Local package initialization:Jun 14 11:14:05 t1 ntpd[771]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): expired less than 14 days ago panic: Assertion ifsd_m[next] == NULL failed at ../../../net/iflib.c:2927 - Peter From owner-svn-src-all@freebsd.org Wed Jun 14 16:13:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B062EB95E20; Wed, 14 Jun 2017 16:13:00 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E1A06E938; Wed, 14 Jun 2017 16:12:59 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.16.0.17/8.16.0.17) with SMTP id v5EAoPW2010020; Wed, 14 Jun 2017 11:12:56 -0500 Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by pp2.rice.edu with ESMTP id 2b0btj9nqj-1; Wed, 14 Jun 2017 11:12:56 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh2.mail.rice.edu (Postfix) with ESMTPSA id CCF6A500150; Wed, 14 Jun 2017 11:12:55 -0500 (CDT) Subject: Re: svn commit: r319905 - in head/sys: kern sys To: rgrimes@freebsd.org Cc: Hans Petter Selasky , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706141552.v5EFq5rJ062076@pdx.rh.CN85.dnsmgr.net> From: Alan Cox Message-ID: <06a51008-6cb1-fbc1-500b-c5821b306649@rice.edu> Date: Wed, 14 Jun 2017 11:12:55 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <201706141552.v5EFq5rJ062076@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=5 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611190142 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:13:00 -0000 On 06/14/2017 10:52, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> On 06/14/2017 06:04, Hans Petter Selasky wrote: >>> On 06/13/17 19:49, Alan Cox wrote: >>>> +#define bitcount64(x) __bitcount64((uint64_t)(x)) >>> bitcount64() is already defined by sys/libkern.h - use that?=20 >> This snippet appears in code that is only used when compiling this fil= e >> as a user-space application for testing. Attempting to use >> sys/libkern.h in the user-space compilation provoked warnings. > Could we please add a comment to this define indicating this? > This snippet is enclosed in the #else of an #ifdef _KERNEL, where the entire #ifdef _KERNEL is not that long, so if you're looking at the actual file rather than a diff, it's pretty clear. And just a few lines above the #ifdef _KERNEL is the comment: * = =20 * This code can be compiled stand-alone for debugging. =20 */ From owner-svn-src-all@freebsd.org Wed Jun 14 16:13:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66DD0B95E94; Wed, 14 Jun 2017 16:13:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3422C6EA6D; Wed, 14 Jun 2017 16:13:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EGDKq5063022; Wed, 14 Jun 2017 16:13:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EGDKiI063021; Wed, 14 Jun 2017 16:13:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706141613.v5EGDKiI063021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 14 Jun 2017 16:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319944 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:13:21 -0000 Author: glebius Date: Wed Jun 14 16:13:20 2017 New Revision: 319944 URL: https://svnweb.freebsd.org/changeset/base/319944 Log: Check return value from soaccept(). Coverity: 1376209 Modified: head/sys/netgraph/ng_ksocket.c Modified: head/sys/netgraph/ng_ksocket.c ============================================================================== --- head/sys/netgraph/ng_ksocket.c Wed Jun 14 13:44:32 2017 (r319943) +++ head/sys/netgraph/ng_ksocket.c Wed Jun 14 16:13:20 2017 (r319944) @@ -1184,7 +1184,8 @@ ng_ksocket_accept(priv_p priv) if (error) return (error); - soaccept(so, &sa); + if ((error = soaccept(so, &sa)) != 0) + return (error); len = OFFSETOF(struct ng_ksocket_accept, addr); if (sa != NULL) From owner-svn-src-all@freebsd.org Wed Jun 14 16:23:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87668BEE602; Wed, 14 Jun 2017 16:23:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6434F6F62F; Wed, 14 Jun 2017 16:23:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EGNFdc067190; Wed, 14 Jun 2017 16:23:15 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EGNFI1067187; Wed, 14 Jun 2017 16:23:15 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706141623.v5EGNFI1067187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 14 Jun 2017 16:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319945 - in vendor/illumos/dist/lib: libzfs/common libzfs_core/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:23:16 -0000 Author: avg Date: Wed Jun 14 16:23:15 2017 New Revision: 319945 URL: https://svnweb.freebsd.org/changeset/base/319945 Log: 8264 want support for promoting datasets in libzfs_core illumos/illumos-gate@a4b8c9aa65a0a735aba318024a424a90d7b06c37 https://github.com/illumos/illumos-gate/commit/a4b8c9aa65a0a735aba318024a424a90d7b06c37 https://www.illumos.org/issues/8264 Oddly there is a lzc_clone function, but no lzc_promote function. Reviewed by: Andriy Gapon Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Approved by: Dan McDonald Author: Andrew Stormont Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Wed Jun 14 16:13:20 2017 (r319944) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Wed Jun 14 16:23:15 2017 (r319945) @@ -30,6 +30,7 @@ * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Nexenta Systems, Inc. * Copyright 2016 Igor Kozhukhov + * Copyright 2017 RackTop Systems. */ #include @@ -3630,8 +3631,7 @@ int zfs_promote(zfs_handle_t *zhp) { libzfs_handle_t *hdl = zhp->zfs_hdl; - zfs_cmd_t zc = { 0 }; - char parent[MAXPATHLEN]; + char snapname[ZFS_MAX_DATASET_NAME_LEN]; int ret; char errbuf[1024]; @@ -3644,31 +3644,25 @@ zfs_promote(zfs_handle_t *zhp) return (zfs_error(hdl, EZFS_BADTYPE, errbuf)); } - (void) strlcpy(parent, zhp->zfs_dmustats.dds_origin, sizeof (parent)); - if (parent[0] == '\0') { + if (zhp->zfs_dmustats.dds_origin[0] == '\0') { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "not a cloned filesystem")); return (zfs_error(hdl, EZFS_BADTYPE, errbuf)); } - (void) strlcpy(zc.zc_value, zhp->zfs_dmustats.dds_origin, - sizeof (zc.zc_value)); - (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - ret = zfs_ioctl(hdl, ZFS_IOC_PROMOTE, &zc); + ret = lzc_promote(zhp->zfs_name, snapname, sizeof (snapname)); if (ret != 0) { - int save_errno = errno; - - switch (save_errno) { + switch (ret) { case EEXIST: /* There is a conflicting snapshot name. */ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "conflicting snapshot '%s' from parent '%s'"), - zc.zc_string, parent); + snapname, zhp->zfs_dmustats.dds_origin); return (zfs_error(hdl, EZFS_EXISTS, errbuf)); default: - return (zfs_standard_error(hdl, save_errno, errbuf)); + return (zfs_standard_error(hdl, ret, errbuf)); } } return (ret); Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Wed Jun 14 16:13:20 2017 (r319944) +++ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Wed Jun 14 16:23:15 2017 (r319945) @@ -23,6 +23,7 @@ * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2017 RackTop Systems. */ /* @@ -203,6 +204,28 @@ lzc_clone(const char *fsname, const char *origin, return (error); } +int +lzc_promote(const char *fsname, char *snapnamebuf, int snapnamelen) +{ + /* + * The promote ioctl is still legacy, so we need to construct our + * own zfs_cmd_t rather than using lzc_ioctl(). + */ + zfs_cmd_t zc = { 0 }; + + ASSERT3S(g_refcount, >, 0); + VERIFY3S(g_fd, !=, -1); + + (void) strlcpy(zc.zc_name, fsname, sizeof (zc.zc_name)); + if (ioctl(g_fd, ZFS_IOC_PROMOTE, &zc) != 0) { + int error = errno; + if (error == EEXIST && snapnamebuf != NULL) + (void) strlcpy(snapnamebuf, zc.zc_string, snapnamelen); + return (error); + } + return (0); +} + /* * Creates snapshots. * @@ -330,7 +353,7 @@ lzc_exists(const char *dataset) { /* * The objset_stats ioctl is still legacy, so we need to construct our - * own zfs_cmd_t rather than using zfsc_ioctl(). + * own zfs_cmd_t rather than using lzc_ioctl(). */ zfs_cmd_t zc = { 0 }; Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Wed Jun 14 16:13:20 2017 (r319944) +++ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Wed Jun 14 16:23:15 2017 (r319945) @@ -22,6 +22,7 @@ /* * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2017 RackTop Systems. */ #ifndef _LIBZFS_CORE_H @@ -49,6 +50,7 @@ enum lzc_dataset_type { int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **); int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *); int lzc_clone(const char *, const char *, nvlist_t *); +int lzc_promote(const char *, char *, int); int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **); int lzc_bookmark(nvlist_t *, nvlist_t **); int lzc_get_bookmarks(const char *, nvlist_t *, nvlist_t **); From owner-svn-src-all@freebsd.org Wed Jun 14 16:27:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 367CCBEE758; Wed, 14 Jun 2017 16:27:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F29CB6F841; Wed, 14 Jun 2017 16:27:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EGRtfn067384; Wed, 14 Jun 2017 16:27:55 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EGRtmk067383; Wed, 14 Jun 2017 16:27:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706141627.v5EGRtmk067383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 14 Jun 2017 16:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319946 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:27:56 -0000 Author: avg Date: Wed Jun 14 16:27:54 2017 New Revision: 319946 URL: https://svnweb.freebsd.org/changeset/base/319946 Log: 8264 want support for promoting datasets in libzfs_core illumos/illumos-gate@a4b8c9aa65a0a735aba318024a424a90d7b06c37 https://github.com/illumos/illumos-gate/commit/a4b8c9aa65a0a735aba318024a424a90d7b06c37 https://www.illumos.org/issues/8264 Oddly there is a lzc_clone function, but no lzc_promote function. Reviewed by: Andriy Gapon Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Approved by: Dan McDonald Author: Andrew Stormont Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Wed Jun 14 16:23:15 2017 (r319945) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Wed Jun 14 16:27:54 2017 (r319946) @@ -31,6 +31,7 @@ * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Toomas Soome + * Copyright 2017 RackTop Systems. */ /* @@ -4702,7 +4703,6 @@ zfs_ioc_pool_reopen(zfs_cmd_t *zc) /* * inputs: * zc_name name of filesystem - * zc_value name of origin snapshot * * outputs: * zc_string name of conflicting snapshot, if there is one @@ -4710,16 +4710,49 @@ zfs_ioc_pool_reopen(zfs_cmd_t *zc) static int zfs_ioc_promote(zfs_cmd_t *zc) { + dsl_pool_t *dp; + dsl_dataset_t *ds, *ods; + char origin[ZFS_MAX_DATASET_NAME_LEN]; char *cp; + int error; + error = dsl_pool_hold(zc->zc_name, FTAG, &dp); + if (error != 0) + return (error); + + error = dsl_dataset_hold(dp, zc->zc_name, FTAG, &ds); + if (error != 0) { + dsl_pool_rele(dp, FTAG); + return (error); + } + + if (!dsl_dir_is_clone(ds->ds_dir)) { + dsl_dataset_rele(ds, FTAG); + dsl_pool_rele(dp, FTAG); + return (SET_ERROR(EINVAL)); + } + + error = dsl_dataset_hold_obj(dp, + dsl_dir_phys(ds->ds_dir)->dd_origin_obj, FTAG, &ods); + if (error != 0) { + dsl_dataset_rele(ds, FTAG); + dsl_pool_rele(dp, FTAG); + return (error); + } + + dsl_dataset_name(ods, origin); + dsl_dataset_rele(ods, FTAG); + dsl_dataset_rele(ds, FTAG); + dsl_pool_rele(dp, FTAG); + /* * We don't need to unmount *all* the origin fs's snapshots, but * it's easier. */ - cp = strchr(zc->zc_value, '@'); + cp = strchr(origin, '@'); if (cp) *cp = '\0'; - (void) dmu_objset_find(zc->zc_value, + (void) dmu_objset_find(origin, zfs_unmount_snap_cb, NULL, DS_FIND_SNAPSHOTS); return (dsl_dataset_promote(zc->zc_name, zc->zc_string)); } From owner-svn-src-all@freebsd.org Wed Jun 14 16:31:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50197BEE9FB; Wed, 14 Jun 2017 16:31:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A2656FB21; Wed, 14 Jun 2017 16:31:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EGVbCw071198; Wed, 14 Jun 2017 16:31:37 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EGVbj1071194; Wed, 14 Jun 2017 16:31:37 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706141631.v5EGVbj1071194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 14 Jun 2017 16:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319947 - in head: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:31:38 -0000 Author: avg Date: Wed Jun 14 16:31:36 2017 New Revision: 319947 URL: https://svnweb.freebsd.org/changeset/base/319947 Log: MFV r319945,r319946: 8264 want support for promoting datasets in libzfs_core illumos/illumos-gate@a4b8c9aa65a0a735aba318024a424a90d7b06c37 https://github.com/illumos/illumos-gate/commit/a4b8c9aa65a0a735aba318024a424a90d7b06c37 https://www.illumos.org/issues/8264 Oddly there is a lzc_clone function, but no lzc_promote function. Reviewed by: Andriy Gapon Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Approved by: Dan McDonald Author: Andrew Stormont MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Jun 14 16:27:54 2017 (r319946) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Jun 14 16:31:36 2017 (r319947) @@ -30,6 +30,7 @@ * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Nexenta Systems, Inc. * Copyright 2016 Igor Kozhukhov + * Copyright 2017 RackTop Systems. */ #include @@ -3675,8 +3676,7 @@ int zfs_promote(zfs_handle_t *zhp) { libzfs_handle_t *hdl = zhp->zfs_hdl; - zfs_cmd_t zc = { 0 }; - char parent[MAXPATHLEN]; + char snapname[ZFS_MAX_DATASET_NAME_LEN]; int ret; char errbuf[1024]; @@ -3689,31 +3689,25 @@ zfs_promote(zfs_handle_t *zhp) return (zfs_error(hdl, EZFS_BADTYPE, errbuf)); } - (void) strlcpy(parent, zhp->zfs_dmustats.dds_origin, sizeof (parent)); - if (parent[0] == '\0') { + if (zhp->zfs_dmustats.dds_origin[0] == '\0') { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "not a cloned filesystem")); return (zfs_error(hdl, EZFS_BADTYPE, errbuf)); } - (void) strlcpy(zc.zc_value, zhp->zfs_dmustats.dds_origin, - sizeof (zc.zc_value)); - (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - ret = zfs_ioctl(hdl, ZFS_IOC_PROMOTE, &zc); + ret = lzc_promote(zhp->zfs_name, snapname, sizeof (snapname)); if (ret != 0) { - int save_errno = errno; - - switch (save_errno) { + switch (ret) { case EEXIST: /* There is a conflicting snapshot name. */ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "conflicting snapshot '%s' from parent '%s'"), - zc.zc_string, parent); + snapname, zhp->zfs_dmustats.dds_origin); return (zfs_error(hdl, EZFS_EXISTS, errbuf)); default: - return (zfs_standard_error(hdl, save_errno, errbuf)); + return (zfs_standard_error(hdl, ret, errbuf)); } } return (ret); Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Jun 14 16:27:54 2017 (r319946) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Jun 14 16:31:36 2017 (r319947) @@ -23,6 +23,7 @@ * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2017 RackTop Systems. */ /* @@ -244,6 +245,28 @@ lzc_clone(const char *fsname, const char *origin, return (error); } +int +lzc_promote(const char *fsname, char *snapnamebuf, int snapnamelen) +{ + /* + * The promote ioctl is still legacy, so we need to construct our + * own zfs_cmd_t rather than using lzc_ioctl(). + */ + zfs_cmd_t zc = { 0 }; + + ASSERT3S(g_refcount, >, 0); + VERIFY3S(g_fd, !=, -1); + + (void) strlcpy(zc.zc_name, fsname, sizeof (zc.zc_name)); + if (ioctl(g_fd, ZFS_IOC_PROMOTE, &zc) != 0) { + int error = errno; + if (error == EEXIST && snapnamebuf != NULL) + (void) strlcpy(snapnamebuf, zc.zc_string, snapnamelen); + return (error); + } + return (0); +} + /* * Creates snapshots. * @@ -371,7 +394,7 @@ lzc_exists(const char *dataset) { /* * The objset_stats ioctl is still legacy, so we need to construct our - * own zfs_cmd_t rather than using zfsc_ioctl(). + * own zfs_cmd_t rather than using lzc_ioctl(). */ zfs_cmd_t zc = { 0 }; Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Jun 14 16:27:54 2017 (r319946) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Jun 14 16:31:36 2017 (r319947) @@ -22,6 +22,7 @@ /* * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Martin Matuska . All rights reserved. + * Copyright 2017 RackTop Systems. */ #ifndef _LIBZFS_CORE_H @@ -49,6 +50,7 @@ enum lzc_dataset_type { int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **); int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *); int lzc_clone(const char *, const char *, nvlist_t *); +int lzc_promote(const char *, char *, int); int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **); int lzc_bookmark(nvlist_t *, nvlist_t **); int lzc_get_bookmarks(const char *, nvlist_t *, nvlist_t **); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jun 14 16:27:54 2017 (r319946) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jun 14 16:31:36 2017 (r319947) @@ -32,6 +32,7 @@ * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Toomas Soome + * Copyright 2017 RackTop Systems. */ /* @@ -4884,7 +4885,6 @@ zfs_ioc_pool_reopen(zfs_cmd_t *zc) /* * inputs: * zc_name name of filesystem - * zc_value name of origin snapshot * * outputs: * zc_string name of conflicting snapshot, if there is one @@ -4892,16 +4892,49 @@ zfs_ioc_pool_reopen(zfs_cmd_t *zc) static int zfs_ioc_promote(zfs_cmd_t *zc) { + dsl_pool_t *dp; + dsl_dataset_t *ds, *ods; + char origin[ZFS_MAX_DATASET_NAME_LEN]; char *cp; + int error; + error = dsl_pool_hold(zc->zc_name, FTAG, &dp); + if (error != 0) + return (error); + + error = dsl_dataset_hold(dp, zc->zc_name, FTAG, &ds); + if (error != 0) { + dsl_pool_rele(dp, FTAG); + return (error); + } + + if (!dsl_dir_is_clone(ds->ds_dir)) { + dsl_dataset_rele(ds, FTAG); + dsl_pool_rele(dp, FTAG); + return (SET_ERROR(EINVAL)); + } + + error = dsl_dataset_hold_obj(dp, + dsl_dir_phys(ds->ds_dir)->dd_origin_obj, FTAG, &ods); + if (error != 0) { + dsl_dataset_rele(ds, FTAG); + dsl_pool_rele(dp, FTAG); + return (error); + } + + dsl_dataset_name(ods, origin); + dsl_dataset_rele(ods, FTAG); + dsl_dataset_rele(ds, FTAG); + dsl_pool_rele(dp, FTAG); + /* * We don't need to unmount *all* the origin fs's snapshots, but * it's easier. */ - cp = strchr(zc->zc_value, '@'); + cp = strchr(origin, '@'); if (cp) *cp = '\0'; - (void) dmu_objset_find(zc->zc_value, + (void) dmu_objset_find(origin, zfs_unmount_snap_cb, NULL, DS_FIND_SNAPSHOTS); return (dsl_dataset_promote(zc->zc_name, zc->zc_string)); } From owner-svn-src-all@freebsd.org Wed Jun 14 16:36:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BE67BEEB9F; Wed, 14 Jun 2017 16:36:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17DA96FFC2; Wed, 14 Jun 2017 16:36:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EGa2at071411; Wed, 14 Jun 2017 16:36:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EGa1EW071404; Wed, 14 Jun 2017 16:36:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706141636.v5EGa1EW071404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 14 Jun 2017 16:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319948 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:36:03 -0000 Author: avg Date: Wed Jun 14 16:36:01 2017 New Revision: 319948 URL: https://svnweb.freebsd.org/changeset/base/319948 Log: 5428 provide fts(), reallocarray(), and strtonum() illumos/illumos-gate@4585130b259133a26efae68275dbe56b08366deb https://github.com/illumos/illumos-gate/commit/4585130b259133a26efae68275dbe56b08366deb https://www.illumos.org/issues/5428 Reviewed by: Robert Mustacchi Approved by: Joshua M. Clulow Author: Yuri Pankov Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_errlog.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c Wed Jun 14 16:31:36 2017 (r319947) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c Wed Jun 14 16:36:01 2017 (r319948) @@ -85,7 +85,7 @@ dsl_deadlist_load_tree(dsl_deadlist_t *dl) zap_cursor_retrieve(&zc, &za) == 0; zap_cursor_advance(&zc)) { dsl_deadlist_entry_t *dle = kmem_alloc(sizeof (*dle), KM_SLEEP); - dle->dle_mintxg = strtonum(za.za_name, NULL); + dle->dle_mintxg = zfs_strtonum(za.za_name, NULL); VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, za.za_first_integer)); avl_add(&dl->dl_tree, dle); @@ -490,7 +490,7 @@ dsl_deadlist_merge(dsl_deadlist_t *dl, uint64_t obj, d for (zap_cursor_init(&zc, dl->dl_os, obj); zap_cursor_retrieve(&zc, &za) == 0; zap_cursor_advance(&zc)) { - uint64_t mintxg = strtonum(za.za_name, NULL); + uint64_t mintxg = zfs_strtonum(za.za_name, NULL); dsl_deadlist_insert_bpobj(dl, za.za_first_integer, mintxg, tx); VERIFY3U(0, ==, zap_remove_int(dl->dl_os, obj, mintxg, tx)); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Wed Jun 14 16:31:36 2017 (r319947) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Wed Jun 14 16:36:01 2017 (r319948) @@ -1365,7 +1365,7 @@ dsl_scan_visit(dsl_scan_t *scn, dmu_tx_t *tx) dsl_dataset_t *ds; uint64_t dsobj; - dsobj = strtonum(za.za_name, NULL); + dsobj = zfs_strtonum(za.za_name, NULL); VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj, dsobj, tx)); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c Wed Jun 14 16:31:36 2017 (r319947) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c Wed Jun 14 16:36:01 2017 (r319948) @@ -340,7 +340,7 @@ static int dsl_dataset_hold_obj_string(dsl_pool_t *dp, const char *dsobj, void *tag, dsl_dataset_t **dsp) { - return (dsl_dataset_hold_obj(dp, strtonum(dsobj, NULL), tag, dsp)); + return (dsl_dataset_hold_obj(dp, zfs_strtonum(dsobj, NULL), tag, dsp)); } static int Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_errlog.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_errlog.c Wed Jun 14 16:31:36 2017 (r319947) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_errlog.c Wed Jun 14 16:36:01 2017 (r319948) @@ -73,13 +73,13 @@ bookmark_to_name(zbookmark_phys_t *zb, char *buf, size static void name_to_bookmark(char *buf, zbookmark_phys_t *zb) { - zb->zb_objset = strtonum(buf, &buf); + zb->zb_objset = zfs_strtonum(buf, &buf); ASSERT(*buf == ':'); - zb->zb_object = strtonum(buf + 1, &buf); + zb->zb_object = zfs_strtonum(buf + 1, &buf); ASSERT(*buf == ':'); - zb->zb_level = (int)strtonum(buf + 1, &buf); + zb->zb_level = (int)zfs_strtonum(buf + 1, &buf); ASSERT(*buf == ':'); - zb->zb_blkid = strtonum(buf + 1, &buf); + zb->zb_blkid = zfs_strtonum(buf + 1, &buf); ASSERT(*buf == '\0'); } #endif Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Wed Jun 14 16:31:36 2017 (r319947) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Wed Jun 14 16:36:01 2017 (r319948) @@ -1481,7 +1481,7 @@ zfs_panic_recover(const char *fmt, ...) * lowercase hexadecimal numbers that don't overflow. */ uint64_t -strtonum(const char *str, char **nptr) +zfs_strtonum(const char *str, char **nptr) { uint64_t val = 0; char c; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Wed Jun 14 16:31:36 2017 (r319947) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Wed Jun 14 16:36:01 2017 (r319948) @@ -829,7 +829,7 @@ extern int spa_maxblocksize(spa_t *spa); extern void zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp); extern int spa_mode(spa_t *spa); -extern uint64_t strtonum(const char *str, char **nptr); +extern uint64_t zfs_strtonum(const char *str, char **nptr); extern char *spa_his_ievent_table[]; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Wed Jun 14 16:31:36 2017 (r319947) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Wed Jun 14 16:36:01 2017 (r319948) @@ -632,7 +632,7 @@ fuidstr_to_sid(zfsvfs_t *zfsvfs, const char *fuidstr, uint64_t fuid; const char *domain; - fuid = strtonum(fuidstr, NULL); + fuid = zfs_strtonum(fuidstr, NULL); domain = zfs_fuid_find_by_idx(zfsvfs, FUID_INDEX(fuid)); if (domain) From owner-svn-src-all@freebsd.org Wed Jun 14 16:42:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25F4CBEF0EA; Wed, 14 Jun 2017 16:42:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBD9E706E0; Wed, 14 Jun 2017 16:42:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EGgdlj075577; Wed, 14 Jun 2017 16:42:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EGgcCA075571; Wed, 14 Jun 2017 16:42:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706141642.v5EGgcCA075571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 14 Jun 2017 16:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319949 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:42:40 -0000 Author: avg Date: Wed Jun 14 16:42:38 2017 New Revision: 319949 URL: https://svnweb.freebsd.org/changeset/base/319949 Log: MFV r319948: 5428 provide fts(), reallocarray(), and strtonum() illumos/illumos-gate@4585130b259133a26efae68275dbe56b08366deb https://github.com/illumos/illumos-gate/commit/4585130b259133a26efae68275dbe56b08366deb https://www.illumos.org/issues/5428 Most of the upstream change is not applicable to FreeBSD. Only the renaming of strtonum to zfs_strtonum is relevant to us. And we already had it partially done. Reviewed by: Robert Mustacchi Approved by: Joshua M. Clulow Author: Yuri Pankov MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Wed Jun 14 16:36:01 2017 (r319948) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Wed Jun 14 16:42:38 2017 (r319949) @@ -85,7 +85,7 @@ dsl_deadlist_load_tree(dsl_deadlist_t *dl) zap_cursor_retrieve(&zc, &za) == 0; zap_cursor_advance(&zc)) { dsl_deadlist_entry_t *dle = kmem_alloc(sizeof (*dle), KM_SLEEP); - dle->dle_mintxg = strtonum(za.za_name, NULL); + dle->dle_mintxg = zfs_strtonum(za.za_name, NULL); VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, za.za_first_integer)); avl_add(&dl->dl_tree, dle); @@ -490,7 +490,7 @@ dsl_deadlist_merge(dsl_deadlist_t *dl, uint64_t obj, d for (zap_cursor_init(&zc, dl->dl_os, obj); zap_cursor_retrieve(&zc, &za) == 0; zap_cursor_advance(&zc)) { - uint64_t mintxg = strtonum(za.za_name, NULL); + uint64_t mintxg = zfs_strtonum(za.za_name, NULL); dsl_deadlist_insert_bpobj(dl, za.za_first_integer, mintxg, tx); VERIFY3U(0, ==, zap_remove_int(dl->dl_os, obj, mintxg, tx)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Wed Jun 14 16:36:01 2017 (r319948) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Wed Jun 14 16:42:38 2017 (r319949) @@ -1389,7 +1389,7 @@ dsl_scan_visit(dsl_scan_t *scn, dmu_tx_t *tx) dsl_dataset_t *ds; uint64_t dsobj; - dsobj = strtonum(za.za_name, NULL); + dsobj = zfs_strtonum(za.za_name, NULL); VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj, dsobj, tx)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Wed Jun 14 16:36:01 2017 (r319948) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Wed Jun 14 16:42:38 2017 (r319949) @@ -340,7 +340,7 @@ static int dsl_dataset_hold_obj_string(dsl_pool_t *dp, const char *dsobj, void *tag, dsl_dataset_t **dsp) { - return (dsl_dataset_hold_obj(dp, strtonum(dsobj, NULL), tag, dsp)); + return (dsl_dataset_hold_obj(dp, zfs_strtonum(dsobj, NULL), tag, dsp)); } static int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Wed Jun 14 16:36:01 2017 (r319948) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Wed Jun 14 16:42:38 2017 (r319949) @@ -73,13 +73,13 @@ bookmark_to_name(zbookmark_phys_t *zb, char *buf, size static void name_to_bookmark(char *buf, zbookmark_phys_t *zb) { - zb->zb_objset = strtonum(buf, &buf); + zb->zb_objset = zfs_strtonum(buf, &buf); ASSERT(*buf == ':'); - zb->zb_object = strtonum(buf + 1, &buf); + zb->zb_object = zfs_strtonum(buf + 1, &buf); ASSERT(*buf == ':'); - zb->zb_level = (int)strtonum(buf + 1, &buf); + zb->zb_level = (int)zfs_strtonum(buf + 1, &buf); ASSERT(*buf == ':'); - zb->zb_blkid = strtonum(buf + 1, &buf); + zb->zb_blkid = zfs_strtonum(buf + 1, &buf); ASSERT(*buf == '\0'); } #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Wed Jun 14 16:36:01 2017 (r319948) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Wed Jun 14 16:42:38 2017 (r319949) @@ -848,7 +848,6 @@ extern void zfs_blkptr_verify(spa_t *spa, const blkptr extern int spa_mode(spa_t *spa); extern uint64_t zfs_strtonum(const char *str, char **nptr); -#define strtonum(str, nptr) zfs_strtonum((str), (nptr)) extern char *spa_his_ievent_table[]; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jun 14 16:36:01 2017 (r319948) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jun 14 16:42:38 2017 (r319949) @@ -630,7 +630,7 @@ fuidstr_to_sid(zfsvfs_t *zfsvfs, const char *fuidstr, uint64_t fuid; const char *domain; - fuid = strtonum(fuidstr, NULL); + fuid = zfs_strtonum(fuidstr, NULL); domain = zfs_fuid_find_by_idx(zfsvfs, FUID_INDEX(fuid)); if (domain) From owner-svn-src-all@freebsd.org Wed Jun 14 16:44:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39619BEF190; Wed, 14 Jun 2017 16:44:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14D0D7083A; Wed, 14 Jun 2017 16:44:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EGiBng075700; Wed, 14 Jun 2017 16:44:11 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EGiBA4075699; Wed, 14 Jun 2017 16:44:11 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706141644.v5EGiBA4075699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 14 Jun 2017 16:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319950 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:44:12 -0000 Author: avg Date: Wed Jun 14 16:44:10 2017 New Revision: 319950 URL: https://svnweb.freebsd.org/changeset/base/319950 Log: 5220 L2ARC does not support devices that do not provide 512B access illumos/illumos-gate@403a8da73c64ff9dfb6230ba045c765a242213fb https://github.com/illumos/illumos-gate/commit/403a8da73c64ff9dfb6230ba045c765a242213fb https://www.illumos.org/issues/5220 There are disk devices that have logical sector size larger than 512B, for example 4KB. That is, their physical sector size is larger than 512B and they do not provide emulation for 512B sector sizes. For such devices both a data offset and a data size must be properly aligned. L2ARC should arrange that because it uses physical I/O. zio_vdev_io_start() performs a necessary transformation if io_size is not aligned to vdev_ashift, but that is done only for logical I/O. Something similar should be done in L2ARC code. * a temporary write buffer should be allocated if the original buffer is not going to be compressed and its size is not aligned * size of a temporary compression buffer should be ashift aligned * for the reads, if a size of a target buffer is not sufficiently large and it is not aligned then a temporary read buffer should be allocated Reviewed by: George Wilson Reviewed by: Dan Kimmel Reviewed by: Saso Kiselkov Approved by: Dan McDonald Author: Andriy Gapon Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Wed Jun 14 16:42:38 2017 (r319949) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Wed Jun 14 16:44:10 2017 (r319950) @@ -1075,6 +1075,7 @@ typedef struct l2arc_read_callback { blkptr_t l2rcb_bp; /* original blkptr */ zbookmark_phys_t l2rcb_zb; /* original bookmark */ int l2rcb_flags; /* original flags */ + abd_t *l2rcb_abd; /* temporary buffer */ } l2arc_read_callback_t; typedef struct l2arc_write_callback { @@ -5048,6 +5049,8 @@ top: !HDR_L2_WRITING(hdr) && !HDR_L2_EVICTED(hdr) && !(l2arc_noprefetch && HDR_PREFETCH(hdr))) { l2arc_read_callback_t *cb; + abd_t *abd; + uint64_t asize; DTRACE_PROBE1(l2arc__hit, arc_buf_hdr_t *, hdr); ARCSTAT_BUMP(arcstat_l2_hits); @@ -5059,8 +5062,17 @@ top: cb->l2rcb_zb = *zb; cb->l2rcb_flags = zio_flags; + asize = vdev_psize_to_asize(vd, size); + if (asize != size) { + abd = abd_alloc_for_io(asize, + HDR_ISTYPE_METADATA(hdr)); + cb->l2rcb_abd = abd; + } else { + abd = hdr->b_l1hdr.b_pabd; + } + ASSERT(addr >= VDEV_LABEL_START_SIZE && - addr + lsize < vd->vdev_psize - + addr + asize <= vd->vdev_psize - VDEV_LABEL_END_SIZE); /* @@ -5072,7 +5084,7 @@ top: ASSERT3U(HDR_GET_COMPRESS(hdr), !=, ZIO_COMPRESS_EMPTY); rzio = zio_read_phys(pio, vd, addr, - size, hdr->b_l1hdr.b_pabd, + asize, abd, ZIO_CHECKSUM_OFF, l2arc_read_done, cb, priority, zio_flags | ZIO_FLAG_DONT_CACHE | @@ -6566,6 +6578,33 @@ l2arc_read_done(zio_t *zio) mutex_enter(hash_lock); ASSERT3P(hash_lock, ==, HDR_LOCK(hdr)); + /* + * If the data was read into a temporary buffer, + * move it and free the buffer. + */ + if (cb->l2rcb_abd != NULL) { + ASSERT3U(arc_hdr_size(hdr), <, zio->io_size); + if (zio->io_error == 0) { + abd_copy(hdr->b_l1hdr.b_pabd, cb->l2rcb_abd, + arc_hdr_size(hdr)); + } + + /* + * The following must be done regardless of whether + * there was an error: + * - free the temporary buffer + * - point zio to the real ARC buffer + * - set zio size accordingly + * These are required because zio is either re-used for + * an I/O of the block in the case of the error + * or the zio is passed to arc_read_done() and it + * needs real data. + */ + abd_free(cb->l2rcb_abd); + zio->io_size = zio->io_orig_size = arc_hdr_size(hdr); + zio->io_abd = zio->io_orig_abd = hdr->b_l1hdr.b_pabd; + } + ASSERT3P(zio->io_abd, !=, NULL); /* @@ -6903,23 +6942,34 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint * Normally the L2ARC can use the hdr's data, but if * we're sharing data between the hdr and one of its * bufs, L2ARC needs its own copy of the data so that - * the ZIO below can't race with the buf consumer. To - * ensure that this copy will be available for the + * the ZIO below can't race with the buf consumer. + * Another case where we need to create a copy of the + * data is when the buffer size is not device-aligned + * and we need to pad the block to make it such. + * That also keeps the clock hand suitably aligned. + * + * To ensure that the copy will be available for the * lifetime of the ZIO and be cleaned up afterwards, we * add it to the l2arc_free_on_write queue. */ + uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev, + size); abd_t *to_write; - if (!HDR_SHARED_DATA(hdr)) { + if (!HDR_SHARED_DATA(hdr) && size == asize) { to_write = hdr->b_l1hdr.b_pabd; } else { - to_write = abd_alloc_for_io(size, + to_write = abd_alloc_for_io(asize, HDR_ISTYPE_METADATA(hdr)); abd_copy(to_write, hdr->b_l1hdr.b_pabd, size); + if (asize != size) { + abd_zero_off(to_write, size, + asize - size); + } l2arc_free_abd_on_write(to_write, size, arc_buf_type(hdr)); } wzio = zio_write_phys(pio, dev->l2ad_vdev, - hdr->b_l2hdr.b_daddr, size, to_write, + hdr->b_l2hdr.b_daddr, asize, to_write, ZIO_CHECKSUM_OFF, NULL, hdr, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_CANFAIL, B_FALSE); @@ -6929,11 +6979,6 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint zio_t *, wzio); write_asize += size; - /* - * Keep the clock hand suitably device-aligned. - */ - uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev, - size); write_psize += asize; dev->l2ad_hand += asize; From owner-svn-src-all@freebsd.org Wed Jun 14 16:46:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA740BEF488; Wed, 14 Jun 2017 16:46:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 861D070C5D; Wed, 14 Jun 2017 16:46:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EGkn4C075841; Wed, 14 Jun 2017 16:46:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EGkntI075839; Wed, 14 Jun 2017 16:46:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706141646.v5EGkntI075839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 14 Jun 2017 16:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319951 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:46:50 -0000 Author: avg Date: Wed Jun 14 16:46:49 2017 New Revision: 319951 URL: https://svnweb.freebsd.org/changeset/base/319951 Log: 8311 ZFS_READONLY is a little too strict illumos/illumos-gate@2889ec41c05e9ffe1890b529b3111354da325aeb https://github.com/illumos/illumos-gate/commit/2889ec41c05e9ffe1890b529b3111354da325aeb https://www.illumos.org/issues/8311 Description: There was a misunderstanding about the enforcement details of the "Read-only" flag introduced for SMB/CIFS compatibility, way back in 2007 in the Sun PSARC 2007/315 case. The original authors thought enforcement of the READONLY flag should work similarly as the IMMUTABLE flag. Unfortunately, that enforcement is incompatible with the expectations of Windows applications using this feature through the SMB service. Applications assume (and the MS File System Algorithms MS-FSA confirms they should) that an SMB client can: (a) Open an SMB handle on a file with read/write access, (b) Set the DOS attributes to include the READONLY flag, (c) continue to have write access via that handle. This access model is essentially the same as a Unix/POSIX application that creates a file (with read/write access), uses fchmod() to change the file mode to something not granting write access (i.e. 0444), and then continues to write that file using the open handle it got before the mode change. Currently, the SMB server works-around this problem in a way that will become difficult to maintain as we implement support for SMB3 persistent handles, so SMB depends on this fix. I've written a test program that can be used to demonstrate this problem, and added it to zfs-tests (tests/functional/acl/cifs/cifs_attr_004_pos). It currently fails, but will pass when this problem fixed. Steps to Reproduce: Run the test program on a ZFS file system. Expected Results: Pass Actual Results: Fail. Reviewed by: Sanjay Nadkarni Reviewed by: Yuri Pankov Reviewed by: Andrew Stormont Reviewed by: Matt Ahrens Reviewed by: John Kennedy Approved by: Prakash Surya Author: Gordon Ross Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed Jun 14 16:44:10 2017 (r319950) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed Jun 14 16:46:49 2017 (r319951) @@ -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 2014 Nexenta Systems, Inc. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. All rights reserved. */ #include @@ -2035,13 +2035,11 @@ zfs_zaccess_dataset_check(znode_t *zp, uint32_t v4_mod } /* - * Only check for READONLY on non-directories. + * Intentionally allow ZFS_READONLY through here. + * See zfs_zaccess_common(). */ if ((v4_mode & WRITE_MASK_DATA) && - (((ZTOV(zp)->v_type != VDIR) && - (zp->z_pflags & (ZFS_READONLY | ZFS_IMMUTABLE))) || - (ZTOV(zp)->v_type == VDIR && - (zp->z_pflags & ZFS_IMMUTABLE)))) { + (zp->z_pflags & ZFS_IMMUTABLE)) { return (SET_ERROR(EPERM)); } @@ -2251,6 +2249,24 @@ zfs_zaccess_common(znode_t *zp, uint32_t v4_mode, uint if (skipaclchk) { *working_mode = 0; return (0); + } + + /* + * Note: ZFS_READONLY represents the "DOS R/O" attribute. + * When that flag is set, we should behave as if write access + * were not granted by anything in the ACL. In particular: + * We _must_ allow writes after opening the file r/w, then + * setting the DOS R/O attribute, and writing some more. + * (Similar to how you can write after fchmod(fd, 0444).) + * + * Therefore ZFS_READONLY is ignored in the dataset check + * above, and checked here as if part of the ACL check. + * Also note: DOS R/O is ignored for directories. + */ + if ((v4_mode & WRITE_MASK_DATA) && + (ZTOV(zp)->v_type != VDIR) && + (zp->z_pflags & ZFS_READONLY)) { + return (SET_ERROR(EPERM)); } return (zfs_zaccess_aces_check(zp, working_mode, B_FALSE, cr)); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Wed Jun 14 16:44:10 2017 (r319950) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Wed Jun 14 16:46:49 2017 (r319951) @@ -707,9 +707,11 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t } /* - * If immutable or not appending then return EPERM + * If immutable or not appending then return EPERM. + * Intentionally allow ZFS_READONLY through here. + * See zfs_zaccess_common() */ - if ((zp->z_pflags & (ZFS_IMMUTABLE | ZFS_READONLY)) || + if ((zp->z_pflags & ZFS_IMMUTABLE) || ((zp->z_pflags & ZFS_APPENDONLY) && !(ioflag & FAPPEND) && (uio->uio_loffset < zp->z_size))) { ZFS_EXIT(zfsvfs); @@ -2791,10 +2793,9 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred return (SET_ERROR(EPERM)); } - if ((mask & AT_SIZE) && (zp->z_pflags & ZFS_READONLY)) { - ZFS_EXIT(zfsvfs); - return (SET_ERROR(EPERM)); - } + /* + * Note: ZFS_READONLY is handled in zfs_zaccess_common. + */ /* * Verify timestamps doesn't overflow 32 bits. @@ -4698,8 +4699,12 @@ zfs_map(vnode_t *vp, offset_t off, struct as *as, cadd ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); + /* + * Note: ZFS_READONLY is handled in zfs_zaccess_common. + */ + if ((prot & PROT_WRITE) && (zp->z_pflags & - (ZFS_IMMUTABLE | ZFS_READONLY | ZFS_APPENDONLY))) { + (ZFS_IMMUTABLE | ZFS_APPENDONLY))) { ZFS_EXIT(zfsvfs); return (SET_ERROR(EPERM)); } From owner-svn-src-all@freebsd.org Wed Jun 14 16:55:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18A7FBEF6AE; Wed, 14 Jun 2017 16:55:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5B0A710C5; Wed, 14 Jun 2017 16:55:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EGtNEv079774; Wed, 14 Jun 2017 16:55:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EGtNxr079773; Wed, 14 Jun 2017 16:55:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706141655.v5EGtNxr079773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 14 Jun 2017 16:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319952 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:55:25 -0000 Author: markj Date: Wed Jun 14 16:55:23 2017 New Revision: 319952 URL: https://svnweb.freebsd.org/changeset/base/319952 Log: Fix indentation. MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/mad.c Modified: head/sys/ofed/drivers/infiniband/core/mad.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/mad.c Wed Jun 14 16:46:49 2017 (r319951) +++ head/sys/ofed/drivers/infiniband/core/mad.c Wed Jun 14 16:55:23 2017 (r319952) @@ -1702,28 +1702,28 @@ int ib_post_send_mad(struct ib_mad_send_buf *send_buf, if (ret < 0) goto error; } else { - /* Reference MAD agent until send completes */ - atomic_inc(&mad_agent_priv->refcount); - spin_lock_irqsave(&mad_agent_priv->lock, flags); - list_add_tail(&mad_send_wr->agent_list, - &mad_agent_priv->send_list); - spin_unlock_irqrestore(&mad_agent_priv->lock, flags); - - if (mad_agent_priv->agent.rmpp_version) { - ret = ib_send_rmpp_mad(mad_send_wr); - if (ret >= 0 && ret != IB_RMPP_RESULT_CONSUMED) - ret = ib_send_mad(mad_send_wr); - } else - ret = ib_send_mad(mad_send_wr); - if (ret < 0) { - /* Fail send request */ + /* Reference MAD agent until send completes */ + atomic_inc(&mad_agent_priv->refcount); spin_lock_irqsave(&mad_agent_priv->lock, flags); - list_del(&mad_send_wr->agent_list); + list_add_tail(&mad_send_wr->agent_list, + &mad_agent_priv->send_list); spin_unlock_irqrestore(&mad_agent_priv->lock, flags); - atomic_dec(&mad_agent_priv->refcount); - goto error; + + if (mad_agent_priv->agent.rmpp_version) { + ret = ib_send_rmpp_mad(mad_send_wr); + if (ret >= 0 && ret != IB_RMPP_RESULT_CONSUMED) + ret = ib_send_mad(mad_send_wr); + } else + ret = ib_send_mad(mad_send_wr); + if (ret < 0) { + /* Fail send request */ + spin_lock_irqsave(&mad_agent_priv->lock, flags); + list_del(&mad_send_wr->agent_list); + spin_unlock_irqrestore(&mad_agent_priv->lock, flags); + atomic_dec(&mad_agent_priv->refcount); + goto error; + } } - } } return 0; error: From owner-svn-src-all@freebsd.org Wed Jun 14 16:55:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F37CBBEF723; Wed, 14 Jun 2017 16:55:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDC757120E; Wed, 14 Jun 2017 16:55:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EGtlH0079833; Wed, 14 Jun 2017 16:55:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EGtlqC079831; Wed, 14 Jun 2017 16:55:47 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706141655.v5EGtlqC079831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 14 Jun 2017 16:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319953 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 16:55:49 -0000 Author: avg Date: Wed Jun 14 16:55:47 2017 New Revision: 319953 URL: https://svnweb.freebsd.org/changeset/base/319953 Log: MFV r319951: 8311 ZFS_READONLY is a little too strict illumos/illumos-gate@2889ec41c05e9ffe1890b529b3111354da325aeb https://github.com/illumos/illumos-gate/commit/2889ec41c05e9ffe1890b529b3111354da325aeb https://www.illumos.org/issues/8311 Description: There was a misunderstanding about the enforcement details of the "Read-only" flag introduced for SMB/CIFS compatibility, way back in 2007 in the Sun PSARC 2007/315 case. The original authors thought enforcement of the READONLY flag should work similarly as the IMMUTABLE flag. Unfortunately, that enforcement is incompatible with the expectations of Windows applications using this feature through the SMB service. Applications assume (and the MS File System Algorithms MS-FSA confirms they should) that an SMB client can: (a) Open an SMB handle on a file with read/write access, (b) Set the DOS attributes to include the READONLY flag, (c) continue to have write access via that handle. This access model is essentially the same as a Unix/POSIX application that creates a file (with read/write access), uses fchmod() to change the file mode to something not granting write access (i.e. 0444), and then continues to write that file using the open handle it got before the mode change. Currently, the SMB server works-around this problem in a way that will become difficult to maintain as we implement support for SMB3 persistent handles, so SMB depends on this fix. I've written a test program that can be used to demonstrate this problem, and added it to zfs-tests (tests/functional/acl/cifs/cifs_attr_004_pos). It currently fails, but will pass when this problem fixed. Steps to Reproduce: Run the test program on a ZFS file system. Expected Results: Pass Actual Results: Fail. Reviewed by: Sanjay Nadkarni Reviewed by: Yuri Pankov Reviewed by: Andrew Stormont Reviewed by: Matt Ahrens Reviewed by: John Kennedy Approved by: Prakash Surya Author: Gordon Ross MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed Jun 14 16:55:23 2017 (r319952) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed Jun 14 16:55:47 2017 (r319953) @@ -20,8 +20,8 @@ */ /* * 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 2017 Nexenta Systems, Inc. All rights reserved. */ #include @@ -2017,13 +2017,11 @@ zfs_zaccess_dataset_check(znode_t *zp, uint32_t v4_mod } /* - * Only check for READONLY on non-directories. + * Intentionally allow ZFS_READONLY through here. + * See zfs_zaccess_common(). */ if ((v4_mode & WRITE_MASK_DATA) && - (((ZTOV(zp)->v_type != VDIR) && - (zp->z_pflags & (ZFS_READONLY | ZFS_IMMUTABLE))) || - (ZTOV(zp)->v_type == VDIR && - (zp->z_pflags & ZFS_IMMUTABLE)))) { + (zp->z_pflags & ZFS_IMMUTABLE)) { return (SET_ERROR(EPERM)); } @@ -2246,6 +2244,24 @@ zfs_zaccess_common(znode_t *zp, uint32_t v4_mode, uint if (skipaclchk) { *working_mode = 0; return (0); + } + + /* + * Note: ZFS_READONLY represents the "DOS R/O" attribute. + * When that flag is set, we should behave as if write access + * were not granted by anything in the ACL. In particular: + * We _must_ allow writes after opening the file r/w, then + * setting the DOS R/O attribute, and writing some more. + * (Similar to how you can write after fchmod(fd, 0444).) + * + * Therefore ZFS_READONLY is ignored in the dataset check + * above, and checked here as if part of the ACL check. + * Also note: DOS R/O is ignored for directories. + */ + if ((v4_mode & WRITE_MASK_DATA) && + (ZTOV(zp)->v_type != VDIR) && + (zp->z_pflags & ZFS_READONLY)) { + return (SET_ERROR(EPERM)); } return (zfs_zaccess_aces_check(zp, working_mode, B_FALSE, cr)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jun 14 16:55:23 2017 (r319952) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jun 14 16:55:47 2017 (r319953) @@ -905,9 +905,11 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t } /* - * If immutable or not appending then return EPERM + * If immutable or not appending then return EPERM. + * Intentionally allow ZFS_READONLY through here. + * See zfs_zaccess_common() */ - if ((zp->z_pflags & (ZFS_IMMUTABLE | ZFS_READONLY)) || + if ((zp->z_pflags & ZFS_IMMUTABLE) || ((zp->z_pflags & ZFS_APPENDONLY) && !(ioflag & FAPPEND) && (uio->uio_loffset < zp->z_size))) { ZFS_EXIT(zfsvfs); @@ -2946,10 +2948,9 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred return (SET_ERROR(EPERM)); } - if ((mask & AT_SIZE) && (zp->z_pflags & ZFS_READONLY)) { - ZFS_EXIT(zfsvfs); - return (SET_ERROR(EPERM)); - } + /* + * Note: ZFS_READONLY is handled in zfs_zaccess_common. + */ /* * Verify timestamps doesn't overflow 32 bits. From owner-svn-src-all@freebsd.org Wed Jun 14 18:34:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C152BF14F2; Wed, 14 Jun 2017 18:34:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C65D74548; Wed, 14 Jun 2017 18:34:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EIYMw1021290; Wed, 14 Jun 2017 18:34:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EIYMoQ021289; Wed, 14 Jun 2017 18:34:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201706141834.v5EIYMoQ021289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 14 Jun 2017 18:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319954 - head/usr.sbin/freebsd-update X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 18:34:23 -0000 Author: gjb Date: Wed Jun 14 18:34:22 2017 New Revision: 319954 URL: https://svnweb.freebsd.org/changeset/base/319954 Log: Modernize FreeBSD version numbers in freebsd-update(8). While here, expand a contraction to make textproc/igor happy. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/freebsd-update/freebsd-update.8 Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Wed Jun 14 16:55:47 2017 (r319953) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Wed Jun 14 18:34:22 2017 (r319954) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2015 +.Dd June 14, 2017 .Dt FREEBSD-UPDATE 8 .Os FreeBSD .Sh NAME @@ -56,13 +56,13 @@ by the .Fx Release Engineering Team, e.g., .Fx -9.3-RELEASE and +10.3-RELEASE and .Fx -10.1-RELEASE, but not +11.0-RELEASE, but not .Fx -9.3-STABLE or +10.3-STABLE or .Fx -11-CURRENT. +12-CURRENT. .Sh OPTIONS The following options are supported: .Bl -tag -width "-r newrelease" @@ -114,7 +114,7 @@ Please do not run from crontab or similar using this flag, see: .Nm Cm cron .It Fl -currently-running Ar release -Don't detect the currently-running release; instead, assume that the +Do not detect the currently-running release; instead, assume that the system is running the specified .Ar release . This is most likely to be useful when upgrading jails. From owner-svn-src-all@freebsd.org Wed Jun 14 18:53:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AB50BF19BF; Wed, 14 Jun 2017 18:53:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B808574DB8; Wed, 14 Jun 2017 18:53:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EIrXUJ029210; Wed, 14 Jun 2017 18:53:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EIrXdC029208; Wed, 14 Jun 2017 18:53:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706141853.v5EIrXdC029208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 14 Jun 2017 18:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319955 - head/contrib/llvm/tools/lld/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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 18:53:35 -0000 Author: emaste Date: Wed Jun 14 18:53:33 2017 New Revision: 319955 URL: https://svnweb.freebsd.org/changeset/base/319955 Log: lld: sort relocations No functional change; applied to facilitate merge of later LLD commit. Reviewed by: dim, Rafael Espíndola Obtained from: LLD r298797 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D11190 Modified: head/contrib/llvm/tools/lld/ELF/InputSection.cpp head/contrib/llvm/tools/lld/ELF/Relocations.h Modified: head/contrib/llvm/tools/lld/ELF/InputSection.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/InputSection.cpp Wed Jun 14 18:34:22 2017 (r319954) +++ head/contrib/llvm/tools/lld/ELF/InputSection.cpp Wed Jun 14 18:53:33 2017 (r319955) @@ -290,82 +290,37 @@ static typename ELFT::uint getRelocTargetVA(uint32_t Type, typename ELFT::uint A, typename ELFT::uint P, const SymbolBody &Body, RelExpr Expr) { switch (Expr) { - case R_HINT: - case R_TLSDESC_CALL: - llvm_unreachable("cannot relocate hint relocs"); - case R_TLSLD: - return In::Got->getTlsIndexOff() + A - In::Got->getSize(); - case R_TLSLD_PC: - return In::Got->getTlsIndexVA() + A - P; - case R_THUNK_ABS: - return Body.getThunkVA() + A; - case R_THUNK_PC: - case R_THUNK_PLT_PC: - return Body.getThunkVA() + A - P; - case R_PPC_TOC: - return getPPC64TocBase() + A; - case R_TLSGD: - return In::Got->getGlobalDynOffset(Body) + A - - In::Got->getSize(); - case R_TLSGD_PC: - return In::Got->getGlobalDynAddr(Body) + A - P; - case R_TLSDESC: - return In::Got->getGlobalDynAddr(Body) + A; - case R_TLSDESC_PAGE: - return getAArch64Page(In::Got->getGlobalDynAddr(Body) + A) - - getAArch64Page(P); - case R_PLT: - return Body.getPltVA() + A; - case R_PLT_PC: - case R_PPC_PLT_OPD: - return Body.getPltVA() + A - P; - case R_SIZE: - return Body.getSize() + A; + case R_ABS: + case R_RELAX_GOT_PC_NOPIC: + return Body.getVA(A); + case R_GOT: + case R_RELAX_TLS_GD_TO_IE_ABS: + return Body.getGotVA() + A; + case R_GOTONLY_PC: + return In::Got->getVA() + A - P; + case R_GOTONLY_PC_FROM_END: + return In::Got->getVA() + A - P + In::Got->getSize(); case R_GOTREL: return Body.getVA(A) - In::Got->getVA(); case R_GOTREL_FROM_END: return Body.getVA(A) - In::Got->getVA() - In::Got->getSize(); - case R_RELAX_TLS_GD_TO_IE_END: case R_GOT_FROM_END: + case R_RELAX_TLS_GD_TO_IE_END: return Body.getGotOffset() + A - In::Got->getSize(); - case R_RELAX_TLS_GD_TO_IE_ABS: - case R_GOT: - return Body.getGotVA() + A; - case R_RELAX_TLS_GD_TO_IE_PAGE_PC: + case R_GOT_OFF: + return Body.getGotOffset() + A; case R_GOT_PAGE_PC: + case R_RELAX_TLS_GD_TO_IE_PAGE_PC: return getAArch64Page(Body.getGotVA() + A) - getAArch64Page(P); - case R_RELAX_TLS_GD_TO_IE: case R_GOT_PC: + case R_RELAX_TLS_GD_TO_IE: return Body.getGotVA() + A - P; - case R_GOTONLY_PC: - return In::Got->getVA() + A - P; - case R_GOTONLY_PC_FROM_END: - return In::Got->getVA() + A - P + In::Got->getSize(); - case R_RELAX_TLS_LD_TO_LE: - case R_RELAX_TLS_IE_TO_LE: - case R_RELAX_TLS_GD_TO_LE: - case R_TLS: - // A weak undefined TLS symbol resolves to the base of the TLS - // block, i.e. gets a value of zero. If we pass --gc-sections to - // lld and .tbss is not referenced, it gets reclaimed and we don't - // create a TLS program header. Therefore, we resolve this - // statically to zero. - if (Body.isTls() && (Body.isLazy() || Body.isUndefined()) && - Body.symbol()->isWeak()) - return 0; - if (Target->TcbSize) - return Body.getVA(A) + - alignTo(Target->TcbSize, Out::TlsPhdr->p_align); - return Body.getVA(A) - Out::TlsPhdr->p_memsz; - case R_RELAX_TLS_GD_TO_LE_NEG: - case R_NEG_TLS: - return Out::TlsPhdr->p_memsz - Body.getVA(A); - case R_ABS: - case R_RELAX_GOT_PC_NOPIC: - return Body.getVA(A); - case R_GOT_OFF: - return Body.getGotOffset() + A; + case R_HINT: + case R_TLSDESC_CALL: + llvm_unreachable("cannot relocate hint relocs"); + case R_MIPS_GOTREL: + return Body.getVA(A) - In::MipsGot->getGp(); case R_MIPS_GOT_LOCAL_PAGE: // If relocation against MIPS local symbol requires GOT entry, this entry // should be initialized by 'page address'. This address is high 16-bits @@ -381,8 +336,6 @@ getRelocTargetVA(uint32_t Type, typename ELFT::uint A, return In::MipsGot->getVA() + In::MipsGot->getBodyEntryOffset(Body, A) - In::MipsGot->getGp(); - case R_MIPS_GOTREL: - return Body.getVA(A) - In::MipsGot->getGp(); case R_MIPS_TLSGD: return In::MipsGot->getVA() + In::MipsGot->getTlsOffset() + In::MipsGot->getGlobalDynOffset(Body) - @@ -390,6 +343,26 @@ getRelocTargetVA(uint32_t Type, typename ELFT::uint A, case R_MIPS_TLSLD: return In::MipsGot->getVA() + In::MipsGot->getTlsOffset() + In::MipsGot->getTlsIndexOff() - In::MipsGot->getGp(); + case R_PAGE_PC: + case R_PLT_PAGE_PC: + if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) + return getAArch64Page(A); + return getAArch64Page(Body.getVA(A)) - getAArch64Page(P); + case R_PC: + if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) { + // On ARM and AArch64 a branch to an undefined weak resolves to the + // next instruction, otherwise the place. + if (Config->EMachine == EM_ARM) + return getARMUndefinedRelativeWeakVA(Type, A, P); + if (Config->EMachine == EM_AARCH64) + return getAArch64UndefinedRelativeWeakVA(Type, A, P); + } + return Body.getVA(A) - P; + case R_PLT: + return Body.getPltVA() + A; + case R_PLT_PC: + case R_PPC_PLT_OPD: + return Body.getPltVA() + A - P; case R_PPC_OPD: { uint64_t SymVA = Body.getVA(A); // If we have an undefined weak symbol, we might get here with a symbol @@ -408,22 +381,50 @@ getRelocTargetVA(uint32_t Type, typename ELFT::uint A, } return SymVA - P; } - case R_PC: - if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) { - // On ARM and AArch64 a branch to an undefined weak resolves to the - // next instruction, otherwise the place. - if (Config->EMachine == EM_ARM) - return getARMUndefinedRelativeWeakVA(Type, A, P); - if (Config->EMachine == EM_AARCH64) - return getAArch64UndefinedRelativeWeakVA(Type, A, P); - } + case R_PPC_TOC: + return getPPC64TocBase() + A; case R_RELAX_GOT_PC: return Body.getVA(A) - P; - case R_PLT_PAGE_PC: - case R_PAGE_PC: - if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) - return getAArch64Page(A); - return getAArch64Page(Body.getVA(A)) - getAArch64Page(P); + case R_RELAX_TLS_GD_TO_LE: + case R_RELAX_TLS_IE_TO_LE: + case R_RELAX_TLS_LD_TO_LE: + case R_TLS: + // A weak undefined TLS symbol resolves to the base of the TLS + // block, i.e. gets a value of zero. If we pass --gc-sections to + // lld and .tbss is not referenced, it gets reclaimed and we don't + // create a TLS program header. Therefore, we resolve this + // statically to zero. + if (Body.isTls() && (Body.isLazy() || Body.isUndefined()) && + Body.symbol()->isWeak()) + return 0; + if (Target->TcbSize) + return Body.getVA(A) + + alignTo(Target->TcbSize, Out::TlsPhdr->p_align); + return Body.getVA(A) - Out::TlsPhdr->p_memsz; + case R_RELAX_TLS_GD_TO_LE_NEG: + case R_NEG_TLS: + return Out::TlsPhdr->p_memsz - Body.getVA(A); + case R_SIZE: + return Body.getSize() + A; + case R_THUNK_ABS: + return Body.getThunkVA() + A; + case R_THUNK_PC: + case R_THUNK_PLT_PC: + return Body.getThunkVA() + A - P; + case R_TLSDESC: + return In::Got->getGlobalDynAddr(Body) + A; + case R_TLSDESC_PAGE: + return getAArch64Page(In::Got->getGlobalDynAddr(Body) + A) - + getAArch64Page(P); + case R_TLSGD: + return In::Got->getGlobalDynOffset(Body) + A - + In::Got->getSize(); + case R_TLSGD_PC: + return In::Got->getGlobalDynAddr(Body) + A - P; + case R_TLSLD: + return In::Got->getTlsIndexOff() + A - In::Got->getSize(); + case R_TLSLD_PC: + return In::Got->getTlsIndexVA() + A - P; } llvm_unreachable("Invalid expression"); } Modified: head/contrib/llvm/tools/lld/ELF/Relocations.h ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Relocations.h Wed Jun 14 18:34:22 2017 (r319954) +++ head/contrib/llvm/tools/lld/ELF/Relocations.h Wed Jun 14 18:53:33 2017 (r319955) @@ -34,26 +34,26 @@ enum RelExpr { R_GOT_PAGE_PC, R_GOT_PC, R_HINT, + R_MIPS_GOTREL, R_MIPS_GOT_LOCAL_PAGE, R_MIPS_GOT_OFF, R_MIPS_GOT_OFF32, - R_MIPS_GOTREL, R_MIPS_TLSGD, R_MIPS_TLSLD, R_NEG_TLS, R_PAGE_PC, R_PC, R_PLT, - R_PLT_PC, R_PLT_PAGE_PC, + R_PLT_PC, R_PPC_OPD, R_PPC_PLT_OPD, R_PPC_TOC, R_RELAX_GOT_PC, R_RELAX_GOT_PC_NOPIC, R_RELAX_TLS_GD_TO_IE, - R_RELAX_TLS_GD_TO_IE_END, R_RELAX_TLS_GD_TO_IE_ABS, + R_RELAX_TLS_GD_TO_IE_END, R_RELAX_TLS_GD_TO_IE_PAGE_PC, R_RELAX_TLS_GD_TO_LE, R_RELAX_TLS_GD_TO_LE_NEG, @@ -65,8 +65,8 @@ enum RelExpr { R_THUNK_PLT_PC, R_TLS, R_TLSDESC, - R_TLSDESC_PAGE, R_TLSDESC_CALL, + R_TLSDESC_PAGE, R_TLSGD, R_TLSGD_PC, R_TLSLD, From owner-svn-src-all@freebsd.org Wed Jun 14 18:56:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C31E7BF1A42; Wed, 14 Jun 2017 18:56:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63DE574F38; Wed, 14 Jun 2017 18:56:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EIuXn3029372; Wed, 14 Jun 2017 18:56:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EIuXWG029371; Wed, 14 Jun 2017 18:56:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706141856.v5EIuXWG029371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 14 Jun 2017 18:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319956 - head/contrib/llvm/tools/lld/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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 18:56:34 -0000 Author: emaste Date: Wed Jun 14 18:56:33 2017 New Revision: 319956 URL: https://svnweb.freebsd.org/changeset/base/319956 Log: lld: Fix weak symbols on arm and aarch64 Given .weak target .global _start _start: b target The intention is that the branch goes to the instruction after the branch, effectively turning it on a nop. The branch adds the runtime PC, but we were adding it statically too. I noticed the oddity by inspection, but llvm-objdump seems to agree, since it now prints things like: b #-4 <_start+0x4> Obtained from: LLD commit r305212 Differential Revision: https://reviews.freebsd.org/D11191 Reviewed by: dim, Rafael Espíndola Obtained from: LLD r305212 MFC after: 3 days Modified: head/contrib/llvm/tools/lld/ELF/InputSection.cpp Modified: head/contrib/llvm/tools/lld/ELF/InputSection.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/InputSection.cpp Wed Jun 14 18:53:33 2017 (r319955) +++ head/contrib/llvm/tools/lld/ELF/InputSection.cpp Wed Jun 14 18:56:33 2017 (r319956) @@ -255,7 +255,7 @@ static uint32_t getARMUndefinedRelativeWeakVA(uint32_t uint32_t P) { switch (Type) { case R_ARM_THM_JUMP11: - return P + 2; + return P + 2 + A; case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_PC24: @@ -263,12 +263,12 @@ static uint32_t getARMUndefinedRelativeWeakVA(uint32_t case R_ARM_PREL31: case R_ARM_THM_JUMP19: case R_ARM_THM_JUMP24: - return P + 4; + return P + 4 + A; case R_ARM_THM_CALL: // We don't want an interworking BLX to ARM - return P + 5; + return P + 5 + A; default: - return A; + return P + A; } } @@ -279,9 +279,9 @@ static uint64_t getAArch64UndefinedRelativeWeakVA(uint case R_AARCH64_CONDBR19: case R_AARCH64_JUMP26: case R_AARCH64_TSTBR14: - return P + 4; + return P + 4 + A; default: - return A; + return P + A; } } @@ -344,20 +344,30 @@ getRelocTargetVA(uint32_t Type, typename ELFT::uint A, return In::MipsGot->getVA() + In::MipsGot->getTlsOffset() + In::MipsGot->getTlsIndexOff() - In::MipsGot->getGp(); case R_PAGE_PC: - case R_PLT_PAGE_PC: + case R_PLT_PAGE_PC: { + uint64_t Dest; if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) - return getAArch64Page(A); - return getAArch64Page(Body.getVA(A)) - getAArch64Page(P); - case R_PC: + Dest = getAArch64Page(A); + else + Dest = getAArch64Page(Body.getVA(A)); + return Dest - getAArch64Page(P); + } + case R_PC: { + uint64_t Dest; if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) { // On ARM and AArch64 a branch to an undefined weak resolves to the // next instruction, otherwise the place. if (Config->EMachine == EM_ARM) - return getARMUndefinedRelativeWeakVA(Type, A, P); - if (Config->EMachine == EM_AARCH64) - return getAArch64UndefinedRelativeWeakVA(Type, A, P); + Dest = getARMUndefinedRelativeWeakVA(Type, A, P); + else if (Config->EMachine == EM_AARCH64) + Dest = getAArch64UndefinedRelativeWeakVA(Type, A, P); + else + Dest = Body.getVA(A); + } else { + Dest = Body.getVA(A); } - return Body.getVA(A) - P; + return Dest - P; + } case R_PLT: return Body.getPltVA() + A; case R_PLT_PC: From owner-svn-src-all@freebsd.org Wed Jun 14 19:36:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33106BF28F1; Wed, 14 Jun 2017 19:36:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0077376551; Wed, 14 Jun 2017 19:36:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EJaTRF045948; Wed, 14 Jun 2017 19:36:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EJaTK6045947; Wed, 14 Jun 2017 19:36:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706141936.v5EJaTK6045947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 14 Jun 2017 19:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319957 - head/contrib/llvm/tools/lld/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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 19:36:30 -0000 Author: emaste Date: Wed Jun 14 19:36:28 2017 New Revision: 319957 URL: https://svnweb.freebsd.org/changeset/base/319957 Log: lld: Add armelf emulation mode Obtained from: LLD r305375 Modified: head/contrib/llvm/tools/lld/ELF/Driver.cpp Modified: head/contrib/llvm/tools/lld/ELF/Driver.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Driver.cpp Wed Jun 14 18:56:33 2017 (r319956) +++ head/contrib/llvm/tools/lld/ELF/Driver.cpp Wed Jun 14 19:36:28 2017 (r319957) @@ -76,7 +76,7 @@ static std::tuple parseEmu std::pair Ret = StringSwitch>(S) .Cases("aarch64elf", "aarch64linux", {ELF64LEKind, EM_AARCH64}) - .Case("armelf_linux_eabi", {ELF32LEKind, EM_ARM}) + .Cases("armelf", "armelf_linux_eabi", {ELF32LEKind, EM_ARM}) .Case("elf32_x86_64", {ELF32LEKind, EM_X86_64}) .Case("elf32btsmip", {ELF32BEKind, EM_MIPS}) .Case("elf32ltsmip", {ELF32LEKind, EM_MIPS}) From owner-svn-src-all@freebsd.org Wed Jun 14 22:50:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7680CBF53F4; Wed, 14 Jun 2017 22:50:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E1CA7B4E2; Wed, 14 Jun 2017 22:50:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x22a.google.com with SMTP id u12so19402107qth.0; Wed, 14 Jun 2017 15:50:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HUbm6bOMUDqnarQYlYKbwDMSqYXH2CVi13i/Eyi8pF0=; b=U5pSaRz02gLYGMGygtKj35U+lu5Sosz8tjRwCXViLoTUrAKNzIdSmnKCk2p4AjX+rg i6PlAxmxDlftYmEfTCJhKnZicWOiHbM1qo/pceRJhL7izZrd+JwLqWyE5ajRI793tnXR Y8eEb4niXOQB4bKMqi02/GHBfoVS4su0LDm6a+eUrx0QLlt2nkajcLeOLq6M7eLsRuNo cw9ipFbTk5h/+cSS1fYlJ2/Dlh8y+2D6T1nwx7d8sqrDjNEw3dudH0xeO9c1QKrp7Vxf +vJ0qWM56oVniFnzCG4ivms7e8ikZhyJktNMRDTW9Rnhpi8s/yFYOh1cNvVnUrMf8D0q Oisg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HUbm6bOMUDqnarQYlYKbwDMSqYXH2CVi13i/Eyi8pF0=; b=b/PN1Fd9Q0MGjRvRCPnS9XOI2AwH0beqOF6i6mSx46QGzYMjzDIIVFdRX2uzCkBNGA ZiH4qg3MDai94aSwKx7WmBYpbXymIqjXKZtdXI9qJ1pZW1gUQUwDxudBqAAPO/ttR8RA Csp3sWA4ZbpTDl9jvwbRw74ZTlz+68zoBq5TF0PNr9AtMuqdrz+8/42rzsnQ5CvDiAlP oEe1K3w2aAlgE+G3h88vuqSDTQGwG7ZCi+f3KXf++xtS+MzD6om41IK7yh8WyrmF/8QW eWlxhwF1wD2St9NctRK9oPvoYyG9tLB+mm9VzMVsQ/ykdQ6bjqoiTyLVsE31ksMxsWSv Iyfw== X-Gm-Message-State: AKS2vOzl454uUpZ8iMSPH0KpDw9q/DKPO9vZuWolNNwH0IWpys9JxDVC cU+b4kJootU9QUe8AfN4ll3GEcPqTY0/ X-Received: by 10.55.76.140 with SMTP id z134mr2966441qka.35.1497480639020; Wed, 14 Jun 2017 15:50:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.92.214 with HTTP; Wed, 14 Jun 2017 15:50:38 -0700 (PDT) In-Reply-To: <59cc8b64-0cba-70c7-68c8-53f48a3c1471@FreeBSD.org> References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> <59cc8b64-0cba-70c7-68c8-53f48a3c1471@FreeBSD.org> From: Ngie Cooper Date: Wed, 14 Jun 2017 15:50:38 -0700 Message-ID: Subject: Re: svn commit: r319897 - head/usr.bin/yes To: Bryan Drewery Cc: Justin Hibbits , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Jun 2017 22:50:40 -0000 On Wed, Jun 14, 2017 at 7:27 AM, Bryan Drewery wrote: ... > The code has become more complex. I think capsicum does make sense now > in case there is an unseen overflow in the new optimized code. Can we add SCTP support to it? I think we could totally make this into a performant network service, e.g., an echo server that always says, "yes". I don't think TCP would be performant enough, and I think UDP's unreliable'ness doesn't have enough protocol guarantees to make sure the sender-receiver pairs can submit streams of infinite "yes"'es. -Ngie From owner-svn-src-all@freebsd.org Thu Jun 15 00:57:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98DA7BF79B2; Thu, 15 Jun 2017 00:57:36 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7977D7F373; Thu, 15 Jun 2017 00:57:36 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id C10E116269; Thu, 15 Jun 2017 00:57:35 +0000 (UTC) Date: Thu, 15 Jun 2017 00:57:35 +0000 From: Alexey Dokuchaev To: Pietro Cerutti Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319897 - head/usr.bin/yes Message-ID: <20170615005735.GA34038@FreeBSD.org> References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201706131235.v5DCZ1aR077437@repo.freebsd.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 00:57:36 -0000 On Tue, Jun 13, 2017 at 12:35:01PM +0000, Pietro Cerutti wrote: > New Revision: 319897 > URL: https://svnweb.freebsd.org/changeset/base/319897 > > Log: > Improve yes' throughput > > On my system, this brings up the throughput from ~20 to ~600 MiB/s. Nice. > Inspired by: https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/ So, how does it now compares with GNU's on the same hardware? ./danfe From owner-svn-src-all@freebsd.org Thu Jun 15 00:59:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2FBBBF7A81; Thu, 15 Jun 2017 00:59:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0C3D7F4EE; Thu, 15 Jun 2017 00:59:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F0x2W8077217; Thu, 15 Jun 2017 00:59:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F0x2JI077216; Thu, 15 Jun 2017 00:59:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201706150059.v5F0x2JI077216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 15 Jun 2017 00:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319962 - head/contrib/ipfilter/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 00:59:04 -0000 Author: cy Date: Thu Jun 15 00:59:02 2017 New Revision: 319962 URL: https://svnweb.freebsd.org/changeset/base/319962 Log: Correct example directory location. Submitted by: olivier@ MFC after: 3 days Modified: head/contrib/ipfilter/man/ipf.5 Modified: head/contrib/ipfilter/man/ipf.5 ============================================================================== --- head/contrib/ipfilter/man/ipf.5 Thu Jun 15 00:32:01 2017 (r319961) +++ head/contrib/ipfilter/man/ipf.5 Thu Jun 15 00:59:02 2017 (r319962) @@ -1693,6 +1693,6 @@ environment. /dev/ipf /etc/ipf.conf .br -/usr/share/examples/ipf Directory with examples. +/usr/share/examples/ipfilter Directory with examples. .SH SEE ALSO ipf(8), ipfstat(8), ippool.conf(5), ippool(8) From owner-svn-src-all@freebsd.org Thu Jun 15 02:39:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAD38BFC924; Thu, 15 Jun 2017 02:39:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB82F8341A; Thu, 15 Jun 2017 02:39:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F2dXSX017462; Thu, 15 Jun 2017 02:39:33 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F2dXSc017461; Thu, 15 Jun 2017 02:39:33 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201706150239.v5F2dXSc017461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 15 Jun 2017 02:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319963 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 02:39:35 -0000 Author: jkim Date: Thu Jun 15 02:39:33 2017 New Revision: 319963 URL: https://svnweb.freebsd.org/changeset/base/319963 Log: Null pointer must be checked before use. This fixes a regression introduced in r318716. Note it is a direct commit to stable/11 because head removed support for idle page zeroing in r305362. PR: 219994 Reviewed by: markj Approved by: re (gjb) Modified: stable/11/sys/vm/vm_page.c Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Thu Jun 15 00:59:02 2017 (r319962) +++ stable/11/sys/vm/vm_page.c Thu Jun 15 02:39:33 2017 (r319963) @@ -1759,18 +1759,18 @@ retry: pagedaemon_wakeup(); return (NULL); } - if (m_ret != NULL) + if (m_ret != NULL) { vm_phys_freecnt_adj(m_ret, -npages); - else { + for (m = m_ret; m < &m_ret[npages]; m++) + if ((m->flags & PG_ZERO) != 0) + vm_page_zero_count--; + } else { #if VM_NRESERVLEVEL > 0 if (vm_reserv_reclaim_contig(npages, low, high, alignment, boundary)) goto retry; #endif } - for (m = m_ret; m < &m_ret[npages]; m++) - if ((m->flags & PG_ZERO) != 0) - vm_page_zero_count--; mtx_unlock(&vm_page_queue_free_mtx); if (m_ret == NULL) return (NULL); From owner-svn-src-all@freebsd.org Thu Jun 15 02:45:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EBB9BFCDA1; Thu, 15 Jun 2017 02:45:45 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 024EA83906; Thu, 15 Jun 2017 02:45:44 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F2jitH021478; Thu, 15 Jun 2017 02:45:44 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F2jhna021469; Thu, 15 Jun 2017 02:45:43 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201706150245.v5F2jhna021469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 15 Jun 2017 02:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319964 - head/sys/dev/qlnx/qlnxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 02:45:45 -0000 Author: davidcs Date: Thu Jun 15 02:45:43 2017 New Revision: 319964 URL: https://svnweb.freebsd.org/changeset/base/319964 Log: Upgrade STORMFW to 8.30.0.0 and ecore version to 8.30.0.0 Add support for pci deviceID 0x8070 for QLE41xxx product line which supports 10GbE/25GbE/40GbE MFC after:5 days Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h head/sys/dev/qlnx/qlnxe/common_hsi.h head/sys/dev/qlnx/qlnxe/ecore.h head/sys/dev/qlnx/qlnxe/ecore_chain.h head/sys/dev/qlnx/qlnxe/ecore_cxt.c head/sys/dev/qlnx/qlnxe/ecore_cxt.h head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.h head/sys/dev/qlnx/qlnxe/ecore_dbg_values.h head/sys/dev/qlnx/qlnxe/ecore_dcbx.c head/sys/dev/qlnx/qlnxe/ecore_dcbx.h head/sys/dev/qlnx/qlnxe/ecore_dev.c head/sys/dev/qlnx/qlnxe/ecore_dev_api.h head/sys/dev/qlnx/qlnxe/ecore_fcoe_api.h head/sys/dev/qlnx/qlnxe/ecore_gtt_reg_addr.h head/sys/dev/qlnx/qlnxe/ecore_hsi_common.h head/sys/dev/qlnx/qlnxe/ecore_hsi_debug_tools.h head/sys/dev/qlnx/qlnxe/ecore_hsi_eth.h head/sys/dev/qlnx/qlnxe/ecore_hsi_fcoe.h head/sys/dev/qlnx/qlnxe/ecore_hsi_iscsi.h head/sys/dev/qlnx/qlnxe/ecore_hsi_iwarp.h head/sys/dev/qlnx/qlnxe/ecore_hsi_rdma.h head/sys/dev/qlnx/qlnxe/ecore_hsi_roce.h head/sys/dev/qlnx/qlnxe/ecore_hw.c head/sys/dev/qlnx/qlnxe/ecore_hw.h head/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.c head/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.h head/sys/dev/qlnx/qlnxe/ecore_init_ops.c head/sys/dev/qlnx/qlnxe/ecore_init_ops.h head/sys/dev/qlnx/qlnxe/ecore_init_values.h head/sys/dev/qlnx/qlnxe/ecore_int.c head/sys/dev/qlnx/qlnxe/ecore_int.h head/sys/dev/qlnx/qlnxe/ecore_int_api.h head/sys/dev/qlnx/qlnxe/ecore_iov_api.h head/sys/dev/qlnx/qlnxe/ecore_iro.h head/sys/dev/qlnx/qlnxe/ecore_iro_values.h head/sys/dev/qlnx/qlnxe/ecore_iscsi.h head/sys/dev/qlnx/qlnxe/ecore_iscsi_api.h head/sys/dev/qlnx/qlnxe/ecore_l2.c head/sys/dev/qlnx/qlnxe/ecore_l2.h head/sys/dev/qlnx/qlnxe/ecore_l2_api.h head/sys/dev/qlnx/qlnxe/ecore_ll2.h head/sys/dev/qlnx/qlnxe/ecore_ll2_api.h head/sys/dev/qlnx/qlnxe/ecore_mcp.c head/sys/dev/qlnx/qlnxe/ecore_mcp.h head/sys/dev/qlnx/qlnxe/ecore_mcp_api.h head/sys/dev/qlnx/qlnxe/ecore_ooo.h head/sys/dev/qlnx/qlnxe/ecore_proto_if.h head/sys/dev/qlnx/qlnxe/ecore_roce.h head/sys/dev/qlnx/qlnxe/ecore_roce_api.h head/sys/dev/qlnx/qlnxe/ecore_rt_defs.h head/sys/dev/qlnx/qlnxe/ecore_sp_api.h head/sys/dev/qlnx/qlnxe/ecore_sp_commands.c head/sys/dev/qlnx/qlnxe/ecore_sp_commands.h head/sys/dev/qlnx/qlnxe/ecore_spq.c head/sys/dev/qlnx/qlnxe/ecore_sriov.h head/sys/dev/qlnx/qlnxe/ecore_vf.h head/sys/dev/qlnx/qlnxe/ecore_vf_api.h head/sys/dev/qlnx/qlnxe/ecore_vfpf_if.h head/sys/dev/qlnx/qlnxe/eth_common.h head/sys/dev/qlnx/qlnxe/fcoe_common.h head/sys/dev/qlnx/qlnxe/iscsi_common.h head/sys/dev/qlnx/qlnxe/mcp_private.h head/sys/dev/qlnx/qlnxe/mcp_public.h head/sys/dev/qlnx/qlnxe/mfw_hsi.h head/sys/dev/qlnx/qlnxe/nvm_cfg.h head/sys/dev/qlnx/qlnxe/nvm_map.h head/sys/dev/qlnx/qlnxe/pcics_reg_driver.h head/sys/dev/qlnx/qlnxe/qlnx_def.h head/sys/dev/qlnx/qlnxe/qlnx_os.c head/sys/dev/qlnx/qlnxe/qlnx_ver.h head/sys/dev/qlnx/qlnxe/rdma_common.h head/sys/dev/qlnx/qlnxe/reg_addr.h head/sys/dev/qlnx/qlnxe/spad_layout.h head/sys/dev/qlnx/qlnxe/storage_common.h head/sys/dev/qlnx/qlnxe/tcp_common.h Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/bcm_osal.h Thu Jun 15 02:39:33 2017 (r319963) +++ head/sys/dev/qlnx/qlnxe/bcm_osal.h Thu Jun 15 02:45:43 2017 (r319964) @@ -34,12 +34,17 @@ #include "ecore_status.h" #include -#if __FreeBSD_version >= 1100090 +#if __FreeBSD_version >= 1200000 #include #else +#if __FreeBSD_version >= 1100090 +#include +#else #include #endif +#endif +#define OSAL_NUM_CPUS() mp_ncpus /* * prototypes of freebsd specific functions required by ecore */ @@ -60,6 +65,7 @@ extern int qlnx_pci_find_capability(void *ecore_dev, i extern uint32_t qlnx_direct_reg_rd32(void *p_hwfn, uint32_t *reg_addr); extern void qlnx_direct_reg_wr32(void *p_hwfn, void *reg_addr, uint32_t value); +extern void qlnx_direct_reg_wr64(void *p_hwfn, void *reg_addr, uint64_t value); extern uint32_t qlnx_reg_rd32(void *p_hwfn, uint32_t reg_addr); extern void qlnx_reg_wr32(void *p_hwfn, uint32_t reg_addr, uint32_t value); @@ -129,6 +135,8 @@ rounddown_pow_of_two(unsigned long x) #endif /* #ifndef QLNX_RDMA */ +#define OSAL_UNUSED + #define OSAL_CPU_TO_BE64(val) htobe64(val) #define OSAL_BE64_TO_CPU(val) be64toh(val) @@ -199,6 +207,8 @@ typedef struct osal_list_t #define REG_WR(hwfn, addr, val) qlnx_reg_wr32(hwfn, addr, val) #define REG_WR16(hwfn, addr, val) qlnx_reg_wr16(hwfn, addr, val) #define DIRECT_REG_WR(p_hwfn, addr, value) qlnx_direct_reg_wr32(p_hwfn, addr, value) +#define DIRECT_REG_WR64(p_hwfn, addr, value) \ + qlnx_direct_reg_wr64(p_hwfn, addr, value) #define DIRECT_REG_RD(p_hwfn, addr) qlnx_direct_reg_rd32(p_hwfn, addr) #define REG_RD(hwfn, addr) qlnx_reg_rd32(hwfn, addr) #define DOORBELL(hwfn, addr, value) \ Modified: head/sys/dev/qlnx/qlnxe/common_hsi.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/common_hsi.h Thu Jun 15 02:39:33 2017 (r319963) +++ head/sys/dev/qlnx/qlnxe/common_hsi.h Thu Jun 15 02:45:43 2017 (r319964) @@ -88,7 +88,7 @@ #define CORE_SPQE_PAGE_SIZE_BYTES 4096 /* - * Usually LL2 queues are opened in pairs TX-RX. + * Usually LL2 queues are opened in pairs – TX-RX. * There is a hard restriction on number of RX queues (limited by Tstorm RAM) and TX counters (Pstorm RAM). * Number of TX queues is almost unlimited. * The constants are different so as to allow asymmetric LL2 connections @@ -99,13 +99,13 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// -// Include firmware version number only- do not add constants here to avoid redundunt compilations +// Include firmware verison number only- do not add constants here to avoid redundunt compilations /////////////////////////////////////////////////////////////////////////////////////////////////// #define FW_MAJOR_VERSION 8 -#define FW_MINOR_VERSION 18 -#define FW_REVISION_VERSION 14 +#define FW_MINOR_VERSION 30 +#define FW_REVISION_VERSION 0 #define FW_ENGINEERING_VERSION 0 /***********************/ @@ -113,60 +113,60 @@ /***********************/ /* PCI functions */ -#define MAX_NUM_PORTS_K2 (4) #define MAX_NUM_PORTS_BB (2) -#define MAX_NUM_PORTS (MAX_NUM_PORTS_K2) +#define MAX_NUM_PORTS_K2 (4) +#define MAX_NUM_PORTS_E5 (MAX_NUM_PORTS_K2) +#define MAX_NUM_PORTS (MAX_NUM_PORTS_E5) -#define MAX_NUM_PFS_K2 (16) #define MAX_NUM_PFS_BB (8) -#define MAX_NUM_PFS (MAX_NUM_PFS_K2) +#define MAX_NUM_PFS_K2 (16) +#define MAX_NUM_PFS_E5 (MAX_NUM_PFS_K2) +#define MAX_NUM_PFS (MAX_NUM_PFS_E5) #define MAX_NUM_OF_PFS_IN_CHIP (16) /* On both engines */ #define MAX_NUM_VFS_BB (120) #define MAX_NUM_VFS_K2 (192) -#define E4_MAX_NUM_VFS (MAX_NUM_VFS_K2) -#define E5_MAX_NUM_VFS (240) -#define COMMON_MAX_NUM_VFS (E5_MAX_NUM_VFS) +#define MAX_NUM_VFS_E4 (MAX_NUM_VFS_K2) +#define MAX_NUM_VFS_E5 (240) +#define COMMON_MAX_NUM_VFS (MAX_NUM_VFS_E5) #define MAX_NUM_FUNCTIONS_BB (MAX_NUM_PFS_BB + MAX_NUM_VFS_BB) #define MAX_NUM_FUNCTIONS_K2 (MAX_NUM_PFS_K2 + MAX_NUM_VFS_K2) -#define MAX_NUM_FUNCTIONS (MAX_NUM_PFS + E4_MAX_NUM_VFS) +#define MAX_NUM_FUNCTIONS (MAX_NUM_PFS + MAX_NUM_VFS_E4) /* in both BB and K2, the VF number starts from 16. so for arrays containing all */ /* possible PFs and VFs - we need a constant for this size */ #define MAX_FUNCTION_NUMBER_BB (MAX_NUM_PFS + MAX_NUM_VFS_BB) #define MAX_FUNCTION_NUMBER_K2 (MAX_NUM_PFS + MAX_NUM_VFS_K2) -#define MAX_FUNCTION_NUMBER (MAX_NUM_PFS + E4_MAX_NUM_VFS) +#define MAX_FUNCTION_NUMBER_E4 (MAX_NUM_PFS + MAX_NUM_VFS_E4) +#define MAX_FUNCTION_NUMBER_E5 (MAX_NUM_PFS + MAX_NUM_VFS_E5) +#define COMMON_MAX_FUNCTION_NUMBER (MAX_NUM_PFS + MAX_NUM_VFS_E5) #define MAX_NUM_VPORTS_K2 (208) #define MAX_NUM_VPORTS_BB (160) -#define MAX_NUM_VPORTS (MAX_NUM_VPORTS_K2) +#define MAX_NUM_VPORTS_E4 (MAX_NUM_VPORTS_K2) +#define MAX_NUM_VPORTS_E5 (256) +#define COMMON_MAX_NUM_VPORTS (MAX_NUM_VPORTS_E5) #define MAX_NUM_L2_QUEUES_K2 (320) #define MAX_NUM_L2_QUEUES_BB (256) #define MAX_NUM_L2_QUEUES (MAX_NUM_L2_QUEUES_K2) /* Traffic classes in network-facing blocks (PBF, BTB, NIG, BRB, PRS and QM) */ -// 4-Port K2. #define NUM_PHYS_TCS_4PORT_K2 (4) +#define NUM_PHYS_TCS_4PORT_E5 (6) #define NUM_OF_PHYS_TCS (8) - +#define PURE_LB_TC NUM_OF_PHYS_TCS #define NUM_TCS_4PORT_K2 (NUM_PHYS_TCS_4PORT_K2 + 1) +#define NUM_TCS_4PORT_E5 (NUM_PHYS_TCS_4PORT_E5 + 1) #define NUM_OF_TCS (NUM_OF_PHYS_TCS + 1) -#define LB_TC (NUM_OF_PHYS_TCS) - /* Num of possible traffic priority values */ #define NUM_OF_PRIO (8) -#define MAX_NUM_VOQS_K2 (NUM_TCS_4PORT_K2 * MAX_NUM_PORTS_K2) -#define MAX_NUM_VOQS_BB (NUM_OF_TCS * MAX_NUM_PORTS_BB) -#define MAX_NUM_VOQS (MAX_NUM_VOQS_K2) -#define MAX_PHYS_VOQS (NUM_OF_PHYS_TCS * MAX_NUM_PORTS_BB) - /* CIDs */ -#define E4_NUM_OF_CONNECTION_TYPES (8) -#define E5_NUM_OF_CONNECTION_TYPES (16) +#define NUM_OF_CONNECTION_TYPES_E4 (8) +#define NUM_OF_CONNECTION_TYPES_E5 (16) #define NUM_OF_TASK_TYPES (8) #define NUM_OF_LCIDS (320) #define NUM_OF_LTIDS (320) @@ -375,11 +375,13 @@ /* number of TX queues in the QM */ #define MAX_QM_TX_QUEUES_K2 512 #define MAX_QM_TX_QUEUES_BB 448 +#define MAX_QM_TX_QUEUES_E5 MAX_QM_TX_QUEUES_K2 #define MAX_QM_TX_QUEUES MAX_QM_TX_QUEUES_K2 /* number of Other queues in the QM */ #define MAX_QM_OTHER_QUEUES_BB 64 #define MAX_QM_OTHER_QUEUES_K2 128 +#define MAX_QM_OTHER_QUEUES_E5 MAX_QM_OTHER_QUEUES_K2 #define MAX_QM_OTHER_QUEUES MAX_QM_OTHER_QUEUES_K2 /* number of queues in a PF queue group */ @@ -413,7 +415,9 @@ #define CAU_FSM_ETH_TX 1 /* Number of Protocol Indices per Status Block */ -#define PIS_PER_SB 12 +#define PIS_PER_SB_E4 12 +#define PIS_PER_SB_E5 8 +#define MAX_PIS_PER_SB OSAL_MAX_T(u8, PIS_PER_SB_E4, PIS_PER_SB_E5) #define CAU_HC_STOPPED_STATE 3 /* fsm is stopped or not valid for this sb */ @@ -427,7 +431,8 @@ #define MAX_SB_PER_PATH_K2 (368) #define MAX_SB_PER_PATH_BB (288) -#define MAX_TOT_SB_PER_PATH MAX_SB_PER_PATH_K2 +#define MAX_SB_PER_PATH_E5 (512) +#define MAX_TOT_SB_PER_PATH MAX_SB_PER_PATH_E5 #define MAX_SB_PER_PF_MIMD 129 #define MAX_SB_PER_PF_SIMD 64 @@ -588,7 +593,7 @@ // ILT Records #define PXP_NUM_ILT_RECORDS_BB 7600 #define PXP_NUM_ILT_RECORDS_K2 11000 -#define MAX_NUM_ILT_RECORDS MAX(PXP_NUM_ILT_RECORDS_BB,PXP_NUM_ILT_RECORDS_K2) +#define MAX_NUM_ILT_RECORDS OSAL_MAX_T(u16, PXP_NUM_ILT_RECORDS_BB,PXP_NUM_ILT_RECORDS_K2) // Host Interface @@ -633,7 +638,8 @@ /******************/ /* Number of PBF command queue lines. Each line is 32B. */ -#define PBF_MAX_CMD_LINES 3328 +#define PBF_MAX_CMD_LINES_E4 3328 +#define PBF_MAX_CMD_LINES_E5 5280 /* Number of BTB blocks. Each block is 256B. */ #define BTB_MAX_BLOCKS 1440 @@ -737,8 +743,8 @@ union rdma_eqe_data */ struct malicious_vf_eqe_data { - u8 vfId /* Malicious VF ID */; - u8 errId /* Malicious VF error */; + u8 vf_id /* Malicious VF ID */; + u8 err_id /* Malicious VF error */; __le16 reserved[3]; }; @@ -747,7 +753,7 @@ struct malicious_vf_eqe_data */ struct initial_cleanup_eqe_data { - u8 vfId /* VF ID */; + u8 vf_id /* VF ID */; u8 reserved[7]; }; @@ -1059,7 +1065,7 @@ struct db_rdma_dpm_data { __le16 icid /* internal CID */; __le16 prod_val /* aggregated value to update */; - struct db_rdma_dpm_params params /* parameters passed to RDMA firmware */; + struct db_rdma_dpm_params params /* parametes passed to RDMA firmware */; }; @@ -1113,25 +1119,25 @@ enum igu_seg_access /* - * Enumeration for L3 type field of parsing_and_err_flags_union. L3Type: 0 - unknown (not ip) ,1 - Ipv4, 2 - Ipv6 (this field can be filled according to the last-ethertype) + * Enumeration for L3 type field of parsing_and_err_flags. L3Type: 0 - unknown (not ip) ,1 - Ipv4, 2 - Ipv6 (this field can be filled according to the last-ethertype) */ enum l3_type { - e_l3Type_unknown, - e_l3Type_ipv4, - e_l3Type_ipv6, + e_l3_type_unknown, + e_l3_type_ipv4, + e_l3_type_ipv6, MAX_L3_TYPE }; /* - * Enumeration for l4Protocol field of parsing_and_err_flags_union. L4-protocol 0 - none, 1 - TCP, 2- UDP. if the packet is IPv4 fragment, and its not the first fragment, the protocol-type should be set to none. + * Enumeration for l4Protocol field of parsing_and_err_flags. L4-protocol 0 - none, 1 - TCP, 2- UDP. if the packet is IPv4 fragment, and its not the first fragment, the protocol-type should be set to none. */ enum l4_protocol { - e_l4Protocol_none, - e_l4Protocol_tcp, - e_l4Protocol_udp, + e_l4_protocol_none, + e_l4_protocol_tcp, + e_l4_protocol_udp, MAX_L4_PROTOCOL }; @@ -1146,11 +1152,11 @@ struct parsing_and_err_flags #define PARSING_AND_ERR_FLAGS_L3TYPE_SHIFT 0 #define PARSING_AND_ERR_FLAGS_L4PROTOCOL_MASK 0x3 /* L4-protocol 0 - none, 1 - TCP, 2- UDP. if the packet is IPv4 fragment, and its not the first fragment, the protocol-type should be set to none. (use enum l4_protocol) */ #define PARSING_AND_ERR_FLAGS_L4PROTOCOL_SHIFT 2 -#define PARSING_AND_ERR_FLAGS_IPV4FRAG_MASK 0x1 /* Set if the packet is IPv4 fragment. */ +#define PARSING_AND_ERR_FLAGS_IPV4FRAG_MASK 0x1 /* Set if the packet is IPv4/IPv6 fragment. */ #define PARSING_AND_ERR_FLAGS_IPV4FRAG_SHIFT 4 -#define PARSING_AND_ERR_FLAGS_TAG8021QEXIST_MASK 0x1 /* Set if VLAN tag exists. Invalid if tunnel type are IP GRE or IP GENEVE. */ +#define PARSING_AND_ERR_FLAGS_TAG8021QEXIST_MASK 0x1 /* corresponds to the same 8021q tag that is selected for 8021q-tag fiel. This flag should be set if the tag appears in the packet, regardless of its value. */ #define PARSING_AND_ERR_FLAGS_TAG8021QEXIST_SHIFT 5 -#define PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED_MASK 0x1 /* Set if L4 checksum was calculated. */ +#define PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED_MASK 0x1 /* Set if L4 checksum was calculated. taken from the EOP descriptor. */ #define PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED_SHIFT 6 #define PARSING_AND_ERR_FLAGS_TIMESYNCPKT_MASK 0x1 /* Set for PTP packet. */ #define PARSING_AND_ERR_FLAGS_TIMESYNCPKT_SHIFT 7 @@ -1162,11 +1168,11 @@ struct parsing_and_err_flags #define PARSING_AND_ERR_FLAGS_L4CHKSMERROR_SHIFT 10 #define PARSING_AND_ERR_FLAGS_TUNNELEXIST_MASK 0x1 /* Set if GRE/VXLAN/GENEVE tunnel detected. */ #define PARSING_AND_ERR_FLAGS_TUNNELEXIST_SHIFT 11 -#define PARSING_AND_ERR_FLAGS_TUNNEL8021QTAGEXIST_MASK 0x1 /* Set if VLAN tag exists in tunnel header. */ +#define PARSING_AND_ERR_FLAGS_TUNNEL8021QTAGEXIST_MASK 0x1 /* This flag should be set if the tag appears in the packet tunnel header, regardless of its value.. */ #define PARSING_AND_ERR_FLAGS_TUNNEL8021QTAGEXIST_SHIFT 12 #define PARSING_AND_ERR_FLAGS_TUNNELIPHDRERROR_MASK 0x1 /* Set if either tunnel-ipv4-version-mismatch or tunnel-ipv4-hdr-len-error or tunnel-ipv4-cksm is set or tunneling ipv6 ver mismatch */ #define PARSING_AND_ERR_FLAGS_TUNNELIPHDRERROR_SHIFT 13 -#define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMWASCALCULATED_MASK 0x1 /* Set if GRE or VXLAN/GENEVE UDP checksum was calculated. */ +#define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMWASCALCULATED_MASK 0x1 /* taken from the EOP descriptor. */ #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMWASCALCULATED_SHIFT 14 #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMERROR_MASK 0x1 /* Set if tunnel L4 checksum validation failed. Valid only if tunnel L4 checksum was calculated. */ #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMERROR_SHIFT 15 @@ -1419,21 +1425,42 @@ enum rss_hash_type /* * status block structure */ -struct status_block +struct status_block_e4 { - __le16 pi_array[PIS_PER_SB]; + __le16 pi_array[PIS_PER_SB_E4]; __le32 sb_num; -#define STATUS_BLOCK_SB_NUM_MASK 0x1FF -#define STATUS_BLOCK_SB_NUM_SHIFT 0 -#define STATUS_BLOCK_ZERO_PAD_MASK 0x7F -#define STATUS_BLOCK_ZERO_PAD_SHIFT 9 -#define STATUS_BLOCK_ZERO_PAD2_MASK 0xFFFF -#define STATUS_BLOCK_ZERO_PAD2_SHIFT 16 +#define STATUS_BLOCK_E4_SB_NUM_MASK 0x1FF +#define STATUS_BLOCK_E4_SB_NUM_SHIFT 0 +#define STATUS_BLOCK_E4_ZERO_PAD_MASK 0x7F +#define STATUS_BLOCK_E4_ZERO_PAD_SHIFT 9 +#define STATUS_BLOCK_E4_ZERO_PAD2_MASK 0xFFFF +#define STATUS_BLOCK_E4_ZERO_PAD2_SHIFT 16 __le32 prod_index; -#define STATUS_BLOCK_PROD_INDEX_MASK 0xFFFFFF -#define STATUS_BLOCK_PROD_INDEX_SHIFT 0 -#define STATUS_BLOCK_ZERO_PAD3_MASK 0xFF -#define STATUS_BLOCK_ZERO_PAD3_SHIFT 24 +#define STATUS_BLOCK_E4_PROD_INDEX_MASK 0xFFFFFF +#define STATUS_BLOCK_E4_PROD_INDEX_SHIFT 0 +#define STATUS_BLOCK_E4_ZERO_PAD3_MASK 0xFF +#define STATUS_BLOCK_E4_ZERO_PAD3_SHIFT 24 +}; + + +/* + * status block structure + */ +struct status_block_e5 +{ + __le16 pi_array[PIS_PER_SB_E5]; + __le32 sb_num; +#define STATUS_BLOCK_E5_SB_NUM_MASK 0x1FF +#define STATUS_BLOCK_E5_SB_NUM_SHIFT 0 +#define STATUS_BLOCK_E5_ZERO_PAD_MASK 0x7F +#define STATUS_BLOCK_E5_ZERO_PAD_SHIFT 9 +#define STATUS_BLOCK_E5_ZERO_PAD2_MASK 0xFFFF +#define STATUS_BLOCK_E5_ZERO_PAD2_SHIFT 16 + __le32 prod_index; +#define STATUS_BLOCK_E5_PROD_INDEX_MASK 0xFFFFFF +#define STATUS_BLOCK_E5_PROD_INDEX_SHIFT 0 +#define STATUS_BLOCK_E5_ZERO_PAD3_MASK 0xFF +#define STATUS_BLOCK_E5_ZERO_PAD3_SHIFT 24 }; Modified: head/sys/dev/qlnx/qlnxe/ecore.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/ecore.h Thu Jun 15 02:39:33 2017 (r319963) +++ head/sys/dev/qlnx/qlnxe/ecore.h Thu Jun 15 02:45:43 2017 (r319964) @@ -39,8 +39,8 @@ #include "mcp_public.h" #define ECORE_MAJOR_VERSION 8 -#define ECORE_MINOR_VERSION 18 -#define ECORE_REVISION_VERSION 13 +#define ECORE_MINOR_VERSION 30 +#define ECORE_REVISION_VERSION 0 #define ECORE_ENGINEERING_VERSION 0 #define ECORE_VERSION \ @@ -110,13 +110,13 @@ do { \ #define GET_FIELD(value, name) \ (((value) >> (name##_SHIFT)) & name##_MASK) -#define ECORE_MFW_GET_FIELD(name, field) \ - (((name) & (field ## _MASK)) >> (field ## _SHIFT)) +#define GET_MFW_FIELD(name, field) \ + (((name) & (field ## _MASK)) >> (field ## _OFFSET)) -#define ECORE_MFW_SET_FIELD(name, field, value) \ +#define SET_MFW_FIELD(name, field, value) \ do { \ - (name) &= ~((field ## _MASK) << (field ## _SHIFT)); \ - (name) |= (((value) << (field ## _SHIFT)) & (field ## _MASK)); \ + (name) &= ~((field ## _MASK) << (field ## _OFFSET)); \ + (name) |= (((value) << (field ## _OFFSET)) & (field ## _MASK)); \ } while (0) static OSAL_INLINE u32 DB_ADDR(u32 cid, u32 DEMS) @@ -401,6 +401,11 @@ enum ecore_wol_support { ECORE_WOL_SUPPORT_PME, }; +enum ecore_db_rec_exec { + DB_REC_DRY_RUN, + DB_REC_REAL_DEAL, +}; + struct ecore_hw_info { /* PCI personality */ enum ecore_pci_personality personality; @@ -450,10 +455,7 @@ struct ecore_hw_info { #ifndef ETH_ALEN #define ETH_ALEN 6 /* @@@ TBD - define somewhere else for Windows */ #endif - unsigned char hw_mac_addr[ETH_ALEN]; - u64 node_wwn; /* For FCoE only */ - u64 port_wwn; /* For FCoE only */ u16 num_iscsi_conns; u16 num_fcoe_conns; @@ -537,6 +539,12 @@ struct ecore_qm_info { u8 num_pf_rls; }; +struct ecore_db_recovery_info { + osal_list_t list; + osal_spinlock_t lock; + u32 db_recovery_counter; +}; + struct storm_stats { u32 address; u32 len; @@ -605,6 +613,11 @@ struct ecore_hwfn { struct ecore_ptt *p_main_ptt; struct ecore_ptt *p_dpc_ptt; + /* PTP will be used only by the leading funtion. + * Usage of all PTP-apis should be synchronized as result. + */ + struct ecore_ptt *p_ptp_ptt; + struct ecore_sb_sp_info *p_sp_sb; struct ecore_sb_attn_info *p_sb_attn; @@ -661,6 +674,9 @@ struct ecore_hwfn { /* L2-related */ struct ecore_l2_info *p_l2_info; + + /* Mechanism for recovering from doorbell drop */ + struct ecore_db_recovery_info db_recovery_info; }; enum ecore_mf_mode { @@ -694,7 +710,7 @@ struct ecore_dev { #define ECORE_IS_AH(dev) ((dev)->type == ECORE_DEV_TYPE_AH) #define ECORE_IS_K2(dev) ECORE_IS_AH(dev) -#define ECORE_IS_E5(dev) false +#define ECORE_IS_E5(dev) ((dev)->type == ECORE_DEV_TYPE_E5) #define ECORE_E5_MISSING_CODE OSAL_BUILD_BUG_ON(false) @@ -703,6 +719,7 @@ struct ecore_dev { #define ECORE_DEV_ID_MASK 0xff00 #define ECORE_DEV_ID_MASK_BB 0x1600 #define ECORE_DEV_ID_MASK_AH 0x8000 +#define ECORE_DEV_ID_MASK_E5 0x8100 u16 chip_num; #define CHIP_NUM_MASK 0xffff @@ -746,7 +763,7 @@ struct ecore_dev { #define CHIP_BOND_ID_SHIFT 0 u8 num_engines; - u8 num_ports_in_engines; + u8 num_ports_in_engine; u8 num_funcs_in_port; u8 path_id; @@ -836,6 +853,9 @@ struct ecore_dev { : MAX_SB_PER_PATH_K2) #define NUM_OF_ENG_PFS(dev) (ECORE_IS_BB(dev) ? MAX_NUM_PFS_BB \ : MAX_NUM_PFS_K2) + +#define CRC8_TABLE_SIZE 256 + /** * @brief ecore_concrete_to_sw_fid - get the sw function id from * the concrete value. @@ -844,8 +864,7 @@ struct ecore_dev { * * @return OSAL_INLINE u8 */ -static OSAL_INLINE u8 ecore_concrete_to_sw_fid(struct ecore_dev *p_dev, - u32 concrete_fid) +static OSAL_INLINE u8 ecore_concrete_to_sw_fid(u32 concrete_fid) { u8 vfid = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_VFID); u8 pfid = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_PFID); @@ -860,8 +879,8 @@ static OSAL_INLINE u8 ecore_concrete_to_sw_fid(struct return sw_fid; } -#define PURE_LB_TC 8 #define PKT_LB_TC 9 +#define MAX_NUM_VOQS_E4 20 int ecore_configure_vport_wfq(struct ecore_dev *p_dev, u16 vp_id, u32 rate); void ecore_configure_vp_wfq_on_link_change(struct ecore_dev *p_dev, @@ -873,6 +892,7 @@ int ecore_configure_pf_min_bandwidth(struct ecore_dev void ecore_clean_wfq_db(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt); int ecore_device_num_engines(struct ecore_dev *p_dev); int ecore_device_num_ports(struct ecore_dev *p_dev); +int ecore_device_get_port_id(struct ecore_dev *p_dev); void ecore_set_fw_mac_addr(__le16 *fw_msb, __le16 *fw_mid, __le16 *fw_lsb, u8 *mac); @@ -892,6 +912,13 @@ u16 ecore_get_cm_pq_idx_mcos(struct ecore_hwfn *p_hwfn u16 ecore_get_cm_pq_idx_vf(struct ecore_hwfn *p_hwfn, u16 vf); u16 ecore_get_cm_pq_idx_rl(struct ecore_hwfn *p_hwfn, u8 qpid); +const char *ecore_hw_get_resc_name(enum ecore_resources res_id); + +/* doorbell recovery mechanism */ +void ecore_db_recovery_dp(struct ecore_hwfn *p_hwfn); +void ecore_db_recovery_execute(struct ecore_hwfn *p_hwfn, + enum ecore_db_rec_exec); + /* amount of resources used in qm init */ u8 ecore_init_qm_get_num_tcs(struct ecore_hwfn *p_hwfn); u16 ecore_init_qm_get_num_vfs(struct ecore_hwfn *p_hwfn); @@ -900,7 +927,5 @@ u16 ecore_init_qm_get_num_vports(struct ecore_hwfn *p_ u16 ecore_init_qm_get_num_pqs(struct ecore_hwfn *p_hwfn); #define ECORE_LEADING_HWFN(dev) (&dev->hwfns[0]) - -const char *ecore_hw_get_resc_name(enum ecore_resources res_id); #endif /* __ECORE_H */ Modified: head/sys/dev/qlnx/qlnxe/ecore_chain.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/ecore_chain.h Thu Jun 15 02:39:33 2017 (r319963) +++ head/sys/dev/qlnx/qlnxe/ecore_chain.h Thu Jun 15 02:45:43 2017 (r319964) @@ -214,6 +214,11 @@ static OSAL_INLINE u32 ecore_chain_get_cons_idx_u32(st return p_chain->u.chain32.cons_idx; } +/* FIXME: + * Should create OSALs for the below definitions. + * For Linux, replace them with the existing U16_MAX and U32_MAX, and handle + * kernel versions that lack them. + */ #define ECORE_U16_MAX ((u16)~0U) #define ECORE_U32_MAX ((u32)~0U) Modified: head/sys/dev/qlnx/qlnxe/ecore_cxt.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/ecore_cxt.c Thu Jun 15 02:39:33 2017 (r319963) +++ head/sys/dev/qlnx/qlnxe/ecore_cxt.c Thu Jun 15 02:45:43 2017 (r319964) @@ -72,17 +72,7 @@ __FBSDID("$FreeBSD$"); #define TM_ELEM_SIZE 4 /* ILT constants */ -/* If for some reason, HW P size is modified to be less than 32K, - * special handling needs to be made for CDU initialization - */ -#ifdef CONFIG_ECORE_ROCE -/* For RoCE we configure to 64K to cover for RoCE max tasks 256K purpose. Can be - * optimized with resource management scheme - */ #define ILT_DEFAULT_HW_P_SIZE 4 -#else -#define ILT_DEFAULT_HW_P_SIZE 3 -#endif #define ILT_PAGE_IN_BYTES(hw_p_size) (1U << ((hw_p_size) + 12)) #define ILT_CFG_REG(cli, reg) PSWRQ2_REG_##cli##_##reg##_RT_OFFSET @@ -97,22 +87,22 @@ __FBSDID("$FreeBSD$"); /* connection context union */ union conn_context { - struct core_conn_context core_ctx; - struct eth_conn_context eth_ctx; - struct iscsi_conn_context iscsi_ctx; - struct fcoe_conn_context fcoe_ctx; - struct roce_conn_context roce_ctx; + struct e4_core_conn_context core_ctx; + struct e4_eth_conn_context eth_ctx; + struct e4_iscsi_conn_context iscsi_ctx; + struct e4_fcoe_conn_context fcoe_ctx; + struct e4_roce_conn_context roce_ctx; }; /* TYPE-0 task context - iSCSI, FCOE */ union type0_task_context { - struct iscsi_task_context iscsi_ctx; - struct fcoe_task_context fcoe_ctx; + struct e4_iscsi_task_context iscsi_ctx; + struct e4_fcoe_task_context fcoe_ctx; }; /* TYPE-1 task context - ROCE */ union type1_task_context { - struct rdma_task_context roce_ctx; + struct e4_rdma_task_context roce_ctx; }; struct src_ent { @@ -274,12 +264,10 @@ struct ecore_cxt_mngr { }; /* check if resources/configuration is required according to protocol type */ -static bool src_proto(struct ecore_hwfn *p_hwfn, - enum protocol_type type) +static bool src_proto(enum protocol_type type) { return type == PROTOCOLID_ISCSI || type == PROTOCOLID_FCOE || - type == PROTOCOLID_TOE || type == PROTOCOLID_IWARP; } @@ -319,14 +307,13 @@ struct ecore_src_iids { u32 per_vf_cids; }; -static void ecore_cxt_src_iids(struct ecore_hwfn *p_hwfn, - struct ecore_cxt_mngr *p_mngr, +static void ecore_cxt_src_iids(struct ecore_cxt_mngr *p_mngr, struct ecore_src_iids *iids) { u32 i; for (i = 0; i < MAX_CONN_TYPES; i++) { - if (!src_proto(p_hwfn, i)) + if (!src_proto(i)) continue; iids->pf_cids += p_mngr->conn_cfg[i].cid_count; @@ -346,8 +333,7 @@ struct ecore_tm_iids { u32 per_vf_tids; }; -static void ecore_cxt_tm_iids(struct ecore_hwfn *p_hwfn, - struct ecore_cxt_mngr *p_mngr, +static void ecore_cxt_tm_iids(struct ecore_cxt_mngr *p_mngr, struct ecore_tm_iids *iids) { bool tm_vf_required = false; @@ -454,6 +440,20 @@ static struct ecore_tid_seg *ecore_cxt_tid_seg_info(st return OSAL_NULL; } +static void ecore_cxt_set_srq_count(struct ecore_hwfn *p_hwfn, u32 num_srqs) +{ + struct ecore_cxt_mngr *p_mgr = p_hwfn->p_cxt_mngr; + + p_mgr->srq_count = num_srqs; +} + +u32 ecore_cxt_get_srq_count(struct ecore_hwfn *p_hwfn) +{ + struct ecore_cxt_mngr *p_mgr = p_hwfn->p_cxt_mngr; + + return p_mgr->srq_count; +} + /* set the iids (cid/tid) count per protocol */ static void ecore_cxt_set_proto_cid_count(struct ecore_hwfn *p_hwfn, enum protocol_type type, @@ -779,7 +779,7 @@ enum _ecore_status_t ecore_cxt_cfg_ilt_compute(struct p_blk = ecore_cxt_set_blk(&p_cli->pf_blks[0]); ecore_cxt_qm_iids(p_hwfn, &qm_iids); - total = ecore_qm_pf_mem_size(p_hwfn->rel_pf_id, qm_iids.cids, + total = ecore_qm_pf_mem_size(qm_iids.cids, qm_iids.vf_cids, qm_iids.tids, p_hwfn->qm_info.num_pqs, p_hwfn->qm_info.num_vf_pqs); @@ -797,7 +797,7 @@ enum _ecore_status_t ecore_cxt_cfg_ilt_compute(struct /* SRC */ p_cli = ecore_cxt_set_cli(&p_mngr->clients[ILT_CLI_SRC]); - ecore_cxt_src_iids(p_hwfn, p_mngr, &src_iids); + ecore_cxt_src_iids(p_mngr, &src_iids); /* Both the PF and VFs searcher connections are stored in the per PF * database. Thus sum the PF searcher cids and all the VFs searcher @@ -822,7 +822,7 @@ enum _ecore_status_t ecore_cxt_cfg_ilt_compute(struct /* TM PF */ p_cli = ecore_cxt_set_cli(&p_mngr->clients[ILT_CLI_TM]); - ecore_cxt_tm_iids(p_hwfn, p_mngr, &tm_iids); + ecore_cxt_tm_iids(p_mngr, &tm_iids); total = tm_iids.pf_cids + tm_iids.pf_tids_total; if (total) { p_blk = ecore_cxt_set_blk(&p_cli->pf_blks[0]); @@ -952,7 +952,7 @@ static enum _ecore_status_t ecore_cxt_src_t2_alloc(str if (!p_src->active) return ECORE_SUCCESS; - ecore_cxt_src_iids(p_hwfn, p_mngr, &src_iids); + ecore_cxt_src_iids(p_mngr, &src_iids); conn_num = src_iids.pf_cids + src_iids.per_vf_cids * p_mngr->vf_count; total_size = conn_num * sizeof(struct src_ent); @@ -1287,7 +1287,7 @@ enum _ecore_status_t ecore_cxt_mngr_alloc(struct ecore clients[ILT_CLI_TSDM].last.reg = ILT_CFG_REG(TSDM, LAST_ILT); clients[ILT_CLI_TSDM].p_size.reg = ILT_CFG_REG(TSDM, P_SIZE); - /* default ILT page size for all clients is 32K */ + /* default ILT page size for all clients is 64K */ for (i = 0; i < ILT_CLI_MAX; i++) p_mngr->clients[i].p_size.val = ILT_DEFAULT_HW_P_SIZE; @@ -1299,7 +1299,9 @@ enum _ecore_status_t ecore_cxt_mngr_alloc(struct ecore p_mngr->vf_count = p_hwfn->p_dev->p_iov_info->total_vfs; /* Initialize the dynamic ILT allocation mutex */ +#ifdef CONFIG_ECORE_LOCK_ALLOC OSAL_MUTEX_ALLOC(p_hwfn, &p_mngr->mutex); +#endif OSAL_MUTEX_INIT(&p_mngr->mutex); /* Set the cxt mangr pointer priori to further allocations */ @@ -1347,7 +1349,9 @@ void ecore_cxt_mngr_free(struct ecore_hwfn *p_hwfn) ecore_cid_map_free(p_hwfn); ecore_cxt_src_t2_free(p_hwfn); ecore_ilt_shadow_free(p_hwfn); +#ifdef CONFIG_ECORE_LOCK_ALLOC OSAL_MUTEX_DEALLOC(&p_hwfn->p_cxt_mngr->mutex); +#endif OSAL_FREE(p_hwfn->p_dev, p_hwfn->p_cxt_mngr); p_hwfn->p_cxt_mngr = OSAL_NULL; @@ -1555,7 +1559,7 @@ static void ecore_cdu_init_pf(struct ecore_hwfn *p_hwf } } -void ecore_qm_init_pf(struct ecore_hwfn *p_hwfn) +void ecore_qm_init_pf(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt) { struct ecore_qm_info *qm_info = &p_hwfn->qm_info; struct ecore_qm_iids iids; @@ -1563,9 +1567,8 @@ void ecore_qm_init_pf(struct ecore_hwfn *p_hwfn) OSAL_MEM_ZERO(&iids, sizeof(iids)); ecore_cxt_qm_iids(p_hwfn, &iids); - ecore_qm_pf_rt_init(p_hwfn, p_hwfn->p_main_ptt, p_hwfn->port_id, + ecore_qm_pf_rt_init(p_hwfn, p_ptt, p_hwfn->port_id, p_hwfn->rel_pf_id, qm_info->max_phys_tcs_per_port, - p_hwfn->first_on_engine, iids.cids, iids.vf_cids, iids.tids, qm_info->start_pq, qm_info->num_pqs - qm_info->num_vf_pqs, @@ -1749,7 +1752,7 @@ static void ecore_ilt_init_pf(struct ecore_hwfn *p_hwf if (p_shdw[line].p_virt != OSAL_NULL) { SET_FIELD(ilt_hw_entry, ILT_ENTRY_VALID, 1ULL); SET_FIELD(ilt_hw_entry, ILT_ENTRY_PHY_ADDR, - (p_shdw[line].p_phys >> 12)); + (unsigned long long)(p_shdw[line].p_phys >> 12)); DP_VERBOSE( p_hwfn, ECORE_MSG_ILT, @@ -1771,7 +1774,7 @@ static void ecore_src_init_pf(struct ecore_hwfn *p_hwf struct ecore_src_iids src_iids; OSAL_MEM_ZERO(&src_iids, sizeof(src_iids)); - ecore_cxt_src_iids(p_hwfn, p_mngr, &src_iids); + ecore_cxt_src_iids(p_mngr, &src_iids); conn_num = src_iids.pf_cids + src_iids.per_vf_cids * p_mngr->vf_count; if (!conn_num) return; @@ -1817,7 +1820,7 @@ static void ecore_tm_init_pf(struct ecore_hwfn *p_hwfn u8 i; OSAL_MEM_ZERO(&tm_iids, sizeof(tm_iids)); - ecore_cxt_tm_iids(p_hwfn, p_mngr, &tm_iids); + ecore_cxt_tm_iids(p_mngr, &tm_iids); /* @@@TBD No pre-scan for now */ @@ -1908,9 +1911,11 @@ static void ecore_prs_init_common(struct ecore_hwfn *p static void ecore_prs_init_pf(struct ecore_hwfn *p_hwfn) { struct ecore_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; - struct ecore_conn_type_cfg *p_fcoe = &p_mngr->conn_cfg[PROTOCOLID_FCOE]; + struct ecore_conn_type_cfg *p_fcoe; struct ecore_tid_seg *p_tid; + p_fcoe = &p_mngr->conn_cfg[PROTOCOLID_FCOE]; + /* If FCoE is active set the MAX OX_ID (tid) in the Parser */ if (!p_fcoe->cid_count) return; @@ -1934,9 +1939,9 @@ void ecore_cxt_hw_init_common(struct ecore_hwfn *p_hwf ecore_prs_init_common(p_hwfn); } -void ecore_cxt_hw_init_pf(struct ecore_hwfn *p_hwfn) +void ecore_cxt_hw_init_pf(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt) { - ecore_qm_init_pf(p_hwfn); + ecore_qm_init_pf(p_hwfn, p_ptt); ecore_cm_init_pf(p_hwfn); ecore_dq_init_pf(p_hwfn); ecore_cdu_init_pf(p_hwfn); @@ -2119,20 +2124,6 @@ enum _ecore_status_t ecore_cxt_get_cid_info(struct eco return ECORE_SUCCESS; } -static void ecore_cxt_set_srq_count(struct ecore_hwfn *p_hwfn, u32 num_srqs) -{ - struct ecore_cxt_mngr *p_mgr = p_hwfn->p_cxt_mngr; - - p_mgr->srq_count = num_srqs; -} - -u32 ecore_cxt_get_srq_count(struct ecore_hwfn *p_hwfn) -{ - struct ecore_cxt_mngr *p_mgr = p_hwfn->p_cxt_mngr; - - return p_mgr->srq_count; -} - static void ecore_rdma_set_pf_params(struct ecore_hwfn *p_hwfn, struct ecore_rdma_pf_params *p_params, u32 num_tasks) @@ -2143,7 +2134,7 @@ static void ecore_rdma_set_pf_params(struct ecore_hwfn /* Override personality with rdma flavor */ num_srqs = OSAL_MIN_T(u32, ECORE_RDMA_MAX_SRQS, p_params->num_srqs); - /* The only case RDMA personality can be overridden is if NVRAM is + /* The only case RDMA personality can be overriden is if NVRAM is * configured with ETH_RDMA or if no rdma protocol was requested */ switch (p_params->rdma_protocol) { @@ -2170,8 +2161,12 @@ static void ecore_rdma_set_pf_params(struct ecore_hwfn switch (p_hwfn->hw_info.personality) { case ECORE_PCI_ETH_IWARP: - num_qps = OSAL_MIN_T(u32, IWARP_MAX_QPS, p_params->num_qps); - num_cons = num_qps; + /* Each QP requires one connection */ + num_cons = OSAL_MIN_T(u32, IWARP_MAX_QPS, p_params->num_qps); +#ifdef CONFIG_ECORE_IWARP /* required for the define */ + /* additional connections required for passive tcp handling */ + num_cons += ECORE_IWARP_PREALLOC_CNT; +#endif proto = PROTOCOLID_IWARP; p_params->roce_edpm_mode = false; break; @@ -2576,14 +2571,14 @@ enum _ecore_status_t ecore_cxt_get_task_ctx(struct eco u8 ctx_type, void **pp_task_ctx) { - struct ecore_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; - struct ecore_ilt_client_cfg *p_cli; - struct ecore_ilt_cli_blk *p_seg; - struct ecore_tid_seg *p_seg_info; - u32 proto, seg; - u32 total_lines; - u32 tid_size, ilt_idx; - u32 num_tids_per_block; + struct ecore_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; + struct ecore_ilt_client_cfg *p_cli; + struct ecore_tid_seg *p_seg_info; + struct ecore_ilt_cli_blk *p_seg; + u32 num_tids_per_block; + u32 tid_size, ilt_idx; + u32 total_lines; + u32 proto, seg; /* Verify the personality */ switch (p_hwfn->hw_info.personality) { Modified: head/sys/dev/qlnx/qlnxe/ecore_cxt.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/ecore_cxt.h Thu Jun 15 02:39:33 2017 (r319963) +++ head/sys/dev/qlnx/qlnxe/ecore_cxt.h Thu Jun 15 02:45:43 2017 (r319964) @@ -28,7 +28,6 @@ * */ - #ifndef _ECORE_CID_ #define _ECORE_CID_ @@ -130,15 +129,17 @@ void ecore_cxt_hw_init_common(struct ecore_hwfn *p_hwf * @brief ecore_cxt_hw_init_pf - Initailze ILT and DQ, PF phase, per path. * * @param p_hwfn + * @param p_ptt */ -void ecore_cxt_hw_init_pf(struct ecore_hwfn *p_hwfn); +void ecore_cxt_hw_init_pf(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt); /** * @brief ecore_qm_init_pf - Initailze the QM PF phase, per path * * @param p_hwfn + * @param p_ptt */ -void ecore_qm_init_pf(struct ecore_hwfn *p_hwfn); +void ecore_qm_init_pf(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt); /** * @brief Reconfigures QM pf on the fly Modified: head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c Thu Jun 15 02:39:33 2017 (r319963) +++ head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c Thu Jun 15 02:45:43 2017 (r319964) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); - #include "bcm_osal.h" #include "ecore.h" #include "ecore_hw.h" @@ -62,9 +61,6 @@ enum mem_groups { MEM_GROUP_IOR, MEM_GROUP_RAM, MEM_GROUP_BTB_RAM, - MEM_GROUP_RDIF_CTX, - MEM_GROUP_TDIF_CTX, - MEM_GROUP_CFC_MEM, MEM_GROUP_CONN_CFC_MEM, MEM_GROUP_TASK_CFC_MEM, MEM_GROUP_CAU_PI, @@ -73,6 +69,9 @@ enum mem_groups { MEM_GROUP_PBUF, MEM_GROUP_MULD_MEM, MEM_GROUP_BTB_MEM, + MEM_GROUP_RDIF_CTX, + MEM_GROUP_TDIF_CTX, + MEM_GROUP_CFC_MEM, MEM_GROUP_IGU_MEM, MEM_GROUP_IGU_MSIX, MEM_GROUP_CAU_SB, @@ -95,9 +94,6 @@ static const char* s_mem_group_names[] = { "IOR", "RAM", "BTB_RAM", - "RDIF_CTX", - "TDIF_CTX", - "CFC_MEM", "CONN_CFC_MEM", "TASK_CFC_MEM", "CAU_PI", @@ -106,6 +102,9 @@ static const char* s_mem_group_names[] = { "PBUF", "MULD_MEM", "BTB_MEM", + "RDIF_CTX", + "TDIF_CTX", + "CFC_MEM", "IGU_MEM", "IGU_MSIX", "CAU_SB", @@ -161,7 +160,7 @@ static u32 cond12(const u32 *r, const u32 *imm) { return (r[0] != r[1] && r[2] > imm[0]); } -static u32 cond3(const u32 *r, const u32 *imm) { +static u32 cond3(const u32 *r, const u32 OSAL_UNUSED *imm) { return (r[0] != r[1]); } @@ -256,7 +255,7 @@ struct storm_defs { /* Block constant definitions */ struct block_defs { const char *name; - bool has_dbg_bus[MAX_CHIP_IDS]; + bool exists[MAX_CHIP_IDS]; bool associated_to_storm; /* Valid only if associated_to_storm is true */ @@ -280,8 +279,8 @@ struct block_defs { /* Reset register definitions */ struct reset_reg_defs { u32 addr; - u32 unreset_val; bool exists[MAX_CHIP_IDS]; + u32 unreset_val[MAX_CHIP_IDS]; }; /* Debug Bus Constraint operation constant definitions */ @@ -311,8 +310,8 @@ struct rss_mem_defs { const char *mem_name; const char *type_name; u32 addr; + u32 entry_width; u32 num_entries[MAX_CHIP_IDS]; - u32 entry_width[MAX_CHIP_IDS]; }; struct vfc_ram_defs { @@ -550,7 +549,7 @@ static struct dbg_array s_dbg_arrays[MAX_BIN_DBG_BUFFE static struct dbg_array s_dbg_arrays[MAX_BIN_DBG_BUFFER_TYPE] = { /* BIN_BUF_DBG_MODE_TREE */ - { (const u32 *)dbg_modes_tree_buf, OSAL_ARRAY_SIZE(dbg_modes_tree_buf)}, + { (const u32*)dbg_modes_tree_buf, OSAL_ARRAY_SIZE(dbg_modes_tree_buf)}, /* BIN_BUF_DBG_DUMP_REG */ { dump_reg, OSAL_ARRAY_SIZE(dump_reg) }, @@ -615,7 +614,7 @@ static struct chip_defs s_chip_defs[MAX_CHIP_IDS] = { /* FPGA */ { MAX_NUM_PORTS_BB, MAX_NUM_PFS_BB, MAX_NUM_VFS_BB } } }, - { "k2", + { "ah", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jun 15 03:09:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9C26BFE00C; Thu, 15 Jun 2017 03:09:23 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C10D84A2D; Thu, 15 Jun 2017 03:09:23 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id LL9ldoNXDyd2DLL9mdD2Zk; Wed, 14 Jun 2017 21:09:15 -0600 X-Authority-Analysis: v=2.2 cv=F5wnTupN c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=8nJEP1OIZ-IA:10 a=LWSFodeU3zMA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=4V2vZeva4j3ycGOhxwIA:9 a=mryjqznjMHERn_nU:21 a=wPNLvfGTeEIA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 52F7DA22; Wed, 14 Jun 2017 20:09:13 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v5F37wLG052878; Wed, 14 Jun 2017 20:07:58 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201706150307.v5F37wLG052878@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: David C Somayajulu cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319964 - head/sys/dev/qlnx/qlnxe In-Reply-To: Message from David C Somayajulu of "Thu, 15 Jun 2017 02:45:43 -0000." <201706150245.v5F2jhna021469@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Wed, 14 Jun 2017 20:07:58 -0700 X-CMAE-Envelope: MS4wfOKNUq2OkbgH6wOXb+Y/gSfI/DrZAPGgSl1cS/BjXwRsox6n2yAsUJCrC+eP6zCMolIWSOSesuYQXkl4qE9mLYEfNvB31y7XHEiSekqPJdRhjE4eTEcy R21UmDFjJrtLxnVr1+Ckb9Bk570Le80MEhEtMcfRHBAd2UYJus6176XGE85mUOzmn5dSxLL3uVSpLfLaXTP/Q/gqAAlssnXQsEKTwokkMQLhY+A+e7Tr9mDO zFPiBt4lxcb4JW+qrVRNLdPKNw3LEFt/s3GCAxz9to9/fMSWsxZ1l2E3ixtz+VF6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 03:09:23 -0000 In message <201706150245.v5F2jhna021469@repo.freebsd.org>, David C Somayajulu w rites: > Author: davidcs > Date: Thu Jun 15 02:45:43 2017 > New Revision: 319964 > URL: https://svnweb.freebsd.org/changeset/base/319964 > > Log: > Upgrade STORMFW to 8.30.0.0 and ecore version to 8.30.0.0 > Add support for pci deviceID 0x8070 for QLE41xxx product line which > supports 10GbE/25GbE/40GbE > > MFC after:5 days > > Modified: > head/sys/dev/qlnx/qlnxe/bcm_osal.h > head/sys/dev/qlnx/qlnxe/common_hsi.h > head/sys/dev/qlnx/qlnxe/ecore.h > head/sys/dev/qlnx/qlnxe/ecore_chain.h > head/sys/dev/qlnx/qlnxe/ecore_cxt.c > head/sys/dev/qlnx/qlnxe/ecore_cxt.h > head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c > head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.h > head/sys/dev/qlnx/qlnxe/ecore_dbg_values.h > head/sys/dev/qlnx/qlnxe/ecore_dcbx.c > head/sys/dev/qlnx/qlnxe/ecore_dcbx.h > head/sys/dev/qlnx/qlnxe/ecore_dev.c > head/sys/dev/qlnx/qlnxe/ecore_dev_api.h > head/sys/dev/qlnx/qlnxe/ecore_fcoe_api.h > head/sys/dev/qlnx/qlnxe/ecore_gtt_reg_addr.h > head/sys/dev/qlnx/qlnxe/ecore_hsi_common.h > head/sys/dev/qlnx/qlnxe/ecore_hsi_debug_tools.h > head/sys/dev/qlnx/qlnxe/ecore_hsi_eth.h > head/sys/dev/qlnx/qlnxe/ecore_hsi_fcoe.h > head/sys/dev/qlnx/qlnxe/ecore_hsi_iscsi.h > head/sys/dev/qlnx/qlnxe/ecore_hsi_iwarp.h > head/sys/dev/qlnx/qlnxe/ecore_hsi_rdma.h > head/sys/dev/qlnx/qlnxe/ecore_hsi_roce.h > head/sys/dev/qlnx/qlnxe/ecore_hw.c > head/sys/dev/qlnx/qlnxe/ecore_hw.h > head/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.c > head/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.h > head/sys/dev/qlnx/qlnxe/ecore_init_ops.c > head/sys/dev/qlnx/qlnxe/ecore_init_ops.h > head/sys/dev/qlnx/qlnxe/ecore_init_values.h > head/sys/dev/qlnx/qlnxe/ecore_int.c > head/sys/dev/qlnx/qlnxe/ecore_int.h > head/sys/dev/qlnx/qlnxe/ecore_int_api.h > head/sys/dev/qlnx/qlnxe/ecore_iov_api.h > head/sys/dev/qlnx/qlnxe/ecore_iro.h > head/sys/dev/qlnx/qlnxe/ecore_iro_values.h > head/sys/dev/qlnx/qlnxe/ecore_iscsi.h > head/sys/dev/qlnx/qlnxe/ecore_iscsi_api.h > head/sys/dev/qlnx/qlnxe/ecore_l2.c > head/sys/dev/qlnx/qlnxe/ecore_l2.h > head/sys/dev/qlnx/qlnxe/ecore_l2_api.h > head/sys/dev/qlnx/qlnxe/ecore_ll2.h > head/sys/dev/qlnx/qlnxe/ecore_ll2_api.h > head/sys/dev/qlnx/qlnxe/ecore_mcp.c > head/sys/dev/qlnx/qlnxe/ecore_mcp.h > head/sys/dev/qlnx/qlnxe/ecore_mcp_api.h > head/sys/dev/qlnx/qlnxe/ecore_ooo.h > head/sys/dev/qlnx/qlnxe/ecore_proto_if.h > head/sys/dev/qlnx/qlnxe/ecore_roce.h > head/sys/dev/qlnx/qlnxe/ecore_roce_api.h > head/sys/dev/qlnx/qlnxe/ecore_rt_defs.h > head/sys/dev/qlnx/qlnxe/ecore_sp_api.h > head/sys/dev/qlnx/qlnxe/ecore_sp_commands.c > head/sys/dev/qlnx/qlnxe/ecore_sp_commands.h > head/sys/dev/qlnx/qlnxe/ecore_spq.c > head/sys/dev/qlnx/qlnxe/ecore_sriov.h > head/sys/dev/qlnx/qlnxe/ecore_vf.h > head/sys/dev/qlnx/qlnxe/ecore_vf_api.h > head/sys/dev/qlnx/qlnxe/ecore_vfpf_if.h > head/sys/dev/qlnx/qlnxe/eth_common.h > head/sys/dev/qlnx/qlnxe/fcoe_common.h > head/sys/dev/qlnx/qlnxe/iscsi_common.h > head/sys/dev/qlnx/qlnxe/mcp_private.h > head/sys/dev/qlnx/qlnxe/mcp_public.h > head/sys/dev/qlnx/qlnxe/mfw_hsi.h > head/sys/dev/qlnx/qlnxe/nvm_cfg.h > head/sys/dev/qlnx/qlnxe/nvm_map.h > head/sys/dev/qlnx/qlnxe/pcics_reg_driver.h > head/sys/dev/qlnx/qlnxe/qlnx_def.h > head/sys/dev/qlnx/qlnxe/qlnx_os.c > head/sys/dev/qlnx/qlnxe/qlnx_ver.h > head/sys/dev/qlnx/qlnxe/rdma_common.h > head/sys/dev/qlnx/qlnxe/reg_addr.h > head/sys/dev/qlnx/qlnxe/spad_layout.h > head/sys/dev/qlnx/qlnxe/storage_common.h > head/sys/dev/qlnx/qlnxe/tcp_common.h > [...] Hi David, Tell me if I'm off base here but this driver comes directly from Cavium, right? Why was it never imported into vendor-sys and MFVed into head like other vendor source? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Thu Jun 15 03:58:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3505DBFFE89; Thu, 15 Jun 2017 03:58:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B66C1D03; Thu, 15 Jun 2017 03:58:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F3wOWW050498; Thu, 15 Jun 2017 03:58:24 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F3wNrI050494; Thu, 15 Jun 2017 03:58:23 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706150358.v5F3wNrI050494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 15 Jun 2017 03:58:23 +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: r319965 - in stable/10/sys: kern 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 03:58:25 -0000 Author: alc Date: Thu Jun 15 03:58:23 2017 New Revision: 319965 URL: https://svnweb.freebsd.org/changeset/base/319965 Log: MFC r318995 In r118390, the swap pager's approach to striping swap allocation over multiple devices was changed. However, swapoff_one() was not fully and correctly converted. In particular, with r118390's introduction of a per- device blist, the maximum swap block size, "dmmax", became irrelevant to swapoff_one()'s operation. Moreover, swapoff_one() was performing out-of- range operations on the per-device blist that were silently ignored by blist_fill(). This change corrects both of these problems with swapoff_one(), which will allow us to potentially increase MAX_PAGEOUT_CLUSTER. Previously, swapoff_one() would panic inside of blist_fill() if you increased MAX_PAGEOUT_CLUSTER. MFC r319001 After r118390, the variable "dmmax" was neither the correct strip size nor the correct maximum block size. Moreover, after r318995, it serves no purpose except to provide information to user space through a read- sysctl. This change eliminates the variable "dmmax" but retains the sysctl. It also corrects the value returned by the sysctl. MFC r319604 Halve the memory being internally allocated by the blist allocator. In short, half of the memory that is allocated to implement the radix tree is wasted because we did not change "u_daddr_t" to be a 64-bit unsigned int when we changed "daddr_t" to be a 64-bit (signed) int. (See r96849 and r96851.) MFC r319612 When the function blist_fill() was added to the kernel in r107913, the swap pager used a different scheme for striping the allocation of swap space across multiple devices. And, although blist_fill() was intended to support fill operations with large counts, the old striping scheme never performed a fill larger than the stripe size. Consequently, the misplacement of a sanity check in blst_meta_fill() went undetected. Now, moving forward in time to r118390, a new scheme for striping was introduced that maintained a blist allocator per device, but as noted in r318995, swapoff_one() was not fully and correctly converted to the new scheme. This change completes what was started in r318995 by fixing the underlying bug in blst_meta_fill() that stops swapoff_one() from simply performing a single blist_fill() operation. MFC r319627 Starting in r118390, swaponsomething() began to reserve the blocks at the beginning of a swap area for a disk label. However, neither r118390 nor r118544, which increased the reservation from one to two blocks, correctly accounted for these blocks when updating the variable "swap_pager_avail". This change corrects that error. MFC r319655 Originally, this file could be compiled as a user-space application for testing purposes. However, over the years, various changes to the kernel have broken this feature. This revision applies some fixes to get user- space compilation working again. There are no changes in this revision to code that is used by the kernel. Modified: stable/10/sys/kern/subr_blist.c stable/10/sys/sys/blist.h stable/10/sys/vm/swap_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_blist.c ============================================================================== --- stable/10/sys/kern/subr_blist.c Thu Jun 15 02:45:43 2017 (r319964) +++ stable/10/sys/kern/subr_blist.c Thu Jun 15 03:58:23 2017 (r319965) @@ -99,9 +99,8 @@ __FBSDID("$FreeBSD$"); #define BLIST_DEBUG #endif -#define SWAPBLK_NONE ((daddr_t)-1) - #include +#include #include #include #include @@ -110,8 +109,6 @@ __FBSDID("$FreeBSD$"); #define malloc(a,b,c) calloc(a, 1) #define free(a,b) free(a) -typedef unsigned int u_daddr_t; - #include void panic(const char *ctl, ...); @@ -366,7 +363,7 @@ blst_leaf_alloc( j >>= 1; mask >>= j; } - scan->u.bmu_bitmap &= ~(1 << r); + scan->u.bmu_bitmap &= ~((u_daddr_t)1 << r); return(blk + r); } if (count <= BLIST_BMAP_RADIX) { @@ -658,7 +655,7 @@ static void blst_copy( int i; for (i = 0; i < BLIST_BMAP_RADIX && i < count; ++i) { - if (v & (1 << i)) + if (v & ((u_daddr_t)1 << i)) blist_free(dest, blk + i, 1); } } @@ -769,6 +766,8 @@ blst_meta_fill( int next_skip = ((u_int)skip / BLIST_META_RADIX); int nblks = 0; + if (count > radix) + panic("blist_meta_fill: allocation too large"); if (count == radix || scan->u.bmu_avail == 0) { /* * ALL-ALLOCATED special case @@ -800,9 +799,6 @@ blst_meta_fill( radix /= BLIST_META_RADIX; } - if (count > radix) - panic("blist_meta_fill: allocation too large"); - i = (allocBlk - blk) / radix; blk += i * radix; i = i * next_skip + 1; @@ -922,7 +918,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t if (radix == BLIST_BMAP_RADIX) { printf( - "%*.*s(%08llx,%lld): bitmap %08llx big=%lld\n", + "%*.*s(%08llx,%lld): bitmap %016llx big=%lld\n", tab, tab, "", (long long)blk, (long long)radix, (long long)scan->u.bmu_bitmap, @@ -1016,10 +1012,9 @@ main(int ac, char **av) for (;;) { char buf[1024]; - daddr_t da = 0; - daddr_t count = 0; + long long da = 0; + long long count = 0; - printf("%lld/%lld/%lld> ", (long long)bl->bl_free, (long long)size, (long long)bl->bl_radix); fflush(stdout); @@ -1028,7 +1023,7 @@ main(int ac, char **av) switch(buf[0]) { case 'r': if (sscanf(buf + 1, "%lld", &count) == 1) { - blist_resize(&bl, count, 1); + blist_resize(&bl, count, 1, M_WAITOK); } else { printf("?\n"); } @@ -1044,16 +1039,14 @@ main(int ac, char **av) } break; case 'f': - if (sscanf(buf + 1, "%llx %lld", - (long long *)&da, (long long *)&count) == 2) { + if (sscanf(buf + 1, "%llx %lld", &da, &count) == 2) { blist_free(bl, da, count); } else { printf("?\n"); } break; case 'l': - if (sscanf(buf + 1, "%llx %lld", - (long long *)&da, (long long *)&count) == 2) { + if (sscanf(buf + 1, "%llx %lld", &da, &count) == 2) { printf(" n=%d\n", blist_fill(bl, da, count)); } else { Modified: stable/10/sys/sys/blist.h ============================================================================== --- stable/10/sys/sys/blist.h Thu Jun 15 02:45:43 2017 (r319964) +++ stable/10/sys/sys/blist.h Thu Jun 15 03:58:23 2017 (r319965) @@ -44,7 +44,7 @@ * ops. * * SWAPBLK_NONE is returned on failure. This module is typically - * capable of managing up to (2^31) blocks per blist, though + * capable of managing up to (2^63) blocks per blist, though * the memory utilization would be insane if you actually did * that. Managing something like 512MB worth of 4K blocks * eats around 32 KBytes of memory. @@ -56,7 +56,7 @@ #ifndef _SYS_BLIST_H_ #define _SYS_BLIST_H_ -typedef u_int32_t u_daddr_t; /* unsigned disk address */ +typedef uint64_t u_daddr_t; /* unsigned disk address */ /* * note: currently use SWAPBLK_NONE as an absolute value rather then Modified: stable/10/sys/vm/swap_pager.c ============================================================================== --- stable/10/sys/vm/swap_pager.c Thu Jun 15 02:45:43 2017 (r319964) +++ stable/10/sys/vm/swap_pager.c Thu Jun 15 03:58:23 2017 (r319965) @@ -115,9 +115,8 @@ __FBSDID("$FreeBSD$"); #include /* - * SWB_NPAGES must be a power of 2. It may be set to 1, 2, 4, 8, 16 - * or 32 pages per allocation. - * The 32-page limit is due to the radix code (kern/subr_blist.c). + * MAX_PAGEOUT_CLUSTER must be a power of 2 between 1 and 64. + * The 64-page limit is due to the radix code (kern/subr_blist.c). */ #ifndef MAX_PAGEOUT_CLUSTER #define MAX_PAGEOUT_CLUSTER 16 @@ -381,18 +380,14 @@ struct pagerops swappagerops = { }; /* - * dmmax is in page-sized chunks with the new swap system. It was - * dev-bsized chunks in the old. dmmax is always a power of 2. - * * swap_*() routines are externally accessible. swp_*() routines are * internal. */ -static int dmmax; static int nswap_lowat = 128; /* in pages, swap_pager_almost_full warn */ static int nswap_hiwat = 512; /* in pages, swap_pager_almost_full warn */ -SYSCTL_INT(_vm, OID_AUTO, dmmax, - CTLFLAG_RD, &dmmax, 0, "Maximum size of a swap block"); +SYSCTL_INT(_vm, OID_AUTO, dmmax, CTLFLAG_RD, &nsw_cluster_max, 0, + "Maximum size of a swap block in pages"); static void swp_sizecheck(void); static void swp_pager_async_iodone(struct buf *bp); @@ -499,11 +494,6 @@ swap_pager_init(void) mtx_init(&sw_alloc_mtx, "swap_pager list", NULL, MTX_DEF); mtx_init(&sw_dev_mtx, "swapdev", NULL, MTX_DEF); sx_init(&sw_alloc_sx, "swspsx"); - - /* - * Device Stripe, in PAGE_SIZE'd blocks - */ - dmmax = SWB_NPAGES * 2; } /* @@ -2252,7 +2242,7 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl sp->sw_end = dvbase + nblks; TAILQ_INSERT_TAIL(&swtailq, sp, sw_list); nswapdev++; - swap_pager_avail += nblks; + swap_pager_avail += nblks - 2; swap_total += (vm_ooffset_t)nblks * PAGE_SIZE; swapon_check_swzone(swap_total / PAGE_SIZE); swp_sizecheck(); @@ -2324,7 +2314,7 @@ done: static int swapoff_one(struct swdevt *sp, struct ucred *cred) { - u_long nblks, dvbase; + u_long nblks; #ifdef MAC int error; #endif @@ -2355,10 +2345,7 @@ swapoff_one(struct swdevt *sp, struct ucred *cred) */ mtx_lock(&sw_dev_mtx); sp->sw_flags |= SW_CLOSING; - for (dvbase = 0; dvbase < sp->sw_end; dvbase += dmmax) { - swap_pager_avail -= blist_fill(sp->sw_blist, - dvbase, dmmax); - } + swap_pager_avail -= blist_fill(sp->sw_blist, 0, nblks); swap_total -= (vm_ooffset_t)nblks * PAGE_SIZE; mtx_unlock(&sw_dev_mtx); From owner-svn-src-all@freebsd.org Thu Jun 15 04:37:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E614C091BD; Thu, 15 Jun 2017 04:37:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F253E2EBA; Thu, 15 Jun 2017 04:37:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F4bN6k066450; Thu, 15 Jun 2017 04:37:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F4bNK6066449; Thu, 15 Jun 2017 04:37:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201706150437.v5F4bNK6066449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 15 Jun 2017 04:37:23 +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: r319966 - stable/10/usr.sbin/rpc.lockd 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 04:37:24 -0000 Author: delphij Date: Thu Jun 15 04:37:23 2017 New Revision: 319966 URL: https://svnweb.freebsd.org/changeset/base/319966 Log: MFC r319852: Fix buffer lengths. After r319369, the RPC code validates caller supplied buffer length in taddr2uaddr. When no -h is specified, the sizeof(ai_addr) is used, which is always smaller than the required size and therefore uaddr would be NULL, causing the kernel to copyin() from userland NULL and fail with EFAULT. Modified: stable/10/usr.sbin/rpc.lockd/lockd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpc.lockd/lockd.c ============================================================================== --- stable/10/usr.sbin/rpc.lockd/lockd.c Thu Jun 15 03:58:23 2017 (r319965) +++ stable/10/usr.sbin/rpc.lockd/lockd.c Thu Jun 15 04:37:23 2017 (r319966) @@ -906,8 +906,7 @@ lookup_addresses(struct netconfig *nconf) sin->sin_port = htons(0); sin->sin_addr.s_addr = htonl(INADDR_ANY); res->ai_addr = (struct sockaddr*) sin; - res->ai_addrlen = (socklen_t) - sizeof(res->ai_addr); + res->ai_addrlen = sizeof(struct sockaddr_in); break; case AF_INET6: sin6 = malloc(sizeof(struct sockaddr_in6)); @@ -917,7 +916,7 @@ lookup_addresses(struct netconfig *nconf) sin6->sin6_port = htons(0); sin6->sin6_addr = in6addr_any; res->ai_addr = (struct sockaddr*) sin6; - res->ai_addrlen = (socklen_t) sizeof(res->ai_addr); + res->ai_addrlen = sizeof(struct sockaddr_in6); break; default: break; @@ -942,7 +941,7 @@ lookup_addresses(struct netconfig *nconf) } } - servaddr.len = servaddr.maxlen = res->ai_addr->sa_len; + servaddr.len = servaddr.maxlen = res->ai_addrlen; servaddr.buf = res->ai_addr; uaddr = taddr2uaddr(nconf, &servaddr); From owner-svn-src-all@freebsd.org Thu Jun 15 04:49:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE300C0971B; Thu, 15 Jun 2017 04:49:13 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE4C83445; Thu, 15 Jun 2017 04:49:13 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F4nCTb070517; Thu, 15 Jun 2017 04:49:12 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F4nCkm070516; Thu, 15 Jun 2017 04:49:12 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201706150449.v5F4nCkm070516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 15 Jun 2017 04:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319967 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 04:49:14 -0000 Author: rlibby Date: Thu Jun 15 04:49:12 2017 New Revision: 319967 URL: https://svnweb.freebsd.org/changeset/base/319967 Log: ddb show socket debugging Display the mbuf/cluster count for a sockbuf and fix a couple whitespace issues in the output. Reviewed by: jhb, markj (both previous version) Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11062 Modified: head/sys/kern/uipc_debug.c Modified: head/sys/kern/uipc_debug.c ============================================================================== --- head/sys/kern/uipc_debug.c Thu Jun 15 04:37:23 2017 (r319966) +++ head/sys/kern/uipc_debug.c Thu Jun 15 04:49:12 2017 (r319967) @@ -333,8 +333,6 @@ db_print_protosw(struct protosw *pr, const char *prnam db_printf("pr_fasttimo: %p ", pr->pr_fasttimo); db_printf("pr_slowtimo: %p ", pr->pr_slowtimo); db_printf("pr_drain: %p\n", pr->pr_drain); - - db_print_indent(indent); } static void @@ -408,6 +406,8 @@ db_print_sockbuf(struct sockbuf *sb, const char *sockb db_printf("sb_mbmax: %u\n", sb->sb_mbmax); db_print_indent(indent); + db_printf("sb_mcnt: %u ", sb->sb_mcnt); + db_printf("sb_ccnt: %u ", sb->sb_ccnt); db_printf("sb_ctl: %u ", sb->sb_ctl); db_printf("sb_lowat: %d ", sb->sb_lowat); db_printf("sb_timeo: %jd\n", sb->sb_timeo); @@ -448,7 +448,6 @@ db_print_socket(struct socket *so, const char *socketn db_printf(")\n"); db_print_indent(indent); - db_printf(") "); db_printf("so_pcb: %p ", so->so_pcb); db_printf("so_proto: %p\n", so->so_proto); @@ -466,6 +465,7 @@ db_print_socket(struct socket *so, const char *socketn } else { db_printf("so_qstate: 0x%x (", so->so_qstate); db_print_soqstate(so->so_qstate); + db_printf(") "); db_printf("so_listen: %p ", so->so_listen); /* so_list skipped */ db_printf("so_timeo: %d ", so->so_timeo); @@ -473,7 +473,7 @@ db_print_socket(struct socket *so, const char *socketn db_print_indent(indent); db_printf("so_sigio: %p ", so->so_sigio); - db_printf("so_oobmark: %lu ", so->so_oobmark); + db_printf("so_oobmark: %lu\n", so->so_oobmark); db_print_sockbuf(&so->so_rcv, "so_rcv", indent); db_print_sockbuf(&so->so_snd, "so_snd", indent); From owner-svn-src-all@freebsd.org Thu Jun 15 05:00:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66DA4C09A3A; Thu, 15 Jun 2017 05:00:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A799D3901; Thu, 15 Jun 2017 05:00:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v5F50c4u068501 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 14 Jun 2017 22:00:38 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v5F50bLG068500; Wed, 14 Jun 2017 22:00:37 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 14 Jun 2017 22:00:37 -0700 From: Gleb Smirnoff To: Andreas Tobler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319722 - in head: sys/cam/ctl sys/dev/iscsi sys/kern sys/netgraph sys/netgraph/bluetooth/socket sys/netinet sys/ofed/drivers/infiniband/core sys/ofed/drivers/infiniband/ulp/sdp sys/rpc... Message-ID: <20170615050037.GO50023@FreeBSD.org> References: <201706082130.v58LUY0j095589@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 05:00:45 -0000 Hi, On Wed, Jun 14, 2017 at 09:59:50AM +0200, Andreas Tobler wrote: A> with this revision I get either a kernel panic or a hang. This happens A> on powerpc (32-bit). The powerpc64 looks stable. A> A> Here you can see the backtrace in case of the panic: A> https://people.freebsd.org/~andreast/r319722_ppc32_1.jpg A> A> In the source code I see a comment with XXXGL... A> Is this powerpc specific or do you think that there are some issues in A> the uipc_socket.c code? The comment has nothing to do with arch or 32-bit. Is it possible to understand what is the actual instruction at soisconnected()+0x21c ? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Thu Jun 15 05:04:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BF8FC09C88; Thu, 15 Jun 2017 05:04:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 142233E04; Thu, 15 Jun 2017 05:04:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v5F541pZ068518 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 14 Jun 2017 22:04:01 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v5F540Hu068517; Wed, 14 Jun 2017 22:04:00 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 14 Jun 2017 22:04:00 -0700 From: Gleb Smirnoff To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319874 - head/sys/kern Message-ID: <20170615050400.GP50023@FreeBSD.org> References: <201706122111.v5CLBBUT092606@repo.freebsd.org> <20170612234356.GD50023@FreeBSD.org> <20170613120643.GX2088@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170613120643.GX2088@kib.kiev.ua> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 05:04:03 -0000 On Tue, Jun 13, 2017 at 03:06:43PM +0300, Konstantin Belousov wrote: K> On Mon, Jun 12, 2017 at 04:43:56PM -0700, Gleb Smirnoff wrote: K> > On Mon, Jun 12, 2017 at 09:11:11PM +0000, Konstantin Belousov wrote: K> > K> Author: kib K> > K> Date: Mon Jun 12 21:11:11 2017 K> > K> New Revision: 319874 K> > K> URL: https://svnweb.freebsd.org/changeset/base/319874 K> > K> K> > K> Log: K> > K> Print unimplemented syscall number to the ctty on SIGSYS, if enabled K> > K> by the knob kern.lognosys. K> > K> > Why is it off by default? K> In some (non-default) situation it may cause lot of ctty output. K> I made the knob tunable to allow it to be set very early (init) K> if needed. I remember myself being a beginner UNIX user, and all this "bad system call, core dumped" messages were so annoyingly uninformative for me, and I had no idea how to track to the actual problem. This feature gives a lot of clue for a beginner user, but having it default to off, devaluates its value. To avoid possible tty spam for an application that produces ton of bad syscalls, but ignores SIGSYS, we can enable the feature for those processes, who doesn't ignore SIGSYS. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Thu Jun 15 05:12:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6CA9C09FCF for ; Thu, 15 Jun 2017 05:12:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B8C36435F for ; Thu, 15 Jun 2017 05:12:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x229.google.com with SMTP id m62so11809811itc.0 for ; Wed, 14 Jun 2017 22:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=JaWEY6jdsVSduE4nTczLzyABijljlGOSTn4E48zHL5c=; b=BGR0avJyxF5C4i1aPrh9jVxUGVLqBx4p4KkAuteZjeaaek2ZRckUUc6Mh0IiiaJ9Vo BwF7bVIsN+vaNp0WS5gxJU/LrEPvduuq6XPlJjFwGIfNe13dND80Q1O1VZDXtv+FsspI Zf9/tsWSTl5Fbs3Rs9vQVnjbgObyZrcTuG1TqMmUi+BH+Z1ARw85KG1YzaJweBgfmcyP BMtc3Uj8K4mkTaRFQJ30uQ7IFIL8wqMFF6qWAqin9uW010IV7DB/RCvFdy8Vb5frYukw x0Jz0HRJW28V24ghlUxRhHWPSfXuJg7ExFRN3JWYi0jciVYNkIiGvLT0qEov+zkzgjW5 mdqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=JaWEY6jdsVSduE4nTczLzyABijljlGOSTn4E48zHL5c=; b=sLuUDoUhZ6BPWnC6qYmdJO440R1jDMbC48O0BOCK3988RXSfuTXSGc8M9pZWa7akny uacz58fbF9S7h5P8aU6LuLZrE2eoH4Hy44ZwHP6xMd+4KkebFdJWhfHLdfCdWgHYkQWX imFZLSFvP1j5pES3hC2c6izKR6uqZ5Z5S1GZToaytG7Bap9u73r8WB5ho6n7ksTtv+tH 3RV5rlGi4dSllxA3j+QSjhwxF+WjeN3Z8lcXcccIoDqPxsivwU/28xH5VCTCTwYhQs32 XDCGpSzH6Ll/vocKs0Gr3oXutAeATTYFz4tFaKuQ9HZ7ctACBFDoJtjBFuOkUwyJwLIR 4Cpg== X-Gm-Message-State: AKS2vOwdhdcttUYIXe+g1OP1iIToatEy8dkV0WkLikJkxUcGKlnn5aAa ZJnqGOfuq8Uaq4bzMhvttQT1tic7ycSo X-Received: by 10.36.73.131 with SMTP id e3mr3539218itd.0.1497503552846; Wed, 14 Jun 2017 22:12:32 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.192.69 with HTTP; Wed, 14 Jun 2017 22:12:32 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:402:51b7:c887:1fa6] In-Reply-To: <20170615050400.GP50023@FreeBSD.org> References: <201706122111.v5CLBBUT092606@repo.freebsd.org> <20170612234356.GD50023@FreeBSD.org> <20170613120643.GX2088@kib.kiev.ua> <20170615050400.GP50023@FreeBSD.org> From: Warner Losh Date: Wed, 14 Jun 2017 23:12:32 -0600 X-Google-Sender-Auth: YDmV6edDimOk7ItQVBlhghD7Xfk Message-ID: Subject: Re: svn commit: r319874 - head/sys/kern To: Gleb Smirnoff Cc: Konstantin Belousov , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 05:12:33 -0000 On Wed, Jun 14, 2017 at 11:04 PM, Gleb Smirnoff wrote: > On Tue, Jun 13, 2017 at 03:06:43PM +0300, Konstantin Belousov wrote: > K> On Mon, Jun 12, 2017 at 04:43:56PM -0700, Gleb Smirnoff wrote: > K> > On Mon, Jun 12, 2017 at 09:11:11PM +0000, Konstantin Belousov wrote: > K> > K> Author: kib > K> > K> Date: Mon Jun 12 21:11:11 2017 > K> > K> New Revision: 319874 > K> > K> URL: https://svnweb.freebsd.org/changeset/base/319874 > K> > K> > K> > K> Log: > K> > K> Print unimplemented syscall number to the ctty on SIGSYS, if > enabled > K> > K> by the knob kern.lognosys. > K> > > K> > Why is it off by default? > K> In some (non-default) situation it may cause lot of ctty output. > K> I made the knob tunable to allow it to be set very early (init) > K> if needed. > > I remember myself being a beginner UNIX user, and all this > "bad system call, core dumped" messages were so annoyingly > uninformative for me, and I had no idea how to track to the > actual problem. This feature gives a lot of clue for a beginner > user, but having it default to off, devaluates its value. > We can also rate limit the messages. We have the technology. Warner > > To avoid possible tty spam for an application that produces ton > of bad syscalls, but ignores SIGSYS, we can enable the feature > for those processes, who doesn't ignore SIGSYS. > > -- > Totus tuus, Glebius. > > From owner-svn-src-all@freebsd.org Thu Jun 15 06:12:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C25E9C310F9; Thu, 15 Jun 2017 06:12:34 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.imp.ch (smtp.imp.ch [157.161.13.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 869D965A46; Thu, 15 Jun 2017 06:12:34 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from [172.29.4.124] (borderline21.nexus-ag.com [212.203.104.226]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id BE937CA0DB; Thu, 15 Jun 2017 08:12:30 +0200 (CEST) Subject: Re: svn commit: r319722 - in head: sys/cam/ctl sys/dev/iscsi sys/kern sys/netgraph sys/netgraph/bluetooth/socket sys/netinet sys/ofed/drivers/infiniband/core sys/ofed/drivers/infiniband/ulp/sdp sys/rpc... To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706082130.v58LUY0j095589@repo.freebsd.org> <20170615050037.GO50023@FreeBSD.org> From: Andreas Tobler Message-ID: <19f78347-7d2e-7033-6903-828efbb490cf@FreeBSD.org> Date: Thu, 15 Jun 2017 08:12:31 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170615050037.GO50023@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-CH Content-Transfer-Encoding: 7bit X-Scanned-By: Obelix Submit on 127.0.1.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 06:12:34 -0000 On 15.06.17 07:00, Gleb Smirnoff wrote: > Hi, > > On Wed, Jun 14, 2017 at 09:59:50AM +0200, Andreas Tobler wrote: > A> with this revision I get either a kernel panic or a hang. This happens > A> on powerpc (32-bit). The powerpc64 looks stable. > A> > A> Here you can see the backtrace in case of the panic: > A> https://people.freebsd.org/~andreast/r319722_ppc32_1.jpg > A> > A> In the source code I see a comment with XXXGL... > A> Is this powerpc specific or do you think that there are some issues in > A> the uipc_socket.c code? > > The comment has nothing to do with arch or 32-bit. Is > it possible to understand what is the actual instruction > at soisconnected()+0x21c ? > (gdb) p /x 0x5a5808 + 0x21c $2 = 0x5a5a24 005a5808 : 5a5808: 94 21 ff c0 stwu r1,-64(r1) 5a580c: 7c 08 02 a6 mflr r0 5a5810: 93 01 00 20 stw r24,32(r1) .... 5a5a0c: 39 40 00 00 li r10,0 5a5a10: 2f 8a 00 00 cmpwi cr7,r10,0 5a5a14: 40 9e 00 0c bne cr7,5a5a20 5a5a18: 38 7c 00 10 addi r3,r28,16 5a5a1c: 4b f1 c4 61 bl 4c1e7c <__mtx_unlock_sleep> 5a5a20: 7f 63 db 78 mr r3,r27 ->5a5a24: 4b ff f5 9d bl 5a4fc0 5a5a28: 48 00 04 80 b 5a5ea8 5a5a2c: 7c 45 13 78 mr r5,r2 5a5a30: 39 20 00 04 li r9,4 I'm going to stress test before 319722 to see if I can confirm Mark's comment. Thanks! Andreas From owner-svn-src-all@freebsd.org Thu Jun 15 06:21:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35F17C31222; Thu, 15 Jun 2017 06:21:03 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0614265D3A; Thu, 15 Jun 2017 06:21:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F6L2fC008704; Thu, 15 Jun 2017 06:21:02 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F6L2nF008703; Thu, 15 Jun 2017 06:21:02 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201706150621.v5F6L2nF008703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 15 Jun 2017 06:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319968 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 06:21:03 -0000 Author: araujo Date: Thu Jun 15 06:21:01 2017 New Revision: 319968 URL: https://svnweb.freebsd.org/changeset/base/319968 Log: Initialize variables and use byteorder(9) instead of aliasing char array buf via uint32_t pointer. CID: 1375949 Reported by: Coverity, cem Reviewed by: cem MFC after: 3 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D11153 Modified: head/usr.sbin/bhyve/rfb.c Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Thu Jun 15 04:49:12 2017 (r319967) +++ head/usr.sbin/bhyve/rfb.c Thu Jun 15 06:21:01 2017 (r319968) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #ifndef WITHOUT_CAPSICUM #include #endif +#include #include #include #include @@ -754,7 +755,7 @@ rfb_handle(struct rfb_softc *rc, int cfd) { const char *vbuf = "RFB 003.008\n"; unsigned char buf[80]; - unsigned char *message; + unsigned char *message = NULL; #ifndef NO_OPENSSL unsigned char challenge[AUTH_LENGTH]; @@ -766,7 +767,7 @@ rfb_handle(struct rfb_softc *rc, int cfd) #endif pthread_t tid; - uint32_t sres; + uint32_t sres = 0; int len; rc->cfd = cfd; @@ -858,7 +859,7 @@ rfb_handle(struct rfb_softc *rc, int cfd) stream_write(cfd, &sres, 4); if (sres) { - *((uint32_t *) buf) = htonl(strlen(message)); + be32enc(buf, strlen(message)); stream_write(cfd, buf, 4); stream_write(cfd, message, strlen(message)); goto done; From owner-svn-src-all@freebsd.org Thu Jun 15 06:46:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E8FBC318EC; Thu, 15 Jun 2017 06:46:41 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01A8066819; Thu, 15 Jun 2017 06:46:40 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F6kexD019161; Thu, 15 Jun 2017 06:46:40 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F6kenB019160; Thu, 15 Jun 2017 06:46:40 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201706150646.v5F6kenB019160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 15 Jun 2017 06:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319969 - head/usr.sbin/ip6addrctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 06:46:41 -0000 Author: araujo Date: Thu Jun 15 06:46:40 2017 New Revision: 319969 URL: https://svnweb.freebsd.org/changeset/base/319969 Log: Use nitems() from sys/param.h. MFC after: 4 weeks. Modified: head/usr.sbin/ip6addrctl/ip6addrctl.c Modified: head/usr.sbin/ip6addrctl/ip6addrctl.c ============================================================================== --- head/usr.sbin/ip6addrctl/ip6addrctl.c Thu Jun 15 06:21:01 2017 (r319968) +++ head/usr.sbin/ip6addrctl/ip6addrctl.c Thu Jun 15 06:46:40 2017 (r319969) @@ -111,7 +111,7 @@ get_policy(void) struct in6_addrpolicy *buf; struct in6_addrpolicy *pol, *ep; - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &l, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &l, NULL, 0) < 0) { err(1, "sysctl(IPV6CTL_ADDRCTLPOLICY)"); /* NOTREACHED */ } @@ -123,7 +123,7 @@ get_policy(void) errx(1, "malloc failed"); /* NOTREACHED */ } - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &l, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &l, NULL, 0) < 0) { err(1, "sysctl(IPV6CTL_ADDRCTLPOLICY)"); /* NOTREACHED */ } From owner-svn-src-all@freebsd.org Thu Jun 15 06:48:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC1A6C31966; Thu, 15 Jun 2017 06:48:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC5126696F; Thu, 15 Jun 2017 06:48:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F6maKs019269; Thu, 15 Jun 2017 06:48:36 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F6majo019268; Thu, 15 Jun 2017 06:48:36 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201706150648.v5F6majo019268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 15 Jun 2017 06:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319970 - head/usr.sbin/ifmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 06:48:38 -0000 Author: araujo Date: Thu Jun 15 06:48:36 2017 New Revision: 319970 URL: https://svnweb.freebsd.org/changeset/base/319970 Log: Use nitems() from sys/param.h. MFC after: 4 weeks. Modified: head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Thu Jun 15 06:46:40 2017 (r319969) +++ head/usr.sbin/ifmcstat/ifmcstat.c Thu Jun 15 06:48:36 2017 (r319970) @@ -805,7 +805,7 @@ inm_print_sources_sysctl(uint32_t ifindex, struct in_a uint32_t fmode; const char *modestr; - mibsize = sizeof(mib) / sizeof(mib[0]); + mibsize = nitems(mib); if (sysctlnametomib("net.inet.ip.mcast.filters", mib, &mibsize) == -1) { perror("sysctlnametomib"); return; @@ -814,7 +814,7 @@ inm_print_sources_sysctl(uint32_t ifindex, struct in_a needed = 0; mib[5] = ifindex; mib[6] = gina.s_addr; /* 32 bits wide */ - mibsize = sizeof(mib) / sizeof(mib[0]); + mibsize = nitems(mib); do { if (sysctl(mib, mibsize, NULL, &needed, NULL, 0) == -1) { perror("sysctl net.inet.ip.mcast.filters"); @@ -905,7 +905,7 @@ in6m_print_sources_sysctl(uint32_t ifindex, struct in6 uint32_t fmode; const char *modestr; - mibsize = sizeof(mib) / sizeof(mib[0]); + mibsize = nitems(mib); if (sysctlnametomib("net.inet6.ip6.mcast.filters", mib, &mibsize) == -1) { perror("sysctlnametomib"); @@ -918,7 +918,7 @@ in6m_print_sources_sysctl(uint32_t ifindex, struct in6 for (i = 0; i < 4; i++) mib[6 + i] = *pi++; - mibsize = sizeof(mib) / sizeof(mib[0]); + mibsize = nitems(mib); do { if (sysctl(mib, mibsize, NULL, &needed, NULL, 0) == -1) { perror("sysctl net.inet6.ip6.mcast.filters"); @@ -1145,7 +1145,7 @@ ifmcstat_getifmaddrs(void) size_t mibsize, len; int mib[5]; - mibsize = sizeof(mib) / sizeof(mib[0]); + mibsize = nitems(mib); if (sysctlnametomib("net.inet.igmp.ifinfo", mib, &mibsize) == -1) { perror("sysctlnametomib"); @@ -1170,7 +1170,7 @@ ifmcstat_getifmaddrs(void) size_t mibsize, len; int mib[5]; - mibsize = sizeof(mib) / sizeof(mib[0]); + mibsize = nitems(mib); if (sysctlnametomib("net.inet6.mld.ifinfo", mib, &mibsize) == -1) { perror("sysctlnametomib"); From owner-svn-src-all@freebsd.org Thu Jun 15 07:15:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF309C31F43; Thu, 15 Jun 2017 07:15:07 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F2DE673CE; Thu, 15 Jun 2017 07:15:07 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F7F6Hf031225; Thu, 15 Jun 2017 07:15:06 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F7F6aT031218; Thu, 15 Jun 2017 07:15:06 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201706150715.v5F7F6aT031218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Thu, 15 Jun 2017 07:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 07:15:08 -0000 Author: jasone Date: Thu Jun 15 07:15:05 2017 New Revision: 319971 URL: https://svnweb.freebsd.org/changeset/base/319971 Log: Update jemalloc to 5.0.0. Added: head/contrib/jemalloc/include/jemalloc/internal/arena_externs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/arena_inlines_a.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/arena_structs_a.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/arena_structs_b.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/arena_types.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/atomic_c11.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/atomic_gcc_atomic.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/atomic_gcc_sync.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/background_thread_externs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/background_thread_inlines.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/background_thread_structs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/base_externs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/base_inlines.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/base_structs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/base_types.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/bit_util.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/extent_dss.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/extent_externs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/extent_inlines.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/extent_mmap.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/extent_structs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/extent_types.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/hooks.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_externs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_includes.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_a.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_b.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_c.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/jemalloc_preamble.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/large_externs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/malloc_io.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/mutex_pool.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/mutex_prof.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/prof_externs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/prof_inlines_a.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/prof_inlines_b.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/prof_structs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/prof_types.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/rtree_tsd.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/stats_tsd.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/sz.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/tcache_externs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/tcache_inlines.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/tcache_structs.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/tcache_types.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/tsd_generic.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/tsd_malloc_thread_cleanup.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/tsd_tls.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/tsd_types.h (contents, props changed) head/contrib/jemalloc/src/background_thread.c (contents, props changed) head/contrib/jemalloc/src/extent_dss.c (contents, props changed) head/contrib/jemalloc/src/extent_mmap.c (contents, props changed) head/contrib/jemalloc/src/hooks.c (contents, props changed) head/contrib/jemalloc/src/large.c (contents, props changed) head/contrib/jemalloc/src/malloc_io.c (contents, props changed) head/contrib/jemalloc/src/mutex_pool.c (contents, props changed) head/contrib/jemalloc/src/sz.c (contents, props changed) Deleted: head/contrib/jemalloc/include/jemalloc/internal/arena.h head/contrib/jemalloc/include/jemalloc/internal/base.h head/contrib/jemalloc/include/jemalloc/internal/chunk.h head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h head/contrib/jemalloc/include/jemalloc/internal/extent.h head/contrib/jemalloc/include/jemalloc/internal/huge.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/mb.h head/contrib/jemalloc/include/jemalloc/internal/prof.h head/contrib/jemalloc/include/jemalloc/internal/quarantine.h head/contrib/jemalloc/include/jemalloc/internal/tcache.h head/contrib/jemalloc/include/jemalloc/internal/valgrind.h head/contrib/jemalloc/src/atomic.c head/contrib/jemalloc/src/chunk.c head/contrib/jemalloc/src/chunk_dss.c head/contrib/jemalloc/src/chunk_mmap.c head/contrib/jemalloc/src/huge.c head/contrib/jemalloc/src/mb.c head/contrib/jemalloc/src/quarantine.c head/contrib/jemalloc/src/util.c Modified: head/contrib/jemalloc/COPYING head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-Xlist head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/FREEBSD-upgrade head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/assert.h head/contrib/jemalloc/include/jemalloc/internal/atomic.h head/contrib/jemalloc/include/jemalloc/internal/bitmap.h head/contrib/jemalloc/include/jemalloc/internal/ckh.h head/contrib/jemalloc/include/jemalloc/internal/ctl.h head/contrib/jemalloc/include/jemalloc/internal/hash.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h head/contrib/jemalloc/include/jemalloc/internal/mutex.h head/contrib/jemalloc/include/jemalloc/internal/nstime.h head/contrib/jemalloc/include/jemalloc/internal/pages.h head/contrib/jemalloc/include/jemalloc/internal/ph.h head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h head/contrib/jemalloc/include/jemalloc/internal/prng.h head/contrib/jemalloc/include/jemalloc/internal/public_namespace.h head/contrib/jemalloc/include/jemalloc/internal/ql.h head/contrib/jemalloc/include/jemalloc/internal/qr.h head/contrib/jemalloc/include/jemalloc/internal/rb.h head/contrib/jemalloc/include/jemalloc/internal/rtree.h head/contrib/jemalloc/include/jemalloc/internal/size_classes.h head/contrib/jemalloc/include/jemalloc/internal/smoothstep.h head/contrib/jemalloc/include/jemalloc/internal/spin.h head/contrib/jemalloc/include/jemalloc/internal/stats.h head/contrib/jemalloc/include/jemalloc/internal/ticker.h head/contrib/jemalloc/include/jemalloc/internal/tsd.h head/contrib/jemalloc/include/jemalloc/internal/util.h head/contrib/jemalloc/include/jemalloc/internal/witness.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h head/contrib/jemalloc/include/jemalloc/jemalloc_typedefs.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/base.c head/contrib/jemalloc/src/bitmap.c head/contrib/jemalloc/src/ckh.c head/contrib/jemalloc/src/ctl.c head/contrib/jemalloc/src/extent.c head/contrib/jemalloc/src/hash.c head/contrib/jemalloc/src/jemalloc.c head/contrib/jemalloc/src/mutex.c head/contrib/jemalloc/src/nstime.c head/contrib/jemalloc/src/pages.c head/contrib/jemalloc/src/prng.c head/contrib/jemalloc/src/prof.c head/contrib/jemalloc/src/rtree.c head/contrib/jemalloc/src/spin.c head/contrib/jemalloc/src/stats.c head/contrib/jemalloc/src/tcache.c head/contrib/jemalloc/src/ticker.c head/contrib/jemalloc/src/tsd.c head/contrib/jemalloc/src/witness.c head/include/malloc_np.h head/lib/libc/stdlib/jemalloc/Makefile.inc Modified: head/contrib/jemalloc/COPYING ============================================================================== --- head/contrib/jemalloc/COPYING Thu Jun 15 06:48:36 2017 (r319970) +++ head/contrib/jemalloc/COPYING Thu Jun 15 07:15:05 2017 (r319971) @@ -1,10 +1,10 @@ Unless otherwise specified, files in the jemalloc source distribution are subject to the following license: -------------------------------------------------------------------------------- -Copyright (C) 2002-2016 Jason Evans . +Copyright (C) 2002-2017 Jason Evans . All rights reserved. Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved. -Copyright (C) 2009-2016 Facebook, Inc. All rights reserved. +Copyright (C) 2009-2017 Facebook, 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: Modified: head/contrib/jemalloc/ChangeLog ============================================================================== --- head/contrib/jemalloc/ChangeLog Thu Jun 15 06:48:36 2017 (r319970) +++ head/contrib/jemalloc/ChangeLog Thu Jun 15 07:15:05 2017 (r319971) @@ -4,6 +4,193 @@ brevity. Much more detail can be found in the git rev https://github.com/jemalloc/jemalloc +* 5.0.0 (June 13, 2017) + + Unlike all previous jemalloc releases, this release does not use naturally + aligned "chunks" for virtual memory management, and instead uses page-aligned + "extents". This change has few externally visible effects, but the internal + impacts are... extensive. Many other internal changes combine to make this + the most cohesively designed version of jemalloc so far, with ample + opportunity for further enhancements. + + Continuous integration is now an integral aspect of development thanks to the + efforts of @davidtgoldblatt, and the dev branch tends to remain reasonably + stable on the tested platforms (Linux, FreeBSD, macOS, and Windows). As a + side effect the official release frequency may decrease over time. + + New features: + - Implement optional per-CPU arena support; threads choose which arena to use + based on current CPU rather than on fixed thread-->arena associations. + (@interwq) + - Implement two-phase decay of unused dirty pages. Pages transition from + dirty-->muzzy-->clean, where the first phase transition relies on + madvise(... MADV_FREE) semantics, and the second phase transition discards + pages such that they are replaced with demand-zeroed pages on next access. + (@jasone) + - Increase decay time resolution from seconds to milliseconds. (@jasone) + - Implement opt-in per CPU background threads, and use them for asynchronous + decay-driven unused dirty page purging. (@interwq) + - Add mutex profiling, which collects a variety of statistics useful for + diagnosing overhead/contention issues. (@interwq) + - Add C++ new/delete operator bindings. (@djwatson) + - Support manually created arena destruction, such that all data and metadata + are discarded. Add MALLCTL_ARENAS_DESTROYED for accessing merged stats + associated with destroyed arenas. (@jasone) + - Add MALLCTL_ARENAS_ALL as a fixed index for use in accessing + merged/destroyed arena statistics via mallctl. (@jasone) + - Add opt.abort_conf to optionally abort if invalid configuration options are + detected during initialization. (@interwq) + - Add opt.stats_print_opts, so that e.g. JSON output can be selected for the + stats dumped during exit if opt.stats_print is true. (@jasone) + - Add --with-version=VERSION for use when embedding jemalloc into another + project's git repository. (@jasone) + - Add --disable-thp to support cross compiling. (@jasone) + - Add --with-lg-hugepage to support cross compiling. (@jasone) + - Add mallctl interfaces (various authors): + + background_thread + + opt.abort_conf + + opt.retain + + opt.percpu_arena + + opt.background_thread + + opt.{dirty,muzzy}_decay_ms + + opt.stats_print_opts + + arena..initialized + + arena..destroy + + arena..{dirty,muzzy}_decay_ms + + arena..extent_hooks + + arenas.{dirty,muzzy}_decay_ms + + arenas.bin..slab_size + + arenas.nlextents + + arenas.lextent..size + + arenas.create + + stats.background_thread.{num_threads,num_runs,run_interval} + + stats.mutexes.{ctl,background_thread,prof,reset}. + {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds, + num_owner_switch} + + stats.arenas..{dirty,muzzy}_decay_ms + + stats.arenas..uptime + + stats.arenas..{pmuzzy,base,internal,resident} + + stats.arenas..{dirty,muzzy}_{npurge,nmadvise,purged} + + stats.arenas..bins..{nslabs,reslabs,curslabs} + + stats.arenas..bins..mutex. + {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds, + num_owner_switch} + + stats.arenas..lextents..{nmalloc,ndalloc,nrequests,curlextents} + + stats.arenas.i.mutexes.{large,extent_avail,extents_dirty,extents_muzzy, + extents_retained,decay_dirty,decay_muzzy,base,tcache_list}. + {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds, + num_owner_switch} + + Portability improvements: + - Improve reentrant allocation support, such that deadlock is less likely if + e.g. a system library call in turn allocates memory. (@davidtgoldblatt, + @interwq) + - Support static linking of jemalloc with glibc. (@djwatson) + + Optimizations and refactors: + - Organize virtual memory as "extents" of virtual memory pages, rather than as + naturally aligned "chunks", and store all metadata in arbitrarily distant + locations. This reduces virtual memory external fragmentation, and will + interact better with huge pages (not yet explicitly supported). (@jasone) + - Fold large and huge size classes together; only small and large size classes + remain. (@jasone) + - Unify the allocation paths, and merge most fast-path branching decisions. + (@davidtgoldblatt, @interwq) + - Embed per thread automatic tcache into thread-specific data, which reduces + conditional branches and dereferences. Also reorganize tcache to increase + fast-path data locality. (@interwq) + - Rewrite atomics to closely model the C11 API, convert various + synchronization from mutex-based to atomic, and use the explicit memory + ordering control to resolve various hypothetical races without increasing + synchronization overhead. (@davidtgoldblatt) + - Extensively optimize rtree via various methods: + + Add multiple layers of rtree lookup caching, since rtree lookups are now + part of fast-path deallocation. (@interwq) + + Determine rtree layout at compile time. (@jasone) + + Make the tree shallower for common configurations. (@jasone) + + Embed the root node in the top-level rtree data structure, thus avoiding + one level of indirection. (@jasone) + + Further specialize leaf elements as compared to internal node elements, + and directly embed extent metadata needed for fast-path deallocation. + (@jasone) + + Ignore leading always-zero address bits (architecture-specific). + (@jasone) + - Reorganize headers (ongoing work) to make them hermetic, and disentangle + various module dependencies. (@davidtgoldblatt) + - Convert various internal data structures such as size class metadata from + boot-time-initialized to compile-time-initialized. Propagate resulting data + structure simplifications, such as making arena metadata fixed-size. + (@jasone) + - Simplify size class lookups when constrained to size classes that are + multiples of the page size. This speeds lookups, but the primary benefit is + complexity reduction in code that was the source of numerous regressions. + (@jasone) + - Lock individual extents when possible for localized extent operations, + rather than relying on a top-level arena lock. (@davidtgoldblatt, @jasone) + - Use first fit layout policy instead of best fit, in order to improve + packing. (@jasone) + - If munmap(2) is not in use, use an exponential series to grow each arena's + virtual memory, so that the number of disjoint virtual memory mappings + remains low. (@jasone) + - Implement per arena base allocators, so that arenas never share any virtual + memory pages. (@jasone) + - Automatically generate private symbol name mangling macros. (@jasone) + + Incompatible changes: + - Replace chunk hooks with an expanded/normalized set of extent hooks. + (@jasone) + - Remove ratio-based purging. (@jasone) + - Remove --disable-tcache. (@jasone) + - Remove --disable-tls. (@jasone) + - Remove --enable-ivsalloc. (@jasone) + - Remove --with-lg-size-class-group. (@jasone) + - Remove --with-lg-tiny-min. (@jasone) + - Remove --disable-cc-silence. (@jasone) + - Remove --enable-code-coverage. (@jasone) + - Remove --disable-munmap (replaced by opt.retain). (@jasone) + - Remove Valgrind support. (@jasone) + - Remove quarantine support. (@jasone) + - Remove redzone support. (@jasone) + - Remove mallctl interfaces (various authors): + + config.munmap + + config.tcache + + config.tls + + config.valgrind + + opt.lg_chunk + + opt.purge + + opt.lg_dirty_mult + + opt.decay_time + + opt.quarantine + + opt.redzone + + opt.thp + + arena..lg_dirty_mult + + arena..decay_time + + arena..chunk_hooks + + arenas.initialized + + arenas.lg_dirty_mult + + arenas.decay_time + + arenas.bin..run_size + + arenas.nlruns + + arenas.lrun..size + + arenas.nhchunks + + arenas.hchunk..size + + arenas.extend + + stats.cactive + + stats.arenas..lg_dirty_mult + + stats.arenas..decay_time + + stats.arenas..metadata.{mapped,allocated} + + stats.arenas..{npurge,nmadvise,purged} + + stats.arenas..huge.{allocated,nmalloc,ndalloc,nrequests} + + stats.arenas..bins..{nruns,reruns,curruns} + + stats.arenas..lruns..{nmalloc,ndalloc,nrequests,curruns} + + stats.arenas..hchunks..{nmalloc,ndalloc,nrequests,curhchunks} + + Bug fixes: + - Improve interval-based profile dump triggering to dump only one profile when + a single allocation's size exceeds the interval. (@jasone) + - Use prefixed function names (as controlled by --with-jemalloc-prefix) when + pruning backtrace frames in jeprof. (@jasone) + * 4.5.0 (February 28, 2017) This is the first release to benefit from much broader continuous integration @@ -12,7 +199,7 @@ brevity. Much more detail can be found in the git rev regressions fixed by this release. New features: - - Add --disable-thp and the opt.thp to provide opt-out mechanisms for + - Add --disable-thp and the opt.thp mallctl to provide opt-out mechanisms for transparent huge page integration. (@jasone) - Update zone allocator integration to work with macOS 10.12. (@glandium) - Restructure *CFLAGS configuration, so that CFLAGS behaves typically, and @@ -25,7 +212,7 @@ brevity. Much more detail can be found in the git rev - Handle race in per size class utilization computation. This functionality was first released in 4.0.0. (@interwq) - Fix lock order reversal during gdump. (@jasone) - - Fix-refactor tcache synchronization. This regression was first released in + - Fix/refactor tcache synchronization. This regression was first released in 4.0.0. (@jasone) - Fix various JSON-formatted malloc_stats_print() bugs. This functionality was first released in 4.3.0. (@jasone) Modified: head/contrib/jemalloc/FREEBSD-Xlist ============================================================================== --- head/contrib/jemalloc/FREEBSD-Xlist Thu Jun 15 06:48:36 2017 (r319970) +++ head/contrib/jemalloc/FREEBSD-Xlist Thu Jun 15 07:15:05 2017 (r319971) @@ -4,7 +4,7 @@ $FreeBSD$ .git* .travis.yml FREEBSD-* -INSTALL +INSTALL.md Makefile* README autogen.sh @@ -13,23 +13,24 @@ bin/ build-aux/ config.* configure* -coverage.sh doc/*.in doc/*.xml doc/*.xsl doc/*.html -include/jemalloc/internal/jemalloc_internal.h.in +include/jemalloc/internal/atomic_msvc.h include/jemalloc/internal/jemalloc_internal_defs.h.in +include/jemalloc/internal/jemalloc_preamble.h.in include/jemalloc/internal/private_namespace.sh -include/jemalloc/internal/private_symbols.txt -include/jemalloc/internal/private_unnamespace.h -include/jemalloc/internal/private_unnamespace.sh +include/jemalloc/internal/private_symbols_jet.awk +include/jemalloc/internal/private_symbols.awk +include/jemalloc/internal/private_symbols.sh include/jemalloc/internal/public_namespace.sh include/jemalloc/internal/public_symbols.txt include/jemalloc/internal/public_unnamespace.h include/jemalloc/internal/public_unnamespace.sh include/jemalloc/internal/size_classes.sh include/jemalloc/internal/smoothstep.sh +include/jemalloc/internal/tsd_win.h include/jemalloc/jemalloc.h.in include/jemalloc/jemalloc.sh include/jemalloc/jemalloc_defs.h @@ -48,8 +49,10 @@ include/jemalloc/jemalloc_typedefs.h.in include/msvc_compat/ install-sh jemalloc.pc* +m4/ msvc/ +run_tests.sh scripts/ -src/valgrind.c +src/jemalloc_cpp.cpp src/zone.c test/ Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Thu Jun 15 06:48:36 2017 (r319970) +++ head/contrib/jemalloc/FREEBSD-diffs Thu Jun 15 07:15:05 2017 (r319971) @@ -1,21 +1,19 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in -index c97ab0f..be8dda5 100644 +index 21e401ac..f977c5f5 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in -@@ -53,11 +53,23 @@ +@@ -53,11 +53,21 @@ This manual describes jemalloc @jemalloc_version@. More information can be found at the jemalloc website. + + The following configuration options are enabled in libc's built-in + jemalloc: , -+ , , -+ , , -+ , , and -+ . Additionally, -+ is enabled in development versions of -+ FreeBSD (controlled by the MALLOC_PRODUCTION make -+ variable). ++ , , ++ , and . ++ Additionally, is enabled in development ++ versions of FreeBSD (controlled by the ++ MALLOC_PRODUCTION make variable). + @@ -27,7 +25,7 @@ index c97ab0f..be8dda5 100644 Standard API -@@ -2989,4 +3001,18 @@ malloc_conf = "lg_chunk:24";]]> +@@ -3252,4 +3262,18 @@ malloc_conf = "narenas:1";]]> The posix_memalign() function conforms to IEEE Std 1003.1-2001 (POSIX.1). @@ -46,42 +44,42 @@ index c97ab0f..be8dda5 100644 + 11.0. + -diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h -index 119e3a5..277989f 100644 ---- a/include/jemalloc/internal/arena.h -+++ b/include/jemalloc/internal/arena.h -@@ -731,8 +731,13 @@ arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t pageind) - JEMALLOC_ALWAYS_INLINE const arena_chunk_map_misc_t * - arena_miscelm_get_const(const arena_chunk_t *chunk, size_t pageind) - { -+#if 1 /* Work around gcc bug. */ -+ arena_chunk_t *mchunk = (arena_chunk_t *)chunk; +diff --git a/include/jemalloc/internal/hooks.h b/include/jemalloc/internal/hooks.h +index cd49afcb..85e2a991 100644 +--- a/include/jemalloc/internal/hooks.h ++++ b/include/jemalloc/internal/hooks.h +@@ -6,13 +6,6 @@ extern JEMALLOC_EXPORT void (*hooks_libc_hook)(); -+ return (arena_miscelm_get_mutable(mchunk, pageind)); -+#else - return (arena_miscelm_get_mutable((arena_chunk_t *)chunk, pageind)); -+#endif - } + #define JEMALLOC_HOOK(fn, hook) ((void)(hook != NULL && (hook(), 0)), fn) - JEMALLOC_ALWAYS_INLINE size_t -@@ -791,8 +796,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t pageind) - JEMALLOC_ALWAYS_INLINE const size_t * - arena_mapbitsp_get_const(const arena_chunk_t *chunk, size_t pageind) - { -+#if 1 /* Work around gcc bug. */ -+ arena_chunk_t *mchunk = (arena_chunk_t *)chunk; +-#define open JEMALLOC_HOOK(open, hooks_libc_hook) +-#define read JEMALLOC_HOOK(read, hooks_libc_hook) +-#define write JEMALLOC_HOOK(write, hooks_libc_hook) +-#define readlink JEMALLOC_HOOK(readlink, hooks_libc_hook) +-#define close JEMALLOC_HOOK(close, hooks_libc_hook) +-#define creat JEMALLOC_HOOK(creat, hooks_libc_hook) +-#define secure_getenv JEMALLOC_HOOK(secure_getenv, hooks_libc_hook) + /* Note that this is undef'd and re-define'd in src/prof.c. */ + #define _Unwind_Backtrace JEMALLOC_HOOK(_Unwind_Backtrace, hooks_libc_hook) -+ return (arena_mapbitsp_get_mutable(mchunk, pageind)); -+#else - return (arena_mapbitsp_get_mutable((arena_chunk_t *)chunk, pageind)); -+#endif - } +diff --git a/include/jemalloc/internal/jemalloc_internal_decls.h b/include/jemalloc/internal/jemalloc_internal_decls.h +index 1efdb56b..12a7e5a8 100644 +--- a/include/jemalloc/internal/jemalloc_internal_decls.h ++++ b/include/jemalloc/internal/jemalloc_internal_decls.h +@@ -1,6 +1,9 @@ + #ifndef JEMALLOC_INTERNAL_DECLS_H + #define JEMALLOC_INTERNAL_DECLS_H - JEMALLOC_ALWAYS_INLINE size_t -diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index e3b499a..827fdbf 100644 ---- a/include/jemalloc/internal/jemalloc_internal.h.in -+++ b/include/jemalloc/internal/jemalloc_internal.h.in ++#include "libc_private.h" ++#include "namespace.h" ++ + #include + #ifdef _WIN32 + # include +diff --git a/include/jemalloc/internal/jemalloc_preamble.h.in b/include/jemalloc/internal/jemalloc_preamble.h.in +index 18539a09..c8af8683 100644 +--- a/include/jemalloc/internal/jemalloc_preamble.h.in ++++ b/include/jemalloc/internal/jemalloc_preamble.h.in @@ -8,6 +8,9 @@ #include #endif @@ -89,10 +87,10 @@ index e3b499a..827fdbf 100644 +#include "un-namespace.h" +#include "libc_private.h" + - #define JEMALLOC_NO_DEMANGLE + #define JEMALLOC_NO_DEMANGLE #ifdef JEMALLOC_JET - # define JEMALLOC_N(n) jet_##n -@@ -42,13 +45,7 @@ static const bool config_fill = + # undef JEMALLOC_IS_MALLOC +@@ -68,13 +71,7 @@ static const bool config_fill = false #endif ; @@ -107,25 +105,11 @@ index e3b499a..827fdbf 100644 static const char * const config_malloc_conf = JEMALLOC_CONFIG_MALLOC_CONF; static const bool config_prof = #ifdef JEMALLOC_PROF -diff --git a/include/jemalloc/internal/jemalloc_internal_decls.h b/include/jemalloc/internal/jemalloc_internal_decls.h -index c907d91..4626632 100644 ---- a/include/jemalloc/internal/jemalloc_internal_decls.h -+++ b/include/jemalloc/internal/jemalloc_internal_decls.h -@@ -1,6 +1,9 @@ - #ifndef JEMALLOC_INTERNAL_DECLS_H - #define JEMALLOC_INTERNAL_DECLS_H - -+#include "libc_private.h" -+#include "namespace.h" -+ - #include - #ifdef _WIN32 - # include diff --git a/include/jemalloc/internal/mutex.h b/include/jemalloc/internal/mutex.h -index 2b4b1c3..e03a6d0 100644 +index 6520c251..0013cbe9 100644 --- a/include/jemalloc/internal/mutex.h +++ b/include/jemalloc/internal/mutex.h -@@ -57,9 +57,6 @@ struct malloc_mutex_s { +@@ -121,9 +121,6 @@ struct malloc_mutex_s { #ifdef JEMALLOC_LAZY_LOCK extern bool isthreaded; @@ -134,33 +118,21 @@ index 2b4b1c3..e03a6d0 100644 -# define isthreaded true #endif - bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, -@@ -67,6 +64,7 @@ bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, - void malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex); - void malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t *mutex); - void malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex); -+bool malloc_mutex_first_thread(void); - bool malloc_mutex_boot(void); + bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, +@@ -131,6 +128,7 @@ bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, + void malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex); + void malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t *mutex); + void malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex); ++bool malloc_mutex_first_thread(void); + bool malloc_mutex_boot(void); + void malloc_mutex_prof_data_reset(tsdn_t *tsdn, malloc_mutex_t *mutex); - #endif /* JEMALLOC_H_EXTERNS */ -diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt -index 60b57e5..056a8fe 100644 ---- a/include/jemalloc/internal/private_symbols.txt -+++ b/include/jemalloc/internal/private_symbols.txt -@@ -312,7 +312,6 @@ iralloct_realign - isalloc - isdalloct - isqalloc --isthreaded - ivsalloc - ixalloc - jemalloc_postfork_child diff --git a/include/jemalloc/jemalloc_FreeBSD.h b/include/jemalloc/jemalloc_FreeBSD.h new file mode 100644 -index 0000000..c58a8f3 +index 00000000..355b565c --- /dev/null +++ b/include/jemalloc/jemalloc_FreeBSD.h -@@ -0,0 +1,162 @@ +@@ -0,0 +1,185 @@ +/* + * Override settings that were generated in jemalloc_defs.h as necessary. + */ @@ -173,51 +145,65 @@ index 0000000..c58a8f3 + +#undef JEMALLOC_DSS + ++#undef JEMALLOC_BACKGROUND_THREAD ++ +/* + * The following are architecture-dependent, so conditionally define them for + * each supported architecture. + */ +#undef JEMALLOC_TLS_MODEL +#undef STATIC_PAGE_SHIFT ++#undef LG_VADDR +#undef LG_SIZEOF_PTR +#undef LG_SIZEOF_INT +#undef LG_SIZEOF_LONG +#undef LG_SIZEOF_INTMAX_T + +#ifdef __i386__ ++# define LG_VADDR 32 +# define LG_SIZEOF_PTR 2 +# define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) +#endif +#ifdef __ia64__ ++# define LG_VADDR 64 +# define LG_SIZEOF_PTR 3 +#endif +#ifdef __sparc64__ ++# define LG_VADDR 64 +# define LG_SIZEOF_PTR 3 +# define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) +#endif +#ifdef __amd64__ ++# define LG_VADDR 48 +# define LG_SIZEOF_PTR 3 +# define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) +#endif +#ifdef __arm__ ++# define LG_VADDR 32 +# define LG_SIZEOF_PTR 2 +#endif +#ifdef __aarch64__ ++# define LG_VADDR 48 +# define LG_SIZEOF_PTR 3 +#endif +#ifdef __mips__ +#ifdef __mips_n64 ++# define LG_VADDR 64 +# define LG_SIZEOF_PTR 3 +#else ++# define LG_VADDR 32 +# define LG_SIZEOF_PTR 2 +#endif +#endif +#ifdef __powerpc64__ ++# define LG_VADDR 64 +# define LG_SIZEOF_PTR 3 +#elif defined(__powerpc__) ++# define LG_VADDR 32 +# define LG_SIZEOF_PTR 2 +#endif +#ifdef __riscv__ ++# define LG_VADDR 64 +# define LG_SIZEOF_PTR 3 +#endif + @@ -291,8 +277,17 @@ index 0000000..c58a8f3 +#define read _read +#define write _write +#define close _close ++#define pthread_join _pthread_join ++#define pthread_once _pthread_once ++#define pthread_self _pthread_self ++#define pthread_equal _pthread_equal +#define pthread_mutex_lock _pthread_mutex_lock ++#define pthread_mutex_trylock _pthread_mutex_trylock +#define pthread_mutex_unlock _pthread_mutex_unlock ++#define pthread_cond_init _pthread_cond_init ++#define pthread_cond_wait _pthread_cond_wait ++#define pthread_cond_timedwait _pthread_cond_timedwait ++#define pthread_cond_signal _pthread_cond_signal + +#ifdef JEMALLOC_C_ +/* @@ -324,7 +319,7 @@ index 0000000..c58a8f3 +__weak_reference(__nallocm, nallocm); +#endif diff --git a/include/jemalloc/jemalloc_rename.sh b/include/jemalloc/jemalloc_rename.sh -index f943891..47d032c 100755 +index f9438912..47d032c1 100755 --- a/include/jemalloc/jemalloc_rename.sh +++ b/include/jemalloc/jemalloc_rename.sh @@ -19,4 +19,6 @@ done @@ -335,10 +330,10 @@ index f943891..47d032c 100755 +#include "jemalloc_FreeBSD.h" EOF diff --git a/src/jemalloc.c b/src/jemalloc.c -index f73a26c..fcfe204 100644 +index 52c86aa6..868c9e86 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c -@@ -4,6 +4,10 @@ +@@ -20,6 +20,10 @@ /******************************************************************************/ /* Data. */ @@ -349,7 +344,7 @@ index f73a26c..fcfe204 100644 /* Runtime configuration options. */ const char *je_malloc_conf #ifndef _WIN32 -@@ -2781,6 +2785,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) +@@ -2981,6 +2985,103 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) { */ /******************************************************************************/ /* @@ -366,78 +361,74 @@ index f73a26c..fcfe204 100644 +#define ALLOCM_ERR_NOT_MOVED 2 + +int -+je_allocm(void **ptr, size_t *rsize, size_t size, int flags) -+{ -+ void *p; -+ ++je_allocm(void **ptr, size_t *rsize, size_t size, int flags) { + assert(ptr != NULL); + -+ p = je_mallocx(size, flags); -+ if (p == NULL) ++ void *p = je_mallocx(size, flags); ++ if (p == NULL) { + return (ALLOCM_ERR_OOM); -+ if (rsize != NULL) -+ *rsize = isalloc(tsdn_fetch(), p, config_prof); ++ } ++ if (rsize != NULL) { ++ *rsize = isalloc(tsdn_fetch(), p); ++ } + *ptr = p; -+ return (ALLOCM_SUCCESS); ++ return ALLOCM_SUCCESS; +} + +int -+je_rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, int flags) -+{ -+ int ret; -+ bool no_move = flags & ALLOCM_NO_MOVE; -+ ++je_rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, int flags) { + assert(ptr != NULL); + assert(*ptr != NULL); + assert(size != 0); + assert(SIZE_T_MAX - size >= extra); + ++ int ret; ++ bool no_move = flags & ALLOCM_NO_MOVE; ++ + if (no_move) { + size_t usize = je_xallocx(*ptr, size, extra, flags); + ret = (usize >= size) ? ALLOCM_SUCCESS : ALLOCM_ERR_NOT_MOVED; -+ if (rsize != NULL) ++ if (rsize != NULL) { + *rsize = usize; ++ } + } else { + void *p = je_rallocx(*ptr, size+extra, flags); + if (p != NULL) { + *ptr = p; + ret = ALLOCM_SUCCESS; -+ } else ++ } else { + ret = ALLOCM_ERR_OOM; -+ if (rsize != NULL) -+ *rsize = isalloc(tsdn_fetch(), *ptr, config_prof); ++ } ++ if (rsize != NULL) { ++ *rsize = isalloc(tsdn_fetch(), *ptr); ++ } + } -+ return (ret); ++ return ret; +} + +int -+je_sallocm(const void *ptr, size_t *rsize, int flags) -+{ -+ ++je_sallocm(const void *ptr, size_t *rsize, int flags) { + assert(rsize != NULL); + *rsize = je_sallocx(ptr, flags); -+ return (ALLOCM_SUCCESS); ++ return ALLOCM_SUCCESS; +} + +int -+je_dallocm(void *ptr, int flags) -+{ -+ ++je_dallocm(void *ptr, int flags) { + je_dallocx(ptr, flags); -+ return (ALLOCM_SUCCESS); ++ return ALLOCM_SUCCESS; +} + +int -+je_nallocm(size_t *rsize, size_t size, int flags) -+{ -+ size_t usize; -+ -+ usize = je_nallocx(size, flags); -+ if (usize == 0) -+ return (ALLOCM_ERR_OOM); -+ if (rsize != NULL) ++je_nallocm(size_t *rsize, size_t size, int flags) { ++ size_t usize = je_nallocx(size, flags); ++ if (usize == 0) { ++ return ALLOCM_ERR_OOM; ++ } ++ if (rsize != NULL) { + *rsize = usize; -+ return (ALLOCM_SUCCESS); ++ } ++ return ALLOCM_SUCCESS; +} + +#undef ALLOCM_LG_ALIGN @@ -457,7 +448,7 @@ index f73a26c..fcfe204 100644 * The following functions are used by threading libraries for protection of * malloc during fork(). */ -@@ -2922,4 +3027,11 @@ jemalloc_postfork_child(void) +@@ -3141,4 +3242,11 @@ jemalloc_postfork_child(void) { ctl_postfork_child(tsd_tsdn(tsd)); } @@ -469,11 +460,36 @@ index f73a26c..fcfe204 100644 +} + /******************************************************************************/ +diff --git a/src/malloc_io.c b/src/malloc_io.c +index 6b99afcd..4363cb83 100644 +--- a/src/malloc_io.c ++++ b/src/malloc_io.c +@@ -88,6 +88,20 @@ wrtmessage(void *cbopaque, const char *s) { + + JEMALLOC_EXPORT void (*je_malloc_message)(void *, const char *s); + ++JEMALLOC_ATTR(visibility("hidden")) ++void ++wrtmessage_1_0(const char *s1, const char *s2, const char *s3, const char *s4) { ++ ++ wrtmessage(NULL, s1); ++ wrtmessage(NULL, s2); ++ wrtmessage(NULL, s3); ++ wrtmessage(NULL, s4); ++} ++ ++void (*__malloc_message_1_0)(const char *s1, const char *s2, const char *s3, ++ const char *s4) = wrtmessage_1_0; ++__sym_compat(_malloc_message, __malloc_message_1_0, FBSD_1.0); ++ + /* + * Wrapper around malloc_message() that avoids the need for + * je_malloc_message(...) throughout the code. diff --git a/src/mutex.c b/src/mutex.c -index 6333e73..13f8d79 100644 +index a528ef0c..820af613 100644 --- a/src/mutex.c +++ b/src/mutex.c -@@ -66,6 +66,17 @@ pthread_create(pthread_t *__restrict thread, +@@ -40,6 +40,17 @@ pthread_create(pthread_t *__restrict thread, #ifdef JEMALLOC_MUTEX_INIT_CB JEMALLOC_EXPORT int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex, void *(calloc_cb)(size_t, size_t)); @@ -490,55 +506,21 @@ index 6333e73..13f8d79 100644 +} #endif - bool -@@ -142,7 +153,7 @@ malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex) + void +@@ -130,6 +141,16 @@ mutex_addr_comp(const witness_t *witness1, void *mutex1, } bool --malloc_mutex_boot(void) -+malloc_mutex_first_thread(void) - { - - #ifdef JEMALLOC_MUTEX_INIT_CB -@@ -156,3 +167,14 @@ malloc_mutex_boot(void) - #endif - return (false); - } ++malloc_mutex_first_thread(void) { + -+bool -+malloc_mutex_boot(void) -+{ -+ +#ifndef JEMALLOC_MUTEX_INIT_CB + return (malloc_mutex_first_thread()); +#else + return (false); +#endif +} -diff --git a/src/util.c b/src/util.c -index dd8c236..a4ff287 100644 ---- a/src/util.c -+++ b/src/util.c -@@ -67,6 +67,22 @@ wrtmessage(void *cbopaque, const char *s) - - JEMALLOC_EXPORT void (*je_malloc_message)(void *, const char *s); - -+JEMALLOC_ATTR(visibility("hidden")) -+void -+wrtmessage_1_0(const char *s1, const char *s2, const char *s3, -+ const char *s4) -+{ + -+ wrtmessage(NULL, s1); -+ wrtmessage(NULL, s2); -+ wrtmessage(NULL, s3); -+ wrtmessage(NULL, s4); -+} -+ -+void (*__malloc_message_1_0)(const char *s1, const char *s2, const char *s3, -+ const char *s4) = wrtmessage_1_0; -+__sym_compat(_malloc_message, __malloc_message_1_0, FBSD_1.0); -+ - /* - * Wrapper around malloc_message() that avoids the need for - * je_malloc_message(...) throughout the code. ++bool + malloc_mutex_init(malloc_mutex_t *mutex, const char *name, + witness_rank_t rank, malloc_mutex_lock_order_t lock_order) { + mutex_prof_data_init(&mutex->prof_data); Modified: head/contrib/jemalloc/FREEBSD-upgrade ============================================================================== --- head/contrib/jemalloc/FREEBSD-upgrade Thu Jun 15 06:48:36 2017 (r319970) +++ head/contrib/jemalloc/FREEBSD-upgrade Thu Jun 15 07:15:05 2017 (r319971) @@ -22,19 +22,19 @@ # # Extract latest jemalloc release. # -# ./FREEBSD-upgrade extract +# ./FREEBSD-upgrade extract # # Fix patch conflicts as necessary, then regenerate diffs to update line # offsets: # # ./FREEBSD-upgrade rediff -# ./FREEBSD-upgrade extract +# ./FREEBSD-upgrade extract # # Do multiple buildworld/installworld rounds. If problems arise and patches # are needed, edit the code in ${work} as necessary, then: # # ./FREEBSD-upgrade rediff -# ./FREEBSD-upgrade extract +# ./FREEBSD-upgrade extract # # The rediff/extract order is important because rediff saves the local # changes, then extract blows away the work tree and re-creates it with the @@ -45,43 +45,98 @@ # ./FREEBSD-upgrade clean set -e +set -x if [ ! -x "FREEBSD-upgrade" ] ; then echo "Run from within src/contrib/jemalloc/" >&2 exit 1 fi +if [ "x${JEMALLOC_REPO}" = "x" ] ; then + JEMALLOC_REPO=https://github.com/jemalloc/jemalloc.git +fi + src=`pwd` -workname="jemalloc.git" -work="${src}/../${workname}" # merge-changes expects ${workname} in "..". + +jemalloc_tmp="jemalloc.tmp" +tmpdir="${src}/../${jemalloc_tmp}" +bare_repo="${tmpdir}/jemalloc_bare.git" +work="jemalloc_work.git" +work_repo="${tmpdir}/${work}" +namespace_repo="${tmpdir}/jemalloc_namespace.git" changes="${src}/FREEBSD-changes" -do_extract() { +do_fetch() { local rev=$1 - # Clone. - rm -rf ${work} - git clone https://github.com/jemalloc/jemalloc.git ${work} + if [ ! -d "${bare_repo}" ] ; then + mkdir -p "${bare_repo}" + git clone --bare ${JEMALLOC_REPO} ${bare_repo} + fi ( - cd ${work} + cd ${bare_repo} + git fetch origin ${rev} + ) +} + +do_extract_helper() { + local rev=$1 + local repo=$2 + do_fetch ${rev} + rm -rf ${repo} + git clone ${bare_repo} ${repo} + ( + cd ${repo} if [ "x${rev}" != "x" ] ; then # Use optional rev argument to check out a revision other than HEAD on # master. git checkout ${rev} fi + ) +} + +do_autogen() { + ./autogen.sh --enable-xmalloc --enable-utrace \ + --with-xslroot=/usr/local/share/xsl/docbook --with-private-namespace=__ \ + --with-lg-page-sizes=12,13,14,16 +} + +do_extract_diff() { + local rev=$1 + local repo=$2 + do_extract_helper ${rev} ${repo} + ( + cd ${repo} # Apply diffs before generating files. patch -p1 < "${src}/FREEBSD-diffs" find . -name '*.orig' -delete - # Generate various files. - ./autogen.sh --enable-cc-silence --enable-xmalloc --enable-utrace \ - --with-xslroot=/usr/local/share/xsl/docbook --with-private-namespace=__ \ - --with-lg-page-sizes=12,13,14,16 + # Generate files. + do_autogen gmake dist ) } +do_extract_namespace() { + local rev=$1 + local repo=$2 + do_extract_helper ${rev} ${repo} + ( + cd ${repo} + # Generate files. + do_autogen + gmake include/jemalloc/internal/private_namespace.h + ) +} + +do_extract() { + local rev=$1 + do_fetch ${rev} + do_extract_diff ${rev} ${work_repo} + do_extract_namespace ${rev} ${namespace_repo} +} + do_diff() { ( - cd ${work} + cd ${work_repo} find . -name '*.orig' -delete find . -name '*.rej' -delete git add -A @@ -98,12 +153,12 @@ case "${command}" in do_extract ${rev} # Compute local differences to the upstream+patches and apply them. ( - cd .. - diff -ru -X ${src}/FREEBSD-Xlist ${workname} jemalloc > ${changes} || true + cd ${tmpdir} + diff -ru -X ${src}/FREEBSD-Xlist ${work} ../jemalloc > ${changes} || true ) ( - cd ${work} - patch -p1 < ${changes} + cd ${work_repo} + patch -p1 < ${changes} || true find . -name '*.orig' -delete ) # Update diff. @@ -115,13 +170,17 @@ case "${command}" in # Delete existing files so that cruft doesn't silently remain. rm -rf ChangeLog COPYING VERSION doc include src # Copy files over. - tar cf - -C ${work} -X FREEBSD-Xlist . |tar xvf - + tar cf - -C ${work_repo} -X FREEBSD-Xlist . |tar xvf - + internal_dir="include/jemalloc/internal" + grep -v ' isthreaded ' \ + "${namespace_repo}/${internal_dir}/private_namespace.h" \ + > "${internal_dir}/private_namespace.h" ;; rediff) # Regenerate diffs based on working tree. do_diff ;; clean) # Remove working tree and temporary files. - rm -rf ${work} ${changes} + rm -rf ${tmpdir} ${changes} ;; *) echo "Unsupported command: \"${command}\"" >&2 Modified: head/contrib/jemalloc/VERSION ============================================================================== --- head/contrib/jemalloc/VERSION Thu Jun 15 06:48:36 2017 (r319970) +++ head/contrib/jemalloc/VERSION Thu Jun 15 07:15:05 2017 (r319971) @@ -1 +1 @@ -4.5.0-0-g04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5 +5.0.0-4-g84f6c2cae0fb1399377ef6aea9368444c4987cc6 Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Thu Jun 15 06:48:36 2017 (r319970) +++ head/contrib/jemalloc/doc/jemalloc.3 Thu Jun 15 07:15:05 2017 (r319971) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jun 15 08:32:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 922EAC788AC; Thu, 15 Jun 2017 08:32:15 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1ACC6A65E; Thu, 15 Jun 2017 08:32:14 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MUTSJ-1dCJPS0mm3-00RFsP; Thu, 15 Jun 2017 10:32:05 +0200 Date: Thu, 15 Jun 2017 10:31:57 +0200 From: "O. Hartmann" To: Jason Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc Message-ID: <20170615103157.43bf216e@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: <201706150715.v5F7F6aT031218@repo.freebsd.org> References: <201706150715.v5F7F6aT031218@repo.freebsd.org> Organization: Walstatt MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:fLdLOgk0lcv4wdsFfxmXWHGBDAHybalwi4jmzHnBvVEghz/8ONp 38moDKEc9Hf5B6Z/ZNqo4MpO3ifp0qRSttGYYhcB95WhvkX4YjpU7OAEBWvecWShMYkbRIT LjhpShBUzBTBnzNUC6ShcYk9lYHBIvZAZQjceERLdsQLUlD7abXtgjBRVHU8ghO4o12fggu TZYIC0VFKL3mtg6QZmRWw== X-UI-Out-Filterresults: notjunk:1;V01:K0:3Q1rTfHwpNM=:1AvBpkohA3FO7TlC2Q2Z7B 8LutXa72pP7IVRwjfutb0QEI1BM0uImk/D4ruQsrco2Obc+VN5tAYIGRqXvNI0FxOGVT3mRTY jrJmmqaVyhEU0zRPGy0Dolb3zIH04478PMX+dH1QzlB4Nc+a7k7K/UpywNJC60vmiOXp8/mQt zwLCyu0HkfuxlHPINsczhpgyQKR1O9hcQQ89yZ+OeuOkLe2g6F7wKUZjlvOCM8G+yTUUGlI7J BAtMH8P3oRs1bYnzvhIf0ID3QFORDVZPO/aO1aRZsd+2gg7WrX9s5jZMFzOtu3Ike5Q5zSUQu oweYOfMn6Mx4126Z+bq8C9hVGMQSe2ySU5tIR0jO+AGyHz1/ragwG8epwZ4k+df4o95fEn/9E ge0gnP9ZDlxcqbcfNrbirWm8CeEd/9rvBgM30PBXJx3ISC9gweH55eop1gcZ+1mzeLjFWil0B sN6X6qIulaZB6B5OwkPJQ0mvzgWd76H+bZAl7VQL8oYdXm8Lyd/KvhnOjdt5hmcRKtqyFywlG YNNnn0srfYy6ay1hRFSusvUM1VAN49vIZH95fPQ+VR1Rul9t1745IN+ytNWMFsscThsZGzklt Kt1WP6Z9ZoRaaO2ghdA7TOdVgLU+zDe/ZKSNGqszUH3L4c0LA+28EYkbszRHpaBwYlpA/CiuH xWXLLFQMwrfxe+kBuBFM2kAkl4/DDhBhCQWpH67gmJQjvuCbHmlSFQfIRCYTASCVxI5Kfu+H+ BgMC1aWiX0j4RFYPnAsPfGU2AuNy2qNO0dphZiMwFfTlR42CCXXrDpzJGXRYAGke/R/bXCtRU f0dZV2f X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 08:32:15 -0000 On Thu, 15 Jun 2017 07:15:06 +0000 (UTC) Jason Evans wrote: > Author: jasone > Date: Thu Jun 15 07:15:05 2017 > New Revision: 319971 > URL: https://svnweb.freebsd.org/changeset/base/319971 > > Log: > Update jemalloc to 5.0.0. > > Added: > head/contrib/jemalloc/include/jemalloc/internal/arena_externs.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/arena_inlines_a.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/arena_structs_a.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/arena_structs_b.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/arena_types.h (contents, > props changed) head/contrib/jemalloc/include/jemalloc/internal/atomic_c11.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/atomic_gcc_atomic.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/atomic_gcc_sync.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/background_thread_externs.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/background_thread_inlines.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/background_thread_structs.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/base_externs.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/base_inlines.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/base_structs.h (contents, > props changed) head/contrib/jemalloc/include/jemalloc/internal/base_types.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/bit_util.h (contents, props > changed) head/contrib/jemalloc/include/jemalloc/internal/extent_dss.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/extent_externs.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/extent_inlines.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/extent_mmap.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/extent_structs.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/extent_types.h (contents, > props changed) head/contrib/jemalloc/include/jemalloc/internal/hooks.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_externs.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_includes.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_a.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_b.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_c.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_preamble.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/large_externs.h (contents, > props changed) head/contrib/jemalloc/include/jemalloc/internal/malloc_io.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/mutex_pool.h (contents, > props changed) head/contrib/jemalloc/include/jemalloc/internal/mutex_prof.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/prof_externs.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/prof_inlines_a.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/prof_inlines_b.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/prof_structs.h (contents, > props changed) head/contrib/jemalloc/include/jemalloc/internal/prof_types.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/rtree_tsd.h (contents, > props changed) head/contrib/jemalloc/include/jemalloc/internal/stats_tsd.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/sz.h (contents, props > changed) head/contrib/jemalloc/include/jemalloc/internal/tcache_externs.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/tcache_inlines.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/tcache_structs.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/tcache_types.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/tsd_generic.h (contents, > props changed) > head/contrib/jemalloc/include/jemalloc/internal/tsd_malloc_thread_cleanup.h > (contents, props changed) > head/contrib/jemalloc/include/jemalloc/internal/tsd_tls.h (contents, props > changed) head/contrib/jemalloc/include/jemalloc/internal/tsd_types.h > (contents, props changed) head/contrib/jemalloc/src/background_thread.c > (contents, props changed) head/contrib/jemalloc/src/extent_dss.c (contents, > props changed) head/contrib/jemalloc/src/extent_mmap.c (contents, props > changed) head/contrib/jemalloc/src/hooks.c (contents, props changed) > head/contrib/jemalloc/src/large.c (contents, props changed) > head/contrib/jemalloc/src/malloc_io.c (contents, props changed) > head/contrib/jemalloc/src/mutex_pool.c (contents, props changed) > head/contrib/jemalloc/src/sz.c (contents, props changed) Deleted: > head/contrib/jemalloc/include/jemalloc/internal/arena.h > head/contrib/jemalloc/include/jemalloc/internal/base.h > head/contrib/jemalloc/include/jemalloc/internal/chunk.h > head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h > head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h > head/contrib/jemalloc/include/jemalloc/internal/extent.h > head/contrib/jemalloc/include/jemalloc/internal/huge.h > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h > head/contrib/jemalloc/include/jemalloc/internal/mb.h > head/contrib/jemalloc/include/jemalloc/internal/prof.h > head/contrib/jemalloc/include/jemalloc/internal/quarantine.h > head/contrib/jemalloc/include/jemalloc/internal/tcache.h > head/contrib/jemalloc/include/jemalloc/internal/valgrind.h > head/contrib/jemalloc/src/atomic.c head/contrib/jemalloc/src/chunk.c > head/contrib/jemalloc/src/chunk_dss.c head/contrib/jemalloc/src/chunk_mmap.c > head/contrib/jemalloc/src/huge.c head/contrib/jemalloc/src/mb.c > head/contrib/jemalloc/src/quarantine.c head/contrib/jemalloc/src/util.c > Modified: head/contrib/jemalloc/COPYING head/contrib/jemalloc/ChangeLog > head/contrib/jemalloc/FREEBSD-Xlist head/contrib/jemalloc/FREEBSD-diffs > head/contrib/jemalloc/FREEBSD-upgrade head/contrib/jemalloc/VERSION > head/contrib/jemalloc/doc/jemalloc.3 > head/contrib/jemalloc/include/jemalloc/internal/assert.h > head/contrib/jemalloc/include/jemalloc/internal/atomic.h > head/contrib/jemalloc/include/jemalloc/internal/bitmap.h > head/contrib/jemalloc/include/jemalloc/internal/ckh.h > head/contrib/jemalloc/include/jemalloc/internal/ctl.h > head/contrib/jemalloc/include/jemalloc/internal/hash.h > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h > head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h > head/contrib/jemalloc/include/jemalloc/internal/mutex.h > head/contrib/jemalloc/include/jemalloc/internal/nstime.h > head/contrib/jemalloc/include/jemalloc/internal/pages.h > head/contrib/jemalloc/include/jemalloc/internal/ph.h > head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h > head/contrib/jemalloc/include/jemalloc/internal/prng.h > head/contrib/jemalloc/include/jemalloc/internal/public_namespace.h > head/contrib/jemalloc/include/jemalloc/internal/ql.h > head/contrib/jemalloc/include/jemalloc/internal/qr.h > head/contrib/jemalloc/include/jemalloc/internal/rb.h > head/contrib/jemalloc/include/jemalloc/internal/rtree.h > head/contrib/jemalloc/include/jemalloc/internal/size_classes.h > head/contrib/jemalloc/include/jemalloc/internal/smoothstep.h > head/contrib/jemalloc/include/jemalloc/internal/spin.h > head/contrib/jemalloc/include/jemalloc/internal/stats.h > head/contrib/jemalloc/include/jemalloc/internal/ticker.h > head/contrib/jemalloc/include/jemalloc/internal/tsd.h > head/contrib/jemalloc/include/jemalloc/internal/util.h > head/contrib/jemalloc/include/jemalloc/internal/witness.h > head/contrib/jemalloc/include/jemalloc/jemalloc.h > head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h > head/contrib/jemalloc/include/jemalloc/jemalloc_typedefs.h > head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/base.c > head/contrib/jemalloc/src/bitmap.c head/contrib/jemalloc/src/ckh.c > head/contrib/jemalloc/src/ctl.c head/contrib/jemalloc/src/extent.c > head/contrib/jemalloc/src/hash.c head/contrib/jemalloc/src/jemalloc.c > head/contrib/jemalloc/src/mutex.c head/contrib/jemalloc/src/nstime.c > head/contrib/jemalloc/src/pages.c head/contrib/jemalloc/src/prng.c > head/contrib/jemalloc/src/prof.c head/contrib/jemalloc/src/rtree.c > head/contrib/jemalloc/src/spin.c head/contrib/jemalloc/src/stats.c > head/contrib/jemalloc/src/tcache.c head/contrib/jemalloc/src/ticker.c > head/contrib/jemalloc/src/tsd.c head/contrib/jemalloc/src/witness.c > head/include/malloc_np.h head/lib/libc/stdlib/jemalloc/Makefile.inc > > Modified: head/contrib/jemalloc/COPYING > ============================================================================== > --- head/contrib/jemalloc/COPYING Thu Jun 15 06:48:36 2017 > (r319970) +++ head/contrib/jemalloc/COPYING Thu Jun 15 07:15:05 > 2017 (r319971) @@ -1,10 +1,10 @@ > Unless otherwise specified, files in the jemalloc source distribution are > subject to the following license: > -------------------------------------------------------------------------------- > -Copyright (C) 2002-2016 Jason Evans . > +Copyright (C) 2002-2017 Jason Evans . > All rights reserved. > Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved. > -Copyright (C) 2009-2016 Facebook, Inc. All rights reserved. > +Copyright (C) 2009-2017 Facebook, 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: > > Modified: head/contrib/jemalloc/ChangeLog > ============================================================================== > --- head/contrib/jemalloc/ChangeLog Thu Jun 15 06:48:36 2017 > (r319970) +++ head/contrib/jemalloc/ChangeLog Thu Jun 15 07:15:05 > 2017 (r319971) @@ -4,6 +4,193 @@ brevity. Much more detail can be > found in the git rev > https://github.com/jemalloc/jemalloc > > +* 5.0.0 (June 13, 2017) > + > + Unlike all previous jemalloc releases, this release does not use naturally > + aligned "chunks" for virtual memory management, and instead uses > page-aligned > + "extents". This change has few externally visible effects, but the > internal > + impacts are... extensive. Many other internal changes combine to make this > + the most cohesively designed version of jemalloc so far, with ample > + opportunity for further enhancements. > + > + Continuous integration is now an integral aspect of development thanks to > the > + efforts of @davidtgoldblatt, and the dev branch tends to remain reasonably > + stable on the tested platforms (Linux, FreeBSD, macOS, and Windows). As a > + side effect the official release frequency may decrease over time. > + > + New features: > + - Implement optional per-CPU arena support; threads choose which arena to > use > + based on current CPU rather than on fixed thread-->arena associations. > + (@interwq) > + - Implement two-phase decay of unused dirty pages. Pages transition from > + dirty-->muzzy-->clean, where the first phase transition relies on > + madvise(... MADV_FREE) semantics, and the second phase transition > discards > + pages such that they are replaced with demand-zeroed pages on next > access. > + (@jasone) > + - Increase decay time resolution from seconds to milliseconds. (@jasone) > + - Implement opt-in per CPU background threads, and use them for > asynchronous > + decay-driven unused dirty page purging. (@interwq) > + - Add mutex profiling, which collects a variety of statistics useful for > + diagnosing overhead/contention issues. (@interwq) > + - Add C++ new/delete operator bindings. (@djwatson) > + - Support manually created arena destruction, such that all data and > metadata > + are discarded. Add MALLCTL_ARENAS_DESTROYED for accessing merged stats > + associated with destroyed arenas. (@jasone) > + - Add MALLCTL_ARENAS_ALL as a fixed index for use in accessing > + merged/destroyed arena statistics via mallctl. (@jasone) > + - Add opt.abort_conf to optionally abort if invalid configuration options > are > + detected during initialization. (@interwq) > + - Add opt.stats_print_opts, so that e.g. JSON output can be selected for > the > + stats dumped during exit if opt.stats_print is true. (@jasone) > + - Add --with-version=VERSION for use when embedding jemalloc into another > + project's git repository. (@jasone) > + - Add --disable-thp to support cross compiling. (@jasone) > + - Add --with-lg-hugepage to support cross compiling. (@jasone) > + - Add mallctl interfaces (various authors): > + + background_thread > + + opt.abort_conf > + + opt.retain > + + opt.percpu_arena > + + opt.background_thread > + + opt.{dirty,muzzy}_decay_ms > + + opt.stats_print_opts > + + arena..initialized > + + arena..destroy > + + arena..{dirty,muzzy}_decay_ms > + + arena..extent_hooks > + + arenas.{dirty,muzzy}_decay_ms > + + arenas.bin..slab_size > + + arenas.nlextents > + + arenas.lextent..size > + + arenas.create > + + stats.background_thread.{num_threads,num_runs,run_interval} > + + stats.mutexes.{ctl,background_thread,prof,reset}. > + > {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds, > + num_owner_switch} > + + stats.arenas..{dirty,muzzy}_decay_ms > + + stats.arenas..uptime > + + stats.arenas..{pmuzzy,base,internal,resident} > + + stats.arenas..{dirty,muzzy}_{npurge,nmadvise,purged} > + + stats.arenas..bins..{nslabs,reslabs,curslabs} > + + stats.arenas..bins..mutex. > + > {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds, > + num_owner_switch} > + + stats.arenas..lextents..{nmalloc,ndalloc,nrequests,curlextents} > + + stats.arenas.i.mutexes.{large,extent_avail,extents_dirty,extents_muzzy, > + extents_retained,decay_dirty,decay_muzzy,base,tcache_list}. > + > {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds, > + num_owner_switch} > + > + Portability improvements: > + - Improve reentrant allocation support, such that deadlock is less likely > if > + e.g. a system library call in turn allocates memory. (@davidtgoldblatt, > + @interwq) > + - Support static linking of jemalloc with glibc. (@djwatson) > + > + Optimizations and refactors: > + - Organize virtual memory as "extents" of virtual memory pages, rather > than as > + naturally aligned "chunks", and store all metadata in arbitrarily distant > + locations. This reduces virtual memory external fragmentation, and will > + interact better with huge pages (not yet explicitly supported). > (@jasone) > + - Fold large and huge size classes together; only small and large size > classes > + remain. (@jasone) > + - Unify the allocation paths, and merge most fast-path branching decisions. > + (@davidtgoldblatt, @interwq) > + - Embed per thread automatic tcache into thread-specific data, which > reduces > + conditional branches and dereferences. Also reorganize tcache to > increase > + fast-path data locality. (@interwq) > + - Rewrite atomics to closely model the C11 API, convert various > + synchronization from mutex-based to atomic, and use the explicit memory > + ordering control to resolve various hypothetical races without increasing > + synchronization overhead. (@davidtgoldblatt) > + - Extensively optimize rtree via various methods: > + + Add multiple layers of rtree lookup caching, since rtree lookups are > now > + part of fast-path deallocation. (@interwq) > + + Determine rtree layout at compile time. (@jasone) > + + Make the tree shallower for common configurations. (@jasone) > + + Embed the root node in the top-level rtree data structure, thus > avoiding > + one level of indirection. (@jasone) > + + Further specialize leaf elements as compared to internal node elements, > + and directly embed extent metadata needed for fast-path deallocation. > + (@jasone) > + + Ignore leading always-zero address bits (architecture-specific). > + (@jasone) > + - Reorganize headers (ongoing work) to make them hermetic, and disentangle > + various module dependencies. (@davidtgoldblatt) > + - Convert various internal data structures such as size class metadata from > + boot-time-initialized to compile-time-initialized. Propagate resulting > data > + structure simplifications, such as making arena metadata fixed-size. > + (@jasone) > + - Simplify size class lookups when constrained to size classes that are > + multiples of the page size. This speeds lookups, but the primary > benefit is > + complexity reduction in code that was the source of numerous regressions. > + (@jasone) > + - Lock individual extents when possible for localized extent operations, > + rather than relying on a top-level arena lock. (@davidtgoldblatt, > @jasone) > + - Use first fit layout policy instead of best fit, in order to improve > + packing. (@jasone) > + - If munmap(2) is not in use, use an exponential series to grow each > arena's > + virtual memory, so that the number of disjoint virtual memory mappings > + remains low. (@jasone) > + - Implement per arena base allocators, so that arenas never share any > virtual > + memory pages. (@jasone) > + - Automatically generate private symbol name mangling macros. (@jasone) > + > + Incompatible changes: > + - Replace chunk hooks with an expanded/normalized set of extent hooks. > + (@jasone) > + - Remove ratio-based purging. (@jasone) > + - Remove --disable-tcache. (@jasone) > + - Remove --disable-tls. (@jasone) > + - Remove --enable-ivsalloc. (@jasone) > + - Remove --with-lg-size-class-group. (@jasone) > + - Remove --with-lg-tiny-min. (@jasone) > + - Remove --disable-cc-silence. (@jasone) > + - Remove --enable-code-coverage. (@jasone) > + - Remove --disable-munmap (replaced by opt.retain). (@jasone) > + - Remove Valgrind support. (@jasone) > + - Remove quarantine support. (@jasone) > + - Remove redzone support. (@jasone) > + - Remove mallctl interfaces (various authors): > + + config.munmap > + + config.tcache > + + config.tls > + + config.valgrind > + + opt.lg_chunk > + + opt.purge > + + opt.lg_dirty_mult > + + opt.decay_time > + + opt.quarantine > + + opt.redzone > + + opt.thp > + + arena..lg_dirty_mult > + + arena..decay_time > + + arena..chunk_hooks > + + arenas.initialized > + + arenas.lg_dirty_mult > + + arenas.decay_time > + + arenas.bin..run_size > + + arenas.nlruns > + + arenas.lrun..size > + + arenas.nhchunks > + + arenas.hchunk..size > + + arenas.extend > + + stats.cactive > + + stats.arenas..lg_dirty_mult > + + stats.arenas..decay_time > + + stats.arenas..metadata.{mapped,allocated} > + + stats.arenas..{npurge,nmadvise,purged} > + + stats.arenas..huge.{allocated,nmalloc,ndalloc,nrequests} > + + stats.arenas..bins..{nruns,reruns,curruns} > + + stats.arenas..lruns..{nmalloc,ndalloc,nrequests,curruns} > + + stats.arenas..hchunks..{nmalloc,ndalloc,nrequests,curhchunks} > + > + Bug fixes: > + - Improve interval-based profile dump triggering to dump only one profile > when > + a single allocation's size exceeds the interval. (@jasone) > + - Use prefixed function names (as controlled by --with-jemalloc-prefix) > when > + pruning backtrace frames in jeprof. (@jasone) > + > * 4.5.0 (February 28, 2017) > > This is the first release to benefit from much broader continuous > integration @@ -12,7 +199,7 @@ brevity. Much more detail can be found in the > git rev regressions fixed by this release. > > New features: > - - Add --disable-thp and the opt.thp to provide opt-out mechanisms for > + - Add --disable-thp and the opt.thp mallctl to provide opt-out mechanisms > for transparent huge page integration. (@jasone) > - Update zone allocator integration to work with macOS 10.12. (@glandium) > - Restructure *CFLAGS configuration, so that CFLAGS behaves typically, and > @@ -25,7 +212,7 @@ brevity. Much more detail can be found in the git rev > - Handle race in per size class utilization computation. This > functionality was first released in 4.0.0. (@interwq) > - Fix lock order reversal during gdump. (@jasone) > - - Fix-refactor tcache synchronization. This regression was first released > in > + - Fix/refactor tcache synchronization. This regression was first released > in 4.0.0. (@jasone) > - Fix various JSON-formatted malloc_stats_print() bugs. This functionality > was first released in 4.3.0. (@jasone) > > Modified: head/contrib/jemalloc/FREEBSD-Xlist > ============================================================================== > --- head/contrib/jemalloc/FREEBSD-Xlist Thu Jun 15 06:48:36 > 2017 (r319970) +++ head/contrib/jemalloc/FREEBSD-Xlist Thu Jun > 15 07:15:05 2017 (r319971) @@ -4,7 +4,7 @@ $FreeBSD$ > .git* > .travis.yml > FREEBSD-* > -INSTALL > +INSTALL.md > Makefile* > README > autogen.sh > @@ -13,23 +13,24 @@ bin/ > build-aux/ > config.* > configure* > -coverage.sh > doc/*.in > doc/*.xml > doc/*.xsl > doc/*.html > -include/jemalloc/internal/jemalloc_internal.h.in > +include/jemalloc/internal/atomic_msvc.h > include/jemalloc/internal/jemalloc_internal_defs.h.in > +include/jemalloc/internal/jemalloc_preamble.h.in > include/jemalloc/internal/private_namespace.sh > -include/jemalloc/internal/private_symbols.txt > -include/jemalloc/internal/private_unnamespace.h > -include/jemalloc/internal/private_unnamespace.sh > +include/jemalloc/internal/private_symbols_jet.awk > +include/jemalloc/internal/private_symbols.awk > +include/jemalloc/internal/private_symbols.sh > include/jemalloc/internal/public_namespace.sh > include/jemalloc/internal/public_symbols.txt > include/jemalloc/internal/public_unnamespace.h > include/jemalloc/internal/public_unnamespace.sh > include/jemalloc/internal/size_classes.sh > include/jemalloc/internal/smoothstep.sh > +include/jemalloc/internal/tsd_win.h > include/jemalloc/jemalloc.h.in > include/jemalloc/jemalloc.sh > include/jemalloc/jemalloc_defs.h > @@ -48,8 +49,10 @@ include/jemalloc/jemalloc_typedefs.h.in > include/msvc_compat/ > install-sh > jemalloc.pc* > +m4/ > msvc/ > +run_tests.sh > scripts/ > -src/valgrind.c > +src/jemalloc_cpp.cpp > src/zone.c > test/ > > Modified: head/contrib/jemalloc/FREEBSD-diffs > ============================================================================== > --- head/contrib/jemalloc/FREEBSD-diffs Thu Jun 15 06:48:36 > 2017 (r319970) +++ head/contrib/jemalloc/FREEBSD-diffs Thu Jun > 15 07:15:05 2017 (r319971) @@ -1,21 +1,19 @@ > diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in > -index c97ab0f..be8dda5 100644 > +index 21e401ac..f977c5f5 100644 > --- a/doc/jemalloc.xml.in > +++ b/doc/jemalloc.xml.in > -@@ -53,11 +53,23 @@ > +@@ -53,11 +53,21 @@ > This manual describes jemalloc @jemalloc_version@. More > information can be found at the url="http://jemalloc.net/">jemalloc website. > + > + The following configuration options are enabled in libc's built-in > + jemalloc: , > -+ , , > -+ , , > -+ , , and > -+ . Additionally, > -+ is enabled in development versions of > -+ FreeBSD (controlled by the MALLOC_PRODUCTION make > -+ variable). > ++ , , > ++ , and . > ++ Additionally, is enabled in development > ++ versions of FreeBSD (controlled by the > ++ MALLOC_PRODUCTION make variable). > + > > > @@ -27,7 +25,7 @@ index c97ab0f..be8dda5 100644 > > Standard API > > -@@ -2989,4 +3001,18 @@ malloc_conf = > "lg_chunk:24";]]> +@@ -3252,4 +3262,18 @@ malloc_conf > = "narenas:1";]]> The > posix_memalign() function conforms to IEEE Std > 1003.1-2001 (POSIX.1). > @@ -46,42 +44,42 @@ index c97ab0f..be8dda5 100644 > + 11.0. > + > > -diff --git a/include/jemalloc/internal/arena.h > b/include/jemalloc/internal/arena.h -index 119e3a5..277989f 100644 > ---- a/include/jemalloc/internal/arena.h > -+++ b/include/jemalloc/internal/arena.h > -@@ -731,8 +731,13 @@ arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t > pageind) > - JEMALLOC_ALWAYS_INLINE const arena_chunk_map_misc_t * > - arena_miscelm_get_const(const arena_chunk_t *chunk, size_t pageind) > - { > -+#if 1 /* Work around gcc bug. */ > -+ arena_chunk_t *mchunk = (arena_chunk_t *)chunk; > +diff --git a/include/jemalloc/internal/hooks.h > b/include/jemalloc/internal/hooks.h +index cd49afcb..85e2a991 100644 > +--- a/include/jemalloc/internal/hooks.h > ++++ b/include/jemalloc/internal/hooks.h > +@@ -6,13 +6,6 @@ extern JEMALLOC_EXPORT void (*hooks_libc_hook)(); > > -+ return (arena_miscelm_get_mutable(mchunk, pageind)); > -+#else > - return (arena_miscelm_get_mutable((arena_chunk_t *)chunk, pageind)); > -+#endif > - } > + #define JEMALLOC_HOOK(fn, hook) ((void)(hook != NULL && (hook(), 0)), fn) > > - JEMALLOC_ALWAYS_INLINE size_t > -@@ -791,8 +796,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t > pageind) > - JEMALLOC_ALWAYS_INLINE const size_t * > - arena_mapbitsp_get_const(const arena_chunk_t *chunk, size_t pageind) > - { > -+#if 1 /* Work around gcc bug. */ > -+ arena_chunk_t *mchunk = (arena_chunk_t *)chunk; > +-#define open JEMALLOC_HOOK(open, hooks_libc_hook) > +-#define read JEMALLOC_HOOK(read, hooks_libc_hook) > +-#define write JEMALLOC_HOOK(write, hooks_libc_hook) > +-#define readlink JEMALLOC_HOOK(readlink, hooks_libc_hook) > +-#define close JEMALLOC_HOOK(close, hooks_libc_hook) > +-#define creat JEMALLOC_HOOK(creat, hooks_libc_hook) > +-#define secure_getenv JEMALLOC_HOOK(secure_getenv, hooks_libc_hook) > + /* Note that this is undef'd and re-define'd in src/prof.c. */ > + #define _Unwind_Backtrace JEMALLOC_HOOK(_Unwind_Backtrace, hooks_libc_hook) > > -+ return (arena_mapbitsp_get_mutable(mchunk, pageind)); > -+#else > - return (arena_mapbitsp_get_mutable((arena_chunk_t *)chunk, > pageind)); -+#endif > - } > +diff --git a/include/jemalloc/internal/jemalloc_internal_decls.h > b/include/jemalloc/internal/jemalloc_internal_decls.h +index > 1efdb56b..12a7e5a8 100644 +--- > a/include/jemalloc/internal/jemalloc_internal_decls.h ++++ > b/include/jemalloc/internal/jemalloc_internal_decls.h +@@ -1,6 +1,9 @@ > + #ifndef JEMALLOC_INTERNAL_DECLS_H > + #define JEMALLOC_INTERNAL_DECLS_H > > - JEMALLOC_ALWAYS_INLINE size_t > -diff --git a/include/jemalloc/internal/jemalloc_internal.h.in > b/include/jemalloc/internal/jemalloc_internal.h.in -index e3b499a..827fdbf > 100644 ---- a/include/jemalloc/internal/jemalloc_internal.h.in > -+++ b/include/jemalloc/internal/jemalloc_internal.h.in > ++#include "libc_private.h" > ++#include "namespace.h" > ++ > + #include > + #ifdef _WIN32 > + # include > +diff --git a/include/jemalloc/internal/jemalloc_preamble.h.in > b/include/jemalloc/internal/jemalloc_preamble.h.in +index 18539a09..c8af8683 > 100644 +--- a/include/jemalloc/internal/jemalloc_preamble.h.in > ++++ b/include/jemalloc/internal/jemalloc_preamble.h.in > @@ -8,6 +8,9 @@ > #include > #endif > @@ -89,10 +87,10 @@ index e3b499a..827fdbf 100644 > +#include "un-namespace.h" > +#include "libc_private.h" > + > - #define JEMALLOC_NO_DEMANGLE > + #define JEMALLOC_NO_DEMANGLE > #ifdef JEMALLOC_JET > - # define JEMALLOC_N(n) jet_##n > -@@ -42,13 +45,7 @@ static const bool config_fill = > + # undef JEMALLOC_IS_MALLOC > +@@ -68,13 +71,7 @@ static const bool config_fill = > false > #endif > ; > @@ -107,25 +105,11 @@ index e3b499a..827fdbf 100644 > static const char * const config_malloc_conf = JEMALLOC_CONFIG_MALLOC_CONF; > static const bool config_prof = > #ifdef JEMALLOC_PROF > -diff --git a/include/jemalloc/internal/jemalloc_internal_decls.h > b/include/jemalloc/internal/jemalloc_internal_decls.h -index c907d91..4626632 > 100644 ---- a/include/jemalloc/internal/jemalloc_internal_decls.h > -+++ b/include/jemalloc/internal/jemalloc_internal_decls.h > -@@ -1,6 +1,9 @@ > - #ifndef JEMALLOC_INTERNAL_DECLS_H > - #define JEMALLOC_INTERNAL_DECLS_H > - > -+#include "libc_private.h" > -+#include "namespace.h" > -+ > - #include > - #ifdef _WIN32 > - # include > diff --git a/include/jemalloc/internal/mutex.h > b/include/jemalloc/internal/mutex.h -index 2b4b1c3..e03a6d0 100644 > +index 6520c251..0013cbe9 100644 > --- a/include/jemalloc/internal/mutex.h > +++ b/include/jemalloc/internal/mutex.h > -@@ -57,9 +57,6 @@ struct malloc_mutex_s { > +@@ -121,9 +121,6 @@ struct malloc_mutex_s { > > #ifdef JEMALLOC_LAZY_LOCK > extern bool isthreaded; > @@ -134,33 +118,21 @@ index 2b4b1c3..e03a6d0 100644 > -# define isthreaded true > #endif > > - bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, > -@@ -67,6 +64,7 @@ bool malloc_mutex_init(malloc_mutex_t *mutex, const > char *name, > - void malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex); > - void malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t > *mutex); > - void malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t > *mutex); -+bool malloc_mutex_first_thread(void); > - bool malloc_mutex_boot(void); > + bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, > +@@ -131,6 +128,7 @@ bool malloc_mutex_init(malloc_mutex_t *mutex, const char > *name, > + void malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex); > + void malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t *mutex); > + void malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex); > ++bool malloc_mutex_first_thread(void); > + bool malloc_mutex_boot(void); > + void malloc_mutex_prof_data_reset(tsdn_t *tsdn, malloc_mutex_t *mutex); > > - #endif /* JEMALLOC_H_EXTERNS */ > -diff --git a/include/jemalloc/internal/private_symbols.txt > b/include/jemalloc/internal/private_symbols.txt -index 60b57e5..056a8fe 100644 > ---- a/include/jemalloc/internal/private_symbols.txt > -+++ b/include/jemalloc/internal/private_symbols.txt > -@@ -312,7 +312,6 @@ iralloct_realign > - isalloc > - isdalloct > - isqalloc > --isthreaded > - ivsalloc > - ixalloc > - jemalloc_postfork_child > diff --git a/include/jemalloc/jemalloc_FreeBSD.h > b/include/jemalloc/jemalloc_FreeBSD.h new file mode 100644 > -index 0000000..c58a8f3 > +index 00000000..355b565c > --- /dev/null > +++ b/include/jemalloc/jemalloc_FreeBSD.h > -@@ -0,0 +1,162 @@ > +@@ -0,0 +1,185 @@ > +/* > + * Override settings that were generated in jemalloc_defs.h as necessary. > + */ > @@ -173,51 +145,65 @@ index 0000000..c58a8f3 > + > +#undef JEMALLOC_DSS > + > ++#undef JEMALLOC_BACKGROUND_THREAD > ++ > +/* > + * The following are architecture-dependent, so conditionally define them > for > + * each supported architecture. > + */ > +#undef JEMALLOC_TLS_MODEL > +#undef STATIC_PAGE_SHIFT > ++#undef LG_VADDR > +#undef LG_SIZEOF_PTR > +#undef LG_SIZEOF_INT > +#undef LG_SIZEOF_LONG > +#undef LG_SIZEOF_INTMAX_T > + > +#ifdef __i386__ > ++# define LG_VADDR 32 > +# define LG_SIZEOF_PTR 2 > +# define JEMALLOC_TLS_MODEL > __attribute__((tls_model("initial-exec"))) +#endif > +#ifdef __ia64__ > ++# define LG_VADDR 64 > +# define LG_SIZEOF_PTR 3 > +#endif > +#ifdef __sparc64__ > ++# define LG_VADDR 64 > +# define LG_SIZEOF_PTR 3 > +# define JEMALLOC_TLS_MODEL > __attribute__((tls_model("initial-exec"))) +#endif > +#ifdef __amd64__ > ++# define LG_VADDR 48 > +# define LG_SIZEOF_PTR 3 > +# define JEMALLOC_TLS_MODEL > __attribute__((tls_model("initial-exec"))) +#endif > +#ifdef __arm__ > ++# define LG_VADDR 32 > +# define LG_SIZEOF_PTR 2 > +#endif > +#ifdef __aarch64__ > ++# define LG_VADDR 48 > +# define LG_SIZEOF_PTR 3 > +#endif > +#ifdef __mips__ > +#ifdef __mips_n64 > ++# define LG_VADDR 64 > +# define LG_SIZEOF_PTR 3 > +#else > ++# define LG_VADDR 32 > +# define LG_SIZEOF_PTR 2 > +#endif > +#endif > +#ifdef __powerpc64__ > ++# define LG_VADDR 64 > +# define LG_SIZEOF_PTR 3 > +#elif defined(__powerpc__) > ++# define LG_VADDR 32 > +# define LG_SIZEOF_PTR 2 > +#endif > +#ifdef __riscv__ > ++# define LG_VADDR 64 > +# define LG_SIZEOF_PTR 3 > +#endif > + > @@ -291,8 +277,17 @@ index 0000000..c58a8f3 > +#define read _read > +#define write _write > +#define close _close > ++#define pthread_join _pthread_join > ++#define pthread_once _pthread_once > ++#define pthread_self _pthread_self > ++#define pthread_equal _pthread_equal > +#define pthread_mutex_lock _pthread_mutex_lock > ++#define pthread_mutex_trylock _pthread_mutex_trylock > +#define pthread_mutex_unlock _pthread_mutex_unlock > ++#define pthread_cond_init _pthread_cond_init > ++#define pthread_cond_wait _pthread_cond_wait > ++#define pthread_cond_timedwait _pthread_cond_timedwait > ++#define pthread_cond_signal _pthread_cond_signal > + > +#ifdef JEMALLOC_C_ > +/* > @@ -324,7 +319,7 @@ index 0000000..c58a8f3 > +__weak_reference(__nallocm, nallocm); > +#endif > diff --git a/include/jemalloc/jemalloc_rename.sh > b/include/jemalloc/jemalloc_rename.sh -index f943891..47d032c 100755 > +index f9438912..47d032c1 100755 > --- a/include/jemalloc/jemalloc_rename.sh > +++ b/include/jemalloc/jemalloc_rename.sh > @@ -19,4 +19,6 @@ done > @@ -335,10 +330,10 @@ index f943891..47d032c 100755 > +#include "jemalloc_FreeBSD.h" > EOF > diff --git a/src/jemalloc.c b/src/jemalloc.c > -index f73a26c..fcfe204 100644 > +index 52c86aa6..868c9e86 100644 > --- a/src/jemalloc.c > +++ b/src/jemalloc.c > -@@ -4,6 +4,10 @@ > +@@ -20,6 +20,10 @@ > /******************************************************************************/ > /* Data. */ > > @@ -349,7 +344,7 @@ index f73a26c..fcfe204 100644 > /* Runtime configuration options. */ > const char *je_malloc_conf > #ifndef _WIN32 > -@@ -2781,6 +2785,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST > void *ptr) +@@ -2981,6 +2985,103 @@ > je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) { */ > /******************************************************************************/ > /* > @@ -366,78 +361,74 @@ index f73a26c..fcfe204 100644 > +#define ALLOCM_ERR_NOT_MOVED 2 > + > +int > -+je_allocm(void **ptr, size_t *rsize, size_t size, int flags) > -+{ > -+ void *p; > -+ > ++je_allocm(void **ptr, size_t *rsize, size_t size, int flags) { > + assert(ptr != NULL); > + > -+ p = je_mallocx(size, flags); > -+ if (p == NULL) > ++ void *p = je_mallocx(size, flags); > ++ if (p == NULL) { > + return (ALLOCM_ERR_OOM); > -+ if (rsize != NULL) > -+ *rsize = isalloc(tsdn_fetch(), p, config_prof); > ++ } > ++ if (rsize != NULL) { > ++ *rsize = isalloc(tsdn_fetch(), p); > ++ } > + *ptr = p; > -+ return (ALLOCM_SUCCESS); > ++ return ALLOCM_SUCCESS; > +} > + > +int > -+je_rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, int flags) > -+{ > -+ int ret; > -+ bool no_move = flags & ALLOCM_NO_MOVE; > -+ > ++je_rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, int flags) > { > + assert(ptr != NULL); > + assert(*ptr != NULL); > + assert(size != 0); > + assert(SIZE_T_MAX - size >= extra); > + > ++ int ret; > ++ bool no_move = flags & ALLOCM_NO_MOVE; > ++ > + if (no_move) { > + size_t usize = je_xallocx(*ptr, size, extra, flags); > + ret = (usize >= size) ? ALLOCM_SUCCESS : > ALLOCM_ERR_NOT_MOVED; -+ if (rsize != NULL) > ++ if (rsize != NULL) { > + *rsize = usize; > ++ } > + } else { > + void *p = je_rallocx(*ptr, size+extra, flags); > + if (p != NULL) { > + *ptr = p; > + ret = ALLOCM_SUCCESS; > -+ } else > ++ } else { > + ret = ALLOCM_ERR_OOM; > -+ if (rsize != NULL) > -+ *rsize = isalloc(tsdn_fetch(), *ptr, config_prof); > ++ } > ++ if (rsize != NULL) { > ++ *rsize = isalloc(tsdn_fetch(), *ptr); > ++ } > + } > -+ return (ret); > ++ return ret; > +} > + > +int > -+je_sallocm(const void *ptr, size_t *rsize, int flags) > -+{ > -+ > ++je_sallocm(const void *ptr, size_t *rsize, int flags) { > + assert(rsize != NULL); > + *rsize = je_sallocx(ptr, flags); > -+ return (ALLOCM_SUCCESS); > ++ return ALLOCM_SUCCESS; > +} > + > +int > -+je_dallocm(void *ptr, int flags) > -+{ > -+ > ++je_dallocm(void *ptr, int flags) { > + je_dallocx(ptr, flags); > -+ return (ALLOCM_SUCCESS); > ++ return ALLOCM_SUCCESS; > +} > + > +int > -+je_nallocm(size_t *rsize, size_t size, int flags) > -+{ > -+ size_t usize; > -+ > -+ usize = je_nallocx(size, flags); > -+ if (usize == 0) > -+ return (ALLOCM_ERR_OOM); > -+ if (rsize != NULL) > ++je_nallocm(size_t *rsize, size_t size, int flags) { > ++ size_t usize = je_nallocx(size, flags); > ++ if (usize == 0) { > ++ return ALLOCM_ERR_OOM; > ++ } > ++ if (rsize != NULL) { > + *rsize = usize; > -+ return (ALLOCM_SUCCESS); > ++ } > ++ return ALLOCM_SUCCESS; > +} > + > +#undef ALLOCM_LG_ALIGN > @@ -457,7 +448,7 @@ index f73a26c..fcfe204 100644 > * The following functions are used by threading libraries for protection of > * malloc during fork(). > */ > -@@ -2922,4 +3027,11 @@ jemalloc_postfork_child(void) > +@@ -3141,4 +3242,11 @@ jemalloc_postfork_child(void) { > ctl_postfork_child(tsd_tsdn(tsd)); > } > > @@ -469,11 +460,36 @@ index f73a26c..fcfe204 100644 > +} > + > /******************************************************************************/ > +diff --git a/src/malloc_io.c b/src/malloc_io.c > +index 6b99afcd..4363cb83 100644 > +--- a/src/malloc_io.c > ++++ b/src/malloc_io.c > +@@ -88,6 +88,20 @@ wrtmessage(void *cbopaque, const char *s) { > + > + JEMALLOC_EXPORT void (*je_malloc_message)(void *, const char *s); > + > ++JEMALLOC_ATTR(visibility("hidden")) > ++void > ++wrtmessage_1_0(const char *s1, const char *s2, const char *s3, const char > *s4) { ++ > ++ wrtmessage(NULL, s1); > ++ wrtmessage(NULL, s2); > ++ wrtmessage(NULL, s3); > ++ wrtmessage(NULL, s4); > ++} > ++ > ++void (*__malloc_message_1_0)(const char *s1, const char *s2, const > char *s3, ++ const char *s4) = wrtmessage_1_0; > ++__sym_compat(_malloc_message, __malloc_message_1_0, FBSD_1.0); > ++ > + /* > + * Wrapper around malloc_message() that avoids the need for > + * je_malloc_message(...) throughout the code. > diff --git a/src/mutex.c b/src/mutex.c > -index 6333e73..13f8d79 100644 > +index a528ef0c..820af613 100644 > --- a/src/mutex.c > +++ b/src/mutex.c > -@@ -66,6 +66,17 @@ pthread_create(pthread_t *__restrict thread, > +@@ -40,6 +40,17 @@ pthread_create(pthread_t *__restrict thread, > #ifdef JEMALLOC_MUTEX_INIT_CB > JEMALLOC_EXPORT int _pthread_mutex_init_calloc_cb(pthread_mutex_t > *mutex, void *(calloc_cb)(size_t, size_t)); > @@ -490,55 +506,21 @@ index 6333e73..13f8d79 100644 > +} > #endif > > - bool > -@@ -142,7 +153,7 @@ malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t > *mutex) > + void > +@@ -130,6 +141,16 @@ mutex_addr_comp(const witness_t *witness1, void *mutex1, > } > > bool > --malloc_mutex_boot(void) > -+malloc_mutex_first_thread(void) > - { > - > - #ifdef JEMALLOC_MUTEX_INIT_CB > -@@ -156,3 +167,14 @@ malloc_mutex_boot(void) > - #endif > - return (false); > - } > ++malloc_mutex_first_thread(void) { > + > -+bool > -+malloc_mutex_boot(void) > -+{ > -+ > +#ifndef JEMALLOC_MUTEX_INIT_CB > + return (malloc_mutex_first_thread()); > +#else > + return (false); > +#endif > +} > -diff --git a/src/util.c b/src/util.c > -index dd8c236..a4ff287 100644 > ---- a/src/util.c > -+++ b/src/util.c > -@@ -67,6 +67,22 @@ wrtmessage(void *cbopaque, const char *s) > - > - JEMALLOC_EXPORT void (*je_malloc_message)(void *, const char *s); > - > -+JEMALLOC_ATTR(visibility("hidden")) > -+void > -+wrtmessage_1_0(const char *s1, const char *s2, const char *s3, > -+ const char *s4) > -+{ > + > -+ wrtmessage(NULL, s1); > -+ wrtmessage(NULL, s2); > -+ wrtmessage(NULL, s3); > -+ wrtmessage(NULL, s4); > -+} > -+ > -+void (*__malloc_message_1_0)(const char *s1, const char *s2, const > char *s3, -+ const char *s4) = wrtmessage_1_0; > -+__sym_compat(_malloc_message, __malloc_message_1_0, FBSD_1.0); > -+ > - /* > - * Wrapper around malloc_message() that avoids the need for > - * je_malloc_message(...) throughout the code. > ++bool > + malloc_mutex_init(malloc_mutex_t *mutex, const char *name, > + witness_rank_t rank, malloc_mutex_lock_order_t lock_order) { > + mutex_prof_data_init(&mutex->prof_data); > > Modified: head/contrib/jemalloc/FREEBSD-upgrade > ============================================================================== > --- head/contrib/jemalloc/FREEBSD-upgrade Thu Jun 15 06:48:36 > 2017 (r319970) +++ head/contrib/jemalloc/FREEBSD-upgrade Thu > Jun 15 07:15:05 2017 (r319971) @@ -22,19 +22,19 @@ > # > # Extract latest jemalloc release. > # > -# ./FREEBSD-upgrade extract > +# ./FREEBSD-upgrade extract > # > # Fix patch conflicts as necessary, then regenerate diffs to update line > # offsets: > # > # ./FREEBSD-upgrade rediff > -# ./FREEBSD-upgrade extract > +# ./FREEBSD-upgrade extract > # > # Do multiple buildworld/installworld rounds. If problems arise and patches > # are needed, edit the code in ${work} as necessary, then: > # > # ./FREEBSD-upgrade rediff > -# ./FREEBSD-upgrade extract > +# ./FREEBSD-upgrade extract > # > # The rediff/extract order is important because rediff saves the local > # changes, then extract blows away the work tree and re-creates it with the > @@ -45,43 +45,98 @@ > # ./FREEBSD-upgrade clean > > set -e > +set -x > > if [ ! -x "FREEBSD-upgrade" ] ; then > echo "Run from within src/contrib/jemalloc/" >&2 > exit 1 > fi > > +if [ "x${JEMALLOC_REPO}" = "x" ] ; then > + JEMALLOC_REPO=https://github.com/jemalloc/jemalloc.git > +fi > + > src=`pwd` > -workname="jemalloc.git" > -work="${src}/../${workname}" # merge-changes expects ${workname} in "..". > + > +jemalloc_tmp="jemalloc.tmp" > +tmpdir="${src}/../${jemalloc_tmp}" > +bare_repo="${tmpdir}/jemalloc_bare.git" > +work="jemalloc_work.git" > +work_repo="${tmpdir}/${work}" > +namespace_repo="${tmpdir}/jemalloc_namespace.git" > changes="${src}/FREEBSD-changes" > > -do_extract() { > +do_fetch() { > local rev=$1 > - # Clone. > - rm -rf ${work} > - git clone https://github.com/jemalloc/jemalloc.git ${work} > + if [ ! -d "${bare_repo}" ] ; then > + mkdir -p "${bare_repo}" > + git clone --bare ${JEMALLOC_REPO} ${bare_repo} > + fi > ( > - cd ${work} > + cd ${bare_repo} > + git fetch origin ${rev} > + ) > +} > + > +do_extract_helper() { > + local rev=$1 > + local repo=$2 > + do_fetch ${rev} > + rm -rf ${repo} > + git clone ${bare_repo} ${repo} > + ( > + cd ${repo} > if [ "x${rev}" != "x" ] ; then > # Use optional rev argument to check out a revision other than HEAD on > # master. > git checkout ${rev} > fi > + ) > +} > + > +do_autogen() { > + ./autogen.sh --enable-xmalloc --enable-utrace \ > + --with-xslroot=/usr/local/share/xsl/docbook --with-private-namespace=__ \ > + --with-lg-page-sizes=12,13,14,16 > +} > + > +do_extract_diff() { > + local rev=$1 > + local repo=$2 > + do_extract_helper ${rev} ${repo} > + ( > + cd ${repo} > # Apply diffs before generating files. > patch -p1 < "${src}/FREEBSD-diffs" > find . -name '*.orig' -delete > - # Generate various files. > - ./autogen.sh --enable-cc-silence --enable-xmalloc --enable-utrace \ > - --with-xslroot=/usr/local/share/xsl/docbook > --with-private-namespace=__ \ > - --with-lg-page-sizes=12,13,14,16 > + # Generate files. > + do_autogen > gmake dist > ) > } > > +do_extract_namespace() { > + local rev=$1 > + local repo=$2 > + do_extract_helper ${rev} ${repo} > + ( > + cd ${repo} > + # Generate files. > + do_autogen > + gmake include/jemalloc/internal/private_namespace.h > + ) > +} > + > +do_extract() { > + local rev=$1 > + do_fetch ${rev} > + do_extract_diff ${rev} ${work_repo} > + do_extract_namespace ${rev} ${namespace_repo} > +} > + > do_diff() { > ( > - cd ${work} > + cd ${work_repo} > find . -name '*.orig' -delete > find . -name '*.rej' -delete > git add -A > @@ -98,12 +153,12 @@ case "${command}" in > do_extract ${rev} > # Compute local differences to the upstream+patches and apply them. > ( > - cd .. > - diff -ru -X ${src}/FREEBSD-Xlist ${workname} jemalloc > ${changes} || > true > + cd ${tmpdir} > + diff -ru -X ${src}/FREEBSD-Xlist ${work} ../jemalloc > ${changes} || > true ) > ( > - cd ${work} > - patch -p1 < ${changes} > + cd ${work_repo} > + patch -p1 < ${changes} || true > find . -name '*.orig' -delete > ) > # Update diff. > @@ -115,13 +170,17 @@ case "${command}" in > # Delete existing files so that cruft doesn't silently remain. > rm -rf ChangeLog COPYING VERSION doc include src > # Copy files over. > - tar cf - -C ${work} -X FREEBSD-Xlist . |tar xvf - > + tar cf - -C ${work_repo} -X FREEBSD-Xlist . |tar xvf - > + internal_dir="include/jemalloc/internal" > + grep -v ' isthreaded ' \ > + "${namespace_repo}/${internal_dir}/private_namespace.h" \ > + > "${internal_dir}/private_namespace.h" > ;; > rediff) # Regenerate diffs based on working tree. > do_diff > ;; > clean) # Remove working tree and temporary files. > - rm -rf ${work} ${changes} > + rm -rf ${tmpdir} ${changes} > ;; > *) > echo "Unsupported command: \"${command}\"" >&2 > > Modified: head/contrib/jemalloc/VERSION > ============================================================================== > --- head/contrib/jemalloc/VERSION Thu Jun 15 06:48:36 2017 > (r319970) +++ head/contrib/jemalloc/VERSION Thu Jun 15 07:15:05 > 2017 (r319971) @@ -1 +1 @@ > -4.5.0-0-g04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5 > +5.0.0-4-g84f6c2cae0fb1399377ef6aea9368444c4987cc6 > > Modified: head/contrib/jemalloc/doc/jemalloc.3 > ============================================================================== > --- head/contrib/jemalloc/doc/jemalloc.3 Thu Jun 15 06:48:36 > 2017 (r319970) +++ head/contrib/jemalloc/doc/jemalloc.3 Thu Jun > 15 07:15:05 2017 (r319971) > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" On all hosts (running CURRENT: FreeBSD 12.0-CURRENT #15 r319965: Thu Jun 15 05:56:12 CEST 2017 amd64 AND FreeBSD 12.0-CURRENT #20 r319934: Wed Jun 14 06:18:46 CEST 2017 amd64) buildworld fails on [...] Building /usr/obj/usr/src/lib/libgcc_s/_libinstall --- secure/lib/libcrypto__L --- --- all_subdir_secure/lib/libcrypto/engines/libaep --- /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [libaep.so] Error code 1 make[6]: stopped in /usr/src/secure/lib/libcrypto/engines/libaep .ERROR_TARGET='libaep.so' From owner-svn-src-all@freebsd.org Thu Jun 15 10:22:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77D43D86DCF; Thu, 15 Jun 2017 10:22:23 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 519A870555; Thu, 15 Jun 2017 10:22:22 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 3A069D00B4F; Thu, 15 Jun 2017 06:22:16 -0400 (EDT) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id v5FAMEd1031702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 15 Jun 2017 12:22:14 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id v5FAME0x031701; Thu, 15 Jun 2017 12:22:14 +0200 (CEST) (envelope-from pho) Date: Thu, 15 Jun 2017 12:22:14 +0200 From: Peter Holm To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319921 - head/sys/net Message-ID: <20170615102214.GA31323@x2.osted.lan> References: <201706132316.v5DNGdF2042725@repo.freebsd.org> <20170614091758.GA86374@x2.osted.lan> <20170614144623.GA96234@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 10:22:23 -0000 On Wed, Jun 14, 2017 at 09:21:30AM -0600, Sean Bruno wrote: > > > On 06/14/17 08:46, Peter Holm wrote: > > On Wed, Jun 14, 2017 at 08:38:36AM -0600, Sean Bruno wrote: > >> > >> > >> On 06/14/17 03:17, Peter Holm wrote: > >>> On Tue, Jun 13, 2017 at 11:16:39PM +0000, Sean Bruno wrote: > >>>> Author: sbruno > >>>> Date: Tue Jun 13 23:16:38 2017 > >>>> New Revision: 319921 > >>>> URL: https://svnweb.freebsd.org/changeset/base/319921 > >>>> > >>>> Log: > >>>> Add new sysctl to allow changing of timing of the txq timers. > >>>> > >>>> Add new sysctl to override use of busdma in the driver. > >>>> > >>>> Submitted by: Drew Gallitin > >>>> > >>>> Modified: > >>>> head/sys/net/iflib.c > >>>> > >>>> Modified: head/sys/net/iflib.c > >>>> ============================================================================== > >>>> --- head/sys/net/iflib.c Tue Jun 13 22:57:57 2017 (r319920) I fried up some test hardware and have some more info for you. Here's a test triggered by a NFS test scenario: https://people.freebsd.org/~pho/stress/log/sbruno002.txt I have uploaded the kernel + core to: https://people.freebsd.org/~pho/kernel+vmcore.519-t2.txz Regards, - Peter From owner-svn-src-all@freebsd.org Thu Jun 15 11:56:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98140D889B9; Thu, 15 Jun 2017 11:56:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6306172B72; Thu, 15 Jun 2017 11:56:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FBue2I046434; Thu, 15 Jun 2017 11:56:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FBuexY046433; Thu, 15 Jun 2017 11:56:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201706151156.v5FBuexY046433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Jun 2017 11:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319972 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 11:56:41 -0000 Author: hselasky Date: Thu Jun 15 11:56:40 2017 New Revision: 319972 URL: https://svnweb.freebsd.org/changeset/base/319972 Log: Use static device numbering instead of dynamic one when creating mlx4en network interfaces. This prevents infinite unit number growth typically when the mlx4en driver is used inside virtual machines which support runtime PCI attach and detach. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Thu Jun 15 07:15:05 2017 (r319971) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Thu Jun 15 11:56:40 2017 (r319972) @@ -54,7 +54,6 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv); static void mlx4_en_sysctl_conf(struct mlx4_en_priv *priv); -static int mlx4_en_unit; #ifdef CONFIG_NET_RX_BUSY_POLL /* must be called with local_bh_disable()d */ @@ -2052,7 +2051,8 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int return -ENOMEM; } dev->if_softc = priv; - if_initname(dev, "mlxen", atomic_fetchadd_int(&mlx4_en_unit, 1)); + if_initname(dev, "mlxen", (device_get_unit( + mdev->pdev->dev.bsddev) * MLX4_MAX_PORTS) + port - 1); dev->if_mtu = ETHERMTU; dev->if_init = mlx4_en_open; dev->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; From owner-svn-src-all@freebsd.org Thu Jun 15 13:15:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5459FD8A44C; Thu, 15 Jun 2017 13:15:14 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCC1175149; Thu, 15 Jun 2017 13:15:13 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id v5FDFAkW082127; Thu, 15 Jun 2017 15:15:10 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 5E679122; Thu, 15 Jun 2017 15:15:10 +0200 (CEST) Message-ID: <59428851.8040900@omnilan.de> Date: Thu, 15 Jun 2017 15:14:57 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Luiz Otavio O Souza CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319881 - head/sys/dev/netmap References: <201706122253.v5CMrJBB038568@repo.freebsd.org> In-Reply-To: <201706122253.v5CMrJBB038568@repo.freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Greylist: ACL 129 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Thu, 15 Jun 2017 15:15:10 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 13:15:14 -0000 Bezüglich Luiz Otavio O Souza's Nachricht vom 13.06.2017 00:53 (localtime): > Author: loos > Date: Mon Jun 12 22:53:18 2017 > New Revision: 319881 > URL: https://svnweb.freebsd.org/changeset/base/319881 > > Log: > Update the current version of netmap to bring it in sync with the github > version. > > This commit contains mostly refactoring, a few fixes and minor added > functionality. > > Submitted by: Vincenzo Maffione > Requested by: many > Sponsored by: Rubicon Communications, LLC (Netgate) > > Modified: > head/sys/dev/netmap/if_ixl_netmap.h > head/sys/dev/netmap/netmap.c > head/sys/dev/netmap/netmap_freebsd.c Here's a interfering change which reverts r313982 for sys/dev/netmap/netmap_freebsd.c: @@ -2143,7 +2146,7 @@ if (ptnmd->ptn_dev) { nm_os_pt_memdev_iounmap(ptnmd->ptn_dev); } - ptnmd->nm_addr = NULL; + ptnmd->nm_addr = 0; ptnmd->nm_paddr = 0; } } … > head/sys/dev/netmap/netmap_mem2.c Also in sys/dev/netmap/netmap_mem2.c r313982 was reverted: @@ -648,7 +671,7 @@ &rid, 0, ~0, *mem_size, RF_ACTIVE); if (ptn_dev->pci_mem == NULL) { *nm_paddr = 0; - *nm_addr = NULL; + *nm_addr = 0; return ENOMEM; } Don't know about the impact of https://svnweb.freebsd.org/base?view=revision&revision=313982 and whether this partial 0/NULL replacement makes sence in sys/dev/netmap/netmap_mem2.c and sys/dev/netmap/netmap_freebsd.c. Just wanted to report and ask for review. Thanks, -harry From owner-svn-src-all@freebsd.org Thu Jun 15 13:24:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B87DD8A722; Thu, 15 Jun 2017 13:24:50 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A78F7562F; Thu, 15 Jun 2017 13:24:49 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id v5FDOmt6082192; Thu, 15 Jun 2017 15:24:48 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 02FF4126; Thu, 15 Jun 2017 15:24:47 +0200 (CEST) Message-ID: <59428A93.4020200@omnilan.de> Date: Thu, 15 Jun 2017 15:24:35 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Luiz Otavio O Souza CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319881 - head/sys/dev/netmap References: <201706122253.v5CMrJBB038568@repo.freebsd.org> <59428851.8040900@omnilan.de> In-Reply-To: <59428851.8040900@omnilan.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Thu, 15 Jun 2017 15:24:48 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 13:24:50 -0000 Bezüglich Harry Schmalzbauer's Nachricht vom 15.06.2017 15:14 (localtime): > Bezüglich Luiz Otavio O Souza's Nachricht vom 13.06.2017 00:53 > (localtime): >> Author: loos >> Date: Mon Jun 12 22:53:18 2017 >> New Revision: 319881 >> URL: https://svnweb.freebsd.org/changeset/base/319881 >> >> Log: >> Update the current version of netmap to bring it in sync with the github >> version. >> >> This commit contains mostly refactoring, a few fixes and minor added >> functionality. >> >> Submitted by: Vincenzo Maffione >> Requested by: many >> Sponsored by: Rubicon Communications, LLC (Netgate) >> >> Modified: >> head/sys/dev/netmap/if_ixl_netmap.h >> head/sys/dev/netmap/netmap.c >> head/sys/dev/netmap/netmap_freebsd.c > Here's a interfering change which > reverts r313982 for sys/dev/netmap/netmap_freebsd.c: > > @@ -2143,7 +2146,7 @@ > if (ptnmd->ptn_dev) { > nm_os_pt_memdev_iounmap(ptnmd->ptn_dev); > } > - ptnmd->nm_addr = NULL; > + ptnmd->nm_addr = 0; > ptnmd->nm_paddr = 0; > } > } > > … >> head/sys/dev/netmap/netmap_mem2.c > Also in sys/dev/netmap/netmap_mem2.c > r313982 was reverted: > > @@ -648,7 +671,7 @@ > &rid, 0, ~0, *mem_size, RF_ACTIVE); > if (ptn_dev->pci_mem == NULL) { > *nm_paddr = 0; > - *nm_addr = NULL; > + *nm_addr = 0; > return ENOMEM; > } > Urghs, pasted the hunks wrong! The latter is in sys/dev/netmap/netmap_freebsd.c and the former belongs to sys/dev/netmap/netmap_mem2.c. Sorry for the consfusion! -harry From owner-svn-src-all@freebsd.org Thu Jun 15 14:15:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F538D8B43F; Thu, 15 Jun 2017 14:15:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B785C76AB3; Thu, 15 Jun 2017 14:15:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v5FEFfF5093186 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 15 Jun 2017 17:15:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v5FEFfF5093186 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v5FEFfcD093185; Thu, 15 Jun 2017 17:15:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 15 Jun 2017 17:15:41 +0300 From: Konstantin Belousov To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319874 - head/sys/kern Message-ID: <20170615141540.GT2088@kib.kiev.ua> References: <201706122111.v5CLBBUT092606@repo.freebsd.org> <20170612234356.GD50023@FreeBSD.org> <20170613120643.GX2088@kib.kiev.ua> <20170615050400.GP50023@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170615050400.GP50023@FreeBSD.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 14:15:47 -0000 On Wed, Jun 14, 2017 at 10:04:00PM -0700, Gleb Smirnoff wrote: > On Tue, Jun 13, 2017 at 03:06:43PM +0300, Konstantin Belousov wrote: > K> On Mon, Jun 12, 2017 at 04:43:56PM -0700, Gleb Smirnoff wrote: > K> > On Mon, Jun 12, 2017 at 09:11:11PM +0000, Konstantin Belousov wrote: > K> > K> Author: kib > K> > K> Date: Mon Jun 12 21:11:11 2017 > K> > K> New Revision: 319874 > K> > K> URL: https://svnweb.freebsd.org/changeset/base/319874 > K> > K> > K> > K> Log: > K> > K> Print unimplemented syscall number to the ctty on SIGSYS, if enabled > K> > K> by the knob kern.lognosys. > K> > > K> > Why is it off by default? > K> In some (non-default) situation it may cause lot of ctty output. > K> I made the knob tunable to allow it to be set very early (init) > K> if needed. > > I remember myself being a beginner UNIX user, and all this > "bad system call, core dumped" messages were so annoyingly > uninformative for me, and I had no idea how to track to the > actual problem. This feature gives a lot of clue for a beginner > user, but having it default to off, devaluates its value. > > To avoid possible tty spam for an application that produces ton > of bad syscalls, but ignores SIGSYS, we can enable the feature > for those processes, who doesn't ignore SIGSYS. I am curious how would you define the process or thread state which ignores SIGSYS. The signal can be ignored or blocked in the signal mask, or catched. All these dispositions cause controlling terminal spam. Also, I do no see a good solution for rate-limiting the message. I argue that rate-limiting must be per-process or even per-thread and not system global, but I do not want to add even an int field to struct thread for this. From owner-svn-src-all@freebsd.org Thu Jun 15 14:17:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC2FDD8B4E7; Thu, 15 Jun 2017 14:17:55 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF0A276C28; Thu, 15 Jun 2017 14:17:55 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1dLVak-0005Gs-RK; Thu, 15 Jun 2017 16:17:47 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Justin Hibbits" , "Bryan Drewery" Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Subject: Re: svn commit: r319897 - head/usr.bin/yes References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> <59cc8b64-0cba-70c7-68c8-53f48a3c1471@FreeBSD.org> Date: Thu, 15 Jun 2017 16:17:46 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <59cc8b64-0cba-70c7-68c8-53f48a3c1471@FreeBSD.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: f0eed3f1d89bc5fb772880ef8d54351a X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 14:17:56 -0000 On Wed, 14 Jun 2017 16:27:52 +0200, Bryan Drewery wrote: > On 6/14/2017 7:26 AM, Justin Hibbits wrote: >> On Wed, Jun 14, 2017 at 9:19 AM, Bryan Drewery >> wrote: >>> On 6/13/2017 5:35 AM, Pietro Cerutti wrote: >>>> Author: gahr (ports committer) >>>> Date: Tue Jun 13 12:35:01 2017 >>>> New Revision: 319897 >>>> URL: https://svnweb.freebsd.org/changeset/base/319897 >>>> >>>> Log: >>>> Improve yes' throughput >>>> >>>> On my system, this brings up the throughput from ~20 to ~600 MiB/s. >>>> >>>> Inspired by: >>>> https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/ >>>> >>>> Reviewed by: cognet >>>> Approved by: cognet >>>> >>>> Modified: >>>> head/usr.bin/yes/yes.c >>> >>> >>> While here we should add libxo support. >>> >>> -- >>> Regards, >>> Bryan Drewery >>> >> >> I think before we add libxo, we need to capsicumize it. After all, it >> does accept arbitrary arguments. > > The code has become more complex. I think capsicum does make sense now > in case there is an unseen overflow in the new optimized code. > > It already has capsicum... https://svnweb.freebsd.org/base?view=revision&revision=308432 :-) From owner-svn-src-all@freebsd.org Thu Jun 15 14:34:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7D20D8B881; Thu, 15 Jun 2017 14:34:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3A2A773B0; Thu, 15 Jun 2017 14:34:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FEYXU2010826; Thu, 15 Jun 2017 14:34:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FEYXb7010825; Thu, 15 Jun 2017 14:34:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706151434.v5FEYXb7010825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 15 Jun 2017 14:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319975 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 14:34:34 -0000 Author: kib Date: Thu Jun 15 14:34:33 2017 New Revision: 319975 URL: https://svnweb.freebsd.org/changeset/base/319975 Log: Some minor improvements to vnode_pager_generic_putpages(). - Add asserts that the pages to write are dirty. The last page, if partially written, is only required to be dirty, while completely written pages should have all dirty bit set. - Use uintmax_t to print vm_page pindexes. - Use NULL instead of casted zero. - Remove if () test which duplicated the loop ending condition. - Miscellaneous style fixes. Reviewed by: alc, markj (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Thu Jun 15 12:47:48 2017 (r319974) +++ head/sys/vm/vnode_pager.c Thu Jun 15 14:34:33 2017 (r319975) @@ -1198,7 +1198,7 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page vm_ooffset_t poffset; struct uio auio; struct iovec aiov; - int count, error, i, maxsize, ncount, ppscheck; + int count, error, i, maxsize, ncount, pgoff, ppscheck; static struct timeval lastfail; static int curfail; @@ -1209,10 +1209,11 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page rtvals[i] = VM_PAGER_ERROR; if ((int64_t)ma[0]->pindex < 0) { - printf("vnode_pager_putpages: attempt to write meta-data!!! -- 0x%lx(%lx)\n", - (long)ma[0]->pindex, (u_long)ma[0]->dirty); + printf("vnode_pager_generic_putpages: " + "attempt to write meta-data 0x%jx(%lx)\n", + (uintmax_t)ma[0]->pindex, (u_long)ma[0]->dirty); rtvals[0] = VM_PAGER_BAD; - return VM_PAGER_BAD; + return (VM_PAGER_BAD); } maxsize = count * PAGE_SIZE; @@ -1235,8 +1236,6 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page VM_OBJECT_WLOCK(object); if (maxsize + poffset > object->un_pager.vnp.vnp_size) { if (object->un_pager.vnp.vnp_size > poffset) { - int pgoff; - maxsize = object->un_pager.vnp.vnp_size - poffset; ncount = btoc(maxsize); if ((pgoff = (int)maxsize & PAGE_MASK) != 0) { @@ -1250,6 +1249,7 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page vm_page_assert_sbusied(m); KASSERT(!pmap_page_is_write_mapped(m), ("vnode_pager_generic_putpages: page %p is not read-only", m)); + MPASS(m->dirty != 0); vm_page_clear_dirty(m, pgoff, PAGE_SIZE - pgoff); } @@ -1257,15 +1257,14 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page maxsize = 0; ncount = 0; } - if (ncount < count) { - for (i = ncount; i < count; i++) { - rtvals[i] = VM_PAGER_BAD; - } - } + for (i = ncount; i < count; i++) + rtvals[i] = VM_PAGER_BAD; } + for (i = 0; i < ncount - ((btoc(maxsize) & PAGE_MASK) != 0); i++) + MPASS(ma[i]->dirty == VM_PAGE_BITS_ALL); VM_OBJECT_WUNLOCK(object); - aiov.iov_base = (caddr_t) 0; + aiov.iov_base = NULL; aiov.iov_len = maxsize; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; @@ -1273,26 +1272,23 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page auio.uio_segflg = UIO_NOCOPY; auio.uio_rw = UIO_WRITE; auio.uio_resid = maxsize; - auio.uio_td = (struct thread *) 0; + auio.uio_td = NULL; error = VOP_WRITE(vp, &auio, vnode_pager_putpages_ioflags(flags), curthread->td_ucred); VM_CNT_INC(v_vnodeout); VM_CNT_ADD(v_vnodepgsout, ncount); ppscheck = 0; - if (error) { - if ((ppscheck = ppsratecheck(&lastfail, &curfail, 1))) - printf("vnode_pager_putpages: I/O error %d\n", error); - } - if (auio.uio_resid) { - if (ppscheck || ppsratecheck(&lastfail, &curfail, 1)) - printf("vnode_pager_putpages: residual I/O %zd at %lu\n", - auio.uio_resid, (u_long)ma[0]->pindex); - } - for (i = 0; i < ncount; i++) { + if (error != 0 && (ppscheck = ppsratecheck(&lastfail, &curfail, 1)) + != 0) + printf("vnode_pager_putpages: I/O error %d\n", error); + if (auio.uio_resid != 0 && (ppscheck != 0 || + ppsratecheck(&lastfail, &curfail, 1) != 0)) + printf("vnode_pager_putpages: residual I/O %zd at %ju\n", + auio.uio_resid, (uintmax_t)ma[0]->pindex); + for (i = 0; i < ncount; i++) rtvals[i] = VM_PAGER_OK; - } - return rtvals[0]; + return (rtvals[0]); } int From owner-svn-src-all@freebsd.org Thu Jun 15 15:08:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24A5FD8C337; Thu, 15 Jun 2017 15:08:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6EBE78333; Thu, 15 Jun 2017 15:08:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FF8t3P022936; Thu, 15 Jun 2017 15:08:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FF8tpI022935; Thu, 15 Jun 2017 15:08:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706151508.v5FF8tpI022935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 15 Jun 2017 15:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319976 - stable/11/tools/test/ptrace X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 15:08:56 -0000 Author: kib Date: Thu Jun 15 15:08:54 2017 New Revision: 319976 URL: https://svnweb.freebsd.org/changeset/base/319976 Log: MFC r319869: Decode recently added flags. Approved by: re (marius) Modified: stable/11/tools/test/ptrace/scescx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/test/ptrace/scescx.c ============================================================================== --- stable/11/tools/test/ptrace/scescx.c Thu Jun 15 14:34:33 2017 (r319975) +++ stable/11/tools/test/ptrace/scescx.c Thu Jun 15 15:08:54 2017 (r319976) @@ -97,6 +97,11 @@ decode_pl_flags(struct ptrace_lwpinfo *lwpinfo) { PL_FLAG_EXEC, "EXEC" }, { PL_FLAG_SI, "SI" }, { PL_FLAG_FORKED, "FORKED" }, + { PL_FLAG_CHILD, "CHILD" }, + { PL_FLAG_BORN, "LWPBORN" }, + { PL_FLAG_EXITED, "LWPEXITED" }, + { PL_FLAG_VFORKED, "VFORKED" }, + { PL_FLAG_VFORK_DONE, "VFORKDONE" }, }; char de[32]; unsigned first, flags, i; From owner-svn-src-all@freebsd.org Thu Jun 15 15:13:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7162D8C4F0; Thu, 15 Jun 2017 15:13:52 +0000 (UTC) (envelope-from jasone@canonware.com) Received: from canonware.com (canonware.com [204.109.63.53]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 927FF78719; Thu, 15 Jun 2017 15:13:52 +0000 (UTC) (envelope-from jasone@canonware.com) Received: from maple (unknown [208.67.62.115]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id C635328A29; Thu, 15 Jun 2017 08:04:58 -0700 (PDT) Date: Thu, 15 Jun 2017 08:04:57 -0700 From: Jason Evans To: "O. Hartmann" Cc: Jason Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc Message-Id: <20170615080457.3c1438e957f34fb8abd241d1@canonware.com> In-Reply-To: <20170615103157.43bf216e@freyja.zeit4.iv.bundesimmobilien.de> References: <201706150715.v5F7F6aT031218@repo.freebsd.org> <20170615103157.43bf216e@freyja.zeit4.iv.bundesimmobilien.de> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 15:13:52 -0000 On Thu, 15 Jun 2017 10:31:57 +0200 "O. Hartmann" wrote: > On Thu, 15 Jun 2017 07:15:06 +0000 (UTC) > Jason Evans wrote: > > > Author: jasone > > Date: Thu Jun 15 07:15:05 2017 > > New Revision: 319971 > > URL: https://svnweb.freebsd.org/changeset/base/319971 > > > > Log: > > Update jemalloc to 5.0.0. > > On all hosts (running CURRENT: FreeBSD 12.0-CURRENT #15 r319965: Thu Jun 15 > 05:56:12 CEST 2017 amd64 AND FreeBSD 12.0-CURRENT #20 r319934: Wed Jun 14 > 06:18:46 CEST 2017 amd64) > > buildworld fails on > > [...] > Building /usr/obj/usr/src/lib/libgcc_s/_libinstall > --- secure/lib/libcrypto__L --- > --- all_subdir_secure/lib/libcrypto/engines/libaep --- > /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s > /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s > cc: error: linker command failed with exit code 1 (use -v to see invocation) > *** [libaep.so] Error code 1 > > make[6]: stopped in /usr/src/secure/lib/libcrypto/engines/libaep > .ERROR_TARGET='libaep.so' I tested this commit based on r319490. I'm in the process of updating to r319971, and will see if the issue reproduces. Thanks, Jason From owner-svn-src-all@freebsd.org Thu Jun 15 15:24:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 439BCD8C72E; Thu, 15 Jun 2017 15:24:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1393A78C44; Thu, 15 Jun 2017 15:24:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FFOF7o031265; Thu, 15 Jun 2017 15:24:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FFOFpA031264; Thu, 15 Jun 2017 15:24:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201706151524.v5FFOFpA031264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 15 Jun 2017 15:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319977 - stable/11/usr.sbin/rpc.lockd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 15:24:16 -0000 Author: delphij Date: Thu Jun 15 15:24:15 2017 New Revision: 319977 URL: https://svnweb.freebsd.org/changeset/base/319977 Log: MFC r319852: Fix buffer lengths. After r319369, the RPC code validates caller supplied buffer length in taddr2uaddr. When no -h is specified, the sizeof(ai_addr) is used, which is always smaller than the required size and therefore uaddr would be NULL, causing the kernel to copyin() from userland NULL and fail with EFAULT. Approved by: re (kib) Modified: stable/11/usr.sbin/rpc.lockd/lockd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/rpc.lockd/lockd.c ============================================================================== --- stable/11/usr.sbin/rpc.lockd/lockd.c Thu Jun 15 15:08:54 2017 (r319976) +++ stable/11/usr.sbin/rpc.lockd/lockd.c Thu Jun 15 15:24:15 2017 (r319977) @@ -902,8 +902,7 @@ lookup_addresses(struct netconfig *nconf) sin->sin_port = htons(0); sin->sin_addr.s_addr = htonl(INADDR_ANY); res->ai_addr = (struct sockaddr*) sin; - res->ai_addrlen = (socklen_t) - sizeof(res->ai_addr); + res->ai_addrlen = sizeof(struct sockaddr_in); break; case AF_INET6: sin6 = malloc(sizeof(struct sockaddr_in6)); @@ -913,7 +912,7 @@ lookup_addresses(struct netconfig *nconf) sin6->sin6_port = htons(0); sin6->sin6_addr = in6addr_any; res->ai_addr = (struct sockaddr*) sin6; - res->ai_addrlen = (socklen_t) sizeof(res->ai_addr); + res->ai_addrlen = sizeof(struct sockaddr_in6); break; default: break; @@ -938,7 +937,7 @@ lookup_addresses(struct netconfig *nconf) } } - servaddr.len = servaddr.maxlen = res->ai_addr->sa_len; + servaddr.len = servaddr.maxlen = res->ai_addrlen; servaddr.buf = res->ai_addr; uaddr = taddr2uaddr(nconf, &servaddr); From owner-svn-src-all@freebsd.org Thu Jun 15 15:36:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 213B4D8C95C; Thu, 15 Jun 2017 15:36:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7DD079119; Thu, 15 Jun 2017 15:36:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 0F6124FB; Thu, 15 Jun 2017 15:36:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id B3D0D26FB; Thu, 15 Jun 2017 15:36:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id XkT2CPdb690n; Thu, 15 Jun 2017 15:36:05 +0000 (UTC) Subject: Re: svn commit: r319897 - head/usr.bin/yes DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 371A126F5 To: Ronald Klop , Justin Hibbits Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> <59cc8b64-0cba-70c7-68c8-53f48a3c1471@FreeBSD.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <1f9c71f7-8231-b302-23b8-b6ff42dfe78c@FreeBSD.org> Date: Thu, 15 Jun 2017 08:36:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rMBoHhxm0ViJg1QoNHFrLdG00xmc3hWjs" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 15:36:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --rMBoHhxm0ViJg1QoNHFrLdG00xmc3hWjs Content-Type: multipart/mixed; boundary="QkwcIUrDseL9iseVa7crmT6KDVCGRGenJ"; protected-headers="v1" From: Bryan Drewery To: Ronald Klop , Justin Hibbits Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Message-ID: <1f9c71f7-8231-b302-23b8-b6ff42dfe78c@FreeBSD.org> Subject: Re: svn commit: r319897 - head/usr.bin/yes References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> <59cc8b64-0cba-70c7-68c8-53f48a3c1471@FreeBSD.org> In-Reply-To: --QkwcIUrDseL9iseVa7crmT6KDVCGRGenJ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/15/2017 7:17 AM, Ronald Klop wrote: > On Wed, 14 Jun 2017 16:27:52 +0200, Bryan Drewery > wrote: >=20 >> On 6/14/2017 7:26 AM, Justin Hibbits wrote: >>> On Wed, Jun 14, 2017 at 9:19 AM, Bryan Drewery = >>> wrote: >>>> On 6/13/2017 5:35 AM, Pietro Cerutti wrote: >>>>> Author: gahr (ports committer) >>>>> Date: Tue Jun 13 12:35:01 2017 >>>>> New Revision: 319897 >>>>> URL: https://svnweb.freebsd.org/changeset/base/319897 >>>>> >>>>> Log: >>>>> Improve yes' throughput >>>>> >>>>> On my system, this brings up the throughput from ~20 to ~600 MiB/= s. >>>>> >>>>> Inspired by: >>>>> https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fas= t/ >>>>> >>>>> Reviewed by: cognet >>>>> Approved by: cognet >>>>> >>>>> Modified: >>>>> head/usr.bin/yes/yes.c >>>> >>>> >>>> While here we should add libxo support. >>>> >>>> --=20 >>>> Regards, >>>> Bryan Drewery >>>> >>> >>> I think before we add libxo, we need to capsicumize it. After all, i= t >>> does accept arbitrary arguments. >> >> The code has become more complex. I think capsicum does make sense no= w >> in case there is an unseen overflow in the new optimized code. >> >> >=20 > It already has capsicum... > https://svnweb.freebsd.org/base?view=3Drevision&revision=3D308432 >=20 > :-) Doh, perfect! Now we need libxo support. I need a constant stream of . --=20 Regards, Bryan Drewery --QkwcIUrDseL9iseVa7crmT6KDVCGRGenJ-- --rMBoHhxm0ViJg1QoNHFrLdG00xmc3hWjs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZQqlnAAoJEDXXcbtuRpfPP2oIAKBi/K3IYj714CKd5JCYxsez 5ItieMMggJkmlpEBEA9daWHo/hE0yTC5pEUuHJDGZrSrf2/BuCCDxhLSy7r2C78L 7Za18+I5TtzchT11M1abOnsq168iGezSHPXg8xhdE99NuFXZrnh0H69d3luEWoSw VBu0xMdjNt5Xfmw9i7UFNk/+9/NuDYubp2tKILeirJs4otKqUoR2cobfyGsnPy7Q HWYkAegZN70HGXCL+Ir0e7CiZ1yQJQW4kjuAAz+agFFkTRwCamBwZwUKnqe7MYWo HUW68xpTb32+apPA/dBVqhQqkk+SZbaDgCxNmAXbWh3noAe7cHGyYegWQ/zL9wc= =y7IK -----END PGP SIGNATURE----- --rMBoHhxm0ViJg1QoNHFrLdG00xmc3hWjs-- From owner-svn-src-all@freebsd.org Thu Jun 15 15:50:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF900D8CC5A; Thu, 15 Jun 2017 15:50:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC92579879; Thu, 15 Jun 2017 15:50:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FFoHMa039700; Thu, 15 Jun 2017 15:50:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FFoHqf039699; Thu, 15 Jun 2017 15:50:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201706151550.v5FFoHqf039699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 15 Jun 2017 15:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319978 - stable/11/usr.sbin/freebsd-update X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 15:50:19 -0000 Author: gjb Date: Thu Jun 15 15:50:17 2017 New Revision: 319978 URL: https://svnweb.freebsd.org/changeset/base/319978 Log: MFC r319954: Modernize FreeBSD version numbers in freebsd-update(8). While here, expand a contraction to make textproc/igor happy. Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.sbin/freebsd-update/freebsd-update.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- stable/11/usr.sbin/freebsd-update/freebsd-update.8 Thu Jun 15 15:24:15 2017 (r319977) +++ stable/11/usr.sbin/freebsd-update/freebsd-update.8 Thu Jun 15 15:50:17 2017 (r319978) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2015 +.Dd June 14, 2017 .Dt FREEBSD-UPDATE 8 .Os FreeBSD .Sh NAME @@ -56,13 +56,13 @@ by the .Fx Release Engineering Team, e.g., .Fx -9.3-RELEASE and +10.3-RELEASE and .Fx -10.1-RELEASE, but not +11.0-RELEASE, but not .Fx -9.3-STABLE or +10.3-STABLE or .Fx -11-CURRENT. +12-CURRENT. .Sh OPTIONS The following options are supported: .Bl -tag -width "-r newrelease" @@ -114,7 +114,7 @@ Please do not run from crontab or similar using this flag, see: .Nm Cm cron .It Fl -currently-running Ar release -Don't detect the currently-running release; instead, assume that the +Do not detect the currently-running release; instead, assume that the system is running the specified .Ar release . This is most likely to be useful when upgrading jails. From owner-svn-src-all@freebsd.org Thu Jun 15 15:50:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 618A3D8CD7B; Thu, 15 Jun 2017 15:50:51 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3008279A1C; Thu, 15 Jun 2017 15:50:51 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FFoofB039788; Thu, 15 Jun 2017 15:50:50 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FFooM8039787; Thu, 15 Jun 2017 15:50:50 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201706151550.v5FFooM8039787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 15 Jun 2017 15:50: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: r319979 - stable/10/usr.sbin/freebsd-update 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 15:50:51 -0000 Author: gjb Date: Thu Jun 15 15:50:49 2017 New Revision: 319979 URL: https://svnweb.freebsd.org/changeset/base/319979 Log: MFC r319954: Modernize FreeBSD version numbers in freebsd-update(8). While here, expand a contraction to make textproc/igor happy. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/freebsd-update/freebsd-update.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- stable/10/usr.sbin/freebsd-update/freebsd-update.8 Thu Jun 15 15:50:17 2017 (r319978) +++ stable/10/usr.sbin/freebsd-update/freebsd-update.8 Thu Jun 15 15:50:49 2017 (r319979) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2015 +.Dd June 14, 2017 .Dt FREEBSD-UPDATE 8 .Os FreeBSD .Sh NAME @@ -56,13 +56,13 @@ by the .Fx Release Engineering Team, e.g., .Fx -9.3-RELEASE and +10.3-RELEASE and .Fx -10.1-RELEASE, but not +11.0-RELEASE, but not .Fx -9.3-STABLE or +10.3-STABLE or .Fx -11-CURRENT. +12-CURRENT. .Sh OPTIONS The following options are supported: .Bl -tag -width "-r newrelease" @@ -114,7 +114,7 @@ Please do not run from crontab or similar using this flag, see: .Nm Cm cron .It Fl -currently-running Ar release -Don't detect the currently-running release; instead, assume that the +Do not detect the currently-running release; instead, assume that the system is running the specified .Ar release . This is most likely to be useful when upgrading jails. From owner-svn-src-all@freebsd.org Thu Jun 15 16:12:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A943AD8D4E3; Thu, 15 Jun 2017 16:12:46 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 693187A7B1; Thu, 15 Jun 2017 16:12:46 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FGCjVP051394; Thu, 15 Jun 2017 16:12:45 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FGCjxV051393; Thu, 15 Jun 2017 16:12:45 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201706151612.v5FGCjxV051393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 15 Jun 2017 16:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319980 - stable/11/contrib/smbfs/lib/smb X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 16:12:46 -0000 Author: jpaetzel Date: Thu Jun 15 16:12:45 2017 New Revision: 319980 URL: https://svnweb.freebsd.org/changeset/base/319980 Log: MFC 319670 Fix SMBFS when saved passwords are greater than 18 character PR: 132302 Submitted by: dhorn2000@gmail.com guru@unixarea.de Approved by: re (gjb) Modified: stable/11/contrib/smbfs/lib/smb/subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/smbfs/lib/smb/subr.c ============================================================================== --- stable/11/contrib/smbfs/lib/smb/subr.c Thu Jun 15 15:50:49 2017 (r319979) +++ stable/11/contrib/smbfs/lib/smb/subr.c Thu Jun 15 16:12:45 2017 (r319980) @@ -232,6 +232,8 @@ smb_simplecrypt(char *dst, const char *src) islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch); ch ^= pos; pos += 13; + if (pos > 256) + pos -= 256; sprintf(dst, "%02x", ch); dst += 2; } @@ -262,6 +264,8 @@ smb_simpledecrypt(char *dst, const char *src) return EINVAL; ch ^= pos; pos += 13; + if (pos > 256) + pos -= 256; if (isascii(ch)) ch = (isupper(ch) ? ('A' + (ch - 'A' + 13) % 26) : islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch); From owner-svn-src-all@freebsd.org Thu Jun 15 17:06:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59952D8E370; Thu, 15 Jun 2017 17:06:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3683A7C176; Thu, 15 Jun 2017 17:06:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FH64Va071804; Thu, 15 Jun 2017 17:06:04 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FH64Gi071801; Thu, 15 Jun 2017 17:06:04 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706151706.v5FH64Gi071801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 15 Jun 2017 17:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319981 - in stable/11/sys: kern sys vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 17:06:05 -0000 Author: alc Date: Thu Jun 15 17:06:04 2017 New Revision: 319981 URL: https://svnweb.freebsd.org/changeset/base/319981 Log: MFC r318995 In r118390, the swap pager's approach to striping swap allocation over multiple devices was changed. However, swapoff_one() was not fully and correctly converted. In particular, with r118390's introduction of a per- device blist, the maximum swap block size, "dmmax", became irrelevant to swapoff_one()'s operation. Moreover, swapoff_one() was performing out-of- range operations on the per-device blist that were silently ignored by blist_fill(). This change corrects both of these problems with swapoff_one(), which will allow us to potentially increase MAX_PAGEOUT_CLUSTER. Previously, swapoff_one() would panic inside of blist_fill() if you increased MAX_PAGEOUT_CLUSTER. MFC r319001 After r118390, the variable "dmmax" was neither the correct strip size nor the correct maximum block size. Moreover, after r318995, it serves no purpose except to provide information to user space through a read- sysctl. This change eliminates the variable "dmmax" but retains the sysctl. It also corrects the value returned by the sysctl. MFC r319604 Halve the memory being internally allocated by the blist allocator. In short, half of the memory that is allocated to implement the radix tree is wasted because we did not change "u_daddr_t" to be a 64-bit unsigned int when we changed "daddr_t" to be a 64-bit (signed) int. (See r96849 and r96851.) MFC r319612 When the function blist_fill() was added to the kernel in r107913, the swap pager used a different scheme for striping the allocation of swap space across multiple devices. And, although blist_fill() was intended to support fill operations with large counts, the old striping scheme never performed a fill larger than the stripe size. Consequently, the misplacement of a sanity check in blst_meta_fill() went undetected. Now, moving forward in time to r118390, a new scheme for striping was introduced that maintained a blist allocator per device, but as noted in r318995, swapoff_one() was not fully and correctly converted to the new scheme. This change completes what was started in r318995 by fixing the underlying bug in blst_meta_fill() that stops swapoff_one() from simply performing a single blist_fill() operation. MFC r319627 Starting in r118390, swaponsomething() began to reserve the blocks at the beginning of a swap area for a disk label. However, neither r118390 nor r118544, which increased the reservation from one to two blocks, correctly accounted for these blocks when updating the variable "swap_pager_avail". This change corrects that error. MFC r319655 Originally, this file could be compiled as a user-space application for testing purposes. However, over the years, various changes to the kernel have broken this feature. This revision applies some fixes to get user- space compilation working again. There are no changes in this revision to code that is used by the kernel. Approved by: re (kib) Modified: stable/11/sys/kern/subr_blist.c stable/11/sys/sys/blist.h stable/11/sys/vm/swap_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_blist.c ============================================================================== --- stable/11/sys/kern/subr_blist.c Thu Jun 15 16:12:45 2017 (r319980) +++ stable/11/sys/kern/subr_blist.c Thu Jun 15 17:06:04 2017 (r319981) @@ -99,9 +99,8 @@ __FBSDID("$FreeBSD$"); #define BLIST_DEBUG #endif -#define SWAPBLK_NONE ((daddr_t)-1) - #include +#include #include #include #include @@ -110,8 +109,6 @@ __FBSDID("$FreeBSD$"); #define malloc(a,b,c) calloc(a, 1) #define free(a,b) free(a) -typedef unsigned int u_daddr_t; - #include void panic(const char *ctl, ...); @@ -366,7 +363,7 @@ blst_leaf_alloc( j >>= 1; mask >>= j; } - scan->u.bmu_bitmap &= ~(1 << r); + scan->u.bmu_bitmap &= ~((u_daddr_t)1 << r); return(blk + r); } if (count <= BLIST_BMAP_RADIX) { @@ -658,7 +655,7 @@ static void blst_copy( int i; for (i = 0; i < BLIST_BMAP_RADIX && i < count; ++i) { - if (v & (1 << i)) + if (v & ((u_daddr_t)1 << i)) blist_free(dest, blk + i, 1); } } @@ -769,6 +766,8 @@ blst_meta_fill( int next_skip = ((u_int)skip / BLIST_META_RADIX); int nblks = 0; + if (count > radix) + panic("blist_meta_fill: allocation too large"); if (count == radix || scan->u.bmu_avail == 0) { /* * ALL-ALLOCATED special case @@ -800,9 +799,6 @@ blst_meta_fill( radix /= BLIST_META_RADIX; } - if (count > radix) - panic("blist_meta_fill: allocation too large"); - i = (allocBlk - blk) / radix; blk += i * radix; i = i * next_skip + 1; @@ -922,7 +918,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t if (radix == BLIST_BMAP_RADIX) { printf( - "%*.*s(%08llx,%lld): bitmap %08llx big=%lld\n", + "%*.*s(%08llx,%lld): bitmap %016llx big=%lld\n", tab, tab, "", (long long)blk, (long long)radix, (long long)scan->u.bmu_bitmap, @@ -1016,10 +1012,9 @@ main(int ac, char **av) for (;;) { char buf[1024]; - daddr_t da = 0; - daddr_t count = 0; + long long da = 0; + long long count = 0; - printf("%lld/%lld/%lld> ", (long long)bl->bl_free, (long long)size, (long long)bl->bl_radix); fflush(stdout); @@ -1028,7 +1023,7 @@ main(int ac, char **av) switch(buf[0]) { case 'r': if (sscanf(buf + 1, "%lld", &count) == 1) { - blist_resize(&bl, count, 1); + blist_resize(&bl, count, 1, M_WAITOK); } else { printf("?\n"); } @@ -1044,16 +1039,14 @@ main(int ac, char **av) } break; case 'f': - if (sscanf(buf + 1, "%llx %lld", - (long long *)&da, (long long *)&count) == 2) { + if (sscanf(buf + 1, "%llx %lld", &da, &count) == 2) { blist_free(bl, da, count); } else { printf("?\n"); } break; case 'l': - if (sscanf(buf + 1, "%llx %lld", - (long long *)&da, (long long *)&count) == 2) { + if (sscanf(buf + 1, "%llx %lld", &da, &count) == 2) { printf(" n=%d\n", blist_fill(bl, da, count)); } else { Modified: stable/11/sys/sys/blist.h ============================================================================== --- stable/11/sys/sys/blist.h Thu Jun 15 16:12:45 2017 (r319980) +++ stable/11/sys/sys/blist.h Thu Jun 15 17:06:04 2017 (r319981) @@ -44,7 +44,7 @@ * ops. * * SWAPBLK_NONE is returned on failure. This module is typically - * capable of managing up to (2^31) blocks per blist, though + * capable of managing up to (2^63) blocks per blist, though * the memory utilization would be insane if you actually did * that. Managing something like 512MB worth of 4K blocks * eats around 32 KBytes of memory. @@ -56,7 +56,7 @@ #ifndef _SYS_BLIST_H_ #define _SYS_BLIST_H_ -typedef u_int32_t u_daddr_t; /* unsigned disk address */ +typedef uint64_t u_daddr_t; /* unsigned disk address */ /* * note: currently use SWAPBLK_NONE as an absolute value rather then Modified: stable/11/sys/vm/swap_pager.c ============================================================================== --- stable/11/sys/vm/swap_pager.c Thu Jun 15 16:12:45 2017 (r319980) +++ stable/11/sys/vm/swap_pager.c Thu Jun 15 17:06:04 2017 (r319981) @@ -115,9 +115,8 @@ __FBSDID("$FreeBSD$"); #include /* - * SWB_NPAGES must be a power of 2. It may be set to 1, 2, 4, 8, 16 - * or 32 pages per allocation. - * The 32-page limit is due to the radix code (kern/subr_blist.c). + * MAX_PAGEOUT_CLUSTER must be a power of 2 between 1 and 64. + * The 64-page limit is due to the radix code (kern/subr_blist.c). */ #ifndef MAX_PAGEOUT_CLUSTER #define MAX_PAGEOUT_CLUSTER 16 @@ -380,18 +379,14 @@ struct pagerops swappagerops = { }; /* - * dmmax is in page-sized chunks with the new swap system. It was - * dev-bsized chunks in the old. dmmax is always a power of 2. - * * swap_*() routines are externally accessible. swp_*() routines are * internal. */ -static int dmmax; static int nswap_lowat = 128; /* in pages, swap_pager_almost_full warn */ static int nswap_hiwat = 512; /* in pages, swap_pager_almost_full warn */ -SYSCTL_INT(_vm, OID_AUTO, dmmax, CTLFLAG_RD, &dmmax, 0, - "Maximum size of a swap block"); +SYSCTL_INT(_vm, OID_AUTO, dmmax, CTLFLAG_RD, &nsw_cluster_max, 0, + "Maximum size of a swap block in pages"); static void swp_sizecheck(void); static void swp_pager_async_iodone(struct buf *bp); @@ -488,11 +483,6 @@ swap_pager_init(void) mtx_init(&sw_dev_mtx, "swapdev", NULL, MTX_DEF); sx_init(&sw_alloc_sx, "swspsx"); sx_init(&swdev_syscall_lock, "swsysc"); - - /* - * Device Stripe, in PAGE_SIZE'd blocks - */ - dmmax = SWB_NPAGES * 2; } /* @@ -2204,7 +2194,7 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl sp->sw_end = dvbase + nblks; TAILQ_INSERT_TAIL(&swtailq, sp, sw_list); nswapdev++; - swap_pager_avail += nblks; + swap_pager_avail += nblks - 2; swap_total += (vm_ooffset_t)nblks * PAGE_SIZE; swapon_check_swzone(swap_total / PAGE_SIZE); swp_sizecheck(); @@ -2271,7 +2261,7 @@ done: static int swapoff_one(struct swdevt *sp, struct ucred *cred) { - u_long nblks, dvbase; + u_long nblks; #ifdef MAC int error; #endif @@ -2302,10 +2292,7 @@ swapoff_one(struct swdevt *sp, struct ucred *cred) */ mtx_lock(&sw_dev_mtx); sp->sw_flags |= SW_CLOSING; - for (dvbase = 0; dvbase < sp->sw_end; dvbase += dmmax) { - swap_pager_avail -= blist_fill(sp->sw_blist, - dvbase, dmmax); - } + swap_pager_avail -= blist_fill(sp->sw_blist, 0, nblks); swap_total -= (vm_ooffset_t)nblks * PAGE_SIZE; mtx_unlock(&sw_dev_mtx); From owner-svn-src-all@freebsd.org Thu Jun 15 17:43:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30E85D8ECCF; Thu, 15 Jun 2017 17:43:42 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F37C77D334; Thu, 15 Jun 2017 17:43:41 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FHhfQq087866; Thu, 15 Jun 2017 17:43:41 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FHhftC087864; Thu, 15 Jun 2017 17:43:41 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201706151743.v5FHhftC087864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 15 Jun 2017 17:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319982 - stable/11/usr.bin/top X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 17:43:42 -0000 Author: allanjude Date: Thu Jun 15 17:43:40 2017 New Revision: 319982 URL: https://svnweb.freebsd.org/changeset/base/319982 Log: MFC: r319866, r319867 top: Change the way the ZFS ARC compression ratio is calculated remove overhead statistics, already included in other counters Approved by: re (gjb) Modified: stable/11/usr.bin/top/machine.c stable/11/usr.bin/top/top.local.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/top/machine.c ============================================================================== --- stable/11/usr.bin/top/machine.c Thu Jun 15 17:06:04 2017 (r319981) +++ stable/11/usr.bin/top/machine.c Thu Jun 15 17:43:40 2017 (r319982) @@ -188,9 +188,9 @@ char *arcnames[] = { NULL }; -int carc_stats[5]; +int carc_stats[4]; char *carcnames[] = { - "K Compressed, ", "K Uncompressed, ", ":1 Ratio, ", "K Overhead", + "K Compressed, ", "K Uncompressed, ", ":1 Ratio, ", NULL }; @@ -580,11 +580,9 @@ get_system_info(struct system_info *si) if (carc_enabled) { GETSYSCTL("kstat.zfs.misc.arcstats.compressed_size", arc_stat); carc_stats[0] = arc_stat >> 10; + carc_stats[2] = arc_stat >> 10; /* For ratio */ GETSYSCTL("kstat.zfs.misc.arcstats.uncompressed_size", arc_stat); carc_stats[1] = arc_stat >> 10; - carc_stats[2] = arc_stats[0]; /* ARC Total */ - GETSYSCTL("kstat.zfs.misc.arcstats.overhead_size", arc_stat); - carc_stats[3] = arc_stat >> 10; si->carc = carc_stats; } Modified: stable/11/usr.bin/top/top.local.1 ============================================================================== --- stable/11/usr.bin/top/top.local.1 Thu Jun 15 17:06:04 2017 (r319981) +++ stable/11/usr.bin/top/top.local.1 Thu Jun 15 17:43:40 2017 (r319982) @@ -65,10 +65,7 @@ bytes of memory used by ARC caches bytes of data stored in ARC caches before compression .TP .B Ratio: -ratio of uncompressed data to total ARC size -.TP -.B Overhead: -amount of overhead from ARC compression +compression ratio of data cached in the ARC .SS Swap Stats .TP .B Total: From owner-svn-src-all@freebsd.org Thu Jun 15 17:44:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0092BD8ED32; Thu, 15 Jun 2017 17:44:18 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEE2E7D461; Thu, 15 Jun 2017 17:44:17 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FHiGoa087957; Thu, 15 Jun 2017 17:44:16 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FHiGl4087955; Thu, 15 Jun 2017 17:44:16 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201706151744.v5FHiGl4087955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 15 Jun 2017 17:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319983 - stable/11/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 17:44:18 -0000 Author: allanjude Date: Thu Jun 15 17:44:16 2017 New Revision: 319983 URL: https://svnweb.freebsd.org/changeset/base/319983 Log: MFC: r319863 bsdinstall: Make ZFS min_auto_ashift adjustment persistent MFC: r319864 bsdinstall: support Auto ZFS mode for ARM64 Approved by: re (gjb) Modified: stable/11/usr.sbin/bsdinstall/scripts/auto stable/11/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/auto Thu Jun 15 17:43:40 2017 (r319982) +++ stable/11/usr.sbin/bsdinstall/scripts/auto Thu Jun 15 17:44:16 2017 (r319983) @@ -260,7 +260,7 @@ Shell \"Open a shell and partition by hand\"" CURARCH=$( uname -m ) case $CURARCH in - amd64|i386) # Booting ZFS Supported + amd64|arm64|i386) # Booting ZFS Supported PMODES="$PMODES \"Auto (ZFS)\" \"Guided Root-on-ZFS\"" ;; *) # Booting ZFS Unspported Modified: stable/11/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/zfsboot Thu Jun 15 17:43:40 2017 (r319982) +++ stable/11/usr.sbin/bsdinstall/scripts/zfsboot Thu Jun 15 17:44:16 2017 (r319983) @@ -1443,6 +1443,12 @@ zfs_create_boot() 'kern.geom.label.gptid.enable=\"0\"' \ $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + if [ "$ZFSBOOT_FORCE_4K_SECTORS" ]; then + f_eval_catch $funcname echo "$ECHO_APPEND" \ + 'vfs.zfs.min_auto_ashift=12' \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + fi + if [ "$ZFSBOOT_SWAP_MIRROR" ]; then f_eval_catch $funcname echo "$ECHO_APPEND" \ 'geom_mirror_load=\"YES\"' \ From owner-svn-src-all@freebsd.org Thu Jun 15 17:46:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E1ECD8EDB3; Thu, 15 Jun 2017 17:46:21 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 580E47D5BC; Thu, 15 Jun 2017 17:46:21 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FHkK6I088066; Thu, 15 Jun 2017 17:46:20 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FHkKbL088065; Thu, 15 Jun 2017 17:46:20 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201706151746.v5FHkKbL088065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 15 Jun 2017 17:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319984 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 17:46:21 -0000 Author: sbruno Date: Thu Jun 15 17:46:20 2017 New Revision: 319984 URL: https://svnweb.freebsd.org/changeset/base/319984 Log: Revert r319921 which seems to cause NFS booting assertion panics in various configurations. Reported by: pho@ Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Jun 15 17:44:16 2017 (r319983) +++ head/sys/net/iflib.c Thu Jun 15 17:46:20 2017 (r319984) @@ -520,17 +520,6 @@ rxd_info_zero(if_rxd_info_t ri) #define MAX_SINGLE_PACKET_FRACTION 12 #define IF_BAD_DMA (bus_addr_t)-1 -static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD, 0, - "iflib driver parameters"); - -static int iflib_timer_int; -SYSCTL_INT(_net_iflib, OID_AUTO, timer_int, CTLFLAG_RW, &iflib_timer_int, - 0, "interval at which to run per-queue timers (in ticks)"); - -static int force_busdma = 1; -SYSCTL_INT(_net_iflib, OID_AUTO, force_busdma, CTLFLAG_RDTUN, &force_busdma, - 1, "force busdma"); - #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING)) #define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx lock", MTX_DEF) @@ -570,6 +559,9 @@ TASKQGROUP_DEFINE(if_config_tqg, 1, 1); #endif /* !INVARIANTS */ #endif +static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD, 0, + "iflib driver parameters"); + /* * XXX need to ensure that this can't accidentally cause the head to be moved backwards */ @@ -1875,6 +1867,7 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun cb_arg.error = 0; q = fl->ifl_rxq; MPASS(sd_map != NULL); + MPASS(sd_map[idx] != NULL); err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[idx], cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, 0); bus_dmamap_sync(fl->ifl_desc_tag, sd_map[idx], BUS_DMASYNC_PREREAD); @@ -2117,8 +2110,7 @@ iflib_timer(void *arg) sctx->isc_pause_frames = 0; if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) - callout_reset_on(&txq->ift_timer, iflib_timer_int, iflib_timer, - txq, txq->ift_timer.c_cpu); + callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); return; hung: CTX_LOCK(ctx); @@ -2193,8 +2185,8 @@ iflib_init_locked(if_ctx_t ctx) IFDI_INTR_ENABLE(ctx); txq = ctx->ifc_txqs; for (i = 0; i < sctx->isc_ntxqsets; i++, txq++) - callout_reset_on(&txq->ift_timer, iflib_timer_int, iflib_timer, - txq, txq->ift_timer.c_cpu); + callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, + txq->ift_timer.c_cpu); } static int @@ -2905,7 +2897,7 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag ifsd_m = txq->ift_sds.ifsd_m; ntxd = txq->ift_size; pidx = txq->ift_pidx; - if (force_busdma || map != NULL) { + if (map != NULL) { uint8_t *ifsd_flags = txq->ift_sds.ifsd_flags; err = bus_dmamap_load_mbuf_sg(tag, map, @@ -3045,8 +3037,7 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) next = (cidx + CACHE_LINE_SIZE) & (ntxd-1); prefetch(&txq->ift_sds.ifsd_flags[next]); } - } - if (txq->ift_sds.ifsd_map != NULL) + } else if (txq->ift_sds.ifsd_map != NULL) map = txq->ift_sds.ifsd_map[pidx]; if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { @@ -3542,8 +3533,7 @@ _task_fn_admin(void *context) } IFDI_UPDATE_ADMIN_STATUS(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) - callout_reset_on(&txq->ift_timer, iflib_timer_int, iflib_timer, - txq, txq->ift_timer.c_cpu); + callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); IFDI_LINK_INTR_ENABLE(ctx); if (ctx->ifc_flags & IFC_DO_RESET) { ctx->ifc_flags &= ~IFC_DO_RESET; @@ -4097,8 +4087,6 @@ iflib_device_register(device_t dev, void *sc, if_share /* set unconditionally for !x86 */ ctx->ifc_flags |= IFC_DMAR; #endif - if (force_busdma) - ctx->ifc_flags |= IFC_DMAR; msix_bar = scctx->isc_msix_bar; main_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0; @@ -4421,9 +4409,6 @@ iflib_device_iov_add_vf(device_t dev, uint16_t vfnum, static int iflib_module_init(void) { - - iflib_timer_int = hz / 2; - TUNABLE_INT_FETCH("net.iflib.timer_int", &iflib_timer_int); return (0); } From owner-svn-src-all@freebsd.org Thu Jun 15 17:47:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AD42D8EDFC; Thu, 15 Jun 2017 17:47:09 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6ABA27D708; Thu, 15 Jun 2017 17:47:08 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (97-123-31-18.albq.qwest.net [97.123.31.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id ACCAE1928AB; Thu, 15 Jun 2017 17:47:01 +0000 (UTC) Subject: Re: svn commit: r319921 - head/sys/net To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706132316.v5DNGdF2042725@repo.freebsd.org> <20170614091758.GA86374@x2.osted.lan> <20170614144623.GA96234@x2.osted.lan> <20170615102214.GA31323@x2.osted.lan> From: Sean Bruno Message-ID: <1cac96e1-f474-b89c-dffc-812a2a57dead@freebsd.org> Date: Thu, 15 Jun 2017 11:46:58 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <20170615102214.GA31323@x2.osted.lan> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xVQuDvh1i3i9xFkIbXDetB1BhSrhhIDcV" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 17:47:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xVQuDvh1i3i9xFkIbXDetB1BhSrhhIDcV Content-Type: multipart/mixed; boundary="cu9pF5qbl1fgqMd1TQ8ui5j2iNJhFp9FT"; protected-headers="v1" From: Sean Bruno To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1cac96e1-f474-b89c-dffc-812a2a57dead@freebsd.org> Subject: Re: svn commit: r319921 - head/sys/net References: <201706132316.v5DNGdF2042725@repo.freebsd.org> <20170614091758.GA86374@x2.osted.lan> <20170614144623.GA96234@x2.osted.lan> <20170615102214.GA31323@x2.osted.lan> In-Reply-To: <20170615102214.GA31323@x2.osted.lan> --cu9pF5qbl1fgqMd1TQ8ui5j2iNJhFp9FT Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 06/15/17 04:22, Peter Holm wrote: > On Wed, Jun 14, 2017 at 09:21:30AM -0600, Sean Bruno wrote: >> >> >> On 06/14/17 08:46, Peter Holm wrote: >>> On Wed, Jun 14, 2017 at 08:38:36AM -0600, Sean Bruno wrote: >>>> >>>> >>>> On 06/14/17 03:17, Peter Holm wrote: >>>>> On Tue, Jun 13, 2017 at 11:16:39PM +0000, Sean Bruno wrote: >>>>>> Author: sbruno >>>>>> Date: Tue Jun 13 23:16:38 2017 >>>>>> New Revision: 319921 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/319921 >>>>>> >>>>>> Log: >>>>>> Add new sysctl to allow changing of timing of the txq timers. >>>>>> =20 >>>>>> Add new sysctl to override use of busdma in the driver. >>>>>> =20 >>>>>> Submitted by: Drew Gallitin >>>>>> >>>>>> Modified: >>>>>> head/sys/net/iflib.c >>>>>> >>>>>> Modified: head/sys/net/iflib.c >>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D >>>>>> --- head/sys/net/iflib.c Tue Jun 13 22:57:57 2017 (r319920) > >=20 > I fried up some test hardware and have some more info for you. > Here's a test triggered by a NFS test scenario: >=20 > https://people.freebsd.org/~pho/stress/log/sbruno002.txt >=20 > I have uploaded the kernel + core to: > https://people.freebsd.org/~pho/kernel+vmcore.519-t2.txz >=20 > Regards, >=20 > - Peter >=20 >=20 Thank you for these diagnostics. I've reverted this change from head. sean --cu9pF5qbl1fgqMd1TQ8ui5j2iNJhFp9FT-- --xVQuDvh1i3i9xFkIbXDetB1BhSrhhIDcV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAllCyBJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LZScQf/WACjrxbB3Zyt4EhjDLsOnw5PyaZtjyi2DzcbRlPCDKUW12qo7TtSLB9j zVxmvSdIJTMYzaCbUJs/LJSciTYaSpk48xZlxPqGWACiGx1EP8T/rebD8BwWKqjh itU6LtgXd7rxHYI0P/T/oGOSxTjdRI0lirdqmZqkelw+l/tcAESI3A9blR3JAR0x 5hTNfDCr1QEsWrnfBS7kEHnqqwI86EFb2GPgS9iiXxSLV4CEbweNr2yjpGwIfdWF hadam721gnq31wX9uTAO7duCb4sav8/5XLXzcgToV1HlAKCAwtxofYlE3t2telzR cUxDx2jaZiOP33EUXVw9FQ/P6Jfb9Q== =bop+ -----END PGP SIGNATURE----- --xVQuDvh1i3i9xFkIbXDetB1BhSrhhIDcV-- From owner-svn-src-all@freebsd.org Thu Jun 15 17:49:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 181F8D8EE9A; Thu, 15 Jun 2017 17:49:12 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D56F97DA51; Thu, 15 Jun 2017 17:49:11 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-io0-x233.google.com with SMTP id t87so16482311ioe.0; Thu, 15 Jun 2017 10:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uwIrZN3aL1EfliP4o/JSkCTFNIKRfn5Ijtm7p402nAE=; b=TbDZmgLIZj2Iv03qr88NGjcLK7YXXWRn4SQea6pJxbobl0CgDUgeyb5T4QpmjvsbNY wQi8eQblMu83sTzwlQMJc/HxOJPI4OJ1gDSJB46mFQIumDZ6GF66wgdcHmPRkzvq5wZW vtixgjLZIl8Aoe6PUKpXYDI9Um2ZJVfznDdhaitvanbA8rTZh8RJJSYblIIb93JFiccI P0PtIGbnHx79qNWJNN+zF1ZZX4RBqzTyeBNtAStCkpKaRBamR0LkZBafxOytNiCg1OzK U8vxtWZxTUj6D5BhtJGVGnEFn7+u6TtXftoQ0CL3iUzlClH1ISTlCB1SiOW9ZPcCkySJ +aHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uwIrZN3aL1EfliP4o/JSkCTFNIKRfn5Ijtm7p402nAE=; b=iwo4XUs4+WvT+WzON5/xdZbSSm+lxyn05Qa5hLPR2FA7Ll6U6RtydYyBFoxAolfBl2 yBnl6RPteX01BAv6XlGAEdedxll0PvAFR7kAyEWt3aW2rvToT7WSuHnpJs9Lotg9cLVu vL6BO+pbVns/UKcyQM2kJZug6LRt6KaJL4iI5VVeYYHSva+hh7hr9ieIuAQ/JLT/0ANe bWMLUbhVwC4Q8+oEkmHVyHGA2cH0piNALDDZnWiFjBVsoESBG05G2ckAO0M1zabcOIAN KsJ4Ti4uRMIPt53vJlbkOGBzyma4KvTgxDi5EgCqynA/MOTa2/9GsLs3DzbSUo4tF54B /1hA== X-Gm-Message-State: AKS2vOz4boWGM+Se7bdYlGzx8b+a3opky7ZMxRaUqSXgPcqGaTegBtML TdCWVTESr0J8E9/ihCDVd8yZtmk+6SJYq5U= X-Received: by 10.107.174.211 with SMTP id n80mr7173831ioo.54.1497548950997; Thu, 15 Jun 2017 10:49:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.33.199 with HTTP; Thu, 15 Jun 2017 10:49:10 -0700 (PDT) In-Reply-To: <201706131235.v5DCZ1aR077437@repo.freebsd.org> References: <201706131235.v5DCZ1aR077437@repo.freebsd.org> From: Xin LI Date: Thu, 15 Jun 2017 10:49:10 -0700 Message-ID: Subject: Re: svn commit: r319897 - head/usr.bin/yes To: Pietro Cerutti , cognet@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 17:49:12 -0000 Hi, On Tue, Jun 13, 2017 at 5:35 AM, Pietro Cerutti wrote: [...] > Modified: head/usr.bin/yes/yes.c > ============================================================================== > --- head/usr.bin/yes/yes.c Tue Jun 13 12:07:18 2017 (r319896) > +++ head/usr.bin/yes/yes.c Tue Jun 13 12:35:01 2017 (r319897) > @@ -44,20 +44,42 @@ static const char rcsid[] = "$FreeBSD$"; > int > main(int argc, char **argv) > { [...] > + { > + exp = argv[1]; > + explen = strlen(exp) + 1; > + exp[explen - 1] = '\n'; > + } I think this effectively replaces the terminating NUL character with '\n', but in this context it seems to be Okay because later code is treating argv[1] as a block of memory instead of NUL-termated string. Could you please add comment here, so future readers would not have to scratch their head and figure this out again and again? By the way, in r319904, the following was introduced: if (explen <= sizeof(buf)) { Why do we bother to copy the buffer when the size is exactly the same (and we could use it directly), in other words, why not explen < sizeof(buf)? Cheers, From owner-svn-src-all@freebsd.org Thu Jun 15 18:49:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BAC5B940CE; Thu, 15 Jun 2017 18:49:48 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E06847FCA5; Thu, 15 Jun 2017 18:49:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FInlTs012596; Thu, 15 Jun 2017 18:49:47 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FInlmu012595; Thu, 15 Jun 2017 18:49:47 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706151849.v5FInlmu012595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 15 Jun 2017 18:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319985 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 18:49:48 -0000 Author: alc Date: Thu Jun 15 18:49:46 2017 New Revision: 319985 URL: https://svnweb.freebsd.org/changeset/base/319985 Log: MFC r319540 The data type returned by vmoff() is too narrow in its range. This could break the transmission of files longer than 4 GB on 32-bit architectures. Approved by: re (gjb) Modified: stable/11/sys/kern/kern_sendfile.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_sendfile.c ============================================================================== --- stable/11/sys/kern/kern_sendfile.c Thu Jun 15 17:46:20 2017 (r319984) +++ stable/11/sys/kern/kern_sendfile.c Thu Jun 15 18:49:46 2017 (r319985) @@ -207,12 +207,12 @@ xfsize(int i, int n, off_t off, off_t len) /* * Helper function to get offset within object for i page. */ -static inline vm_offset_t +static inline vm_ooffset_t vmoff(int i, off_t off) { if (i == 0) - return ((vm_offset_t)off); + return ((vm_ooffset_t)off); return (trunc_page(off + i * PAGE_SIZE)); } From owner-svn-src-all@freebsd.org Thu Jun 15 19:57:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 935C4B95401; Thu, 15 Jun 2017 19:57:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDCA181D63; Thu, 15 Jun 2017 19:57:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FJuxhj041503; Thu, 15 Jun 2017 19:56:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FJux5G041500; Thu, 15 Jun 2017 19:56:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201706151956.v5FJux5G041500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 15 Jun 2017 19:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319986 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 19:57:01 -0000 Author: np Date: Thu Jun 15 19:56:59 2017 New Revision: 319986 URL: https://svnweb.freebsd.org/changeset/base/319986 Log: cxgbe(4): Fix per-queue netmap operation. Do not attempt to initialize netmap queues that are already initialized or aren't supposed to be initialized. Similarly, do not free queues that are not initialized or aren't supposed to be freed. PR: 217156 Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Jun 15 18:49:46 2017 (r319985) +++ head/sys/dev/cxgbe/adapter.h Thu Jun 15 19:56:59 2017 (r319986) @@ -647,7 +647,7 @@ struct sge_wrq { } __aligned(CACHE_LINE_SIZE); - +#define INVALID_NM_RXQ_CNTXT_ID ((uint16_t)(-1)) struct sge_nm_rxq { struct vi_info *vi; @@ -680,6 +680,7 @@ struct sge_nm_rxq { bus_addr_t fl_ba; } __aligned(CACHE_LINE_SIZE); +#define INVALID_NM_TXQ_CNTXT_ID ((u_int)(-1)) struct sge_nm_txq { struct tx_desc *desc; uint16_t cidx; Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Thu Jun 15 18:49:46 2017 (r319985) +++ head/sys/dev/cxgbe/t4_netmap.c Thu Jun 15 19:56:59 2017 (r319986) @@ -224,6 +224,7 @@ free_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq if (rc != 0) device_printf(sc->dev, "%s: failed for iq %d, fl %d: %d\n", __func__, nm_rxq->iq_cntxt_id, nm_rxq->fl_cntxt_id, rc); + nm_rxq->iq_cntxt_id = INVALID_NM_RXQ_CNTXT_ID; return (rc); } @@ -310,6 +311,7 @@ free_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq if (rc != 0) device_printf(sc->dev, "%s: failed for eq %d: %d\n", __func__, nm_txq->cntxt_id, rc); + nm_txq->cntxt_id = INVALID_NM_TXQ_CNTXT_ID; return (rc); } @@ -318,6 +320,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi struct netmap_adapter *na) { struct netmap_slot *slot; + struct netmap_kring *kring; struct sge_nm_rxq *nm_rxq; struct sge_nm_txq *nm_txq; int rc, i, j, hwidx; @@ -347,6 +350,11 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi for_each_nm_rxq(vi, i, nm_rxq) { struct irq *irq = &sc->irq[vi->first_intr + i]; + kring = &na->rx_rings[nm_rxq->nid]; + if (!nm_kring_pending_on(kring) || + nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID) + continue; + alloc_nm_rxq_hwq(vi, nm_rxq, tnl_cong(vi->pi, nm_cong_drop)); nm_rxq->fl_hwidx = hwidx; slot = netmap_reset(na, NR_RX, i, 0); @@ -373,6 +381,11 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi } for_each_nm_txq(vi, i, nm_txq) { + kring = &na->tx_rings[nm_txq->nid]; + if (!nm_kring_pending_on(kring) || + nm_txq->cntxt_id != INVALID_NM_TXQ_CNTXT_ID) + continue; + alloc_nm_txq_hwq(vi, nm_txq); slot = netmap_reset(na, NR_TX, i, 0); MPASS(slot != NULL); /* XXXNM: error check, not assert */ @@ -401,6 +414,7 @@ static int cxgbe_netmap_off(struct adapter *sc, struct vi_info *vi, struct ifnet *ifp, struct netmap_adapter *na) { + struct netmap_kring *kring; int rc, i; struct sge_nm_txq *nm_txq; struct sge_nm_rxq *nm_rxq; @@ -419,6 +433,11 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v for_each_nm_txq(vi, i, nm_txq) { struct sge_qstat *spg = (void *)&nm_txq->desc[nm_txq->sidx]; + kring = &na->tx_rings[nm_txq->nid]; + if (!nm_kring_pending_off(kring) || + nm_txq->cntxt_id == INVALID_NM_TXQ_CNTXT_ID) + continue; + /* Wait for hw pidx to catch up ... */ while (be16toh(nm_txq->pidx) != spg->pidx) pause("nmpidx", 1); @@ -431,6 +450,11 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v } for_each_nm_rxq(vi, i, nm_rxq) { struct irq *irq = &sc->irq[vi->first_intr + i]; + + kring = &na->rx_rings[nm_rxq->nid]; + if (!nm_kring_pending_off(kring) || + nm_rxq->iq_cntxt_id == INVALID_NM_RXQ_CNTXT_ID) + continue; while (!atomic_cmpset_int(&irq->nm_state, NM_ON, NM_OFF)) pause("nmst", 1); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Jun 15 18:49:46 2017 (r319985) +++ head/sys/dev/cxgbe/t4_sge.c Thu Jun 15 19:56:59 2017 (r319986) @@ -3264,6 +3264,7 @@ alloc_nm_rxq(struct vi_info *vi, struct sge_nm_rxq *nm nm_rxq->fl_pidx = nm_rxq->fl_cidx = 0; nm_rxq->fl_sidx = na->num_rx_desc; nm_rxq->intr_idx = intr_idx; + nm_rxq->iq_cntxt_id = INVALID_NM_RXQ_CNTXT_ID; ctx = &vi->ctx; children = SYSCTL_CHILDREN(oid); @@ -3305,6 +3306,8 @@ free_nm_rxq(struct vi_info *vi, struct sge_nm_rxq *nm_ { struct adapter *sc = vi->pi->adapter; + MPASS(nm_rxq->iq_cntxt_id == INVALID_NM_RXQ_CNTXT_ID); + free_ring(sc, nm_rxq->iq_desc_tag, nm_rxq->iq_desc_map, nm_rxq->iq_ba, nm_rxq->iq_desc); free_ring(sc, nm_rxq->fl_desc_tag, nm_rxq->fl_desc_map, nm_rxq->fl_ba, @@ -3339,6 +3342,7 @@ alloc_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(G_FW_VIID_PFN(vi->viid)) | V_TXPKT_VF(G_FW_VIID_VIN(vi->viid)) | V_TXPKT_VF_VLD(G_FW_VIID_VIVLD(vi->viid))); + nm_txq->cntxt_id = INVALID_NM_TXQ_CNTXT_ID; snprintf(name, sizeof(name), "%d", idx); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD, @@ -3361,6 +3365,8 @@ static int free_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_txq) { struct adapter *sc = vi->pi->adapter; + + MPASS(nm_txq->cntxt_id == INVALID_NM_TXQ_CNTXT_ID); free_ring(sc, nm_txq->desc_tag, nm_txq->desc_map, nm_txq->ba, nm_txq->desc); From owner-svn-src-all@freebsd.org Thu Jun 15 20:06:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4799B956E5; Thu, 15 Jun 2017 20:06:42 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84B4B821D8; Thu, 15 Jun 2017 20:06:42 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FK6fZt045608; Thu, 15 Jun 2017 20:06:41 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FK6fak045607; Thu, 15 Jun 2017 20:06:41 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201706152006.v5FK6fak045607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Thu, 15 Jun 2017 20:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319987 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 20:06:42 -0000 Author: stevek Date: Thu Jun 15 20:06:41 2017 New Revision: 319987 URL: https://svnweb.freebsd.org/changeset/base/319987 Log: Replace md(4) usage in diskless(8) script rc.initdiskless with tmpfs(5). Need to multiply the size of the disk passed to mount_md by 512 as mdmfs expects number of 512-byte blocks while tmpfs size option wants number of bytes. Reviewed by: brooks Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D11106 Modified: head/etc/rc.initdiskless Modified: head/etc/rc.initdiskless ============================================================================== --- head/etc/rc.initdiskless Thu Jun 15 19:56:59 2017 (r319986) +++ head/etc/rc.initdiskless Thu Jun 15 20:06:41 2017 (r319987) @@ -195,10 +195,10 @@ handle_remount() { # $1 = mount point to_umount="$b ${to_umount}" } -# Create a generic memory disk +# Create a generic memory disk (using tmpfs) # mount_md() { - /sbin/mdmfs -S -i 4096 -s $1 -M md $2 + mount -t tmpfs -o size=$(($1 * 512)) tmpfs $2 } # Create the memory filesystem if it has not already been created From owner-svn-src-all@freebsd.org Thu Jun 15 20:11:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02671B95928; Thu, 15 Jun 2017 20:11:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6E47825F1; Thu, 15 Jun 2017 20:11:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FKBUS6045835; Thu, 15 Jun 2017 20:11:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FKBUUL045834; Thu, 15 Jun 2017 20:11:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706152011.v5FKBUUL045834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 15 Jun 2017 20:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319988 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 20:11:31 -0000 Author: glebius Date: Thu Jun 15 20:11:29 2017 New Revision: 319988 URL: https://svnweb.freebsd.org/changeset/base/319988 Log: Plug read(2) and write(2) on listening sockets. Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Jun 15 20:06:41 2017 (r319987) +++ head/sys/kern/uipc_socket.c Thu Jun 15 20:11:29 2017 (r319988) @@ -1613,8 +1613,14 @@ sosend(struct socket *so, struct sockaddr *addr, struc int error; CURVNET_SET(so->so_vnet); - error = so->so_proto->pr_usrreqs->pru_sosend(so, addr, uio, top, - control, flags, td); + if (!SOLISTENING(so)) + error = so->so_proto->pr_usrreqs->pru_sosend(so, addr, uio, + top, control, flags, td); + else { + m_freem(top); + m_freem(control); + error = ENOTCONN; + } CURVNET_RESTORE(); return (error); } @@ -2544,8 +2550,11 @@ soreceive(struct socket *so, struct sockaddr **psa, st int error; CURVNET_SET(so->so_vnet); - error = (so->so_proto->pr_usrreqs->pru_soreceive(so, psa, uio, mp0, - controlp, flagsp)); + if (!SOLISTENING(so)) + error = (so->so_proto->pr_usrreqs->pru_soreceive(so, psa, uio, + mp0, controlp, flagsp)); + else + error = ENOTCONN; CURVNET_RESTORE(); return (error); } From owner-svn-src-all@freebsd.org Thu Jun 15 20:11:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50E03B959A1; Thu, 15 Jun 2017 20:11:56 +0000 (UTC) (envelope-from jasone@canonware.com) Received: from canonware.com (canonware.com [204.109.63.53]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3561782777; Thu, 15 Jun 2017 20:11:56 +0000 (UTC) (envelope-from jasone@canonware.com) Received: from maple (unknown [208.67.62.115]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id 1F24928A29; Thu, 15 Jun 2017 13:11:54 -0700 (PDT) Date: Thu, 15 Jun 2017 13:11:52 -0700 From: Jason Evans To: Jason Evans Cc: "O. Hartmann" , Jason Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc Message-Id: <20170615131152.4d3c7dad216234b44cc2686c@canonware.com> In-Reply-To: <20170615080457.3c1438e957f34fb8abd241d1@canonware.com> References: <201706150715.v5F7F6aT031218@repo.freebsd.org> <20170615103157.43bf216e@freyja.zeit4.iv.bundesimmobilien.de> <20170615080457.3c1438e957f34fb8abd241d1@canonware.com> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 20:11:56 -0000 On Thu, 15 Jun 2017 08:04:57 -0700 Jason Evans wrote: > On Thu, 15 Jun 2017 10:31:57 +0200 > "O. Hartmann" wrote: > > > On Thu, 15 Jun 2017 07:15:06 +0000 (UTC) > > Jason Evans wrote: > > > > > Author: jasone > > > Date: Thu Jun 15 07:15:05 2017 > > > New Revision: 319971 > > > URL: https://svnweb.freebsd.org/changeset/base/319971 > > > > > > Log: > > > Update jemalloc to 5.0.0. > > > > On all hosts (running CURRENT: FreeBSD 12.0-CURRENT #15 r319965: Thu Jun 15 > > 05:56:12 CEST 2017 amd64 AND FreeBSD 12.0-CURRENT #20 r319934: Wed Jun 14 > > 06:18:46 CEST 2017 amd64) > > > > buildworld fails on > > > > [...] > > Building /usr/obj/usr/src/lib/libgcc_s/_libinstall > > --- secure/lib/libcrypto__L --- > > --- all_subdir_secure/lib/libcrypto/engines/libaep --- > > /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s > > /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s > > cc: error: linker command failed with exit code 1 (use -v to see invocation) > > *** [libaep.so] Error code 1 > > > > make[6]: stopped in /usr/src/secure/lib/libcrypto/engines/libaep > > .ERROR_TARGET='libaep.so' > > I tested this commit based on r319490. I'm in the process of updating to r319971, and will see if the issue reproduces. I updated from r319490 (with jemalloc update integrated) to r319971, then rebuilt r319971 without issues. Is it possible that the issue you hit isn't directly related to r319971? Thanks, Jason From owner-svn-src-all@freebsd.org Thu Jun 15 21:06:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1538DBEED89; Thu, 15 Jun 2017 21:06:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC074845B6; Thu, 15 Jun 2017 21:06:04 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FL64Lr070987; Thu, 15 Jun 2017 21:06:04 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FL63ri070982; Thu, 15 Jun 2017 21:06:03 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201706152106.v5FL63ri070982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 15 Jun 2017 21:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319989 - in head/sys: dev/bnxt 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 21:06:05 -0000 Author: sbruno Date: Thu Jun 15 21:06:03 2017 New Revision: 319989 URL: https://svnweb.freebsd.org/changeset/base/319989 Log: bnxt(4) Enable LRO support iflib - Handle out of order packet delivery from hardware in support of LRO Out of order updates to rxd's is fixed in r315217. However, it is not completely fixed. While refilling the buffers, iflib is not considering the out of order descriptors. Hence, it is refilling sequentially. "idx" variable in _iflib_fl_refill routine is incremented sequentially. By doing refilling sequentially, it will override the SGEs that are *IN USE* by other connections. Fix is to maintain a bitmap of rx descriptors and differentiate the used one with unused one and refill only at the unused indices. This patch also fixes a few bugs in bnxt, related to the same feature. Submitted by: bhargava.marreddy@broadcom.com Reviewed by: shurd@ Differential Revision: https://reviews.freebsd.org/D10681 Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/bnxt_hwrm.c head/sys/dev/bnxt/bnxt_txrx.c head/sys/dev/bnxt/if_bnxt.c head/sys/net/iflib.c Modified: head/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Thu Jun 15 20:11:29 2017 (r319988) +++ head/sys/dev/bnxt/bnxt.h Thu Jun 15 21:06:03 2017 (r319989) @@ -438,6 +438,7 @@ struct bnxt_ring { uint32_t ring_size; /* Must be a power of two */ uint16_t id; /* Logical ID */ uint16_t phys_id; + struct bnxt_full_tpa_start *tpa_start; }; struct bnxt_cp_ring { @@ -564,7 +565,6 @@ struct bnxt_softc { struct sysctl_ctx_list hw_stats; struct sysctl_oid *hw_stats_oid; - struct bnxt_full_tpa_start *tpa_start; struct bnxt_ver_info *ver_info; struct bnxt_nvram_info *nvm_info; bool wol; Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Thu Jun 15 20:11:29 2017 (r319988) +++ head/sys/dev/bnxt/bnxt_hwrm.c Thu Jun 15 21:06:03 2017 (r319989) @@ -935,7 +935,7 @@ bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, struc /* TODO: Calculate this based on ring size? */ req.max_agg_segs = htole16(3); /* Base this in the allocated TPA start size... */ - req.max_aggs = htole16(2); + req.max_aggs = htole16(7); /* * TODO: max_agg_timer? * req.mag_agg_timer = htole32(XXX); Modified: head/sys/dev/bnxt/bnxt_txrx.c ============================================================================== --- head/sys/dev/bnxt/bnxt_txrx.c Thu Jun 15 20:11:29 2017 (r319988) +++ head/sys/dev/bnxt/bnxt_txrx.c Thu Jun 15 21:06:03 2017 (r319989) @@ -264,6 +264,7 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru) uint8_t flid; uint64_t *paddrs; caddr_t *vaddrs; + qidx_t *frag_idxs; rxqid = iru->iru_qsidx; count = iru->iru_count; @@ -272,6 +273,7 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru) flid = iru->iru_flidx; vaddrs = iru->iru_vaddrs; paddrs = iru->iru_paddrs; + frag_idxs = iru->iru_idxs; if (flid == 0) { rx_ring = &softc->rx_rings[rxqid]; @@ -287,8 +289,8 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru) rxbd[pidx].flags_type = htole16(type); rxbd[pidx].len = htole16(len); /* No need to byte-swap the opaque value */ - rxbd[pidx].opaque = ((rxqid & 0xff) << 24) | (flid << 16) - | pidx; + rxbd[pidx].opaque = (((rxqid & 0xff) << 24) | (flid << 16) + | (frag_idxs[i])); rxbd[pidx].addr = htole64(paddrs[i]); if (++pidx == rx_ring->ring_size) pidx = 0; @@ -329,7 +331,6 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_ struct bnxt_softc *softc = (struct bnxt_softc *)sc; struct bnxt_cp_ring *cpr = &softc->rx_cp_rings[rxqid]; struct rx_pkt_cmpl *rcp; - struct rx_tpa_start_cmpl *rtpa; struct rx_tpa_end_cmpl *rtpae; struct cmpl_base *cmp = (struct cmpl_base *)cpr->ring.vaddr; int avail = 0; @@ -338,7 +339,6 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_ uint8_t ags; int i; uint16_t type; - uint8_t agg_id; for (;;) { NEXT_CP_CONS_V(&cpr->ring, cons, v_bit); @@ -388,18 +388,11 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_ avail++; break; case CMPL_BASE_TYPE_RX_TPA_START: - rtpa = (void *)&cmp[cons]; - agg_id = (rtpa->agg_id & - RX_TPA_START_CMPL_AGG_ID_MASK) >> - RX_TPA_START_CMPL_AGG_ID_SFT; - softc->tpa_start[agg_id].low = *rtpa; NEXT_CP_CONS_V(&cpr->ring, cons, v_bit); CMPL_PREFETCH_NEXT(cpr, cons); if (!CMP_VALID(&cmp[cons], v_bit)) goto cmpl_invalid; - softc->tpa_start[agg_id].high = - ((struct rx_tpa_start_cmpl_hi *)cmp)[cons]; break; case CMPL_BASE_TYPE_RX_AGG: break; @@ -549,7 +542,7 @@ bnxt_pkt_get_tpa(struct bnxt_softc *softc, if_rxd_info /* Get the agg_id */ agg_id = (agend->agg_id & RX_TPA_END_CMPL_AGG_ID_MASK) >> RX_TPA_END_CMPL_AGG_ID_SFT; - tpas = &softc->tpa_start[agg_id]; + tpas = &(softc->rx_rings[ri->iri_qsidx].tpa_start[agg_id]); /* Extract from the first 16-byte BD */ if (le16toh(tpas->low.flags_type) & RX_TPA_START_CMPL_FLAGS_RSS_VALID) { @@ -563,8 +556,8 @@ bnxt_pkt_get_tpa(struct bnxt_softc *softc, if_rxd_info RX_TPA_END_CMPL_AGG_BUFS_SFT; ri->iri_nfrags = ags + 1; /* No need to byte-swap the opaque value */ - ri->iri_frags[0].irf_flid = (tpas->low.opaque >> 16) & 0xff; - ri->iri_frags[0].irf_idx = tpas->low.opaque & 0xffff; + ri->iri_frags[0].irf_flid = ((tpas->low.opaque >> 16) & 0xff); + ri->iri_frags[0].irf_idx = (tpas->low.opaque & 0xffff); ri->iri_frags[0].irf_len = le16toh(tpas->low.len); ri->iri_len = le16toh(tpas->low.len); @@ -600,8 +593,8 @@ bnxt_pkt_get_tpa(struct bnxt_softc *softc, if_rxd_info acp = &((struct rx_abuf_cmpl *)cpr->ring.vaddr)[cpr->cons]; /* No need to byte-swap the opaque value */ - ri->iri_frags[i].irf_flid = (acp->opaque >> 16) & 0xff; - ri->iri_frags[i].irf_idx = acp->opaque & 0xffff; + ri->iri_frags[i].irf_flid = ((acp->opaque >> 16) & 0xff); + ri->iri_frags[i].irf_idx = (acp->opaque & 0xffff); ri->iri_frags[i].irf_len = le16toh(acp->len); ri->iri_len += le16toh(acp->len); } @@ -609,8 +602,8 @@ bnxt_pkt_get_tpa(struct bnxt_softc *softc, if_rxd_info /* And finally, the empty BD at the end... */ ri->iri_nfrags++; /* No need to byte-swap the opaque value */ - ri->iri_frags[i].irf_flid = (agend->opaque >> 16) % 0xff; - ri->iri_frags[i].irf_idx = agend->opaque & 0xffff; + ri->iri_frags[i].irf_flid = ((agend->opaque >> 16) & 0xff); + ri->iri_frags[i].irf_idx = (agend->opaque & 0xffff); ri->iri_frags[i].irf_len = le16toh(agend->len); ri->iri_len += le16toh(agend->len); @@ -623,9 +616,12 @@ bnxt_isc_rxd_pkt_get(void *sc, if_rxd_info_t ri) { struct bnxt_softc *softc = (struct bnxt_softc *)sc; struct bnxt_cp_ring *cpr = &softc->rx_cp_rings[ri->iri_qsidx]; + struct cmpl_base *cmp_q = (struct cmpl_base *)cpr->ring.vaddr; struct cmpl_base *cmp; + struct rx_tpa_start_cmpl *rtpa; uint16_t flags_type; uint16_t type; + uint8_t agg_id; for (;;) { NEXT_CP_CONS_V(&cpr->ring, cpr->cons, cpr->v_bit); @@ -642,9 +638,18 @@ bnxt_isc_rxd_pkt_get(void *sc, if_rxd_info_t ri) case CMPL_BASE_TYPE_RX_TPA_END: return bnxt_pkt_get_tpa(softc, ri, cpr, flags_type); case CMPL_BASE_TYPE_RX_TPA_START: + rtpa = (void *)&cmp_q[cpr->cons]; + agg_id = (rtpa->agg_id & + RX_TPA_START_CMPL_AGG_ID_MASK) >> + RX_TPA_START_CMPL_AGG_ID_SFT; + softc->rx_rings[ri->iri_qsidx].tpa_start[agg_id].low = *rtpa; + NEXT_CP_CONS_V(&cpr->ring, cpr->cons, cpr->v_bit); ri->iri_cidx = RING_NEXT(&cpr->ring, ri->iri_cidx); CMPL_PREFETCH_NEXT(cpr, cpr->cons); + + softc->rx_rings[ri->iri_qsidx].tpa_start[agg_id].high = + ((struct rx_tpa_start_cmpl_hi *)cmp_q)[cpr->cons]; break; default: device_printf(softc->dev, Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Thu Jun 15 20:11:29 2017 (r319988) +++ head/sys/dev/bnxt/if_bnxt.c Thu Jun 15 21:06:03 2017 (r319989) @@ -506,6 +506,17 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, softc->rx_rings[i].vaddr = vaddrs[i * nrxqs + 1]; softc->rx_rings[i].paddr = paddrs[i * nrxqs + 1]; + /* Allocate the TPA start buffer */ + softc->rx_rings[i].tpa_start = malloc(sizeof(struct bnxt_full_tpa_start) * + (RX_TPA_START_CMPL_AGG_ID_MASK >> RX_TPA_START_CMPL_AGG_ID_SFT), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (softc->rx_rings[i].tpa_start == NULL) { + rc = -ENOMEM; + device_printf(softc->dev, + "Unable to allocate space for TPA\n"); + goto tpa_alloc_fail; + } + /* Allocate the AG ring */ softc->ag_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; softc->ag_rings[i].softc = softc; @@ -571,7 +582,10 @@ rss_grp_alloc_fail: iflib_dma_free(&softc->vnic_info.rss_hash_key_tbl); rss_hash_alloc_fail: iflib_dma_free(&softc->vnic_info.mc_list); +tpa_alloc_fail: mc_list_alloc_fail: + for (i = i - 1; i >= 0; i--) + free(softc->rx_rings[i].tpa_start, M_DEVBUF); iflib_dma_free(&softc->rx_stats); hw_stats_alloc_fail: free(softc->grp_info, M_DEVBUF); @@ -635,16 +649,6 @@ bnxt_attach_pre(if_ctx_t ctx) if (rc) goto dma_fail; - /* Allocate the TPA start buffer */ - softc->tpa_start = malloc(sizeof(struct bnxt_full_tpa_start) * - (RX_TPA_START_CMPL_AGG_ID_MASK >> RX_TPA_START_CMPL_AGG_ID_SFT), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (softc->tpa_start == NULL) { - rc = ENOMEM; - device_printf(softc->dev, - "Unable to allocate space for TPA\n"); - goto tpa_failed; - } /* Get firmware version and compare with driver */ softc->ver_info = malloc(sizeof(struct bnxt_ver_info), @@ -814,8 +818,6 @@ nvm_alloc_fail: ver_fail: free(softc->ver_info, M_DEVBUF); ver_alloc_fail: - free(softc->tpa_start, M_DEVBUF); -tpa_failed: bnxt_free_hwrm_dma_mem(softc); dma_fail: BNXT_HWRM_LOCK_DESTROY(softc); @@ -877,7 +879,8 @@ bnxt_detach(if_ctx_t ctx) SLIST_FOREACH_SAFE(tag, &softc->vnic_info.vlan_tags, next, tmp) free(tag, M_DEVBUF); iflib_dma_free(&softc->def_cp_ring_mem); - free(softc->tpa_start, M_DEVBUF); + for (i = 0; i < softc->nrxqsets; i++) + free(softc->rx_rings[i].tpa_start, M_DEVBUF); free(softc->ver_info, M_DEVBUF); free(softc->nvm_info, M_DEVBUF); @@ -1009,14 +1012,17 @@ bnxt_init(if_ctx_t ctx) if (rc) goto fail; -#ifdef notyet - /* Enable LRO/TPA/GRO */ + /* + * Enable LRO/TPA/GRO + * TBD: + * Enable / Disable HW_LRO based on + * ifconfig lro / ifconfig -lro setting + */ rc = bnxt_hwrm_vnic_tpa_cfg(softc, &softc->vnic_info, (if_getcapenable(iflib_get_ifp(ctx)) & IFCAP_LRO) ? HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA : 0); if (rc) goto fail; -#endif for (i = 0; i < softc->ntxqsets; i++) { /* Allocate the statistics context */ Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Jun 15 20:11:29 2017 (r319988) +++ head/sys/net/iflib.c Thu Jun 15 21:06:03 2017 (r319989) @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include /* * enable accounting of every mbuf as it comes in to and goes out of * iflib's software descriptor references @@ -381,6 +382,8 @@ struct iflib_fl { #endif /* implicit pad */ + bitstr_t *ifl_rx_bitmap;; + qidx_t ifl_fragidx; /* constant */ qidx_t ifl_size; uint16_t ifl_buf_size; @@ -1797,7 +1800,7 @@ static void _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count) { struct mbuf *m; - int idx, pidx = fl->ifl_pidx; + int idx, frag_idx = fl->ifl_fragidx, pidx = fl->ifl_pidx; caddr_t cl, *sd_cl; struct mbuf **sd_m; uint8_t *sd_flags; @@ -1840,8 +1843,11 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun * * If the cluster is still set then we know a minimum sized packet was received */ - if ((cl = sd_cl[idx]) == NULL) { - if ((cl = sd_cl[idx] = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) + bit_ffc_at(fl->ifl_rx_bitmap, frag_idx, fl->ifl_size, &frag_idx); + if ((frag_idx < 0) || (frag_idx >= fl->ifl_size)) + bit_ffc(fl->ifl_rx_bitmap, fl->ifl_size, &frag_idx); + if ((cl = sd_cl[frag_idx]) == NULL) { + if ((cl = sd_cl[frag_idx] = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) break; #if MEMORY_LOGGING fl->ifl_cl_enqueued++; @@ -1867,10 +1873,11 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun cb_arg.error = 0; q = fl->ifl_rxq; MPASS(sd_map != NULL); - MPASS(sd_map[idx] != NULL); - err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[idx], + MPASS(sd_map[frag_idx] != NULL); + err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[frag_idx], cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, 0); - bus_dmamap_sync(fl->ifl_desc_tag, sd_map[idx], BUS_DMASYNC_PREREAD); + bus_dmamap_sync(fl->ifl_desc_tag, sd_map[frag_idx], + BUS_DMASYNC_PREREAD); if (err != 0 || cb_arg.error) { /* @@ -1884,12 +1891,13 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun } bus_addr = cb_arg.seg.ds_addr; } - sd_flags[idx] |= RX_SW_DESC_INUSE; + bit_set(fl->ifl_rx_bitmap, frag_idx); + sd_flags[frag_idx] |= RX_SW_DESC_INUSE; - MPASS(sd_m[idx] == NULL); - sd_cl[idx] = cl; - sd_m[idx] = m; - fl->ifl_rxd_idxs[i] = idx; + MPASS(sd_m[frag_idx] == NULL); + sd_cl[frag_idx] = cl; + sd_m[frag_idx] = m; + fl->ifl_rxd_idxs[i] = frag_idx; fl->ifl_bus_addrs[i] = bus_addr; fl->ifl_vm_addrs[i] = cl; fl->ifl_credits++; @@ -1905,8 +1913,8 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun ctx->isc_rxd_refill(ctx->ifc_softc, &iru); i = 0; pidx = idx; + fl->ifl_pidx = idx; } - fl->ifl_pidx = idx; } done: @@ -1920,6 +1928,7 @@ done: bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ctx->isc_rxd_flush(ctx->ifc_softc, fl->ifl_rxq->ifr_id, fl->ifl_id, pidx); + fl->ifl_fragidx = frag_idx; } static __inline void @@ -1999,6 +2008,7 @@ iflib_fl_setup(iflib_fl_t fl) if_ctx_t ctx = rxq->ifr_ctx; if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; + fl->ifl_rx_bitmap = bit_alloc(fl->ifl_size, M_IFLIB, M_WAITOK|M_ZERO); /* ** Free current RX buffer structs and their mbufs */ @@ -2348,6 +2358,7 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int if (map != NULL) bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bit_clear(fl->ifl_rx_bitmap, cidx); } static struct mbuf * @@ -4243,8 +4254,9 @@ iflib_device_deregister(if_ctx_t ctx) iflib_txq_t txq; iflib_rxq_t rxq; device_t dev = ctx->ifc_dev; - int i; + int i, j; struct taskqgroup *tqg; + iflib_fl_t fl; /* Make sure VLANS are not using driver */ if (if_vlantrunkinuse(ifp)) { @@ -4279,6 +4291,10 @@ iflib_device_deregister(if_ctx_t ctx) for (i = 0, rxq = ctx->ifc_rxqs; i < NRXQSETS(ctx); i++, rxq++) { if (rxq->ifr_task.gt_uniq != NULL) taskqgroup_detach(tqg, &rxq->ifr_task); + + for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) + free(fl->ifl_rx_bitmap, M_IFLIB); + } tqg = qgroup_if_config_tqg; if (ctx->ifc_admin_task.gt_uniq != NULL) From owner-svn-src-all@freebsd.org Thu Jun 15 21:14:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C058BEF11C; Thu, 15 Jun 2017 21:14:49 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72E0784A9E; Thu, 15 Jun 2017 21:14:49 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FLEmSc074949; Thu, 15 Jun 2017 21:14:48 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FLEmXZ074948; Thu, 15 Jun 2017 21:14:48 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201706152114.v5FLEmXZ074948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 15 Jun 2017 21:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319990 - head/sys/dev/bnxt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 21:14:49 -0000 Author: sbruno Date: Thu Jun 15 21:14:48 2017 New Revision: 319990 URL: https://svnweb.freebsd.org/changeset/base/319990 Log: bnxt(4): Implement temporary workaround in driver to report supported media types that are currently unavailable from the firmware. e.g. 10G, 25G, 50G & 100G Submitted by: bhargava.marreddy@broadcom.com Reviewed by: venkatkumar.duvvuru@broadcom.com Differential Revision: https://reviews.freebsd.org/D10816 Modified: head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Thu Jun 15 21:06:03 2017 (r319989) +++ head/sys/dev/bnxt/if_bnxt.c Thu Jun 15 21:14:48 2017 (r319990) @@ -287,7 +287,7 @@ static driver_t bnxt_iflib_driver = { * iflib shared context */ -#define BNXT_DRIVER_VERSION "1.0.0.0" +#define BNXT_DRIVER_VERSION "1.0.0.1" char bnxt_driver_version[] = BNXT_DRIVER_VERSION; extern struct if_txrx bnxt_txrx; static struct if_shared_ctx bnxt_sctx_init = { @@ -1158,7 +1158,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if ifmr->ifm_active |= IFM_1000_SGMII; break; default: - ifmr->ifm_active |= IFM_UNKNOWN; + /* + * Workaround: + * Don't return IFM_UNKNOWN until + * Stratus return proper media_type + */ + ifmr->ifm_active |= IFM_1000_KX; break; } break; @@ -1198,7 +1203,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if ifmr->ifm_active |= IFM_10G_T; break; default: - ifmr->ifm_active |= IFM_UNKNOWN; + /* + * Workaround: + * Don't return IFM_UNKNOWN until + * Stratus return proper media_type + */ + ifmr->ifm_active |= IFM_10G_CR1; break; } break; @@ -1219,7 +1229,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if ifmr->ifm_active |= IFM_25G_SR; break; default: - ifmr->ifm_active |= IFM_UNKNOWN; + /* + * Workaround: + * Don't return IFM_UNKNOWN until + * Stratus return proper media_type + */ + ifmr->ifm_active |= IFM_25G_CR; break; } break; @@ -1255,7 +1270,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if ifmr->ifm_active |= IFM_50G_KR2; break; default: - ifmr->ifm_active |= IFM_UNKNOWN; + /* + * Workaround: + * Don't return IFM_UNKNOWN until + * Stratus return proper media_type + */ + ifmr->ifm_active |= IFM_50G_CR2; break; } break; @@ -1276,7 +1296,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if ifmr->ifm_active |= IFM_100G_SR4; break; default: - ifmr->ifm_active |= IFM_UNKNOWN; + /* + * Workaround: + * Don't return IFM_UNKNOWN until + * Stratus return proper media_type + */ + ifmr->ifm_active |= IFM_100G_CR4; break; } default: @@ -2031,9 +2056,6 @@ bnxt_add_media_types(struct bnxt_softc *softc) ifmedia_add(softc->media, IFM_ETHER | IFM_10G_CR1, 0, NULL); break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN: - /* Auto only */ - break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR: @@ -2114,6 +2136,32 @@ bnxt_add_media_types(struct bnxt_softc *softc) if (supported & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB) ifmedia_add(softc->media, IFM_ETHER | IFM_1000_SGMII, 0, NULL); + break; + case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN: + default: + /* + * Workaround for Cumulus & Stratus + * For Stratus: + * media_type is being returned as 0x0 + * Return support speeds as 10G, 25G, 50G & 100G + * + * For Cumulus: + * phy_type is being returned as 0x14 (PHY_TYPE_40G_BASECR4) + * Return support speeds as 1G, 10G, 25G & 50G + */ + if (pci_get_device(softc->dev) == BCM57454) { + /* For Stratus: 10G, 25G, 50G & 100G */ + ifmedia_add(softc->media, IFM_ETHER | IFM_100G_CR4, 0, NULL); + ifmedia_add(softc->media, IFM_ETHER | IFM_50G_CR2, 0, NULL); + ifmedia_add(softc->media, IFM_ETHER | IFM_25G_CR, 0, NULL); + ifmedia_add(softc->media, IFM_ETHER | IFM_10G_CR1, 0, NULL); + } else if (pci_get_device(softc->dev) == BCM57414) { + /* For Cumulus: 1G, 10G, 25G & 50G */ + ifmedia_add(softc->media, IFM_ETHER | IFM_50G_CR2, 0, NULL); + ifmedia_add(softc->media, IFM_ETHER | IFM_25G_CR, 0, NULL); + ifmedia_add(softc->media, IFM_ETHER | IFM_10G_CR1, 0, NULL); + ifmedia_add(softc->media, IFM_ETHER | IFM_1000_T, 0, NULL); + } break; } From owner-svn-src-all@freebsd.org Thu Jun 15 21:34:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 763A5BEF60B; Thu, 15 Jun 2017 21:34:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EF89388; Thu, 15 Jun 2017 21:34:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FLYhvc083087; Thu, 15 Jun 2017 21:34:43 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FLYhAY083086; Thu, 15 Jun 2017 21:34:43 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201706152134.v5FLYhAY083086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 15 Jun 2017 21:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319991 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 21:34:44 -0000 Author: vangyzen Date: Thu Jun 15 21:34:43 2017 New Revision: 319991 URL: https://svnweb.freebsd.org/changeset/base/319991 Log: copy(9): clarify that copystr() does not return EFAULT The previous wording implied that copystr() could return EFAULT. MFC after: 6 weeks Sponsored by: Dell EMC Modified: head/share/man/man9/copy.9 Modified: head/share/man/man9/copy.9 ============================================================================== --- head/share/man/man9/copy.9 Thu Jun 15 21:14:48 2017 (r319990) +++ head/share/man/man9/copy.9 Thu Jun 15 21:34:43 2017 (r319991) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2011 +.Dd June 15, 2017 .Dt COPY 9 .Os .Sh NAME @@ -147,16 +147,20 @@ is .Sh RETURN VALUES The .Nm -functions return 0 on success or +functions return 0 on success. +All but +.Fn copystr +return .Er EFAULT if a bad address is encountered. -In addition, the +The .Fn copyin_nofault and .Fn copyout_nofault functions return .Er EFAULT -if a page fault occurs, and the +if a page fault occurs. +The .Fn copystr and .Fn copyinstr From owner-svn-src-all@freebsd.org Thu Jun 15 23:14:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27973BF1328; Thu, 15 Jun 2017 23:14:06 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E527A64200; Thu, 15 Jun 2017 23:14:05 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5FNE4AU026105; Thu, 15 Jun 2017 23:14:04 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FNE486026104; Thu, 15 Jun 2017 23:14:04 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201706152314.v5FNE486026104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 15 Jun 2017 23:14:04 +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: r319992 - stable/10/contrib/smbfs/lib/smb 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jun 2017 23:14:06 -0000 Author: jpaetzel Date: Thu Jun 15 23:14:04 2017 New Revision: 319992 URL: https://svnweb.freebsd.org/changeset/base/319992 Log: MFC 319670 Fix SMBFS when saved passwords are greater than 18 characters PR: 132302 Submitted by: dhorn2000@gmail.com guru@unixarea.de Modified: stable/10/contrib/smbfs/lib/smb/subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/smbfs/lib/smb/subr.c ============================================================================== --- stable/10/contrib/smbfs/lib/smb/subr.c Thu Jun 15 21:34:43 2017 (r319991) +++ stable/10/contrib/smbfs/lib/smb/subr.c Thu Jun 15 23:14:04 2017 (r319992) @@ -232,6 +232,8 @@ smb_simplecrypt(char *dst, const char *src) islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch); ch ^= pos; pos += 13; + if (pos > 256) + pos -= 256; sprintf(dst, "%02x", ch); dst += 2; } @@ -262,6 +264,8 @@ smb_simpledecrypt(char *dst, const char *src) return EINVAL; ch ^= pos; pos += 13; + if (pos > 256) + pos -= 256; if (isascii(ch)) ch = (isupper(ch) ? ('A' + (ch - 'A' + 13) % 26) : islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch); From owner-svn-src-all@freebsd.org Fri Jun 16 00:00:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CBB4BF1DA6; Fri, 16 Jun 2017 00:00:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0B1365042; Fri, 16 Jun 2017 00:00:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5G002rI042628; Fri, 16 Jun 2017 00:00:02 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5G002kA042627; Fri, 16 Jun 2017 00:00:02 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201706160000.v5G002kA042627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 16 Jun 2017 00:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319993 - stable/11/sys/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 00:00:03 -0000 Author: gjb Date: Fri Jun 16 00:00:01 2017 New Revision: 319993 URL: https://svnweb.freebsd.org/changeset/base/319993 Log: Update stable/11 to BETA2 as part of the 11.1-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/newvers.sh Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Thu Jun 15 23:14:04 2017 (r319992) +++ stable/11/sys/conf/newvers.sh Fri Jun 16 00:00:01 2017 (r319993) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.1" -BRANCH="BETA1" +BRANCH="BETA2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Jun 16 00:44:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C9A3BF29E2; Fri, 16 Jun 2017 00:44:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63EE36639A; Fri, 16 Jun 2017 00:44:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5G0iO90063015; Fri, 16 Jun 2017 00:44:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5G0iNbg063006; Fri, 16 Jun 2017 00:44:23 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201706160044.v5G0iNbg063006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 16 Jun 2017 00:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319994 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 00:44:25 -0000 Author: adrian Date: Fri Jun 16 00:44:23 2017 New Revision: 319994 URL: https://svnweb.freebsd.org/changeset/base/319994 Log: [ar71xx] migrate all of the duplicate configuration out into a shared config file. This brings the default configurations (drivers, net80211 settings, etc) and some of the shared configuration into std.AR_MIPS_BASE. I haven't yet moved the -current settings (witness, memguard, etc) into it. This should simplify building a lot of the same test images for my MIPS AP board development and testing. This is a work in progress; it's not designed to be perfect! Added: head/sys/mips/conf/std.AR_MIPS_BASE (contents, props changed) Modified: head/sys/mips/conf/AP135 head/sys/mips/conf/AR71XX_BASE head/sys/mips/conf/QCA953X_BASE head/sys/mips/conf/std.AR724X head/sys/mips/conf/std.AR91XX head/sys/mips/conf/std.AR933X head/sys/mips/conf/std.AR934X head/sys/mips/conf/std.QCA955X Modified: head/sys/mips/conf/AP135 ============================================================================== --- head/sys/mips/conf/AP135 Fri Jun 16 00:00:01 2017 (r319993) +++ head/sys/mips/conf/AP135 Fri Jun 16 00:44:23 2017 (r319994) @@ -58,13 +58,9 @@ device geom_map device pci device qca955x_pci -device ath_pci -options AR71XX_ATH_EEPROM device firmware # Used by the above +options AR71XX_ATH_EEPROM options ATH_EEPROM_FIRMWARE # Boot off of the rootfs, as defined in the geom_map setup. options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" - -# Default to accept -options IPFIREWALL_DEFAULT_TO_ACCEPT Modified: head/sys/mips/conf/AR71XX_BASE ============================================================================== --- head/sys/mips/conf/AR71XX_BASE Fri Jun 16 00:00:01 2017 (r319993) +++ head/sys/mips/conf/AR71XX_BASE Fri Jun 16 00:44:23 2017 (r319994) @@ -22,13 +22,6 @@ hints "AR71XX_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -# Build these as modules so small platform builds will have the -# modules already built. -makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" - -# For small memory footprints -options VM_KMEM_SIZE_SCALE=1 - options DDB options KDB @@ -57,75 +50,19 @@ options FFS #Berkeley Fast # options UFS_DIRHASH #Improve performance on big directories # options MSDOSFS # Read MSDOS filesystems; useful for USB/CF +include "std.AR_MIPS_BASE" +makeoptions MODULES_OVERRIDE+="hwpmc_mips24k" + device pci device ar71xx_pci -# 802.11 framework -options IEEE80211_DEBUG -options IEEE80211_ALQ -options IEEE80211_SUPPORT_MESH -options IEEE80211_SUPPORT_TDMA -options IEEE80211_AMPDU_AGE -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_xauth # 802.11 hostap support - -# Atheros wireless NICs -device ath # Atheros interface support -device ath_pci # Atheros PCI/Cardbus bus -options ATH_DEBUG -options ATH_DIAGAPI -options ATH_ENABLE_11N -options AH_DEBUG -options AH_DEBUG_ALQ -options ALQ -device ath_hal -option AH_SUPPORT_AR5416 -device ath_rate_sample -option AH_RXCFG_SDMAMW_4BYTES -option AH_AR5416_INTERRUPT_MITIGATION -# There's no DFS radar detection support yet so this won't actually -# detect radars. It however does enable the rest of the channel change -# machinery so DFS can be debugged. -option ATH_ENABLE_DFS - -device mii -device arge - device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order -options USB_DEBUG -options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this device ehci device scbus device umass device da -# On-board SPI flash -device spibus -device ar71xx_spi -device mx25l device ar71xx_wdog - -device uart device uart_ar71xx - device ar71xx_apb - -device loop -device ether -device md -device bpf -device random -device if_bridge -device gif # ip[46] in ip[46] tunneling protocol -device gre # generic encapsulation - only for IPv4 in IPv4 though atm - -options ARGE_DEBUG # Enable if_arge debugging for now - -# Enable GPIO -device gpio -device gpioled Modified: head/sys/mips/conf/QCA953X_BASE ============================================================================== --- head/sys/mips/conf/QCA953X_BASE Fri Jun 16 00:00:01 2017 (r319993) +++ head/sys/mips/conf/QCA953X_BASE Fri Jun 16 00:44:23 2017 (r319994) @@ -26,7 +26,6 @@ options DDB options KDB options ALQ options BREAK_TO_DEBUGGER -options ALT_BREAK_TO_DEBUGGER options SCHED_4BSD #4BSD scheduler options INET #InterNETworking @@ -36,32 +35,9 @@ options TCP_HHOOK # hhook(9) framework for TCP options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -# Don't include the SCSI/CAM strings in the default build -options SCSI_NO_SENSE_STRINGS -options SCSI_NO_OP_STRINGS - -# .. And no sysctl strings -options NO_SYSCTL_DESCR - -# For small memory footprints -options VM_KMEM_SIZE_SCALE=1 - -# Limit IO size -options NBUF=128 - -# Limit UMTX hash size -# options UMTX_NUM_CHAINS=64 - -#options UMA_DEBUG_ALLOC - # PMC options HWPMC_HOOKS -#options HWPMC_MIPS_BACKTRACE -device hwpmc -device hwpmc_mips24k -options ARGE_DEBUG - # options NFS_LEGACYRPC # Debugging for use in -current options INVARIANTS @@ -74,66 +50,21 @@ options FFS #Berkeley Fast Filesy #options UFS_DIRHASH #Improve performance on big directories options NO_FFS_SNAPSHOT # We don't require snapshot support -options IPFIREWALL_DEFAULT_TO_ACCEPT +include "std.AR_MIPS_BASE" +makeoptions MODULES_OVERRIDE+="hwpmc_mips24k" -# Wireless NIC cards -options IEEE80211_DEBUG -options IEEE80211_SUPPORT_MESH -options IEEE80211_SUPPORT_TDMA -options IEEE80211_SUPPORT_SUPERG -options IEEE80211_ALQ # 802.11 ALQ logging support -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_xauth # 802.11 hostap support - -# ath(4) -device ath # Atheros network device -device ath_rate_sample -device ath_ahb # Atheros host bus glue -options ATH_DEBUG -options ATH_DIAGAPI -option ATH_ENABLE_11N -option AH_DEBUG_ALQ - -#device ath_hal -device ath_ar9300 # AR9330 HAL; no need for the others -option AH_DEBUG -option AH_SUPPORT_AR5416 # 11n HAL support option AH_SUPPORT_QCA9530 # Chipset support -option AH_AR5416_INTERRUPT_MITIGATION -device mii -device arge - device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order -options USB_DEBUG -options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this device ehci device scbus device umass device da -device spibus -device ar71xx_spi -device mx25l -device ar71xx_wdog - # Handle 25MHz refclock by allowing a higher baudrate error tolerance. -device uart device uart_ar71xx options UART_DEV_TOLERANCE_PCT=50 device ar71xx_apb -device loop -device ether -device md -device bpf -device random -device if_bridge -device gpio -device gpioled Modified: head/sys/mips/conf/std.AR724X ============================================================================== --- head/sys/mips/conf/std.AR724X Fri Jun 16 00:00:01 2017 (r319993) +++ head/sys/mips/conf/std.AR724X Fri Jun 16 00:44:23 2017 (r319994) @@ -23,13 +23,6 @@ hints "AR724X_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -# Build these as modules so small platform builds will have the -# modules already built. -makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_gre if_tap if_tun libalias ipfw ipfw_nat ipfw_nptv6 if_vlan if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath_main ath_pci ath_hal ath_hal_ar5212 ath_hal_ar5416 ath_hal_ar9300 ath_rate ath_dfs hwpmc hwpmc_mips24k cam" - -# For small memory footprints -options VM_KMEM_SIZE_SCALE=1 - options DDB options KDB options EARLY_PRINTF @@ -42,6 +35,10 @@ options TCP_HHOOK # hhook(9) framework for TCP options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +# PMC +options HWPMC_HOOKS + + #options NFS_LEGACYRPC # Debugging for use in -current options INVARIANTS @@ -51,95 +48,27 @@ options WITNESS_SKIPSPIN options DEBUG_REDZONE options DEBUG_MEMGUARD -# Don't include the SCSI/CAM strings in the default build -options SCSI_NO_SENSE_STRINGS -options SCSI_NO_OP_STRINGS - -# .. And no sysctl strings -options NO_SYSCTL_DESCR - options FFS #Berkeley Fast Filesystem options NO_FFS_SNAPSHOT -options IPFIREWALL_DEFAULT_TO_ACCEPT - # options SOFTUPDATES #Enable FFS soft updates support # options UFS_ACL #Support for access control lists # options UFS_DIRHASH #Improve performance on big directories # options MSDOSFS # Read MSDOS filesystems; useful for USB/CF -options UMTX_CHAINS=16 +include "std.AR_MIPS_BASE" +makeoptions MODULES_OVERRIDE+="hwpmc_mips24k" + device pci device ar724x_pci -# 802.11 framework -options IEEE80211_DEBUG -options IEEE80211_ALQ -options IEEE80211_SUPPORT_MESH -options IEEE80211_SUPPORT_SUPERG -options IEEE80211_SUPPORT_TDMA -options IEEE80211_AMPDU_AGE -#device wlan # 802.11 support -#device wlan_wep # 802.11 WEP support -#device wlan_ccmp # 802.11 CCMP support -#device wlan_tkip # 802.11 TKIP support -#device wlan_xauth # 802.11 hostap support +device usb +device ehci -# Atheros wireless NICs -#device ath # Atheros interface support -#device ath_pci # Atheros PCI/Cardbus bus -options ATH_DEBUG -options ATH_DIAGAPI -options ATH_ENABLE_11N -options AH_DEBUG -options AH_DEBUG_ALQ -options ALQ -#device ath_hal -option AH_SUPPORT_AR5416 -#device ath_rate_sample -option AH_RXCFG_SDMAMW_4BYTES -option AH_AR5416_INTERRUPT_MITIGATION -# There's no DFS radar detection support yet so this won't actually -# detect radars. It however does enable the rest of the channel change -# machinery so DFS can be debugged. -option ATH_ENABLE_DFS - -device mii -device arge -options ARGE_DEBUG # Enable if_arge debugging for now - -#device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order -options USB_DEBUG -options USB_HOST_ALIGN=32 # AR724X (MIPS in general?) requires this -#device ehci - -#device umass - +device umass device scbus device da -# On-board SPI flash -device spibus -device ar71xx_spi -device mx25l -device ar71xx_wdog - -device uart device uart_ar71xx - device ar71xx_apb - -device loop -device ether -device md -device bpf -device random -#device if_bridge -#device gif # ip[46] in ip[46] tunneling protocol -#device gre # generic encapsulation - only for IPv4 in IPv4 though atm - -# Enable GPIO -#device gpio -#device gpioled Modified: head/sys/mips/conf/std.AR91XX ============================================================================== --- head/sys/mips/conf/std.AR91XX Fri Jun 16 00:00:01 2017 (r319993) +++ head/sys/mips/conf/std.AR91XX Fri Jun 16 00:44:23 2017 (r319994) @@ -20,15 +20,11 @@ files "../atheros/files.ar71xx" hints "AR91XX_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc" options DDB options KDB options ALQ -# For small memory footprints -options VM_KMEM_SIZE_SCALE=1 - options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #InterNETworking @@ -39,8 +35,6 @@ options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B r # PMC options HWPMC_HOOKS -device hwpmc -device hwpmc_mips24k # options NFS_LEGACYRPC # Debugging for use in -current @@ -54,70 +48,18 @@ options FFS #Berkeley Fast Filesy #options UFS_DIRHASH #Improve performance on big directories options NO_FFS_SNAPSHOT # We don't require snapshot support -# Wireless NIC cards -options IEEE80211_DEBUG -options IEEE80211_SUPPORT_MESH -options IEEE80211_SUPPORT_TDMA -options IEEE80211_ALQ # 802.11 ALQ logging support -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_xauth # 802.11 hostap support +include "std.AR_MIPS_BASE" -# ath(4) -device ath # Atheros network device -device ath_rate_sample -device ath_ahb # Atheros host bus glue -options ATH_DEBUG -options ATH_DIAGAPI -option ATH_ENABLE_11N - -# Don't bother compiling the whole HAL - AH_SUPPORT_AR9130 breaks the -# rest of the 11n chipset support at the moment and the pre-AR5212 -# HALs aren't required. -# device ath_hal - -# The AR9130 code requires AR5416; and AR5416 requires the AR5212 code. -device ath_ar5212 -device ath_ar5416 -device ath_ar9130 - -options AH_DEBUG -option AH_SUPPORT_AR5416 option AH_SUPPORT_AR9130 # Makes other chipsets not function! -option AH_DEBUG_ALQ # interrupt mitigation not possible on AR9130 -# option AH_AR5416_INTERRUPT_MITIGATION +nooption AH_AR5416_INTERRUPT_MITIGATION -device mii -device arge - device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order -options USB_DEBUG -options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this device ehci device scbus device umass device da -device spibus -device ar71xx_spi -device mx25l -device ar71xx_wdog - -device uart device uart_ar71xx - device ar71xx_apb - -device loop -device ether -device md -device bpf -device random -device if_bridge -device gpio -device gpioled Modified: head/sys/mips/conf/std.AR933X ============================================================================== --- head/sys/mips/conf/std.AR933X Fri Jun 16 00:00:01 2017 (r319993) +++ head/sys/mips/conf/std.AR933X Fri Jun 16 00:44:23 2017 (r319994) @@ -20,15 +20,11 @@ files "../atheros/files.ar71xx" hints "AR933X_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_tap if_tun if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr hwpmc ipfw ipfw_nat libalias ipfw_nptv6 rtwn rtwn_usb rtwnfw otus otusfw hwpmc_mips24k" options DDB options KDB options ALQ -options ALT_BREAK_TO_DEBUGGER -options UMTX_CHAINS=16 - options SCHED_4BSD #4BSD scheduler options INET #InterNETworking #options INET6 #InterNETworking @@ -37,26 +33,8 @@ options TCP_HHOOK # hhook(9) framework for TCP options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -# Don't include the SCSI/CAM strings in the default build -options SCSI_NO_SENSE_STRINGS -options SCSI_NO_OP_STRINGS - -# .. And no sysctl strings -options NO_SYSCTL_DESCR - -# For small memory footprints -options VM_KMEM_SIZE_SCALE=1 - -# Limit IO size -options NBUF=128 - -# Limit UMTX hash size -options UMTX_CHAINS=64 - # PMC options HWPMC_HOOKS -#device hwpmc -#device hwpmc_mips24k # options NFS_LEGACYRPC # Debugging for use in -current @@ -70,64 +48,18 @@ options FFS #Berkeley Fast Filesy #options UFS_DIRHASH #Improve performance on big directories options NO_FFS_SNAPSHOT # We don't require snapshot support -options IPFIREWALL_DEFAULT_TO_ACCEPT +include "std.AR_MIPS_BASE" -# Wireless NIC cards -options IEEE80211_DEBUG -options IEEE80211_SUPPORT_MESH -options IEEE80211_SUPPORT_TDMA -options IEEE80211_SUPPORT_SUPERG -options IEEE80211_ALQ # 802.11 ALQ logging support -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_xauth # 802.11 hostap support +makeoptions MODULES_OVERRIDE+="hwpmc_mips24k" -# ath(4) -device ath # Atheros network device -device ath_rate_sample -device ath_ahb # Atheros host bus glue -options ATH_DEBUG -options ATH_DIAGAPI -option ATH_ENABLE_11N -option AH_DEBUG_ALQ - -#device ath_hal -device ath_ar9300 # AR9330 HAL; no need for the others -option AH_DEBUG -option AH_SUPPORT_AR5416 # 11n HAL support option AH_SUPPORT_AR9330 # Chipset support -option AH_AR5416_INTERRUPT_MITIGATION -device mii -device arge - device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order -options USB_DEBUG -options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this device ehci device scbus device umass device da -device spibus -device ar71xx_spi -device mx25l -device ar71xx_wdog +device uart_ar933x -device uart -device uart_ar933x - -device ar71xx_apb - -device loop -device ether -device md -device bpf -device random -device if_bridge -device gpio -device gpioled Modified: head/sys/mips/conf/std.AR934X ============================================================================== --- head/sys/mips/conf/std.AR934X Fri Jun 16 00:00:01 2017 (r319993) +++ head/sys/mips/conf/std.AR934X Fri Jun 16 00:44:23 2017 (r319994) @@ -20,12 +20,9 @@ files "../atheros/files.ar71xx" hints "AR934X_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_tap if_tun if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr hwpmc ipfw ipfw_nat libalias ipfw_nptv6 rtwn rtwn_usb rtwnfw otus otusfw hwpmc_mips24k" -# makeoptions MODULES_OVERRIDE="" options DDB options KDB -options ALT_BREAK_TO_DEBUGGER options ALQ options SCHED_4BSD #4BSD scheduler @@ -36,23 +33,8 @@ options TCP_HHOOK # hhook(9) framework for TCP options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -# Don't include the SCSI/CAM strings in the default build -options SCSI_NO_SENSE_STRINGS -options SCSI_NO_OP_STRINGS - -# .. And no sysctl strings -options NO_SYSCTL_DESCR - -# Limit IO size -options NBUF=128 - -# Limit UMTX hash size -options UMTX_CHAINS=64 - # PMC options HWPMC_HOOKS -#device hwpmc -#device hwpmc_mips24k # options NFS_LEGACYRPC # Debugging for use in -current @@ -66,66 +48,22 @@ options FFS #Berkeley Fast Filesy #options UFS_DIRHASH #Improve performance on big directories options NO_FFS_SNAPSHOT # We don't require snapshot support -# Wireless NIC cards -options IEEE80211_DEBUG -options IEEE80211_SUPPORT_MESH -options IEEE80211_SUPPORT_TDMA -options IEEE80211_SUPPORT_SUPERG -options IEEE80211_ALQ # 802.11 ALQ logging support -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_xauth # 802.11 hostap support +include "std.AR_MIPS_BASE" +makeoptions MODULES_OVERRIDE+="hwpmc_mips24k" -# ath(4) -device ath # Atheros network device -device ath_rate_sample -device ath_ahb # Atheros host bus glue -options ATH_DEBUG -options ATH_DIAGAPI -option ATH_ENABLE_11N +options AH_SUPPORT_AR9340 -#device ath_hal -device ath_ar9300 # AR9330 HAL; no need for the others -option AH_DEBUG -option AH_SUPPORT_AR5416 # 11n HAL support -option AH_SUPPORT_AR9340 # Chipset support -option AH_DEBUG_ALQ -option AH_AR5416_INTERRUPT_MITIGATION - -device mii -device arge - -device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order -options USB_DEBUG -options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this -device ehci - device pci device ar724x_pci - -device scbus -device umass -device da - -device spibus -device ar71xx_spi -device mx25l -device ar71xx_wdog - -device uart device uart_ar71xx # XXX for now; later a separate APB mux is needed to demux PCI/WLAN interrupts. device ar71xx_apb -device loop -device ether -device md -device bpf -device random -device if_bridge -device gpio -device gpioled +device usb +device ehci + +device scbus +device umass +device da + Added: head/sys/mips/conf/std.AR_MIPS_BASE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/std.AR_MIPS_BASE Fri Jun 16 00:44:23 2017 (r319994) @@ -0,0 +1,96 @@ +# These are the base base bits shared between all of the various Atheros +# MIPS bases. +# +# This allows a shared set of configuration and drivers to be built for +# all of the Atheros MIPS platforms without a lot of configuration file +# duplication. +# +# $FreeBSD$ + +# debugging +options EARLY_PRINTF +options ALT_BREAK_TO_DEBUGGER + +# For small memory footprints +options VM_KMEM_SIZE_SCALE=1 +options UMTX_CHAINS=16 +options NBUF=128 +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS +# .. And no sysctl strings +options NO_SYSCTL_DESCR + +makeoptions MODULES_OVERRIDE+="gpio ar71xx if_gif if_vlan if_gre if_tap" +makeoptions MODULES_OVERRIDE+="if_tun if_bridge bridgestp usb" + +# Random - required during early boot! +device random + +# net80211 +options IEEE80211_DEBUG +options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_TDMA +options IEEE80211_SUPPORT_SUPERG +options IEEE80211_ALQ # 802.11 ALQ logging support + +makeoptions MODULES_OVERRIDE+="wlan wlan_xauth wlan_acl wlan_wep" +makeoptions MODULES_OVERRIDE+="wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr" + +# firewalling +options IPFIREWALL_DEFAULT_TO_ACCEPT + +makeoptions MODULES_OVERRIDE+="ipfw ipfw_nat libalias ipfw_nptv6" + +# USB wifi device drivers +makeoptions MODULES_OVERRIDE+="rtwn rtwn_usb rtwnfw" +makeoptions MODULES_OVERRIDE+="otus otusfw" + +# Atheros wifi device drivers +options ATH_DEBUG +options ATH_DIAGAPI +options ATH_ENABLE_11N +options ATH_ENABLE_DFS + +options AH_DEBUG_ALQ +options AH_DEBUG +options AH_DEBUG_ALQ +options AH_SUPPORT_AR5416 +options AH_AR5416_INTERRUPT_MITIGATION +options AH_RXCFG_SDMAMW_4BYTES + +makeoptions MODULES_OVERRIDE+="ath_main ath_pci ath_ahb ath_rate ath_dfs" +makeoptions MODULES_OVERRIDE+="ath_hal_ar5210 ath_hal_ar5211" +makeoptions MODULES_OVERRIDE+="ath_hal_ar5212 ath_hal_ar5416" +makeoptions MODULES_OVERRIDE+="ath_hal_ar9300 ath_hal" + +# USB configuration +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +options USB_DEBUG +options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this + +# Ethernet configuration +device mii +device arge +options ARGE_DEBUG + +# SPI, flash +device spibus +device ar71xx_spi +device mx25l +device ar71xx_wdog + +# Serial driver +device uart + +# Networking +device loop +device ether +device md +device bpf +#device if_bridge + +# GPIO - normally it's okay as a module +#device gpio +#device gpioled + Modified: head/sys/mips/conf/std.QCA955X ============================================================================== --- head/sys/mips/conf/std.QCA955X Fri Jun 16 00:00:01 2017 (r319993) +++ head/sys/mips/conf/std.QCA955X Fri Jun 16 00:44:23 2017 (r319994) @@ -17,17 +17,9 @@ cpu CPU_MIPS74K makeoptions KERNLOADADDR=0x80050000 options HZ=1000 -#options BREAK_TO_DEBUGGER -options ALT_BREAK_TO_DEBUGGER - -# options BOOTVERBOSE=10 - files "../atheros/files.ar71xx" hints "QCA955X_BASE.hints" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_tap if_tun if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr hwpmc ipfw ipfw_nat libalias ipfw_nptv6 rtwn rtwn_usb rtwnfw otus otusfw" - options DDB options KDB options ALQ @@ -40,23 +32,8 @@ options TCP_HHOOK # hhook(9) framework for TCP options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -# Don't include the SCSI/CAM strings in the default build -options SCSI_NO_SENSE_STRINGS -options SCSI_NO_OP_STRINGS - -# .. And no sysctl strings -options NO_SYSCTL_DESCR - -# Limit IO size -options NBUF=128 - -# Limit UMTX hash size -# options UMTX_NUM_CHAINS=64 - # PMC - fow now there's no hwpmc module for mips74k -#options HWPMC_HOOKS -#device hwpmc -#device hwpmc_mips74k +options HWPMC_HOOKS # options NFS_LEGACYRPC # Debugging for use in -current @@ -70,55 +47,10 @@ options FFS #Berkeley Fast Filesy #options UFS_DIRHASH #Improve performance on big directories options NO_FFS_SNAPSHOT # We don't require snapshot support -# Wireless NIC cards -options IEEE80211_DEBUG -options IEEE80211_SUPPORT_MESH -options IEEE80211_SUPPORT_TDMA -options IEEE80211_SUPPORT_SUPERG -options IEEE80211_ALQ # 802.11 ALQ logging support -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_xauth # 802.11 hostap support +include "std.AR_MIPS_BASE" +makeoptions MODULES_OVERRIDE+="hwpmc_mips74k" -# ath(4) -device ath # Atheros network device -device ath_rate_sample -device ath_ahb # Atheros host bus glue -options ATH_DEBUG -options ATH_DIAGAPI -option ATH_ENABLE_11N -option AH_DEBUG_ALQ - -#device ath_hal -device ath_ar9300 # AR9330 HAL; no need for the others -option AH_DEBUG -option AH_SUPPORT_AR5416 # 11n HAL support option AH_SUPPORT_QCA9550 # Chipset support -option AH_DEBUG_ALQ -option AH_AR5416_INTERRUPT_MITIGATION - -device mii -device arge -options ARGE_DEBUG - -device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order -options USB_DEBUG -options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this -device ehci - -device scbus -device umass -device da - -device spibus -device ar71xx_spi -device mx25l -device ar71xx_wdog - -device uart device uart_ar71xx device ar71xx_apb @@ -126,16 +58,10 @@ device ar71xx_apb # we'll have to stick to shared interrupts for IP2/IP3 demux. # device qca955x_apb -device loop -device ether -device md -device bpf -device random -device if_bridge -device gpio -device gpioled +device usb +device ehci -#options KTR -#options KTR_MASK=(KTR_INTR) -#options KTR_COMPILE=(KTR_INTR) -#options KTR_VERBOSE +device scbus +device umass +device da + From owner-svn-src-all@freebsd.org Fri Jun 16 01:26:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0FEABF340B; Fri, 16 Jun 2017 01:26:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7A57670D3; Fri, 16 Jun 2017 01:26:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5G1Q1L1079134; Fri, 16 Jun 2017 01:26:01 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5G1Q1Fm079133; Fri, 16 Jun 2017 01:26:01 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201706160126.v5G1Q1Fm079133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 16 Jun 2017 01:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319995 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 01:26:03 -0000 Author: araujo Date: Fri Jun 16 01:26:01 2017 New Revision: 319995 URL: https://svnweb.freebsd.org/changeset/base/319995 Log: Check if pthread_create(3) successfully created the thread prior to call pthread_join(3). The variable tid is not yet initialized in case the authentication fails at early stage, that would lead pthread_join be called with an uninitialized variable. CID: 1375950 Reported by: Coverity, cem Reviewed by: cem MFC after: 3 weeks. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D11150 Modified: head/usr.sbin/bhyve/rfb.c Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Fri Jun 16 00:44:23 2017 (r319994) +++ head/usr.sbin/bhyve/rfb.c Fri Jun 16 01:26:01 2017 (r319995) @@ -769,6 +769,7 @@ rfb_handle(struct rfb_softc *rc, int cfd) pthread_t tid; uint32_t sres = 0; int len; + int perror = 1; rc->cfd = cfd; @@ -878,8 +879,9 @@ rfb_handle(struct rfb_softc *rc, int cfd) rfb_send_screen(rc, cfd, 1); - pthread_create(&tid, NULL, rfb_wr_thr, rc); - pthread_set_name_np(tid, "rfbout"); + perror = pthread_create(&tid, NULL, rfb_wr_thr, rc); + if (perror == 0) + pthread_set_name_np(tid, "rfbout"); /* Now read in client requests. 1st byte identifies type */ for (;;) { @@ -915,7 +917,8 @@ rfb_handle(struct rfb_softc *rc, int cfd) } done: rc->cfd = -1; - pthread_join(tid, NULL); + if (perror == 0) + pthread_join(tid, NULL); if (rc->enc_zlib_ok) deflateEnd(&rc->zstream); } From owner-svn-src-all@freebsd.org Fri Jun 16 04:28:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 330D2BF5F6B; Fri, 16 Jun 2017 04:28:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83B196F6FC; Fri, 16 Jun 2017 04:28:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5G4SA88052705; Fri, 16 Jun 2017 04:28:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5G4SANi052704; Fri, 16 Jun 2017 04:28:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706160428.v5G4SANi052704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 16 Jun 2017 04:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319996 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 04:28:12 -0000 Author: bdrewery Date: Fri Jun 16 04:28:10 2017 New Revision: 319996 URL: https://svnweb.freebsd.org/changeset/base/319996 Log: WITH_META_MODE: Don't try showing command if .ERROR_META_FILE is empty. This was sed'ing on stdin for failing .PHONY targets. Reported by: Mark Millard X-MFC-With: r319862 MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/share/mk/local.sys.mk Modified: head/share/mk/local.sys.mk ============================================================================== --- head/share/mk/local.sys.mk Fri Jun 16 01:26:01 2017 (r319995) +++ head/share/mk/local.sys.mk Fri Jun 16 04:28:10 2017 (r319996) @@ -13,7 +13,8 @@ MAKE_PRINT_VAR_ON_ERROR += \ .MAKE.MODE .endif -_ERROR_CMD=${sed -n '/^CMD/s,^CMD ,,p' ${.ERROR_META_FILE}:L:sh} +_ERROR_CMD_EXEC= ${sed -n '/^CMD/s,^CMD ,,p' ${.ERROR_META_FILE}:L:sh} +_ERROR_CMD= ${!empty(.ERROR_META_FILE):?${_ERROR_CMD_EXEC}:.PHONY} MAKE_PRINT_VAR_ON_ERROR+= \ _ERROR_CMD \ .CURDIR \ From owner-svn-src-all@freebsd.org Fri Jun 16 06:12:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECEF0BF766D; Fri, 16 Jun 2017 06:12:10 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E4A371EE6; Fri, 16 Jun 2017 06:12:10 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5G6C9pD096714; Fri, 16 Jun 2017 06:12:09 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5G6C8Uq096006; Fri, 16 Jun 2017 06:12:08 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201706160612.v5G6C8Uq096006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Fri, 16 Jun 2017 06:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319997 - in vendor/Juniper/libxo/dist: doc libxo tests/core tests/core/saved xohtml 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 06:12:11 -0000 Author: phil Date: Fri Jun 16 06:12:07 2017 New Revision: 319997 URL: https://svnweb.freebsd.org/changeset/base/319997 Log: Import libxo 0.8.2 Modified: vendor/Juniper/libxo/dist/doc/libxo-manual.html vendor/Juniper/libxo/dist/libxo/libxo.c vendor/Juniper/libxo/dist/tests/core/saved/test_01.E.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.H.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.HIPx.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.HP.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.J.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.JP.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.T.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.X.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.XP.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out vendor/Juniper/libxo/dist/tests/core/test_01.c vendor/Juniper/libxo/dist/xohtml/xohtml.css vendor/Juniper/libxo/dist/xohtml/xohtml.sh.in Modified: vendor/Juniper/libxo/dist/doc/libxo-manual.html ============================================================================== --- vendor/Juniper/libxo/dist/doc/libxo-manual.html Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/doc/libxo-manual.html Fri Jun 16 06:12:07 2017 (r319997) @@ -22011,7 +22011,7 @@ jQuery(function ($) { -June 8, 2017 +June 14, 2017

libxo: The Easy Way to Generate text, XML, JSON, and HTML output
libxo-manual

Modified: vendor/Juniper/libxo/dist/libxo/libxo.c ============================================================================== --- vendor/Juniper/libxo/dist/libxo/libxo.c Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/libxo/libxo.c Fri Jun 16 06:12:07 2017 (r319997) @@ -95,6 +95,14 @@ #include #endif /* HAVE_GETTEXT */ +/* Rather lame that we can't count on these... */ +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + /* * Three styles of specifying thread-local variables are supported. * configure.ac has the brains to run each possibility through the @@ -473,6 +481,7 @@ static void xo_buf_append_div (xo_handle_t *xop, const char *class, xo_xff_flags_t flags, const char *name, ssize_t nlen, const char *value, ssize_t vlen, + const char *fmt, ssize_t flen, const char *encoding, ssize_t elen); static void @@ -1761,7 +1770,8 @@ xo_message_hcv (xo_handle_t *xop, int code, const char rc += rc2; } - xo_buf_append_div(xop, "message", 0, NULL, 0, bp, rc, NULL, 0); + xo_buf_append_div(xop, "message", 0, NULL, 0, bp, rc, + NULL, 0, NULL, 0); } break; @@ -2703,6 +2713,8 @@ xo_format_string_direct (xo_handle_t *xop, xo_buffer_t if ((flags & XFF_UNESCAPE) && (*cp == '\\' || *cp == '%')) { cp += 1; len -= 1; + if (len == 0 || *cp == '\0') + break; } } @@ -3644,6 +3656,10 @@ xo_do_format_field (xo_handle_t *xop, xo_buffer_t *xbp return 0; } +/* + * Remove any numeric precision/width format from the format string by + * inserting the "%" after the [0-9]+, returning the substring. + */ static char * xo_fix_encoding (xo_handle_t *xop UNUSED, char *encoding) { @@ -3657,8 +3673,7 @@ xo_fix_encoding (xo_handle_t *xop UNUSED, char *encodi break; } - cp -= 1; - *cp = '%'; + *--cp = '%'; /* Back off and insert the '%' */ return cp; } @@ -3777,10 +3792,35 @@ xo_format_humanize (xo_handle_t *xop, xo_buffer_t *xbp } } +/* + * Convenience function that either append a fixed value (if one is + * given) or formats a field using a format string. If it's + * encode_only, then we can't skip formatting the field, since it may + * be pulling arguments off the stack. + */ +static inline void +xo_simple_field (xo_handle_t *xop, unsigned encode_only, + const char *value, ssize_t vlen, + const char *fmt, ssize_t flen, xo_xff_flags_t flags) +{ + if (encode_only) + flags |= XFF_NO_OUTPUT; + + if (vlen == 0) + xo_do_format_field(xop, NULL, fmt, flen, flags); + else if (!encode_only) + xo_data_append_content(xop, value, vlen, flags); +} + +/* + * Html mode: append a
to the output buffer contain a field + * along with all the supporting information indicated by the flags. + */ static void xo_buf_append_div (xo_handle_t *xop, const char *class, xo_xff_flags_t flags, const char *name, ssize_t nlen, const char *value, ssize_t vlen, + const char *fmt, ssize_t flen, const char *encoding, ssize_t elen) { static char div_start[] = "
xo_columns; save.xhs_anchor_columns = xop->xo_anchor_columns; - xo_do_format_field(xop, NULL, value, vlen, flags); + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); if (flags & XFF_HUMANIZE) { /* @@ -4023,14 +4063,14 @@ xo_format_text (xo_handle_t *xop, const char *str, ssi break; case XO_STYLE_HTML: - xo_buf_append_div(xop, "text", 0, NULL, 0, str, len, NULL, 0); + xo_buf_append_div(xop, "text", 0, NULL, 0, str, len, NULL, 0, NULL, 0); break; } } static void xo_format_title (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { const char *fmt = xfip->xfi_format; ssize_t flen = xfip->xfi_flen; @@ -4054,8 +4094,7 @@ xo_format_title (xo_handle_t *xop, xo_field_info_t *xf * Even though we don't care about text, we need to do * enough parsing work to skip over the right bits of xo_vap. */ - if (len == 0) - xo_do_format_field(xop, NULL, fmt, flen, flags | XFF_NO_OUTPUT); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); return; } @@ -4074,17 +4113,17 @@ xo_format_title (xo_handle_t *xop, xo_field_info_t *xf } start = xbp->xb_curp - xbp->xb_bufp; /* Reset start */ - if (len) { + if (vlen) { char *newfmt = alloca(flen + 1); memcpy(newfmt, fmt, flen); newfmt[flen] = '\0'; /* If len is non-zero, the format string apply to the name */ - char *newstr = alloca(len + 1); - memcpy(newstr, str, len); - newstr[len] = '\0'; + char *newstr = alloca(vlen + 1); + memcpy(newstr, value, vlen); + newstr[vlen] = '\0'; - if (newstr[len - 1] == 's') { + if (newstr[vlen - 1] == 's') { char *bp; rc = snprintf(NULL, 0, newfmt, newstr); @@ -4166,8 +4205,9 @@ xo_arg (xo_handle_t *xop) static void xo_format_value (xo_handle_t *xop, const char *name, ssize_t nlen, - const char *format, ssize_t flen, - const char *encoding, ssize_t elen, xo_xff_flags_t flags) + const char *value, ssize_t vlen, + const char *fmt, ssize_t flen, + const char *encoding, ssize_t elen, xo_xff_flags_t flags) { int pretty = XOF_ISSET(xop, XOF_PRETTY); int quote; @@ -4253,7 +4293,7 @@ xo_format_value (xo_handle_t *xop, const char *name, s save.xhs_columns = xop->xo_columns; save.xhs_anchor_columns = xop->xo_anchor_columns; - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); if (flags & XFF_HUMANIZE) xo_format_humanize(xop, xbp, &save, flags); @@ -4263,8 +4303,8 @@ xo_format_value (xo_handle_t *xop, const char *name, s if (flags & XFF_ENCODE_ONLY) flags |= XFF_NO_OUTPUT; - xo_buf_append_div(xop, "data", flags, name, nlen, - format, flen, encoding, elen); + xo_buf_append_div(xop, "data", flags, name, nlen, value, vlen, + fmt, flen, encoding, elen); break; case XO_STYLE_XML: @@ -4273,25 +4313,24 @@ xo_format_value (xo_handle_t *xop, const char *name, s * let the formatting code handle the va_arg popping. */ if (flags & XFF_DISPLAY_ONLY) { - flags |= XFF_NO_OUTPUT; - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); break; } if (encoding) { - format = encoding; + fmt = encoding; flen = elen; } else { char *enc = alloca(flen + 1); - memcpy(enc, format, flen); + memcpy(enc, fmt, flen); enc[flen] = '\0'; - format = xo_fix_encoding(xop, enc); - flen = strlen(format); + fmt = xo_fix_encoding(xop, enc); + flen = strlen(fmt); } if (nlen == 0) { static char missing[] = "missing-field-name"; - xo_failure(xop, "missing field name: %s", format); + xo_failure(xop, "missing field name: %s", fmt); name = missing; nlen = sizeof(missing) - 1; } @@ -4327,7 +4366,9 @@ xo_format_value (xo_handle_t *xop, const char *name, s } xo_data_append(xop, ">", 1); - xo_do_format_field(xop, NULL, format, flen, flags); + + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); + xo_data_append(xop, "", 1); @@ -4337,20 +4378,19 @@ xo_format_value (xo_handle_t *xop, const char *name, s case XO_STYLE_JSON: if (flags & XFF_DISPLAY_ONLY) { - flags |= XFF_NO_OUTPUT; - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); break; } if (encoding) { - format = encoding; + fmt = encoding; flen = elen; } else { char *enc = alloca(flen + 1); - memcpy(enc, format, flen); + memcpy(enc, fmt, flen); enc[flen] = '\0'; - format = xo_fix_encoding(xop, enc); - flen = strlen(format); + fmt = xo_fix_encoding(xop, enc); + flen = strlen(fmt); } int first = (xop->xo_stack[xop->xo_depth].xs_flags & XSF_NOT_FIRST) @@ -4362,18 +4402,20 @@ xo_format_value (xo_handle_t *xop, const char *name, s quote = 1; else if (flags & XFF_NOQUOTE) quote = 0; + else if (vlen != 0) + quote = 1; else if (flen == 0) { quote = 0; - format = "true"; /* JSON encodes empty tags as a boolean true */ + fmt = "true"; /* JSON encodes empty tags as a boolean true */ flen = 4; - } else if (strchr("diouDOUeEfFgG", format[flen - 1]) == NULL) + } else if (strchr("diouDOUeEfFgG", fmt[flen - 1]) == NULL) quote = 1; else quote = 0; if (nlen == 0) { static char missing[] = "missing-field-name"; - xo_failure(xop, "missing field name: %s", format); + xo_failure(xop, "missing field name: %s", fmt); name = missing; nlen = sizeof(missing) - 1; } @@ -4407,7 +4449,7 @@ xo_format_value (xo_handle_t *xop, const char *name, s if (quote) xo_data_append(xop, "\"", 1); - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); if (quote) xo_data_append(xop, "\"", 1); @@ -4415,39 +4457,39 @@ xo_format_value (xo_handle_t *xop, const char *name, s case XO_STYLE_SDPARAMS: if (flags & XFF_DISPLAY_ONLY) { - flags |= XFF_NO_OUTPUT; - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); break; } if (encoding) { - format = encoding; + fmt = encoding; flen = elen; } else { char *enc = alloca(flen + 1); - memcpy(enc, format, flen); + memcpy(enc, fmt, flen); enc[flen] = '\0'; - format = xo_fix_encoding(xop, enc); - flen = strlen(format); + fmt = xo_fix_encoding(xop, enc); + flen = strlen(fmt); } if (nlen == 0) { static char missing[] = "missing-field-name"; - xo_failure(xop, "missing field name: %s", format); + xo_failure(xop, "missing field name: %s", fmt); name = missing; nlen = sizeof(missing) - 1; } xo_data_escape(xop, name, nlen); xo_data_append(xop, "=\"", 2); - xo_do_format_field(xop, NULL, format, flen, flags); + + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); + xo_data_append(xop, "\" ", 2); break; case XO_STYLE_ENCODER: if (flags & XFF_DISPLAY_ONLY) { - flags |= XFF_NO_OUTPUT; - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); break; } @@ -4457,27 +4499,27 @@ xo_format_value (xo_handle_t *xop, const char *name, s quote = 0; else if (flen == 0) { quote = 0; - format = "true"; /* JSON encodes empty tags as a boolean true */ + fmt = "true"; /* JSON encodes empty tags as a boolean true */ flen = 4; - } else if (strchr("diouxXDOUeEfFgGaAcCp", format[flen - 1]) == NULL) + } else if (strchr("diouxXDOUeEfFgGaAcCp", fmt[flen - 1]) == NULL) quote = 1; else quote = 0; if (encoding) { - format = encoding; + fmt = encoding; flen = elen; } else { char *enc = alloca(flen + 1); - memcpy(enc, format, flen); + memcpy(enc, fmt, flen); enc[flen] = '\0'; - format = xo_fix_encoding(xop, enc); - flen = strlen(format); + fmt = xo_fix_encoding(xop, enc); + flen = strlen(fmt); } if (nlen == 0) { static char missing[] = "missing-field-name"; - xo_failure(xop, "missing field name: %s", format); + xo_failure(xop, "missing field name: %s", fmt); name = missing; nlen = sizeof(missing) - 1; } @@ -4487,7 +4529,9 @@ xo_format_value (xo_handle_t *xop, const char *name, s xo_data_append(xop, "", 1); ssize_t value_offset = xo_buf_offset(&xop->xo_data); - xo_do_format_field(xop, NULL, format, flen, flags); + + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); + xo_data_append(xop, "", 1); xo_encoder_handle(xop, quote ? XO_OP_STRING : XO_OP_CONTENT, @@ -4536,37 +4580,27 @@ xo_set_gettext_domain (xo_handle_t *xop, xo_field_info static void xo_format_content (xo_handle_t *xop, const char *class_name, const char *tag_name, - const char *str, ssize_t len, const char *fmt, ssize_t flen, + const char *value, ssize_t vlen, + const char *fmt, ssize_t flen, xo_xff_flags_t flags) { switch (xo_style(xop)) { case XO_STYLE_TEXT: - if (len) - xo_data_append_content(xop, str, len, flags); - else - xo_do_format_field(xop, NULL, fmt, flen, flags); + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); break; case XO_STYLE_HTML: - if (len == 0) { - str = fmt; - len = flen; - } - - xo_buf_append_div(xop, class_name, flags, NULL, 0, str, len, NULL, 0); + xo_buf_append_div(xop, class_name, flags, NULL, 0, + value, vlen, fmt, flen, NULL, 0); break; case XO_STYLE_XML: case XO_STYLE_JSON: case XO_STYLE_SDPARAMS: if (tag_name) { - if (len == 0) { - str = fmt; - len = flen; - } - xo_open_container_h(xop, tag_name); - xo_format_value(xop, "message", 7, str, len, NULL, 0, flags); + xo_format_value(xop, "message", 7, value, vlen, + fmt, flen, NULL, 0, flags); xo_close_container_h(xop, tag_name); } else { @@ -4574,16 +4608,12 @@ xo_format_content (xo_handle_t *xop, const char *class * Even though we don't care about labels, we need to do * enough parsing work to skip over the right bits of xo_vap. */ - if (len == 0) - xo_do_format_field(xop, NULL, fmt, flen, - flags | XFF_NO_OUTPUT); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); } break; case XO_STYLE_ENCODER: - if (len == 0) - xo_do_format_field(xop, NULL, fmt, flen, - flags | XFF_NO_OUTPUT); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); break; } } @@ -4898,7 +4928,7 @@ xo_colors_handle_html (xo_handle_t *xop, xo_colors_t * static void xo_format_colors (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { const char *fmt = xfip->xfi_format; ssize_t flen = xfip->xfi_flen; @@ -4906,13 +4936,13 @@ xo_format_colors (xo_handle_t *xop, xo_field_info_t *x xo_buffer_t xb; /* If the string is static and we've in an encoding style, bail */ - if (len != 0 && xo_style_is_encoding(xop)) + if (vlen != 0 && xo_style_is_encoding(xop)) return; xo_buf_init(&xb); - if (len) - xo_buf_append(&xb, str, len); + if (vlen) + xo_buf_append(&xb, value, vlen); else if (flen) xo_do_format_field(xop, &xb, fmt, flen, 0); else @@ -4972,7 +5002,7 @@ xo_format_colors (xo_handle_t *xop, xo_field_info_t *x static void xo_format_units (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { const char *fmt = xfip->xfi_format; ssize_t flen = xfip->xfi_flen; @@ -4982,7 +5012,7 @@ xo_format_units (xo_handle_t *xop, xo_field_info_t *xf static char units_start_html[] = " data-units=\""; if (!XOIF_ISSET(xop, XOIF_UNITS_PENDING)) { - xo_format_content(xop, "units", NULL, str, len, fmt, flen, flags); + xo_format_content(xop, "units", NULL, value, vlen, fmt, flen, flags); return; } @@ -4997,8 +5027,8 @@ xo_format_units (xo_handle_t *xop, xo_field_info_t *xf else return; - if (len) - xo_data_escape(xop, str, len); + if (vlen) + xo_data_escape(xop, value, vlen); else xo_do_format_field(xop, NULL, fmt, flen, flags); @@ -5026,7 +5056,7 @@ xo_format_units (xo_handle_t *xop, xo_field_info_t *xf static ssize_t xo_find_width (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { const char *fmt = xfip->xfi_format; ssize_t flen = xfip->xfi_flen; @@ -5035,10 +5065,10 @@ xo_find_width (xo_handle_t *xop, xo_field_info_t *xfip char *bp; char *cp; - if (len) { - bp = alloca(len + 1); /* Make local NUL-terminated copy of str */ - memcpy(bp, str, len); - bp[len] = '\0'; + if (vlen) { + bp = alloca(vlen + 1); /* Make local NUL-terminated copy of value */ + memcpy(bp, value, vlen); + bp[vlen] = '\0'; width = strtol(bp, &cp, 0); if (width == LONG_MIN || width == LONG_MAX @@ -5075,7 +5105,7 @@ xo_anchor_clear (xo_handle_t *xop) */ static void xo_anchor_start (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { if (xo_style(xop) != XO_STYLE_TEXT && xo_style(xop) != XO_STYLE_HTML) return; @@ -5092,12 +5122,12 @@ xo_anchor_start (xo_handle_t *xop, xo_field_info_t *xf * Now we find the width, if possible. If it's not there, * we'll get it on the end anchor. */ - xop->xo_anchor_min_width = xo_find_width(xop, xfip, str, len); + xop->xo_anchor_min_width = xo_find_width(xop, xfip, value, vlen); } static void xo_anchor_stop (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { if (xo_style(xop) != XO_STYLE_TEXT && xo_style(xop) != XO_STYLE_HTML) return; @@ -5109,7 +5139,7 @@ xo_anchor_stop (xo_handle_t *xop, xo_field_info_t *xfi XOIF_CLEAR(xop, XOIF_UNITS_PENDING); - ssize_t width = xo_find_width(xop, xfip, str, len); + ssize_t width = xo_find_width(xop, xfip, value, vlen); if (width == 0) width = xop->xo_anchor_min_width; @@ -6213,12 +6243,12 @@ xo_do_emit_fields (xo_handle_t *xop, xo_field_info_t * if (flags & XFF_WS) { xo_format_content(xop, "padding", NULL, " ", 1, NULL, 0, flags); - flags &= ~XFF_WS; /* Block later handling of this */ + flags &= ~XFF_WS; /* Prevent later handling of this flag */ } } if (ftype == 'V') - xo_format_value(xop, content, clen, + xo_format_value(xop, content, clen, NULL, 0, xfip->xfi_format, xfip->xfi_flen, xfip->xfi_encoding, xfip->xfi_elen, flags); else if (ftype == '[') @@ -7899,7 +7929,8 @@ xo_error_hv (xo_handle_t *xop, const char *fmt, va_lis case XO_STYLE_HTML: va_copy(xop->xo_vap, vap); - xo_buf_append_div(xop, "error", 0, NULL, 0, fmt, strlen(fmt), NULL, 0); + xo_buf_append_div(xop, "error", 0, NULL, 0, NULL, 0, + fmt, strlen(fmt), NULL, 0); if (XOIF_ISSET(xop, XOIF_DIV_OPEN)) xo_line_close(xop); @@ -7915,7 +7946,8 @@ xo_error_hv (xo_handle_t *xop, const char *fmt, va_lis va_copy(xop->xo_vap, vap); xo_open_container_h(xop, "error"); - xo_format_value(xop, "message", 7, fmt, strlen(fmt), NULL, 0, 0); + xo_format_value(xop, "message", 7, NULL, 0, + fmt, strlen(fmt), NULL, 0, 0); xo_close_container_h(xop, "error"); va_end(xop->xo_vap); @@ -8132,7 +8164,7 @@ xo_emit_warn_hcv (xo_handle_t *xop, int as_warning, in xo_buffer_t *src = &temp.xo_data; xo_format_value(xop, "message", 7, src->xb_bufp, - src->xb_curp - src->xb_bufp, NULL, 0, 0); + src->xb_curp - src->xb_bufp, NULL, 0, NULL, 0, 0); xo_free(temp.xo_stack); xo_buf_cleanup(src); Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.E.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.E.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.E.out Fri Jun 16 06:12:07 2017 (r319997) @@ -1,5 +1,6 @@ op create: [] [] [0] op open_container: [top] [] [0x810] +op content: [used-percent] [12] [0] op content: [kve_start] [0xdeadbeef] [0x8] op content: [kve_end] [0xcabb1e] [0x8] op string: [host] [my-box] [0x200000] @@ -129,6 +130,9 @@ op string: [mode_octal] [octal] [0x8] op string: [links] [links] [0x1000] op string: [user] [user] [0x1000] op string: [group] [group] [0x1000] +op string: [pre] [that] [0x8] +op content: [links] [3] [0x1000] +op string: [post] [this] [0x1000] op string: [mode] [/some/file] [0x1000] op content: [mode_octal] [640] [0x8] op content: [links] [1] [0x1000] Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.H.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.H.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.H.out Fri Jun 16 06:12:07 2017 (r319997) @@ -1,2 +1,2 @@ -
testing argument modifier
my-box
.
example.com
...
testing argument modifier with encoding to
.
example.com
...
Label text
value
very
42
42 -
Connecting to
my-box
.
example.com
...
Item
Total Sold
In Stock
On Order
SKU
gum
1412
54
10
GRO-000-415
rope
85
4
2
HRD-000-212
ladder
0
2
1
HRD-000-517
bolt
4123
144
42
HRD-000-632
water
17
14
2
GRO-000-2331
Item
'
gum
':
Total sold
:
1412.0
In stock
:
54
On order
:
10
SKU
:
GRO-000-415
Item
'
rope
':
Total sold
:
85.0
In stock
:
4
On order
:
2
SKU
:
HRD-000-212
Item
'
ladder
':
Total sold
! :
0
In stock
:
2
On order
:
1
SKU
:
HRD-000-517
Item
'
bolt
':
Total sold
:
4123.0
In s tock
:
144
On order
:
42
SKU
:
HRD-000-632
Item
'
water
':
Total sold
:
17.0
In stock
:
14
On order
:
2
SKU
:
GRO-000-2331
Item
'
fish
':
Total sold
:
1321.0
In stock
:
45
On order
:
1
SKU
:
GRO-000-533
Item
:
gum
Item
:
rope
Item
:
ladder
Item
:
bolt
Item
:
water
X
X
X
X
X
X
X
X
X
X
Cost
:
425
X
X
Cost
:
455
links
user
group
/some/file
1
user
group
\ No newline at end of file +
df
12
%
testing argument modifier
my-box
.
example.com
...
testing argument modifier with encoding to
.
example.com
...
Label text
value
very
42
42 +
Connecting to
my-box
.
example.com
...
Item
Total Sold
In Stock
On Order
SKU
gum
1412
54
10
GRO-000-415
rope
85
4
2
HRD-000-212
ladder
0
2
1
HRD-000-517
bolt
4123
144
42
HRD-000-632
water
17
14
2
GRO-000-2331
Item
'
gum
':
Total sold
:
1412.0
In stock
:
54
On order
:
10
SKU
:
GRO-000-415
Item
'
rope
':
Total sold
:
85.0
In stock
:
4
On order
:
2
SKU
:
HRD-000-212
Item
'
ladder
':
Total sold
! :
0
In stock
:
2
On order
:
1
SKU
:
HRD-000-517
Item
'
bolt
':
Total sold
:
4123.0
In s tock
:
144
On order
:
42
SKU
:
HRD-000-632
Item
'
water
':
Total sold
:
17.0
In stock
:
14
On order
:
2
SKU
:
GRO-000-2331
Item
'
fish
':
Total sold
:
1321.0
In stock
:
45
On order
:
1
SKU
:
GRO-000-533
Item
:
gum
Item
:
rope
Item
:
ladder
Item
:
bolt
Item
:
water
X
X
X
X
X
X
X
X
X
X
Cost
:
425
X
X
Cost
:
455
links
user
group
3
this
/some/file
1
user
group
\ No newline at end of file Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.HIPx.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.HIPx.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.HIPx.out Fri Jun 16 06:12:07 2017 (r319997) @@ -1,4 +1,9 @@
+
df
+
12
+
%
+
+
testing argument modifier
my-box
.
@@ -331,6 +336,10 @@
group
+
+
+
3
+
this
/some/file
Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.HP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.HP.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.HP.out Fri Jun 16 06:12:07 2017 (r319997) @@ -1,4 +1,9 @@
+
df
+
12
+
%
+
+
testing argument modifier
my-box
.
@@ -331,6 +336,10 @@
group
+
+
+
3
+
this
/some/file
Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.J.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.J.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.J.out Fri Jun 16 06:12:07 2017 (r319997) @@ -1,2 +1,2 @@ -{"top": {"kve_start":"0xdeadbeef","kve_end":"0xcabb1e","host":"my-box","domain":"example.com","host":"my-box","domain":"example.com","label":"value","max-chaos":"very","min-chaos":42,"some-chaos":"[42]","host":"my-box","domain":"example.com", "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data2": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"w ater","sold":17.0,"in-stock":14,"on-order":2}]}, "data3": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data4": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455,"mode":"mode","mode_octal":"octal","links":"links","user":"user","group":"group","mode":"/some/file","mode_octal":640,"links":1,"user":"user","group":"group"} +{"top": {"used-percent":12,"kve_start":"0xdeadbeef","kve_end":"0xcabb1e","host":"my-box","domain":"example.com","host":"my-box","domain":"example.com","label":"value","max-chaos":"very","min-chaos":42,"some-chaos":"[42]","host":"my-box","domain":"example.com", "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data2": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-0 00-2331","name":"water","sold":17.0,"in-stock":14,"on-order":2}]}, "data3": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data4": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455,"mode":"mode","mode_octal":"octal","links":"links","user":"user","group":"group","pre":"that","links":3,"post":"this","mode":"/some/file","mode_octal":640,"links":1,"user":"user","group":"group"} } Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.JP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.JP.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.JP.out Fri Jun 16 06:12:07 2017 (r319997) @@ -1,5 +1,6 @@ { "top": { + "used-percent": 12, "kve_start": "0xdeadbeef", "kve_end": "0xcabb1e", "host": "my-box", @@ -117,6 +118,9 @@ "links": "links", "user": "user", "group": "group", + "pre": "that", + "links": 3, + "post": "this", "mode": "/some/file", "mode_octal": 640, "links": 1, Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.T.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.T.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.T.out Fri Jun 16 06:12:07 2017 (r319997) @@ -1,3 +1,4 @@ +df 12% testing argument modifier my-box.example.com... testing argument modifier with encoding to .example.com... Label text value @@ -50,4 +51,5 @@ XXXXXXXX X XCost: 425 X XCost: 455 links user group +3 this /some/file 1 user group Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.X.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.X.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.X.out Fri Jun 16 06:12:07 2017 (r319997) @@ -1 +1 @@ -0xdeadbeef0xcabb1emy-boxexample.commy-boxexample.comvery42[42]my-boxexample.comGRO-000-415gum14125410HRD-000-212rope8542HRD-000-517ladder021HRD-000-632bolt412314442GRO-000-2331water17142GRO-000-415gum1412.05410HRD-000-212rope85.042HRD-000-517ladder021HRD-000-632bolt4123.014442GRO-000-2331water17.0142GRO-000-533fish1321.0451gumrope ladderboltwater425455modeoctallinksusergroup/some/file6401usergroup \ No newline at end of file +120xdeadbeef0xcabb1emy-boxexample.commy-boxexample.comvery42[42]my-boxexample.comGRO-000-415gum14125410HRD-000-212rope8542HRD-000-517ladder021HRD-000-632bolt412314442GRO-000-2331water17142GRO-000-415gum1412.05410HRD-000-212rope85.042HRD-000-517ladder021HRD-000-632bolt4123.014442GRO-000-2331water17.0142GRO-000-533fish1321.0451gum< /item>ropeladderboltwater425455modeoctallinksusergroup
that
3this/some/file6401usergroup
\ No newline at end of file Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.XP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.XP.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.XP.out Fri Jun 16 06:12:07 2017 (r319997) @@ -1,4 +1,5 @@ + 12 0xdeadbeef 0xcabb1e my-box @@ -108,6 +109,9 @@ links user group +
that
+ 3 + this /some/file 640 1 Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out Fri Jun 16 06:12:07 2017 (r319997) @@ -1,2 +1,2 @@ -{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":30,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":this is an warning}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}} +{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":30,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}} } Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out Fri Jun 16 06:12:07 2017 (r319997) @@ -67,7 +67,7 @@ "message": "two more errors" }, "__warning": { - "message": this is an warning + "message": "this is an warning" }, "__warning": { "message": "two more warnings" Modified: vendor/Juniper/libxo/dist/tests/core/test_01.c ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/test_01.c Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/tests/core/test_01.c Fri Jun 16 06:12:07 2017 (r319997) @@ -80,6 +80,8 @@ main (int argc, char **argv) xo_open_container_h(NULL, "top"); + xo_emit("df {:used-percent/%5.0f}{U:%%}\n", (double) 12); + xo_emit("{e:kve_start/%#jx}", (uintmax_t) 0xdeadbeef); xo_emit("{e:kve_end/%#jx}", (uintmax_t) 0xcabb1e); @@ -189,6 +191,8 @@ main (int argc, char **argv) "{t:user/%s} {t:group/%s} \n", "mode", "octal", "links", "user", "group", "extra1", "extra2", "extra3"); + + xo_emit("{e:pre/%s}{t:links/%-*u}{t:post/%-*s}\n", "that", 8, 3, 8, "this"); xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} " "{t:user/%-*s} {t:group/%-*s} \n", Modified: vendor/Juniper/libxo/dist/xohtml/xohtml.css ============================================================================== --- vendor/Juniper/libxo/dist/xohtml/xohtml.css Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/xohtml/xohtml.css Fri Jun 16 06:12:07 2017 (r319997) @@ -124,7 +124,7 @@ div.muxer-buttons { padding: 20px; } -div.text, div.decoration, div.data, div.header, div.pad, div.item { +div.text, div.decoration, div.data, div.header, div.pad, div.item, div.units { font-family: monospace; display: inline; vertical-align: middle; Modified: vendor/Juniper/libxo/dist/xohtml/xohtml.sh.in ============================================================================== --- vendor/Juniper/libxo/dist/xohtml/xohtml.sh.in Fri Jun 16 04:28:10 2017 (r319996) +++ vendor/Juniper/libxo/dist/xohtml/xohtml.sh.in Fri Jun 16 06:12:07 2017 (r319997) @@ -57,7 +57,8 @@ if [ "$CMD" = "cat" -a -t 0 ]; then do_help fi -echo "\n\n" +echo '' +echo '' echo '' echo '' echo '' @@ -66,10 +67,12 @@ echo '' echo '' -echo "\n\n" +echo '' +echo '' $CMD -echo "\n\n" +echo '' +echo '' exit 0 From owner-svn-src-all@freebsd.org Fri Jun 16 06:15:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7DABBF7727; Fri, 16 Jun 2017 06:15:27 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C3F87209D; Fri, 16 Jun 2017 06:15:27 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5G6FQeF096875; Fri, 16 Jun 2017 06:15:26 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5G6FQG2096874; Fri, 16 Jun 2017 06:15:26 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201706160615.v5G6FQG2096874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Fri, 16 Jun 2017 06:15:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319998 - vendor/Juniper/libxo/0.8.2 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 06:15:28 -0000 Author: phil Date: Fri Jun 16 06:15:26 2017 New Revision: 319998 URL: https://svnweb.freebsd.org/changeset/base/319998 Log: Tag libxo 0.8.2 Added: - copied from r319997, vendor/Juniper/libxo/dist/ Directory Properties: vendor/Juniper/libxo/0.8.2/ (props changed) From owner-svn-src-all@freebsd.org Fri Jun 16 06:29:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C320BF7BED; Fri, 16 Jun 2017 06:29:25 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9287726C7; Fri, 16 Jun 2017 06:29:24 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5G6TNxA001068; Fri, 16 Jun 2017 06:29:23 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5G6TLQb001048; Fri, 16 Jun 2017 06:29:21 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201706160629.v5G6TLQb001048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Fri, 16 Jun 2017 06:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319999 - in head: contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/xohtml usr.bin/xohtml usr.bin/xolint usr.bin/xopo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 06:29:25 -0000 Author: phil Date: Fri Jun 16 06:29:21 2017 New Revision: 319999 URL: https://svnweb.freebsd.org/changeset/base/319999 Log: Merge libxo-0.8.2: - xohtml: Add "-w" option to pull support files from gh_pages - Add "upload-xohtml-files" target to publish support files in gh_pages/ - add HISTORY/AUTHORS section to man pages - xohtml: Add div.units as standard CSS text - Don't treat values as format strings; they are not - add "-p" to "mkdir -p build" in setup.sh - add test case for {U:%%} (from df.c) - detect end-of-string in '%' and '' escaping - make xo_simple_field, for common simple cases - xohtml: nuke "n" in "echo" commands - rename "format" to "fmt" for consistency; same for "str" to "value" - update test cases Submitted by: phil Added: head/usr.bin/xohtml/ head/usr.bin/xohtml/Makefile (contents, props changed) head/usr.bin/xohtml/xohtml.sh (contents, props changed) head/usr.bin/xolint/ head/usr.bin/xolint/Makefile (contents, props changed) head/usr.bin/xopo/ head/usr.bin/xopo/Makefile (contents, props changed) Modified: head/contrib/libxo/doc/libxo-manual.html head/contrib/libxo/libxo/libxo.c head/contrib/libxo/tests/core/saved/test_01.E.out head/contrib/libxo/tests/core/saved/test_01.H.out head/contrib/libxo/tests/core/saved/test_01.HIPx.out head/contrib/libxo/tests/core/saved/test_01.HP.out head/contrib/libxo/tests/core/saved/test_01.J.out head/contrib/libxo/tests/core/saved/test_01.JP.out head/contrib/libxo/tests/core/saved/test_01.T.out head/contrib/libxo/tests/core/saved/test_01.X.out head/contrib/libxo/tests/core/saved/test_01.XP.out head/contrib/libxo/tests/core/saved/test_02.J.out head/contrib/libxo/tests/core/saved/test_02.JP.out head/contrib/libxo/tests/core/test_01.c head/contrib/libxo/xohtml/xohtml.css head/contrib/libxo/xohtml/xohtml.sh.in Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/doc/libxo-manual.html ============================================================================== --- head/contrib/libxo/doc/libxo-manual.html Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/doc/libxo-manual.html Fri Jun 16 06:29:21 2017 (r319999) @@ -22011,7 +22011,7 @@ jQuery(function ($) { -June 8, 2017 +June 14, 2017

libxo: The Easy Way to Generate text, XML, JSON, and HTML output
libxo-manual

Modified: head/contrib/libxo/libxo/libxo.c ============================================================================== --- head/contrib/libxo/libxo/libxo.c Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/libxo/libxo.c Fri Jun 16 06:29:21 2017 (r319999) @@ -95,6 +95,14 @@ #include #endif /* HAVE_GETTEXT */ +/* Rather lame that we can't count on these... */ +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + /* * Three styles of specifying thread-local variables are supported. * configure.ac has the brains to run each possibility through the @@ -473,6 +481,7 @@ static void xo_buf_append_div (xo_handle_t *xop, const char *class, xo_xff_flags_t flags, const char *name, ssize_t nlen, const char *value, ssize_t vlen, + const char *fmt, ssize_t flen, const char *encoding, ssize_t elen); static void @@ -1761,7 +1770,8 @@ xo_message_hcv (xo_handle_t *xop, int code, const char rc += rc2; } - xo_buf_append_div(xop, "message", 0, NULL, 0, bp, rc, NULL, 0); + xo_buf_append_div(xop, "message", 0, NULL, 0, bp, rc, + NULL, 0, NULL, 0); } break; @@ -2703,6 +2713,8 @@ xo_format_string_direct (xo_handle_t *xop, xo_buffer_t if ((flags & XFF_UNESCAPE) && (*cp == '\\' || *cp == '%')) { cp += 1; len -= 1; + if (len == 0 || *cp == '\0') + break; } } @@ -3644,6 +3656,10 @@ xo_do_format_field (xo_handle_t *xop, xo_buffer_t *xbp return 0; } +/* + * Remove any numeric precision/width format from the format string by + * inserting the "%" after the [0-9]+, returning the substring. + */ static char * xo_fix_encoding (xo_handle_t *xop UNUSED, char *encoding) { @@ -3657,8 +3673,7 @@ xo_fix_encoding (xo_handle_t *xop UNUSED, char *encodi break; } - cp -= 1; - *cp = '%'; + *--cp = '%'; /* Back off and insert the '%' */ return cp; } @@ -3777,10 +3792,35 @@ xo_format_humanize (xo_handle_t *xop, xo_buffer_t *xbp } } +/* + * Convenience function that either append a fixed value (if one is + * given) or formats a field using a format string. If it's + * encode_only, then we can't skip formatting the field, since it may + * be pulling arguments off the stack. + */ +static inline void +xo_simple_field (xo_handle_t *xop, unsigned encode_only, + const char *value, ssize_t vlen, + const char *fmt, ssize_t flen, xo_xff_flags_t flags) +{ + if (encode_only) + flags |= XFF_NO_OUTPUT; + + if (vlen == 0) + xo_do_format_field(xop, NULL, fmt, flen, flags); + else if (!encode_only) + xo_data_append_content(xop, value, vlen, flags); +} + +/* + * Html mode: append a
to the output buffer contain a field + * along with all the supporting information indicated by the flags. + */ static void xo_buf_append_div (xo_handle_t *xop, const char *class, xo_xff_flags_t flags, const char *name, ssize_t nlen, const char *value, ssize_t vlen, + const char *fmt, ssize_t flen, const char *encoding, ssize_t elen) { static char div_start[] = "
xo_columns; save.xhs_anchor_columns = xop->xo_anchor_columns; - xo_do_format_field(xop, NULL, value, vlen, flags); + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); if (flags & XFF_HUMANIZE) { /* @@ -4023,14 +4063,14 @@ xo_format_text (xo_handle_t *xop, const char *str, ssi break; case XO_STYLE_HTML: - xo_buf_append_div(xop, "text", 0, NULL, 0, str, len, NULL, 0); + xo_buf_append_div(xop, "text", 0, NULL, 0, str, len, NULL, 0, NULL, 0); break; } } static void xo_format_title (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { const char *fmt = xfip->xfi_format; ssize_t flen = xfip->xfi_flen; @@ -4054,8 +4094,7 @@ xo_format_title (xo_handle_t *xop, xo_field_info_t *xf * Even though we don't care about text, we need to do * enough parsing work to skip over the right bits of xo_vap. */ - if (len == 0) - xo_do_format_field(xop, NULL, fmt, flen, flags | XFF_NO_OUTPUT); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); return; } @@ -4074,17 +4113,17 @@ xo_format_title (xo_handle_t *xop, xo_field_info_t *xf } start = xbp->xb_curp - xbp->xb_bufp; /* Reset start */ - if (len) { + if (vlen) { char *newfmt = alloca(flen + 1); memcpy(newfmt, fmt, flen); newfmt[flen] = '\0'; /* If len is non-zero, the format string apply to the name */ - char *newstr = alloca(len + 1); - memcpy(newstr, str, len); - newstr[len] = '\0'; + char *newstr = alloca(vlen + 1); + memcpy(newstr, value, vlen); + newstr[vlen] = '\0'; - if (newstr[len - 1] == 's') { + if (newstr[vlen - 1] == 's') { char *bp; rc = snprintf(NULL, 0, newfmt, newstr); @@ -4166,8 +4205,9 @@ xo_arg (xo_handle_t *xop) static void xo_format_value (xo_handle_t *xop, const char *name, ssize_t nlen, - const char *format, ssize_t flen, - const char *encoding, ssize_t elen, xo_xff_flags_t flags) + const char *value, ssize_t vlen, + const char *fmt, ssize_t flen, + const char *encoding, ssize_t elen, xo_xff_flags_t flags) { int pretty = XOF_ISSET(xop, XOF_PRETTY); int quote; @@ -4253,7 +4293,7 @@ xo_format_value (xo_handle_t *xop, const char *name, s save.xhs_columns = xop->xo_columns; save.xhs_anchor_columns = xop->xo_anchor_columns; - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); if (flags & XFF_HUMANIZE) xo_format_humanize(xop, xbp, &save, flags); @@ -4263,8 +4303,8 @@ xo_format_value (xo_handle_t *xop, const char *name, s if (flags & XFF_ENCODE_ONLY) flags |= XFF_NO_OUTPUT; - xo_buf_append_div(xop, "data", flags, name, nlen, - format, flen, encoding, elen); + xo_buf_append_div(xop, "data", flags, name, nlen, value, vlen, + fmt, flen, encoding, elen); break; case XO_STYLE_XML: @@ -4273,25 +4313,24 @@ xo_format_value (xo_handle_t *xop, const char *name, s * let the formatting code handle the va_arg popping. */ if (flags & XFF_DISPLAY_ONLY) { - flags |= XFF_NO_OUTPUT; - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); break; } if (encoding) { - format = encoding; + fmt = encoding; flen = elen; } else { char *enc = alloca(flen + 1); - memcpy(enc, format, flen); + memcpy(enc, fmt, flen); enc[flen] = '\0'; - format = xo_fix_encoding(xop, enc); - flen = strlen(format); + fmt = xo_fix_encoding(xop, enc); + flen = strlen(fmt); } if (nlen == 0) { static char missing[] = "missing-field-name"; - xo_failure(xop, "missing field name: %s", format); + xo_failure(xop, "missing field name: %s", fmt); name = missing; nlen = sizeof(missing) - 1; } @@ -4327,7 +4366,9 @@ xo_format_value (xo_handle_t *xop, const char *name, s } xo_data_append(xop, ">", 1); - xo_do_format_field(xop, NULL, format, flen, flags); + + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); + xo_data_append(xop, "", 1); @@ -4337,20 +4378,19 @@ xo_format_value (xo_handle_t *xop, const char *name, s case XO_STYLE_JSON: if (flags & XFF_DISPLAY_ONLY) { - flags |= XFF_NO_OUTPUT; - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); break; } if (encoding) { - format = encoding; + fmt = encoding; flen = elen; } else { char *enc = alloca(flen + 1); - memcpy(enc, format, flen); + memcpy(enc, fmt, flen); enc[flen] = '\0'; - format = xo_fix_encoding(xop, enc); - flen = strlen(format); + fmt = xo_fix_encoding(xop, enc); + flen = strlen(fmt); } int first = (xop->xo_stack[xop->xo_depth].xs_flags & XSF_NOT_FIRST) @@ -4362,18 +4402,20 @@ xo_format_value (xo_handle_t *xop, const char *name, s quote = 1; else if (flags & XFF_NOQUOTE) quote = 0; + else if (vlen != 0) + quote = 1; else if (flen == 0) { quote = 0; - format = "true"; /* JSON encodes empty tags as a boolean true */ + fmt = "true"; /* JSON encodes empty tags as a boolean true */ flen = 4; - } else if (strchr("diouDOUeEfFgG", format[flen - 1]) == NULL) + } else if (strchr("diouDOUeEfFgG", fmt[flen - 1]) == NULL) quote = 1; else quote = 0; if (nlen == 0) { static char missing[] = "missing-field-name"; - xo_failure(xop, "missing field name: %s", format); + xo_failure(xop, "missing field name: %s", fmt); name = missing; nlen = sizeof(missing) - 1; } @@ -4407,7 +4449,7 @@ xo_format_value (xo_handle_t *xop, const char *name, s if (quote) xo_data_append(xop, "\"", 1); - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); if (quote) xo_data_append(xop, "\"", 1); @@ -4415,39 +4457,39 @@ xo_format_value (xo_handle_t *xop, const char *name, s case XO_STYLE_SDPARAMS: if (flags & XFF_DISPLAY_ONLY) { - flags |= XFF_NO_OUTPUT; - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); break; } if (encoding) { - format = encoding; + fmt = encoding; flen = elen; } else { char *enc = alloca(flen + 1); - memcpy(enc, format, flen); + memcpy(enc, fmt, flen); enc[flen] = '\0'; - format = xo_fix_encoding(xop, enc); - flen = strlen(format); + fmt = xo_fix_encoding(xop, enc); + flen = strlen(fmt); } if (nlen == 0) { static char missing[] = "missing-field-name"; - xo_failure(xop, "missing field name: %s", format); + xo_failure(xop, "missing field name: %s", fmt); name = missing; nlen = sizeof(missing) - 1; } xo_data_escape(xop, name, nlen); xo_data_append(xop, "=\"", 2); - xo_do_format_field(xop, NULL, format, flen, flags); + + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); + xo_data_append(xop, "\" ", 2); break; case XO_STYLE_ENCODER: if (flags & XFF_DISPLAY_ONLY) { - flags |= XFF_NO_OUTPUT; - xo_do_format_field(xop, NULL, format, flen, flags); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); break; } @@ -4457,27 +4499,27 @@ xo_format_value (xo_handle_t *xop, const char *name, s quote = 0; else if (flen == 0) { quote = 0; - format = "true"; /* JSON encodes empty tags as a boolean true */ + fmt = "true"; /* JSON encodes empty tags as a boolean true */ flen = 4; - } else if (strchr("diouxXDOUeEfFgGaAcCp", format[flen - 1]) == NULL) + } else if (strchr("diouxXDOUeEfFgGaAcCp", fmt[flen - 1]) == NULL) quote = 1; else quote = 0; if (encoding) { - format = encoding; + fmt = encoding; flen = elen; } else { char *enc = alloca(flen + 1); - memcpy(enc, format, flen); + memcpy(enc, fmt, flen); enc[flen] = '\0'; - format = xo_fix_encoding(xop, enc); - flen = strlen(format); + fmt = xo_fix_encoding(xop, enc); + flen = strlen(fmt); } if (nlen == 0) { static char missing[] = "missing-field-name"; - xo_failure(xop, "missing field name: %s", format); + xo_failure(xop, "missing field name: %s", fmt); name = missing; nlen = sizeof(missing) - 1; } @@ -4487,7 +4529,9 @@ xo_format_value (xo_handle_t *xop, const char *name, s xo_data_append(xop, "", 1); ssize_t value_offset = xo_buf_offset(&xop->xo_data); - xo_do_format_field(xop, NULL, format, flen, flags); + + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); + xo_data_append(xop, "", 1); xo_encoder_handle(xop, quote ? XO_OP_STRING : XO_OP_CONTENT, @@ -4536,37 +4580,27 @@ xo_set_gettext_domain (xo_handle_t *xop, xo_field_info static void xo_format_content (xo_handle_t *xop, const char *class_name, const char *tag_name, - const char *str, ssize_t len, const char *fmt, ssize_t flen, + const char *value, ssize_t vlen, + const char *fmt, ssize_t flen, xo_xff_flags_t flags) { switch (xo_style(xop)) { case XO_STYLE_TEXT: - if (len) - xo_data_append_content(xop, str, len, flags); - else - xo_do_format_field(xop, NULL, fmt, flen, flags); + xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags); break; case XO_STYLE_HTML: - if (len == 0) { - str = fmt; - len = flen; - } - - xo_buf_append_div(xop, class_name, flags, NULL, 0, str, len, NULL, 0); + xo_buf_append_div(xop, class_name, flags, NULL, 0, + value, vlen, fmt, flen, NULL, 0); break; case XO_STYLE_XML: case XO_STYLE_JSON: case XO_STYLE_SDPARAMS: if (tag_name) { - if (len == 0) { - str = fmt; - len = flen; - } - xo_open_container_h(xop, tag_name); - xo_format_value(xop, "message", 7, str, len, NULL, 0, flags); + xo_format_value(xop, "message", 7, value, vlen, + fmt, flen, NULL, 0, flags); xo_close_container_h(xop, tag_name); } else { @@ -4574,16 +4608,12 @@ xo_format_content (xo_handle_t *xop, const char *class * Even though we don't care about labels, we need to do * enough parsing work to skip over the right bits of xo_vap. */ - if (len == 0) - xo_do_format_field(xop, NULL, fmt, flen, - flags | XFF_NO_OUTPUT); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); } break; case XO_STYLE_ENCODER: - if (len == 0) - xo_do_format_field(xop, NULL, fmt, flen, - flags | XFF_NO_OUTPUT); + xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags); break; } } @@ -4898,7 +4928,7 @@ xo_colors_handle_html (xo_handle_t *xop, xo_colors_t * static void xo_format_colors (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { const char *fmt = xfip->xfi_format; ssize_t flen = xfip->xfi_flen; @@ -4906,13 +4936,13 @@ xo_format_colors (xo_handle_t *xop, xo_field_info_t *x xo_buffer_t xb; /* If the string is static and we've in an encoding style, bail */ - if (len != 0 && xo_style_is_encoding(xop)) + if (vlen != 0 && xo_style_is_encoding(xop)) return; xo_buf_init(&xb); - if (len) - xo_buf_append(&xb, str, len); + if (vlen) + xo_buf_append(&xb, value, vlen); else if (flen) xo_do_format_field(xop, &xb, fmt, flen, 0); else @@ -4972,7 +5002,7 @@ xo_format_colors (xo_handle_t *xop, xo_field_info_t *x static void xo_format_units (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { const char *fmt = xfip->xfi_format; ssize_t flen = xfip->xfi_flen; @@ -4982,7 +5012,7 @@ xo_format_units (xo_handle_t *xop, xo_field_info_t *xf static char units_start_html[] = " data-units=\""; if (!XOIF_ISSET(xop, XOIF_UNITS_PENDING)) { - xo_format_content(xop, "units", NULL, str, len, fmt, flen, flags); + xo_format_content(xop, "units", NULL, value, vlen, fmt, flen, flags); return; } @@ -4997,8 +5027,8 @@ xo_format_units (xo_handle_t *xop, xo_field_info_t *xf else return; - if (len) - xo_data_escape(xop, str, len); + if (vlen) + xo_data_escape(xop, value, vlen); else xo_do_format_field(xop, NULL, fmt, flen, flags); @@ -5026,7 +5056,7 @@ xo_format_units (xo_handle_t *xop, xo_field_info_t *xf static ssize_t xo_find_width (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { const char *fmt = xfip->xfi_format; ssize_t flen = xfip->xfi_flen; @@ -5035,10 +5065,10 @@ xo_find_width (xo_handle_t *xop, xo_field_info_t *xfip char *bp; char *cp; - if (len) { - bp = alloca(len + 1); /* Make local NUL-terminated copy of str */ - memcpy(bp, str, len); - bp[len] = '\0'; + if (vlen) { + bp = alloca(vlen + 1); /* Make local NUL-terminated copy of value */ + memcpy(bp, value, vlen); + bp[vlen] = '\0'; width = strtol(bp, &cp, 0); if (width == LONG_MIN || width == LONG_MAX @@ -5075,7 +5105,7 @@ xo_anchor_clear (xo_handle_t *xop) */ static void xo_anchor_start (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { if (xo_style(xop) != XO_STYLE_TEXT && xo_style(xop) != XO_STYLE_HTML) return; @@ -5092,12 +5122,12 @@ xo_anchor_start (xo_handle_t *xop, xo_field_info_t *xf * Now we find the width, if possible. If it's not there, * we'll get it on the end anchor. */ - xop->xo_anchor_min_width = xo_find_width(xop, xfip, str, len); + xop->xo_anchor_min_width = xo_find_width(xop, xfip, value, vlen); } static void xo_anchor_stop (xo_handle_t *xop, xo_field_info_t *xfip, - const char *str, ssize_t len) + const char *value, ssize_t vlen) { if (xo_style(xop) != XO_STYLE_TEXT && xo_style(xop) != XO_STYLE_HTML) return; @@ -5109,7 +5139,7 @@ xo_anchor_stop (xo_handle_t *xop, xo_field_info_t *xfi XOIF_CLEAR(xop, XOIF_UNITS_PENDING); - ssize_t width = xo_find_width(xop, xfip, str, len); + ssize_t width = xo_find_width(xop, xfip, value, vlen); if (width == 0) width = xop->xo_anchor_min_width; @@ -6213,12 +6243,12 @@ xo_do_emit_fields (xo_handle_t *xop, xo_field_info_t * if (flags & XFF_WS) { xo_format_content(xop, "padding", NULL, " ", 1, NULL, 0, flags); - flags &= ~XFF_WS; /* Block later handling of this */ + flags &= ~XFF_WS; /* Prevent later handling of this flag */ } } if (ftype == 'V') - xo_format_value(xop, content, clen, + xo_format_value(xop, content, clen, NULL, 0, xfip->xfi_format, xfip->xfi_flen, xfip->xfi_encoding, xfip->xfi_elen, flags); else if (ftype == '[') @@ -7899,7 +7929,8 @@ xo_error_hv (xo_handle_t *xop, const char *fmt, va_lis case XO_STYLE_HTML: va_copy(xop->xo_vap, vap); - xo_buf_append_div(xop, "error", 0, NULL, 0, fmt, strlen(fmt), NULL, 0); + xo_buf_append_div(xop, "error", 0, NULL, 0, NULL, 0, + fmt, strlen(fmt), NULL, 0); if (XOIF_ISSET(xop, XOIF_DIV_OPEN)) xo_line_close(xop); @@ -7915,7 +7946,8 @@ xo_error_hv (xo_handle_t *xop, const char *fmt, va_lis va_copy(xop->xo_vap, vap); xo_open_container_h(xop, "error"); - xo_format_value(xop, "message", 7, fmt, strlen(fmt), NULL, 0, 0); + xo_format_value(xop, "message", 7, NULL, 0, + fmt, strlen(fmt), NULL, 0, 0); xo_close_container_h(xop, "error"); va_end(xop->xo_vap); @@ -8132,7 +8164,7 @@ xo_emit_warn_hcv (xo_handle_t *xop, int as_warning, in xo_buffer_t *src = &temp.xo_data; xo_format_value(xop, "message", 7, src->xb_bufp, - src->xb_curp - src->xb_bufp, NULL, 0, 0); + src->xb_curp - src->xb_bufp, NULL, 0, NULL, 0, 0); xo_free(temp.xo_stack); xo_buf_cleanup(src); Modified: head/contrib/libxo/tests/core/saved/test_01.E.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.E.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_01.E.out Fri Jun 16 06:29:21 2017 (r319999) @@ -1,5 +1,6 @@ op create: [] [] [0] op open_container: [top] [] [0x810] +op content: [used-percent] [12] [0] op content: [kve_start] [0xdeadbeef] [0x8] op content: [kve_end] [0xcabb1e] [0x8] op string: [host] [my-box] [0x200000] @@ -129,6 +130,9 @@ op string: [mode_octal] [octal] [0x8] op string: [links] [links] [0x1000] op string: [user] [user] [0x1000] op string: [group] [group] [0x1000] +op string: [pre] [that] [0x8] +op content: [links] [3] [0x1000] +op string: [post] [this] [0x1000] op string: [mode] [/some/file] [0x1000] op content: [mode_octal] [640] [0x8] op content: [links] [1] [0x1000] Modified: head/contrib/libxo/tests/core/saved/test_01.H.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.H.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_01.H.out Fri Jun 16 06:29:21 2017 (r319999) @@ -1,2 +1,2 @@ -
testing argument modifier
my-box
.
example.com
...
testing argument modifier with encoding to
.
example.com
...
Label text
value
very
42
42 -
Connecting to
my-box
.
example.com
...
Item
Total Sold
In Stock
On Order
SKU
gum
1412
54
10
GRO-000-415
rope
85
4
2
HRD-000-212
ladder
0
2
1
HRD-000-517
bolt
4123
144
42
HRD-000-632
water
17
14
2
GRO-000-2331
Item
'
gum
':
Total sold
:
1412.0
In stock
:
54
On order
:
10
SKU
:
GRO-000-415
Item
'
rope
':
Total sold
:
85.0
In stock
:
4
On order
:
2
SKU
:
HRD-000-212
Item
'
ladder
':
Total sold
! :
0
In stock
:
2
On order
:
1
SKU
:
HRD-000-517
Item
'
bolt
':
Total sold
:
4123.0
In s tock
:
144
On order
:
42
SKU
:
HRD-000-632
Item
'
water
':
Total sold
:
17.0
In stock
:
14
On order
:
2
SKU
:
GRO-000-2331
Item
'
fish
':
Total sold
:
1321.0
In stock
:
45
On order
:
1
SKU
:
GRO-000-533
Item
:
gum
Item
:
rope
Item
:
ladder
Item
:
bolt
Item
:
water
X
X
X
X
X
X
X
X
X
X
Cost
:
425
X
X
Cost
:
455
links
user
group
/some/file
1
user
group
\ No newline at end of file +
df
12
%
testing argument modifier
my-box
.
example.com
...
testing argument modifier with encoding to
.
example.com
...
Label text
value
very
42
42 +
Connecting to
my-box
.
example.com
...
Item
Total Sold
In Stock
On Order
SKU
gum
1412
54
10
GRO-000-415
rope
85
4
2
HRD-000-212
ladder
0
2
1
HRD-000-517
bolt
4123
144
42
HRD-000-632
water
17
14
2
GRO-000-2331
Item
'
gum
':
Total sold
:
1412.0
In stock
:
54
On order
:
10
SKU
:
GRO-000-415
Item
'
rope
':
Total sold
:
85.0
In stock
:
4
On order
:
2
SKU
:
HRD-000-212
Item
'
ladder
':
Total sold
! :
0
In stock
:
2
On order
:
1
SKU
:
HRD-000-517
Item
'
bolt
':
Total sold
:
4123.0
In s tock
:
144
On order
:
42
SKU
:
HRD-000-632
Item
'
water
':
Total sold
:
17.0
In stock
:
14
On order
:
2
SKU
:
GRO-000-2331
Item
'
fish
':
Total sold
:
1321.0
In stock
:
45
On order
:
1
SKU
:
GRO-000-533
Item
:
gum
Item
:
rope
Item
:
ladder
Item
:
bolt
Item
:
water
X
X
X
X
X
X
X
X
X
X
Cost
:
425
X
X
Cost
:
455
links
user
group
3
this
/some/file
1
user
group
\ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_01.HIPx.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.HIPx.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_01.HIPx.out Fri Jun 16 06:29:21 2017 (r319999) @@ -1,4 +1,9 @@
+
df
+
12
+
%
+
+
testing argument modifier
my-box
.
@@ -331,6 +336,10 @@
group
+
+
+
3
+
this
/some/file
Modified: head/contrib/libxo/tests/core/saved/test_01.HP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.HP.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_01.HP.out Fri Jun 16 06:29:21 2017 (r319999) @@ -1,4 +1,9 @@
+
df
+
12
+
%
+
+
testing argument modifier
my-box
.
@@ -331,6 +336,10 @@
group
+
+
+
3
+
this
/some/file
Modified: head/contrib/libxo/tests/core/saved/test_01.J.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.J.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_01.J.out Fri Jun 16 06:29:21 2017 (r319999) @@ -1,2 +1,2 @@ -{"top": {"kve_start":"0xdeadbeef","kve_end":"0xcabb1e","host":"my-box","domain":"example.com","host":"my-box","domain":"example.com","label":"value","max-chaos":"very","min-chaos":42,"some-chaos":"[42]","host":"my-box","domain":"example.com", "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data2": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"w ater","sold":17.0,"in-stock":14,"on-order":2}]}, "data3": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data4": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455,"mode":"mode","mode_octal":"octal","links":"links","user":"user","group":"group","mode":"/some/file","mode_octal":640,"links":1,"user":"user","group":"group"} +{"top": {"used-percent":12,"kve_start":"0xdeadbeef","kve_end":"0xcabb1e","host":"my-box","domain":"example.com","host":"my-box","domain":"example.com","label":"value","max-chaos":"very","min-chaos":42,"some-chaos":"[42]","host":"my-box","domain":"example.com", "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data2": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-0 00-2331","name":"water","sold":17.0,"in-stock":14,"on-order":2}]}, "data3": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data4": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455,"mode":"mode","mode_octal":"octal","links":"links","user":"user","group":"group","pre":"that","links":3,"post":"this","mode":"/some/file","mode_octal":640,"links":1,"user":"user","group":"group"} } Modified: head/contrib/libxo/tests/core/saved/test_01.JP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.JP.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_01.JP.out Fri Jun 16 06:29:21 2017 (r319999) @@ -1,5 +1,6 @@ { "top": { + "used-percent": 12, "kve_start": "0xdeadbeef", "kve_end": "0xcabb1e", "host": "my-box", @@ -117,6 +118,9 @@ "links": "links", "user": "user", "group": "group", + "pre": "that", + "links": 3, + "post": "this", "mode": "/some/file", "mode_octal": 640, "links": 1, Modified: head/contrib/libxo/tests/core/saved/test_01.T.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.T.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_01.T.out Fri Jun 16 06:29:21 2017 (r319999) @@ -1,3 +1,4 @@ +df 12% testing argument modifier my-box.example.com... testing argument modifier with encoding to .example.com... Label text value @@ -50,4 +51,5 @@ XXXXXXXX X XCost: 425 X XCost: 455 links user group +3 this /some/file 1 user group Modified: head/contrib/libxo/tests/core/saved/test_01.X.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.X.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_01.X.out Fri Jun 16 06:29:21 2017 (r319999) @@ -1 +1 @@ -0xdeadbeef0xcabb1emy-boxexample.commy-boxexample.comvery42[42]my-boxexample.comGRO-000-415gum14125410HRD-000-212rope8542HRD-000-517ladder021HRD-000-632bolt412314442GRO-000-2331water17142GRO-000-415gum1412.05410HRD-000-212rope85.042HRD-000-517ladder021HRD-000-632bolt4123.014442GRO-000-2331water17.0142GRO-000-533fish1321.0451gumrope ladderboltwater425455modeoctallinksusergroup/some/file6401usergroup \ No newline at end of file +120xdeadbeef0xcabb1emy-boxexample.commy-boxexample.comvery42[42]my-boxexample.comGRO-000-415gum14125410HRD-000-212rope8542HRD-000-517ladder021HRD-000-632bolt412314442GRO-000-2331water17142GRO-000-415gum1412.05410HRD-000-212rope85.042HRD-000-517ladder021HRD-000-632bolt4123.014442GRO-000-2331water17.0142GRO-000-533fish1321.0451gum< /item>ropeladderboltwater425455modeoctallinksusergroup
that
3this/some/file6401usergroup
\ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_01.XP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.XP.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_01.XP.out Fri Jun 16 06:29:21 2017 (r319999) @@ -1,4 +1,5 @@ + 12 0xdeadbeef 0xcabb1e my-box @@ -108,6 +109,9 @@ links user group +
that
+ 3 + this /some/file 640 1 Modified: head/contrib/libxo/tests/core/saved/test_02.J.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.J.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_02.J.out Fri Jun 16 06:29:21 2017 (r319999) @@ -1,2 +1,2 @@ -{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":30,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":this is an warning}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}} +{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":30,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}} } Modified: head/contrib/libxo/tests/core/saved/test_02.JP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.JP.out Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/saved/test_02.JP.out Fri Jun 16 06:29:21 2017 (r319999) @@ -67,7 +67,7 @@ "message": "two more errors" }, "__warning": { - "message": this is an warning + "message": "this is an warning" }, "__warning": { "message": "two more warnings" Modified: head/contrib/libxo/tests/core/test_01.c ============================================================================== --- head/contrib/libxo/tests/core/test_01.c Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/tests/core/test_01.c Fri Jun 16 06:29:21 2017 (r319999) @@ -80,6 +80,8 @@ main (int argc, char **argv) xo_open_container_h(NULL, "top"); + xo_emit("df {:used-percent/%5.0f}{U:%%}\n", (double) 12); + xo_emit("{e:kve_start/%#jx}", (uintmax_t) 0xdeadbeef); xo_emit("{e:kve_end/%#jx}", (uintmax_t) 0xcabb1e); @@ -189,6 +191,8 @@ main (int argc, char **argv) "{t:user/%s} {t:group/%s} \n", "mode", "octal", "links", "user", "group", "extra1", "extra2", "extra3"); + + xo_emit("{e:pre/%s}{t:links/%-*u}{t:post/%-*s}\n", "that", 8, 3, 8, "this"); xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} " "{t:user/%-*s} {t:group/%-*s} \n", Modified: head/contrib/libxo/xohtml/xohtml.css ============================================================================== --- head/contrib/libxo/xohtml/xohtml.css Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/xohtml/xohtml.css Fri Jun 16 06:29:21 2017 (r319999) @@ -124,7 +124,7 @@ div.muxer-buttons { padding: 20px; } -div.text, div.decoration, div.data, div.header, div.pad, div.item { +div.text, div.decoration, div.data, div.header, div.pad, div.item, div.units { font-family: monospace; display: inline; vertical-align: middle; Modified: head/contrib/libxo/xohtml/xohtml.sh.in ============================================================================== --- head/contrib/libxo/xohtml/xohtml.sh.in Fri Jun 16 06:15:26 2017 (r319998) +++ head/contrib/libxo/xohtml/xohtml.sh.in Fri Jun 16 06:29:21 2017 (r319999) @@ -57,7 +57,8 @@ if [ "$CMD" = "cat" -a -t 0 ]; then do_help fi -echo "\n\n" +echo '' +echo '' echo '' echo '' echo '' @@ -66,10 +67,12 @@ echo '' echo '' -echo "\n\n" +echo '' +echo '' $CMD -echo "\n\n" +echo '' +echo '' exit 0 Added: head/usr.bin/xohtml/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xohtml/Makefile Fri Jun 16 06:29:21 2017 (r319999) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +.include + +LIBXOSRC= ${SRCTOP}/contrib/libxo + +.PATH: +.PATH: ${LIBXOSRC}/xohtml + +SCRIPTS= xohtml.sh +MAN= xohtml.1 + +EXTERNAL_FILES = \ + external/jquery.js \ + external/jquery.qtip.css \ + external/jquery.qtip.js + +INTERNAL_FILES = \ + xohtml.js \ + xohtml.css + +FILES= ${INTERNAL_FILES} ${EXTERNAL_FILES} +FILESDIR= /usr/share/xohtml +FILESMODE= ${NOBINMODE} + +beforeinstall: mkfilesdir +mkfilesdir: + test -d ${DESTDIR}${FILESDIR} \ + || ${INSTALL} -d -o ${FILESOWN} -g ${FILESGRP} -m 755 ${DESTDIR}${FILESDIR} + +.include Added: head/usr.bin/xohtml/xohtml.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xohtml/xohtml.sh Fri Jun 16 06:29:21 2017 (r319999) @@ -0,0 +1,79 @@ +#!/bin/sh +# $FreeBSD$ +# +# Copyright (c) 2014, Juniper Networks, Inc. +# All rights reserved. +# This SOFTWARE is licensed under the LICENSE provided in the +# ../Copyright file. By downloading, installing, copying, or otherwise +# using the SOFTWARE, you agree to be bound by the terms of that +# LICENSE. +# Phil Shafer, July 2014 +# + +BASE=/usr/share/libxo +CMD=cat +DONE= + +do_help () { + echo "xohtml: wrap libxo-enabled output in HTML" + echo "Usage: xohtml [options] [command [arguments]]" + echo "Valid options are:" + echo " -b | --base " + echo " -c | --command " + echo " -f | --file " + exit 1 +} + +while [ -z "$DONE" -a ! -z "$1" ]; do + case "$1" in + -b|--base) + shift; + BASE="$1"; + shift; + ;; + -c|--command) + shift; + CMD="$1"; + shift; + ;; + -f|--file) + shift; + FILE="$1"; + shift; + exec > "$FILE"; + ;; + -*) + do_help + ;; + *) + DONE=1; + XX=$1; + shift; + CMD="$XX --libxo=html $@" + ;; + esac +done + +if [ "$CMD" = "cat" -a -t 0 ]; then + do_help +fi + +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' + +$CMD + +echo '' +echo '' + +exit 0 Added: head/usr.bin/xolint/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xolint/Makefile Fri Jun 16 06:29:21 2017 (r319999) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.include + +LIBXOSRC= ${SRCTOP}/contrib/libxo + +.PATH: +.PATH: ${LIBXOSRC}/xolint + +SCRIPTS= xolint.pl +MAN= xolint.1 + +.include Added: head/usr.bin/xopo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xopo/Makefile Fri Jun 16 06:29:21 2017 (r319999) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +.include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 16 06:34:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38060BF7E6C; Fri, 16 Jun 2017 06:34:28 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0321372B21; Fri, 16 Jun 2017 06:34:27 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5G6YR5U005125; Fri, 16 Jun 2017 06:34:27 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5G6YRQn005124; Fri, 16 Jun 2017 06:34:27 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201706160634.v5G6YRQn005124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Fri, 16 Jun 2017 06:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320000 - vendor/Juniper/libxo 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 06:34:28 -0000 Author: phil Date: Fri Jun 16 06:34:26 2017 New Revision: 320000 URL: https://svnweb.freebsd.org/changeset/base/320000 Log: Update libxo's import shell for xohtml Submitted by: phil Modified: vendor/Juniper/libxo/import.sh Modified: vendor/Juniper/libxo/import.sh ============================================================================== --- vendor/Juniper/libxo/import.sh Fri Jun 16 06:29:21 2017 (r319999) +++ vendor/Juniper/libxo/import.sh Fri Jun 16 06:34:26 2017 (r320000) @@ -295,6 +295,7 @@ Cd $HEAD run "copying xo_config.h" "(echo '/* \$FreeBSD\$ */' ; cat $CWD/dist/build/libxo/xo_config.h ) > $HEAD/lib/libxo/xo_config.h" run "copying add.man" "(echo '.\\\" \$FreeBSD\$' ; cat $CWD/dist/build/libxo/add.man ) > $HEAD/lib/libxo/add.man" +run "copying xohtml.sh" "(echo '#!/bin/sh' ; echo '# \$FreeBSD\$' ; cat $CWD/dist/build/xohtml/xohtml.sh ) > $HEAD/usr.bin/xohtml/xohtml.sh" #BUILDDIRS="lib/libxo usr.bin/xo" #for dir in $BUILDDIRS ; do From owner-svn-src-all@freebsd.org Fri Jun 16 10:16:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 026B3BFCBAC; Fri, 16 Jun 2017 10:16:25 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B948E797F2; Fri, 16 Jun 2017 10:16:25 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GAGOAC095817; Fri, 16 Jun 2017 10:16:24 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GAGOSN095816; Fri, 16 Jun 2017 10:16:24 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706161016.v5GAGOSN095816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 16 Jun 2017 10:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320001 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 10:16:26 -0000 Author: zbb Date: Fri Jun 16 10:16:24 2017 New Revision: 320001 URL: https://svnweb.freebsd.org/changeset/base/320001 Log: Fix typo in "Marvell" string Change Marwell to Marvell Pointed out by: Ravi Pokala Modified: head/sys/arm/arm/identcpu-v6.c Modified: head/sys/arm/arm/identcpu-v6.c ============================================================================== --- head/sys/arm/arm/identcpu-v6.c Fri Jun 16 06:34:26 2017 (r320000) +++ head/sys/arm/arm/identcpu-v6.c Fri Jun 16 10:16:24 2017 (r320001) @@ -94,9 +94,9 @@ static struct { {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A73, "ARM", "Cortex-A73", CPU_CLASS_CORTEXA}, - {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_581, "Marwell", "PJ4 v7", + {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_581, "Marvell", "PJ4 v7", CPU_CLASS_MARVELL}, - {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_584, "Marwell", "PJ4MP v7", + {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_584, "Marvell", "PJ4MP v7", CPU_CLASS_MARVELL}, {CPU_IMPLEMENTER_QCOM, CPU_ARCH_KRAIT_300, "Qualcomm", "Krait 300", From owner-svn-src-all@freebsd.org Fri Jun 16 13:53:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78153C0977D; Fri, 16 Jun 2017 13:53:03 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46C6280453; Fri, 16 Jun 2017 13:53:03 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GDr2kV085414; Fri, 16 Jun 2017 13:53:02 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GDr2ig085413; Fri, 16 Jun 2017 13:53:02 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706161353.v5GDr2ig085413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 16 Jun 2017 13:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320002 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 13:53:03 -0000 Author: zbb Date: Fri Jun 16 13:53:02 2017 New Revision: 320002 URL: https://svnweb.freebsd.org/changeset/base/320002 Log: Minor style improvements to pmap_remap_vm_attr() Use correct platform_ function name in the comment and remove redundant tabs. Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Jun 16 10:16:24 2017 (r320001) +++ head/sys/arm/arm/pmap-v6.c Fri Jun 16 13:53:02 2017 (r320002) @@ -508,7 +508,7 @@ pmap_set_tex(void) * Usage rules: * - it shall be called after pmap_bootstrap_prepare() and before * cpu_mp_start() (thus only on boot CPU). In practice, it's expected - * to be called from platform_attach() or platform_late_init(). + * to be called from platform_probe_and_attach() or platform_late_init(). * * - if remapping doesn't change caching mode, or until uncached class * is remapped to any kind of cached one, then no other restriction exists. @@ -523,11 +523,11 @@ void pmap_remap_vm_attr(vm_memattr_t old_attr, vm_memattr_t new_attr) { int old_idx, new_idx; - + /* Map VM memattrs to indexes to tex_class table. */ old_idx = pte2_attr_tab[(int)old_attr]; new_idx = pte2_attr_tab[(int)new_attr]; - + /* Replace TEX attribute and apply it. */ tex_class[old_idx] = tex_class[new_idx]; pmap_set_tex(); From owner-svn-src-all@freebsd.org Fri Jun 16 14:19:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF403C09F3F; Fri, 16 Jun 2017 14:19:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 017AB8179A; Fri, 16 Jun 2017 14:19:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GEJOw8095015; Fri, 16 Jun 2017 14:19:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GEJOWW095014; Fri, 16 Jun 2017 14:19:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201706161419.v5GEJOWW095014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 16 Jun 2017 14:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320003 - head/share/zoneinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 14:19:25 -0000 Author: trasz Date: Fri Jun 16 14:19:23 2017 New Revision: 320003 URL: https://svnweb.freebsd.org/changeset/base/320003 Log: Don't print all timezones during installworld. Submitted by: Alex Richardson Reviewed by: gjb MFC after: 1 month Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11154 Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Fri Jun 16 13:53:02 2017 (r320002) +++ head/share/zoneinfo/Makefile Fri Jun 16 14:19:23 2017 (r320003) @@ -88,7 +88,7 @@ install-zoneinfo: mkdir -p ${DESTDIR}/usr/share/zoneinfo cd ${DESTDIR}/usr/share/zoneinfo; mkdir -p ${TZBUILDSUBDIRS} cd ${TZBUILDDIR} && \ - find -s * -type f -print -exec ${INSTALL} ${TAG_ARGS} \ + find -s * -type f -exec ${INSTALL} ${TAG_ARGS} \ -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ \{} ${DESTDIR}/usr/share/zoneinfo/\{} \; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ From owner-svn-src-all@freebsd.org Fri Jun 16 15:09:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88F6C310FE; Fri, 16 Jun 2017 15:09:44 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78B568379E; Fri, 16 Jun 2017 15:09:44 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GF9h6n016716; Fri, 16 Jun 2017 15:09:43 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GF9hsK016715; Fri, 16 Jun 2017 15:09:43 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201706161509.v5GF9hsK016715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 16 Jun 2017 15:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320004 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 15:09:44 -0000 Author: sobomax Date: Fri Jun 16 15:09:43 2017 New Revision: 320004 URL: https://svnweb.freebsd.org/changeset/base/320004 Log: Document st_flags in the stat(2). Approved by: mckusick,vangyzen,jilles Differential Revision: https://reviews.freebsd.org/D10852 Modified: head/lib/libc/sys/stat.2 Modified: head/lib/libc/sys/stat.2 ============================================================================== --- head/lib/libc/sys/stat.2 Fri Jun 16 14:19:23 2017 (r320003) +++ head/lib/libc/sys/stat.2 Fri Jun 16 15:09:43 2017 (r320004) @@ -137,6 +137,11 @@ The numeric ID of the device containing the file. The file's inode number. .It Va st_nlink The number of hard links to the file. +.It Va st_flags +The flags enabled for the file. +See +.Xr chflags 2 +for the list of flags and their description. .El .Pp The From owner-svn-src-all@freebsd.org Fri Jun 16 15:54:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BFABC7716B; Fri, 16 Jun 2017 15:54:00 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id ECAD9921; Fri, 16 Jun 2017 15:53:59 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from dhcp-10-248-112-187.eduroam.wireless.private.cam.ac.uk (global-5-143.nat-2.net.cam.ac.uk [131.111.5.143]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id E0E7B4E6E1; Fri, 16 Jun 2017 15:53:58 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r320002 - head/sys/arm/arm From: Andrew Turner In-Reply-To: <201706161353.v5GDr2ig085413@repo.freebsd.org> Date: Fri, 16 Jun 2017 16:53:58 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7A647614-6401-42EE-B843-54F9D15A0749@fubar.geek.nz> References: <201706161353.v5GDr2ig085413@repo.freebsd.org> To: Zbigniew Bodek X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 15:54:00 -0000 > On 16 Jun 2017, at 14:53, Zbigniew Bodek wrote: >=20 > Author: zbb > Date: Fri Jun 16 13:53:02 2017 > New Revision: 320002 > URL: https://svnweb.freebsd.org/changeset/base/320002 >=20 > Log: > Minor style improvements to pmap_remap_vm_attr() >=20 > Use correct platform_ function name in the comment and remove > redundant tabs. >=20 > Modified: > head/sys/arm/arm/pmap-v6.c >=20 > Modified: head/sys/arm/arm/pmap-v6.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/arm/arm/pmap-v6.c Fri Jun 16 10:16:24 2017 = (r320001) > +++ head/sys/arm/arm/pmap-v6.c Fri Jun 16 13:53:02 2017 = (r320002) > @@ -508,7 +508,7 @@ pmap_set_tex(void) > * Usage rules: > * - it shall be called after pmap_bootstrap_prepare() and before > * cpu_mp_start() (thus only on boot CPU). In practice, it's = expected > - * to be called from platform_attach() or platform_late_init(). > + * to be called from platform_probe_and_attach() or = platform_late_init(). That was correct. The armv6 SoC code should be using PLATFORM and = implement the platform_attach() method. It=E2=80=99s a bug the Marvell = code doesn=E2=80=99t. Andrew= From owner-svn-src-all@freebsd.org Fri Jun 16 16:18:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 311C1C777E2; Fri, 16 Jun 2017 16:18:03 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECFAB178C; Fri, 16 Jun 2017 16:18:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x233.google.com with SMTP id b205so15856592itg.1; Fri, 16 Jun 2017 09:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=oLGOLLAavPexO0BD6gmUyd/prvidX6jKC6EMY673bL0=; b=K8OTKH+jIRGMwjkHLsvsPyPviQYa7JrPd957rIh767fkqNr/GfRbZOZafbL2M+WxV+ YcvTbJlWCgoRUnSgwnMeC914J/42WDO1dXuQg1mEn5R2j4CS5QYKQh/5cS0sMgsd6gpe 4u+EaVdY6VCYqxi3sNX04RqbkRzeZTrJyX2eiathxzBNFto/cZmNZoH6SOYGYnIVOOeJ GXCY4BgqqRGkS8jIeUjm7CBEwRm71qtNQCzwp7HtXRiPsAElRqA84pwkI2dN1Lmn36DO Ff3+z9Qd7VOpylOZUQ/IG9kTwTw+f5Sw5KGswp6fTvZC3ktyYcQShkSfp+M0iUFp5406 Ma0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=oLGOLLAavPexO0BD6gmUyd/prvidX6jKC6EMY673bL0=; b=XUEhyrL38JtAw6Q6tlGlbOHp0loKmW5jXf8E1yIX5zyyIATIGk082jIYP/YDR/i86b rGQHykbRRQAEjF0gt574QAuhKL9vHFENkxNlSFTGS3l71J0P0wTvzaVL172C38jIVCt+ ZGwYKs8QQYX7nkbAQy1o4BpXrPbzOyh2UCDx8qrYdYjCyjZEtyY2pmlui4UScoEkUMns HksgnvgEnm8HWZ4T8uwnTo8OWj16ySpzvkqJCSGjY5BDQ1zNvcaG9dkT8v15bn3dtwWY CPlWSW4K7q9BhTcA4P4MXyYFW+RF0Z6j1UxyxQAg/1GhYobiQ+zqOlITfFdP1sO1Q4pk Eu2Q== X-Gm-Message-State: AKS2vOwCVuDVf/nUu4H8VEeGFpKJh7E+ZDAkvLP8boxapOk1zcOfemFF fceaFpfSsBWgi9G/WLot1fZoMuUkR2vx X-Received: by 10.36.118.11 with SMTP id z11mr11449099itb.88.1497629881841; Fri, 16 Jun 2017 09:18:01 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.10.86 with HTTP; Fri, 16 Jun 2017 09:17:41 -0700 (PDT) In-Reply-To: <201504121300.t3CD0xk7083878@svn.freebsd.org> References: <201504121300.t3CD0xk7083878@svn.freebsd.org> From: Ed Maste Date: Fri, 16 Jun 2017 12:17:41 -0400 X-Google-Sender-Auth: WCpRp4Awrxsz0gRKvFWdJDmeKcE Message-ID: Subject: Re: svn commit: r281466 - in head/sys: arm/conf conf dev/psci To: Andrew Turner Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 16:18:03 -0000 On 12 April 2015 at 09:00, Andrew Turner wrote: > Author: andrew > Date: Sun Apr 12 13:00:58 2015 > New Revision: 281466 > URL: https://svnweb.freebsd.org/changeset/base/281466 > > Log: > Add a driver for the ARM Power State Coordination Interface (PSCI). This > handles versions 0.1 and 0.2 of the standard on 32-bit ARM. Building armv6 with the clang500-import branch now reports psci_arm.S:45:2: error: instruction requres: TrustZone smc #0 ^ > > With this driver we can shutdown in QEMU. Further work is needed to > turn secondary cores on on boot and to support later revisions of the > specification. > > Submitted by: Robin Randhawa > Sponsored by: The FreeBSD Foundation > > Added: > head/sys/dev/psci/ > head/sys/dev/psci/psci.c (contents, props changed) > head/sys/dev/psci/psci.h (contents, props changed) > head/sys/dev/psci/psci_arm.S (contents, props changed) > Modified: > head/sys/arm/conf/VIRT > head/sys/conf/files.arm > > Modified: head/sys/arm/conf/VIRT > ============================================================================== > --- head/sys/arm/conf/VIRT Sun Apr 12 12:31:19 2015 (r281465) > +++ head/sys/arm/conf/VIRT Sun Apr 12 13:00:58 2015 (r281466) > @@ -82,6 +82,7 @@ device uart > device pty > device snp > device pl011 > +device psci > > device virtio > device virtio_mmio > > Modified: head/sys/conf/files.arm > ============================================================================== > --- head/sys/conf/files.arm Sun Apr 12 12:31:19 2015 (r281465) > +++ head/sys/conf/files.arm Sun Apr 12 13:00:58 2015 (r281466) > @@ -85,6 +85,8 @@ dev/fdt/fdt_arm_platform.c optional plat > dev/hwpmc/hwpmc_arm.c optional hwpmc > dev/hwpmc/hwpmc_armv7.c optional hwpmc armv6 > dev/kbd/kbd.c optional sc | vt > +dev/psci/psci.c optional psci > +dev/psci/psci_arm.S optional psci > dev/syscons/scgfbrndr.c optional sc > dev/syscons/scterm-teken.c optional sc > dev/syscons/scvtb.c optional sc > > Added: head/sys/dev/psci/psci.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/psci/psci.c Sun Apr 12 13:00:58 2015 (r281466) > @@ -0,0 +1,286 @@ > +/*- > + * Copyright (c) 2014 Robin Randhawa > + * 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 implements support for ARM's Power State Co-ordination Interface > + * [PSCI]. The implementation adheres to version 0.2 of the PSCI specification > + * but also supports v0.1. PSCI standardizes operations such as system reset, CPU > + * on/off/suspend. PSCI requires a compliant firmware implementation. > + * > + * The PSCI specification used for this implementation is available at: > + * > + * . > + * > + * TODO: > + * - Add support for remaining PSCI calls [this implementation only > + * supports get_version, system_reset and cpu_on]. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include > +#include > +#include > +#include > + > +#include > + > +struct psci_softc { > + device_t dev; > + > + psci_callfn_t psci_call; > + uint32_t psci_fnids[PSCI_FN_MAX]; > +}; > + > +static int psci_v0_1_init(device_t dev); > +static int psci_v0_2_init(device_t dev); > + > +struct psci_softc *psci_softc = NULL; > + > +static struct ofw_compat_data compat_data[] = { > + {"arm,psci-0.2", (uintptr_t)psci_v0_2_init}, > + {"arm,psci", (uintptr_t)psci_v0_1_init}, > + {NULL, 0} > +}; > + > +static int psci_probe(device_t dev); > +static int psci_attach(device_t dev); > +static void psci_shutdown(void *, int); > + > +static device_method_t psci_methods[] = { > + DEVMETHOD(device_probe, psci_probe), > + DEVMETHOD(device_attach, psci_attach), > + > + DEVMETHOD_END > +}; > + > +static driver_t psci_driver = { > + "psci", > + psci_methods, > + sizeof(struct psci_softc), > +}; > + > +static devclass_t psci_devclass; > + > +EARLY_DRIVER_MODULE(psci, simplebus, psci_driver, psci_devclass, 0, 0, > + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); > +EARLY_DRIVER_MODULE(psci, ofwbus, psci_driver, psci_devclass, 0, 0, > + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); > + > +static int > +psci_probe(device_t dev) > +{ > + const struct ofw_compat_data *ocd; > + > + if (!ofw_bus_status_okay(dev)) > + return (ENXIO); > + > + ocd = ofw_bus_search_compatible(dev, compat_data); > + if (ocd->ocd_str == NULL) > + return (ENXIO); > + > + device_set_desc(dev, "ARM Power State Co-ordination Interface Driver"); > + > + return (BUS_PROBE_SPECIFIC); > +} > + > +static int > +psci_attach(device_t dev) > +{ > + struct psci_softc *sc = device_get_softc(dev); > + const struct ofw_compat_data *ocd; > + psci_initfn_t psci_init; > + phandle_t node; > + char method[16]; > + > + if (psci_softc != NULL) > + return (ENXIO); > + > + ocd = ofw_bus_search_compatible(dev, compat_data); > + psci_init = (psci_initfn_t)ocd->ocd_data; > + KASSERT(psci_init != NULL, ("PSCI init function cannot be NULL")); > + > + node = ofw_bus_get_node(dev); > + if ((OF_getprop(node, "method", method, sizeof(method))) > 0) { > + if (strcmp(method, "hvc") == 0) > + sc->psci_call = psci_hvc_despatch; > + else if (strcmp(method, "smc") == 0) > + sc->psci_call = psci_smc_despatch; > + else { > + device_printf(dev, > + "psci_attach: PSCI conduit \"%s\" invalid\n", > + method); > + return (ENXIO); > + } > + } else { > + device_printf(dev, > + "psci_attach: PSCI conduit not supplied in the DT\n"); > + return (ENXIO); > + } > + > + if (psci_init(dev)) > + return (ENXIO); > + > + psci_softc = sc; > + > + return (0); > +} > + > +static int > +psci_get_version(struct psci_softc *sc) > +{ > + uint32_t fnid; > + > + /* PSCI version wasn't supported in v0.1. */ > + fnid = sc->psci_fnids[PSCI_FN_VERSION]; > + if (fnid) > + return (sc->psci_call(fnid, 0, 0, 0)); > + > + return (PSCI_RETVAL_NOT_SUPPORTED); > +} > + > +int > +psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id) > +{ > + > + /* PSCI v0.1 and v0.2 both support cpu_on. */ > + return(psci_softc->psci_call(psci_softc->psci_fnids[PSCI_FN_CPU_ON], cpu, > + entry, context_id)); > +} > + > +static void > +psci_shutdown(void *xsc, int howto) > +{ > + uint32_t fn = 0; > + > + /* PSCI system_off and system_reset werent't supported in v0.1. */ > + if ((howto & RB_POWEROFF) != 0) > + fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_OFF]; > + else if ((howto & RB_HALT) == 0) > + fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_RESET]; > + > + if (fn) > + psci_softc->psci_call(fn, 0, 0, 0); > + > + /* System reset and off do not return. */ > +} > + > +static int > +psci_v0_1_init(device_t dev) > +{ > + struct psci_softc *sc = device_get_softc(dev); > + int psci_fn; > + uint32_t psci_fnid; > + phandle_t node; > + int len; > + > + > + /* Zero out the function ID table - Is this needed ? */ > + for (psci_fn = PSCI_FN_VERSION, psci_fnid = PSCI_FNID_VERSION; > + psci_fn < PSCI_FN_MAX; psci_fn++, psci_fnid++) > + sc->psci_fnids[psci_fn] = 0; > + > + /* PSCI v0.1 doesn't specify function IDs. Get them from DT */ > + node = ofw_bus_get_node(dev); > + > + if ((len = OF_getproplen(node, "cpu_suspend")) > 0) { > + OF_getencprop(node, "cpu_suspend", &psci_fnid, len); > + sc->psci_fnids[PSCI_FN_CPU_SUSPEND] = psci_fnid; > + } > + > + if ((len = OF_getproplen(node, "cpu_on")) > 0) { > + OF_getencprop(node, "cpu_on", &psci_fnid, len); > + sc->psci_fnids[PSCI_FN_CPU_ON] = psci_fnid; > + } > + > + if ((len = OF_getproplen(node, "cpu_off")) > 0) { > + OF_getencprop(node, "cpu_off", &psci_fnid, len); > + sc->psci_fnids[PSCI_FN_CPU_OFF] = psci_fnid; > + } > + > + if ((len = OF_getproplen(node, "migrate")) > 0) { > + OF_getencprop(node, "migrate", &psci_fnid, len); > + sc->psci_fnids[PSCI_FN_MIGRATE] = psci_fnid; > + } > + > + if (bootverbose) > + device_printf(dev, "PSCI version 0.1 available\n"); > + > + return(0); > +} > + > +static int > +psci_v0_2_init(device_t dev) > +{ > + struct psci_softc *sc = device_get_softc(dev); > + int version; > + > + /* PSCI v0.2 specifies explicit function IDs. */ > + sc->psci_fnids[PSCI_FN_VERSION] = PSCI_FNID_VERSION; > + sc->psci_fnids[PSCI_FN_CPU_SUSPEND] = PSCI_FNID_CPU_SUSPEND; > + sc->psci_fnids[PSCI_FN_CPU_OFF] = PSCI_FNID_CPU_OFF; > + sc->psci_fnids[PSCI_FN_CPU_ON] = PSCI_FNID_CPU_ON; > + sc->psci_fnids[PSCI_FN_AFFINITY_INFO] = PSCI_FNID_AFFINITY_INFO; > + sc->psci_fnids[PSCI_FN_MIGRATE] = PSCI_FNID_MIGRATE; > + sc->psci_fnids[PSCI_FN_MIGRATE_INFO_TYPE] = PSCI_FNID_MIGRATE_INFO_TYPE; > + sc->psci_fnids[PSCI_FN_MIGRATE_INFO_UP_CPU] = PSCI_FNID_MIGRATE_INFO_UP_CPU; > + sc->psci_fnids[PSCI_FN_SYSTEM_OFF] = PSCI_FNID_SYSTEM_OFF; > + sc->psci_fnids[PSCI_FN_SYSTEM_RESET] = PSCI_FNID_SYSTEM_RESET; > + > + version = psci_get_version(sc); > + > + if (version == PSCI_RETVAL_NOT_SUPPORTED) > + return (1); > + > + if ((PSCI_VER_MAJOR(version) != 0) && (PSCI_VER_MINOR(version) != 2)) { > + device_printf(dev, "PSCI version number mismatched with DT\n"); > + return (1); > + } > + > + if (bootverbose) > + device_printf(dev, "PSCI version 0.2 available\n"); > + > + /* > + * We only register this for v0.2 since v0.1 doesn't support > + * system_reset. > + */ > + EVENTHANDLER_REGISTER(shutdown_final, psci_shutdown, sc, > + SHUTDOWN_PRI_LAST); > + > + return (0); > +} > > Added: head/sys/dev/psci/psci.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/psci/psci.h Sun Apr 12 13:00:58 2015 (r281466) > @@ -0,0 +1,102 @@ > +/*- > + * Copyright (c) 2013, 2014 Robin Randhawa > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _MACHINE_PSCI_H_ > +#define _MACHINE_PSCI_H_ > + > +#include > + > +typedef int (*psci_initfn_t)(device_t dev); > +typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t); > + > +extern int psci_present; > + > +void psci_system_reset(void); > +int psci_cpu_on(unsigned long, unsigned long, unsigned long); > +int psci_hvc_despatch(register_t, register_t, register_t, register_t); > +int psci_smc_despatch(register_t, register_t, register_t, register_t); > + > + > +/* > + * PSCI return codes. > + */ > +#define PSCI_RETVAL_SUCCESS 0 > +#define PSCI_RETVAL_NOT_SUPPORTED -1 > +#define PSCI_RETVAL_INVALID_PARAMS -2 > +#define PSCI_RETVAL_DENIED -3 > +#define PSCI_RETVAL_ALREADY_ON -4 > +#define PSCI_RETVAL_ON_PENDING -5 > +#define PSCI_RETVAL_INTERNAL_FAILURE -6 > +#define PSCI_RETVAL_NOT_PRESENT -7 > +#define PSCI_RETVAL_DISABLED -8 > + > +/* > + * PSCI function codes (as per PSCI v0.2). > + */ > +#ifdef __aarch64__ > +#define PSCI_FNID_VERSION 0x84000000 > +#define PSCI_FNID_CPU_SUSPEND 0xc4000001 > +#define PSCI_FNID_CPU_OFF 0x84000002 > +#define PSCI_FNID_CPU_ON 0xc4000003 > +#define PSCI_FNID_AFFINITY_INFO 0xc4000004 > +#define PSCI_FNID_MIGRATE 0xc4000005 > +#define PSCI_FNID_MIGRATE_INFO_TYPE 0x84000006 > +#define PSCI_FNID_MIGRATE_INFO_UP_CPU 0xc4000007 > +#define PSCI_FNID_SYSTEM_OFF 0x84000008 > +#define PSCI_FNID_SYSTEM_RESET 0x84000009 > +#else > +#define PSCI_FNID_VERSION 0x84000000 > +#define PSCI_FNID_CPU_SUSPEND 0x84000001 > +#define PSCI_FNID_CPU_OFF 0x84000002 > +#define PSCI_FNID_CPU_ON 0x84000003 > +#define PSCI_FNID_AFFINITY_INFO 0x84000004 > +#define PSCI_FNID_MIGRATE 0x84000005 > +#define PSCI_FNID_MIGRATE_INFO_TYPE 0x84000006 > +#define PSCI_FNID_MIGRATE_INFO_UP_CPU 0x84000007 > +#define PSCI_FNID_SYSTEM_OFF 0x84000008 > +#define PSCI_FNID_SYSTEM_RESET 0x84000009 > +#endif > + > +#define PSCI_VER_MAJOR(v) (((v) >> 16) & 0xFF) > +#define PSCI_VER_MINOR(v) ((v) & 0xFF) > + > +enum psci_fn { > + PSCI_FN_VERSION, > + PSCI_FN_CPU_SUSPEND, > + PSCI_FN_CPU_OFF, > + PSCI_FN_CPU_ON, > + PSCI_FN_AFFINITY_INFO, > + PSCI_FN_MIGRATE, > + PSCI_FN_MIGRATE_INFO_TYPE, > + PSCI_FN_MIGRATE_INFO_UP_CPU, > + PSCI_FN_SYSTEM_OFF, > + PSCI_FN_SYSTEM_RESET, > + PSCI_FN_MAX > +}; > + > +#endif /* _MACHINE_PSCI_H_ */ > > Added: head/sys/dev/psci/psci_arm.S > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/psci/psci_arm.S Sun Apr 12 13:00:58 2015 (r281466) > @@ -0,0 +1,47 @@ > +/*- > + * Copyright (c) 2015 Andrew Turner > + * 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$"); > + > +.arch_extension virt /* For hvc */ > + > +/* > + * int psci_hvc_despatch(register_t psci_fnid, register_t...) > + */ > +ENTRY(psci_hvc_despatch) > + hvc #0 > + RET > +END(psci_hvc_despatch) > + > +/* > + * int psci_smc_despatch(register_t psci_fnid, register_t...) > + */ > +ENTRY(psci_smc_despatch) > + smc #0 > + RET > +END(psci_hvc_despatch) > From owner-svn-src-all@freebsd.org Fri Jun 16 17:18:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92233C789E5; Fri, 16 Jun 2017 17:18:31 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DE6F38A8; Fri, 16 Jun 2017 17:18:31 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GHIUtn069606; Fri, 16 Jun 2017 17:18:30 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GHITk4069597; Fri, 16 Jun 2017 17:18:29 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706161718.v5GHITk4069597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 16 Jun 2017 17:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320005 - in head/sys/arm/mv: . armada38x armadaxp discovery kirkwood orion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 17:18:31 -0000 Author: zbb Date: Fri Jun 16 17:18:29 2017 New Revision: 320005 URL: https://svnweb.freebsd.org/changeset/base/320005 Log: Enhance Armada 38x SoC identification string Add hw_clockrate and CPU frequency, basing on sample-at-reset configuration. Submitted by: Arnaud Ysmal Marcin Wojtas Obtained from: Stormshield, Semihalf Sponsored by: Stormshield Reviewed by: andrew Differential revision: https://reviews.freebsd.org/D10899 Modified: head/sys/arm/mv/armada38x/armada38x.c head/sys/arm/mv/armadaxp/armadaxp.c head/sys/arm/mv/discovery/discovery.c head/sys/arm/mv/kirkwood/kirkwood.c head/sys/arm/mv/mv_common.c head/sys/arm/mv/mvreg.h head/sys/arm/mv/mvvar.h head/sys/arm/mv/orion/orion.c Modified: head/sys/arm/mv/armada38x/armada38x.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x.c Fri Jun 16 15:09:43 2017 (r320004) +++ head/sys/arm/mv/armada38x/armada38x.c Fri Jun 16 17:18:29 2017 (r320005) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -43,6 +44,10 @@ int armada38x_scu_enable(void); int armada38x_win_set_iosync_barrier(void); int armada38x_mbus_optimization(void); +static int hw_clockrate; +SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, + &hw_clockrate, 0, "CPU instruction clock rate"); + uint32_t get_tclk(void) { @@ -58,6 +63,29 @@ get_tclk(void) return (TCLK_250MHZ); else return (TCLK_200MHZ); +} + +uint32_t +get_cpu_freq(void) +{ + uint32_t sar; + + static const uint32_t cpu_frequencies[] = { + 0, 0, 0, 0, + 1066, 0, 0, 0, + 1332, 0, 0, 0, + 1600, 0, 0, 0, + 1866, 0, 0, 2000 + }; + + sar = (uint32_t)get_sar_value(); + sar = (sar & A38X_CPU_DDR_CLK_MASK) >> A38X_CPU_DDR_CLK_SHIFT; + if (sar >= nitems(cpu_frequencies)) + return (0); + + hw_clockrate = cpu_frequencies[sar]; + + return (hw_clockrate * 1000 * 1000); } int Modified: head/sys/arm/mv/armadaxp/armadaxp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp.c Fri Jun 16 15:09:43 2017 (r320004) +++ head/sys/arm/mv/armadaxp/armadaxp.c Fri Jun 16 17:18:29 2017 (r320005) @@ -136,6 +136,13 @@ get_tclk(void) return (TCLK_200MHZ); } +uint32_t +get_cpu_freq(void) +{ + + return (0); +} + static uint32_t count_l2clk(void) { Modified: head/sys/arm/mv/discovery/discovery.c ============================================================================== --- head/sys/arm/mv/discovery/discovery.c Fri Jun 16 15:09:43 2017 (r320004) +++ head/sys/arm/mv/discovery/discovery.c Fri Jun 16 17:18:29 2017 (r320005) @@ -109,3 +109,10 @@ get_tclk(void) panic("Unknown TCLK settings!"); } } + +uint32_t +get_cpu_freq(void) +{ + + return (0); +} Modified: head/sys/arm/mv/kirkwood/kirkwood.c ============================================================================== --- head/sys/arm/mv/kirkwood/kirkwood.c Fri Jun 16 15:09:43 2017 (r320004) +++ head/sys/arm/mv/kirkwood/kirkwood.c Fri Jun 16 17:18:29 2017 (r320005) @@ -79,3 +79,10 @@ get_tclk(void) return (TCLK_166MHZ); } + +uint32_t +get_cpu_freq(void) +{ + + return (0); +} Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Fri Jun 16 15:09:43 2017 (r320004) +++ head/sys/arm/mv/mv_common.c Fri Jun 16 17:18:29 2017 (r320005) @@ -419,7 +419,7 @@ soc_id(uint32_t *dev, uint32_t *rev) static void soc_identify(void) { - uint32_t d, r, size, mode; + uint32_t d, r, size, mode, freq; const char *dev; const char *rev; @@ -512,7 +512,11 @@ soc_identify(void) printf("%s", dev); if (*rev != '\0') printf(" rev %s", rev); - printf(", TClock %dMHz\n", get_tclk() / 1000 / 1000); + printf(", TClock %dMHz", get_tclk() / 1000 / 1000); + freq = get_cpu_freq(); + if (freq != 0) + printf(", Frequency %dMHz", freq / 1000 / 1000); + printf("\n"); mode = read_cpu_ctrl(CPU_CONFIG); printf(" Instruction cache prefetch %s, data cache prefetch %s\n", Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Fri Jun 16 15:09:43 2017 (r320004) +++ head/sys/arm/mv/mvreg.h Fri Jun 16 17:18:29 2017 (r320005) @@ -355,6 +355,9 @@ #define TCLK_300MHZ 300000000 #define TCLK_667MHZ 667000000 +#define A38X_CPU_DDR_CLK_MASK 0x00007c00 +#define A38X_CPU_DDR_CLK_SHIFT 10 + /* * CPU Cache Configuration */ Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Fri Jun 16 15:09:43 2017 (r320004) +++ head/sys/arm/mv/mvvar.h Fri Jun 16 17:18:29 2017 (r320005) @@ -104,6 +104,7 @@ uint32_t ddr_target(int i); uint32_t cpu_extra_feat(void); uint32_t get_tclk(void); +uint32_t get_cpu_freq(void); uint32_t get_l2clk(void); uint32_t read_cpu_ctrl(uint32_t); void write_cpu_ctrl(uint32_t, uint32_t); Modified: head/sys/arm/mv/orion/orion.c ============================================================================== --- head/sys/arm/mv/orion/orion.c Fri Jun 16 15:09:43 2017 (r320004) +++ head/sys/arm/mv/orion/orion.c Fri Jun 16 17:18:29 2017 (r320005) @@ -100,3 +100,10 @@ get_tclk(void) panic("Unknown TCLK settings!"); } } + +uint32_t +get_cpu_freq(void) +{ + + return (0); +} From owner-svn-src-all@freebsd.org Fri Jun 16 17:31:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13438C78EF8; Fri, 16 Jun 2017 17:31:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7424645BB; Fri, 16 Jun 2017 17:31:57 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GHVv1s077535; Fri, 16 Jun 2017 17:31:57 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GHVv61077534; Fri, 16 Jun 2017 17:31:57 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201706161731.v5GHVv61077534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 16 Jun 2017 17:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320006 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 17:31:58 -0000 Author: zbb Date: Fri Jun 16 17:31:56 2017 New Revision: 320006 URL: https://svnweb.freebsd.org/changeset/base/320006 Log: Revert change to description introduced in r320002 Currently some ARM platforms implement their own platform_probe_and_attach() function and other use common routine that calls platform's PLATFORM_ATTACH method. Keep the old description to match the preferred way of naming things. Pointed out by: andrew Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Jun 16 17:18:29 2017 (r320005) +++ head/sys/arm/arm/pmap-v6.c Fri Jun 16 17:31:56 2017 (r320006) @@ -508,7 +508,7 @@ pmap_set_tex(void) * Usage rules: * - it shall be called after pmap_bootstrap_prepare() and before * cpu_mp_start() (thus only on boot CPU). In practice, it's expected - * to be called from platform_probe_and_attach() or platform_late_init(). + * to be called from platform_attach() or platform_late_init(). * * - if remapping doesn't change caching mode, or until uncached class * is remapped to any kind of cached one, then no other restriction exists. From owner-svn-src-all@freebsd.org Fri Jun 16 18:58:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FF37D86D0E; Fri, 16 Jun 2017 18:58:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B588677FE; Fri, 16 Jun 2017 18:58:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GIwm9i010880; Fri, 16 Jun 2017 18:58:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GIwmBw010877; Fri, 16 Jun 2017 18:58:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706161858.v5GIwmBw010877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Jun 2017 18:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320007 - in head/usr.sbin/bsdinstall: partedit 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 18:58:50 -0000 Author: emaste Date: Fri Jun 16 18:58:48 2017 New Revision: 320007 URL: https://svnweb.freebsd.org/changeset/base/320007 Log: bsdinstall: use consistent EFI configuration across platforms - increase arm64 EFI partition to 200M, as x86 - use EFI_BOOTPART_SIZE and EFI_BOOTPART_PATH macros on x86 - increase ZFS EFI partition to 200M PR: 201898 Reviewed by: allanjude, manu MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11239 Modified: head/usr.sbin/bsdinstall/partedit/partedit_arm64.c head/usr.sbin/bsdinstall/partedit/partedit_x86.c head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/partedit/partedit_arm64.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_arm64.c Fri Jun 16 17:31:56 2017 (r320006) +++ head/usr.sbin/bsdinstall/partedit/partedit_arm64.c Fri Jun 16 18:58:48 2017 (r320007) @@ -35,7 +35,7 @@ #include "partedit.h" /* EFI partition size in KB */ -#define EFI_BOOTPART_SIZE (50 * 1024) +#define EFI_BOOTPART_SIZE (200 * 1024 * 1024) #define EFI_BOOTPART_PATH "/boot/boot1.efifat" const char * @@ -73,7 +73,7 @@ bootpart_size(const char *scheme) if (strcmp(scheme, "GPT") != 0) return (0); - return ((EFI_BOOTPART_SIZE) * 1024); + return (EFI_BOOTPART_SIZE); } const char * Modified: head/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_x86.c Fri Jun 16 17:31:56 2017 (r320006) +++ head/usr.sbin/bsdinstall/partedit/partedit_x86.c Fri Jun 16 18:58:48 2017 (r320007) @@ -32,6 +32,10 @@ #include "partedit.h" +/* EFI partition size in bytes */ +#define EFI_BOOTPART_SIZE (200 * 1024 * 1024) +#define EFI_BOOTPART_PATH "/boot/boot1.efifat" + static const char * x86_bootmethod(void) { @@ -99,7 +103,7 @@ bootpart_size(const char *scheme) if (strcmp(x86_bootmethod(), "BIOS") == 0) return (512*1024); else - return (200*1024*1024); + return (EFI_BOOTPART_SIZE); return (0); } @@ -137,7 +141,7 @@ partcode_path(const char *part_type, const char *fs_ty if (strcmp(part_type, "GPT") == 0) { if (strcmp(x86_bootmethod(), "UEFI") == 0) - return ("/boot/boot1.efifat"); + return (EFI_BOOTPART_PATH); else if (strcmp(fs_type, "zfs") == 0) return ("/boot/gptzfsboot"); else Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Fri Jun 16 17:31:56 2017 (r320006) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Fri Jun 16 18:58:48 2017 (r320007) @@ -848,7 +848,7 @@ zfs_create_diskpart() f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ - "$align_small" efiboot$index efi 800k $disk || + "$align_small" efiboot$index efi 200M $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE_PARTONLY" \ /boot/boot1.efifat 1 $disk || From owner-svn-src-all@freebsd.org Fri Jun 16 19:26:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 446ABD877BC; Fri, 16 Jun 2017 19:26:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0916468889; Fri, 16 Jun 2017 19:26:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GJQXXx023126; Fri, 16 Jun 2017 19:26:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GJQXJ1023125; Fri, 16 Jun 2017 19:26:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706161926.v5GJQXJ1023125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Jun 2017 19:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320008 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 19:26:34 -0000 Author: emaste Date: Fri Jun 16 19:26:33 2017 New Revision: 320008 URL: https://svnweb.freebsd.org/changeset/base/320008 Log: bsdinstall: correct comment after r320007 Submitted by: vangyzen Modified: head/usr.sbin/bsdinstall/partedit/partedit_arm64.c Modified: head/usr.sbin/bsdinstall/partedit/partedit_arm64.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_arm64.c Fri Jun 16 18:58:48 2017 (r320007) +++ head/usr.sbin/bsdinstall/partedit/partedit_arm64.c Fri Jun 16 19:26:33 2017 (r320008) @@ -34,7 +34,7 @@ #include "partedit.h" -/* EFI partition size in KB */ +/* EFI partition size in bytes */ #define EFI_BOOTPART_SIZE (200 * 1024 * 1024) #define EFI_BOOTPART_PATH "/boot/boot1.efifat" From owner-svn-src-all@freebsd.org Fri Jun 16 20:00:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5996FD87D68; Fri, 16 Jun 2017 20:00:40 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2859B6A654; Fri, 16 Jun 2017 20:00:40 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GK0dTU035519; Fri, 16 Jun 2017 20:00:39 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GK0diU035518; Fri, 16 Jun 2017 20:00:39 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201706162000.v5GK0diU035518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 16 Jun 2017 20:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320009 - head/usr.sbin/lpr/lpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 20:00:40 -0000 Author: sbruno Date: Fri Jun 16 20:00:39 2017 New Revision: 320009 URL: https://svnweb.freebsd.org/changeset/base/320009 Log: Quiesce clang warning while building lpc. usr.sbin/lpr/lpc/lpc.c Warning passing 'char *[20]' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] Fix: Explicitly cast the variable "margv" to const char ** only for it's use as a parameter to suppress the error Submitted by: Aaron Prieger Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11019 Modified: head/usr.sbin/lpr/lpc/lpc.c Modified: head/usr.sbin/lpr/lpc/lpc.c ============================================================================== --- head/usr.sbin/lpr/lpc/lpc.c Fri Jun 16 19:26:33 2017 (r320008) +++ head/usr.sbin/lpr/lpc/lpc.c Fri Jun 16 20:00:39 2017 (r320009) @@ -197,7 +197,7 @@ cmdscanner(void) makeargv(); if (margc == 0) continue; - if (el != NULL && el_parse(el, margc, margv) != -1) + if (el != NULL && el_parse(el, margc, (const char **)margv) != -1) continue; c = getcmd(margv[0]); From owner-svn-src-all@freebsd.org Fri Jun 16 20:03:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5BAFD87EE2; Fri, 16 Jun 2017 20:03:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC5766A8E9; Fri, 16 Jun 2017 20:03:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GK39P3039162; Fri, 16 Jun 2017 20:03:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GK39SA039160; Fri, 16 Jun 2017 20:03:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706162003.v5GK39SA039160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 16 Jun 2017 20:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320010 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 20:03:11 -0000 Author: jhb Date: Fri Jun 16 20:03:09 2017 New Revision: 320010 URL: https://svnweb.freebsd.org/changeset/base/320010 Log: Decode arguments to sched_* family of system calls. This includes decoding both scheduler policy constants and the sched_param structure for sched_get_priority_max(), sched_get_priority_min(), sched_getparam(), sched_getscheduler(), sched_rr_get_interval(), sched_setparam(), and sched_setscheduler(). Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Fri Jun 16 20:00:39 2017 (r320009) +++ head/usr.bin/truss/syscall.h Fri Jun 16 20:03:09 2017 (r320010) @@ -50,7 +50,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol, Sockoptlevel, Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, - Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, + Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Fri Jun 16 20:00:39 2017 (r320009) +++ head/usr.bin/truss/syscalls.c Fri Jun 16 20:03:09 2017 (r320010) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -395,6 +396,20 @@ static struct syscall decoded_syscalls[] = { .args = { { Rtpriofunc, 0 }, { Int, 1 }, { Ptr, 2 } } }, { .name = "rtprio_thread", .ret_type = 1, .nargs = 3, .args = { { Rtpriofunc, 0 }, { Int, 1 }, { Ptr, 2 } } }, + { .name = "sched_get_priority_max", .ret_type = 1, .nargs = 1, + .args = { { Schedpolicy, 0 } } }, + { .name = "sched_get_priority_min", .ret_type = 1, .nargs = 1, + .args = { { Schedpolicy, 0 } } }, + { .name = "sched_getparam", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Schedparam | OUT, 1 } } }, + { .name = "sched_getscheduler", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, + { .name = "sched_rr_get_interval", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Timespec | OUT, 1 } } }, + { .name = "sched_setparam", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Schedparam, 1 } } }, + { .name = "sched_setscheduler", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Schedpolicy, 1 }, { Schedparam, 2 } } }, { .name = "sctp_generic_recvmsg", .ret_type = 1, .nargs = 7, .args = { { Int, 0 }, { Ptr | IN, 1 }, { Int, 2 }, { Sockaddr | OUT, 3 }, { Ptr | OUT, 4 }, { Ptr | OUT, 5 }, @@ -2155,6 +2170,20 @@ print_arg(struct syscall_args *sc, unsigned long *args print_integer_arg(sysdecode_rtprio_function, fp, args[sc->offset]); break; + case Schedpolicy: + print_integer_arg(sysdecode_scheduler_policy, fp, + args[sc->offset]); + break; + case Schedparam: { + struct sched_param sp; + + if (get_struct(pid, (void *)args[sc->offset], &sp, + sizeof(sp)) != -1) + fprintf(fp, "{ %d }", sp.sched_priority); + else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } case CloudABIAdvice: fputs(xlookup(cloudabi_advice, args[sc->offset]), fp); From owner-svn-src-all@freebsd.org Fri Jun 16 20:08:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B12A5D88038; Fri, 16 Jun 2017 20:08:46 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B6D16AB53; Fri, 16 Jun 2017 20:08:46 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GK8jZQ039396; Fri, 16 Jun 2017 20:08:45 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GK8iBr039388; Fri, 16 Jun 2017 20:08:44 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201706162008.v5GK8iBr039388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 16 Jun 2017 20:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320011 - in head/sys/boot: efi/loader forth i386/libi386 i386/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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 20:08:46 -0000 Author: tsoome Date: Fri Jun 16 20:08:44 2017 New Revision: 320011 URL: https://svnweb.freebsd.org/changeset/base/320011 Log: Add chain loader support for loader Implement simple chain loader in loader; this update does add chain command, taking device or file as argument to load and start new boot loader. In case of BIOS, the chain will read the boot block to address 0000:7c00 and jumps on it. In case of UEFI, the chain command is to be used with efi application, typically stored in EFI System Partition. The update also does add simple menu entry, if the variable chain_disk is set. The value of the variable chain_disk is used as argument for chain loading. Relnotes: yes Differential Revision: https://reviews.freebsd.org/D5992 Added: head/sys/boot/i386/libi386/relocater_tramp.S (contents, props changed) head/sys/boot/i386/loader/chain.c (contents, props changed) Modified: head/sys/boot/efi/loader/main.c head/sys/boot/forth/menu.rc head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/libi386/libi386.h head/sys/boot/i386/loader/Makefile head/sys/boot/i386/loader/help.i386 Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri Jun 16 20:03:09 2017 (r320010) +++ head/sys/boot/efi/loader/main.c Fri Jun 16 20:08:44 2017 (r320011) @@ -795,6 +795,100 @@ command_fdt(int argc, char *argv[]) COMMAND_SET(fdt, "fdt", "flattened device tree handling", command_fdt); #endif +/* + * Chain load another efi loader. + */ +static int +command_chain(int argc, char *argv[]) +{ + EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; + EFI_HANDLE loaderhandle; + EFI_LOADED_IMAGE *loaded_image; + EFI_STATUS status; + struct stat st; + struct devdesc *dev; + char *name, *path; + void *buf; + int fd; + + if (argc < 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + + name = argv[1]; + + if ((fd = open(name, O_RDONLY)) < 0) { + command_errmsg = "no such file"; + return (CMD_ERROR); + } + + if (fstat(fd, &st) < -1) { + command_errmsg = "stat failed"; + close(fd); + return (CMD_ERROR); + } + + status = BS->AllocatePool(EfiLoaderCode, (UINTN)st.st_size, &buf); + if (status != EFI_SUCCESS) { + command_errmsg = "failed to allocate buffer"; + close(fd); + return (CMD_ERROR); + } + if (read(fd, buf, st.st_size) != st.st_size) { + command_errmsg = "error while reading the file"; + (void)BS->FreePool(buf); + close(fd); + return (CMD_ERROR); + } + close(fd); + status = BS->LoadImage(FALSE, IH, NULL, buf, st.st_size, &loaderhandle); + (void)BS->FreePool(buf); + if (status != EFI_SUCCESS) { + command_errmsg = "LoadImage failed"; + return (CMD_ERROR); + } + status = BS->HandleProtocol(loaderhandle, &LoadedImageGUID, + (void **)&loaded_image); + + if (argc > 2) { + int i, len = 0; + CHAR16 *argp; + + for (i = 2; i < argc; i++) + len += strlen(argv[i]) + 1; + + len *= sizeof (*argp); + loaded_image->LoadOptions = argp = malloc (len); + loaded_image->LoadOptionsSize = len; + for (i = 2; i < argc; i++) { + char *ptr = argv[i]; + while (*ptr) + *(argp++) = *(ptr++); + *(argp++) = ' '; + } + *(--argv) = 0; + } + + if (efi_getdev((void **)&dev, name, (const char **)&path) == 0) + loaded_image->DeviceHandle = + efi_find_handle(dev->d_dev, dev->d_unit); + + dev_cleanup(); + status = BS->StartImage(loaderhandle, NULL, NULL); + if (status != EFI_SUCCESS) { + command_errmsg = "StartImage failed"; + free(loaded_image->LoadOptions); + loaded_image->LoadOptions = NULL; + status = BS->UnloadImage(loaded_image); + return (CMD_ERROR); + } + + return (CMD_ERROR); /* not reached */ +} + +COMMAND_SET(chain, "chain", "chain load file", command_chain); + #ifdef EFI_ZFS_BOOT static void efi_zfs_probe(void) Modified: head/sys/boot/forth/menu.rc ============================================================================== --- head/sys/boot/forth/menu.rc Fri Jun 16 20:03:09 2017 (r320010) +++ head/sys/boot/forth/menu.rc Fri Jun 16 20:08:44 2017 (r320011) @@ -73,7 +73,22 @@ s" currdev" getenv dup 0> [if] drop 4 s" zfs:" compare set mainmenu_command[7]="3 goto_menu" set mainmenu_keycode[7]=101 set mainansi_caption[7]="Select Boot ^[1mE^[37mnvironment..." + + s" chain_disk" getenv? [if] + set mainmenu_caption[8]="Chain[L]oad ${chain_disk}" + set mainmenu_command[8]="chain ${chain_disk}" + set mainmenu_keycode[8]=108 + set mainansi_caption[8]="Chain^[1mL^[moad ${chain_disk}" + [then] +[else] + s" chain_disk" getenv? [if] + set mainmenu_caption[7]="Chain[L]oad ${chain_disk}" + set mainmenu_command[7]="chain ${chain_disk}" + set mainmenu_keycode[7]=108 + set mainansi_caption[7]="Chain^[1mL^[moad ${chain_disk}" + [then] [then] [else] drop [then] + \ \ BOOT OPTIONS MENU Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Fri Jun 16 20:03:09 2017 (r320010) +++ head/sys/boot/i386/libi386/Makefile Fri Jun 16 20:08:44 2017 (r320011) @@ -6,7 +6,7 @@ INTERNALLIB= SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ comconsole.c devicename.c elf32_freebsd.c \ - elf64_freebsd.c multiboot.c multiboot_tramp.S \ + elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c .PATH: ${.CURDIR}/../../zfs Modified: head/sys/boot/i386/libi386/libi386.h ============================================================================== --- head/sys/boot/i386/libi386/libi386.h Fri Jun 16 20:03:09 2017 (r320010) +++ head/sys/boot/i386/libi386/libi386.h Fri Jun 16 20:08:44 2017 (r320011) @@ -60,6 +60,35 @@ struct i386_devdesc } d_kind; }; +/* + * relocater trampoline support. + */ +struct relocate_data { + uint32_t src; + uint32_t dest; + uint32_t size; +}; + +extern void relocater(void); + +extern uint32_t relocater_data; +extern uint32_t relocater_size; + +extern uint16_t relocator_ip; +extern uint16_t relocator_cs; +extern uint16_t relocator_ds; +extern uint16_t relocator_es; +extern uint16_t relocator_fs; +extern uint16_t relocator_gs; +extern uint16_t relocator_ss; +extern uint16_t relocator_sp; +extern uint32_t relocator_esi; +extern uint32_t relocator_eax; +extern uint32_t relocator_ebx; +extern uint32_t relocator_edx; +extern uint32_t relocator_ebp; +extern uint16_t relocator_a20_enabled; + int i386_getdev(void **vdev, const char *devspec, const char **path); char *i386_fmtdev(void *vdev); int i386_setcurrdev(struct env_var *ev, int flags, const void *value); Added: head/sys/boot/i386/libi386/relocater_tramp.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/libi386/relocater_tramp.S Fri Jun 16 20:08:44 2017 (r320011) @@ -0,0 +1,358 @@ +/*- + * Copyright 2015 Toomas Soome + * 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$ + */ + + +/* + * relocate is needed to support loading code which has to be located + * below 1MB, as both BTX and loader are using low memory area. + * + * relocate and start loaded code. Since loaded code may need to be + * placed to already occupied memory area, this code is moved to safe + * memory area and then btx __exec will be called with physical pointer + * to this area. __exec will set pointer to %eax and use call *%eax, + * so on entry, we have new "base" address in %eax. + * + * Relocate will first set up and load new safe GDT to shut down BTX, + * then loaded code will be relocated to final memory location, + * then machine will be switched from 32bit protected mode to 16bit + * protected mode following by switch to real mode with A20 enabled or + * disabled. Finally the loaded code will be started and it will take + * over the whole system. + * + * For now, the known "safe" memory area for relocate is 0x600, + * the actual "free" memory is supposed to start from 0x500, leaving + * first 0x100 bytes in reserve. As relocate code+data is very small, + * it will leave enough space to set up boot blocks to 0:7c00 or load + * linux kernel below 1MB space. + */ +/* + * segment selectors + */ + .set SEL_SCODE,0x8 + .set SEL_SDATA,0x10 + .set SEL_RCODE,0x18 + .set SEL_RDATA,0x20 + + .p2align 4 + .globl relocater +relocater: + cli + /* + * set up GDT from new location + */ + movl %eax, %esi /* our base address */ + add $(relocater.1-relocater), %eax + jmp *%eax +relocater.1: + /* set up jump */ + lea (relocater.2-relocater)(%esi), %eax + movl %eax, (jump_vector-relocater) (%esi) + + /* set up gdt */ + lea (gdt-relocater) (%esi), %eax + movl %eax, (gdtaddr-relocater) (%esi) + + /* load gdt */ + lgdt (gdtdesc - relocater) (%esi) + lidt (idt-relocater) (%esi) + + /* update cs */ + ljmp *(jump_vector-relocater) (%esi) + + .code32 +relocater.2: + xorl %eax, %eax + movb $SEL_SDATA, %al + movw %ax, %ss + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + movl %cr0, %eax /* disable paging */ + andl $~0x80000000,%eax + movl %eax, %cr0 + xorl %ecx, %ecx /* flush TLB */ + movl %ecx, %cr3 + cld +/* + * relocate data loop. load source, dest and size from + * relocater_data[i], 0 value will stop the loop. + * registers used for move: %esi, %edi, %ecx. + * %ebx to keep base + * %edx for relocater_data offset + */ + movl %esi, %ebx /* base address */ + xorl %edx, %edx +loop.1: + movl (relocater_data-relocater)(%ebx, %edx, 4), %eax + testl %eax, %eax + jz loop.2 + movl (relocater_data-relocater)(%ebx, %edx, 4), %esi + inc %edx + movl (relocater_data-relocater)(%ebx, %edx, 4), %edi + inc %edx + movl (relocater_data-relocater)(%ebx, %edx, 4), %ecx + inc %edx + rep + movsb + jmp loop.1 +loop.2: + movl %ebx, %esi /* restore esi */ + /* + * data is relocated, switch to 16bit mode + */ + lea (relocater.3-relocater)(%esi), %eax + movl %eax, (jump_vector-relocater) (%esi) + movl $SEL_RCODE, %eax + movl %eax, (jump_vector-relocater+4) (%esi) + + ljmp *(jump_vector-relocater) (%esi) +relocater.3: + .code16 + + movw $SEL_RDATA, %ax + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + movw %ax, %ss + lidt (idt-relocater) (%esi) + lea (relocater.4-relocater)(%esi), %eax + movl %eax, (jump_vector-relocater) (%esi) + xorl %eax, %eax + movl %eax, (jump_vector-relocater+4) (%esi) + /* clear PE */ + movl %cr0, %eax + dec %al + movl %eax, %cr0 + ljmp *(jump_vector-relocater) (%esi) +relocater.4: + xorw %ax, %ax + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + movw %ax, %ss + /* + * set real mode irq offsets + */ + movw $0x7008,%bx + in $0x21,%al # Save master + push %ax # IMR + in $0xa1,%al # Save slave + push %ax # IMR + movb $0x11,%al # ICW1 to + outb %al,$0x20 # master, + outb %al,$0xa0 # slave + movb %bl,%al # ICW2 to + outb %al,$0x21 # master + movb %bh,%al # ICW2 to + outb %al,$0xa1 # slave + movb $0x4,%al # ICW3 to + outb %al,$0x21 # master + movb $0x2,%al # ICW3 to + outb %al,$0xa1 # slave + movb $0x1,%al # ICW4 to + outb %al,$0x21 # master, + outb %al,$0xa1 # slave + pop %ax # Restore slave + outb %al,$0xa1 # IMR + pop %ax # Restore master + outb %al,$0x21 # IMR + # done + /* + * Should A20 be left enabled? + */ + /* movw imm16, %ax */ + .byte 0xb8 + .globl relocator_a20_enabled +relocator_a20_enabled: + .word 0 + test %ax, %ax + jnz a20_done + + movw $0xa00, %ax + movw %ax, %sp + movw %ax, %bp + + /* Disable A20 */ + movw $0x2400, %ax + int $0x15 +# jnc a20_done + + call a20_check_state + testb %al, %al + jz a20_done + + inb $0x92 + andb $(~0x03), %al + outb $0x92 + jmp a20_done + +a20_check_state: + movw $100, %cx +1: + xorw %ax, %ax + movw %ax, %ds + decw %ax + movw %ax, %es + xorw %ax, %ax + movw $0x8000, %ax + movw %ax, %si + addw $0x10, %ax + movw %ax, %di + movb %ds:(%si), %dl + movb %es:(%di), %al + movb %al, %dh + decb %dh + movb %dh, %ds:(%si) + outb %al, $0x80 + outb %al, $0x80 + movb %es:(%di), %dh + subb %dh, %al + xorb $1, %al + movb %dl, %ds:(%si) + testb %al, %al + jz a20_done + loop 1b + ret +a20_done: + /* + * set up registers + */ + /* movw imm16, %ax. */ + .byte 0xb8 + .globl relocator_ds +relocator_ds: .word 0 + movw %ax, %ds + + /* movw imm16, %ax. */ + .byte 0xb8 + .globl relocator_es +relocator_es: .word 0 + movw %ax, %es + + /* movw imm16, %ax. */ + .byte 0xb8 + .globl relocator_fs +relocator_fs: .word 0 + movw %ax, %fs + + /* movw imm16, %ax. */ + .byte 0xb8 + .globl relocator_gs +relocator_gs: .word 0 + movw %ax, %gs + + /* movw imm16, %ax. */ + .byte 0xb8 + .globl relocator_ss +relocator_ss: .word 0 + movw %ax, %ss + + /* movw imm16, %ax. */ + .byte 0xb8 + .globl relocator_sp +relocator_sp: .word 0 + movzwl %ax, %esp + + /* movw imm32, %eax. */ + .byte 0x66, 0xb8 + .globl relocator_esi +relocator_esi: .long 0 + movl %eax, %esi + + /* movw imm32, %edx. */ + .byte 0x66, 0xba + .globl relocator_edx +relocator_edx: .long 0 + + /* movw imm32, %ebx. */ + .byte 0x66, 0xbb + .globl relocator_ebx +relocator_ebx: .long 0 + + /* movw imm32, %eax. */ + .byte 0x66, 0xb8 + .globl relocator_eax +relocator_eax: .long 0 + + /* movw imm32, %ebp. */ + .byte 0x66, 0xbd + .globl relocator_ebp +relocator_ebp: .long 0 + + sti + .byte 0xea /* ljmp */ + .globl relocator_ip +relocator_ip: + .word 0 + .globl relocator_cs +relocator_cs: + .word 0 + +/* GDT to reset BTX */ + .code32 + .p2align 4 +jump_vector: .long 0 + .long SEL_SCODE + +gdt: .word 0x0, 0x0 /* null entry */ + .byte 0x0, 0x0, 0x0, 0x0 + .word 0xffff, 0x0 /* SEL_SCODE */ + .byte 0x0, 0x9a, 0xcf, 0x0 + .word 0xffff, 0x0 /* SEL_SDATA */ + .byte 0x0, 0x92, 0xcf, 0x0 + .word 0xffff, 0x0 /* SEL_RCODE */ + .byte 0x0, 0x9a, 0x0f, 0x0 + .word 0xffff, 0x0 /* SEL_RDATA */ + .byte 0x0, 0x92, 0x0f, 0x0 +gdt.1: + +gdtdesc: .word gdt.1 - gdt - 1 /* limit */ +gdtaddr: .long 0 /* base */ + +idt: .word 0x3ff + .long 0 + + .globl relocater_data +relocater_data: + .long 0 /* src */ + .long 0 /* dest */ + .long 0 /* size */ + .long 0 /* src */ + .long 0 /* dest */ + .long 0 /* size */ + .long 0 /* src */ + .long 0 /* dest */ + .long 0 /* size */ + .long 0 + + .globl relocater_size +relocater_size: + .long relocater_size-relocater Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Fri Jun 16 20:03:09 2017 (r320010) +++ head/sys/boot/i386/loader/Makefile Fri Jun 16 20:08:44 2017 (r320011) @@ -14,7 +14,7 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes # architecture-specific loader code -SRCS= main.c conf.c vers.c +SRCS= main.c conf.c vers.c chain.c # Put LOADER_FIREWIRE_SUPPORT=yes in /etc/make.conf for FireWire/dcons support .if defined(LOADER_FIREWIRE_SUPPORT) Added: head/sys/boot/i386/loader/chain.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/loader/chain.c Fri Jun 16 20:08:44 2017 (r320011) @@ -0,0 +1,135 @@ +/*- + * Copyright 2015 Toomas Soome + * 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. + */ + +/* + * Chain loader to load BIOS boot block either from MBR or PBR. + * + * Note the boot block location 0000:7c000 conflicts with loader, so we need to + * read in to temporary space and relocate on exec, when btx is stopped. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include "bootstrap.h" +#include "libi386/libi386.h" +#include "btxv86.h" + +/* + * The MBR/VBR is located in first sector of disk/partition. + * Read 512B to temporary location and set up relocation. Then + * exec relocator. + */ +#define SECTOR_SIZE (512) + +COMMAND_SET(chain, "chain", "chain load boot block from device", command_chain); + +static int +command_chain(int argc, char *argv[]) +{ + int fd, len, size = SECTOR_SIZE; + struct stat st; + vm_offset_t mem = 0x100000; + uint32_t *uintptr = &relocater_data; + struct i386_devdesc *rootdev; + + if (argc == 1) { + command_errmsg = "no device or file name specified"; + return (CMD_ERROR); + } + if (argc != 2) { + command_errmsg = "invalid trailing arguments"; + return (CMD_ERROR); + } + + fd = open(argv[1], O_RDONLY); + if (fd == -1) { + command_errmsg = "open failed"; + return (CMD_ERROR); + } + + len = strlen(argv[1]); + if (argv[1][len-1] != ':') { + if (fstat(fd, &st) == -1) { + command_errmsg = "stat failed"; + close(fd); + return (CMD_ERROR); + } + size = st.st_size; + } else if (strncmp(argv[1], "disk", 4) != 0) { + command_errmsg = "can only use disk device"; + close(fd); + return (CMD_ERROR); + } + + i386_getdev((void **)(&rootdev), argv[1], NULL); + if (rootdev == NULL) { + command_errmsg = "can't determine root device"; + return (CMD_ERROR); + } + + if (archsw.arch_readin(fd, mem, SECTOR_SIZE) != SECTOR_SIZE) { + command_errmsg = "failed to read disk"; + close(fd); + return (CMD_ERROR); + } + close(fd); + + if (*((uint16_t *)PTOV(mem + DOSMAGICOFFSET)) != DOSMAGIC) { + command_errmsg = "wrong magic"; + return (CMD_ERROR); + } + + uintptr[0] = mem; + uintptr[1] = 0x7C00; + uintptr[2] = SECTOR_SIZE; + + relocator_edx = bd_unit2bios(rootdev->d_unit); + relocator_esi = relocater_size; + relocator_ds = 0; + relocator_es = 0; + relocator_fs = 0; + relocator_gs = 0; + relocator_ss = 0; + relocator_cs = 0; + relocator_sp = 0x7C00; + relocator_ip = 0x7C00; + relocator_a20_enabled = 0; + + i386_copyin(relocater, 0x600, relocater_size); + + dev_cleanup(); + + __exec((void *)0x600); + + panic("exec returned"); + return (CMD_ERROR); /* not reached */ +} Modified: head/sys/boot/i386/loader/help.i386 ============================================================================== --- head/sys/boot/i386/loader/help.i386 Fri Jun 16 20:03:09 2017 (r320010) +++ head/sys/boot/i386/loader/help.i386 Fri Jun 16 20:08:44 2017 (r320011) @@ -43,3 +43,12 @@ Displays the BIOS SMAP (system memory map) table. ################################################################################ +# Tchain DChain load disk block + + chain disk: + + chain will read stage1 (MBR or VBR) boot block from specified device + to address 0000:7C00 and attempts to run it. Use lsdev to get available + device names. Disk name must end with colon. + +################################################################################ From owner-svn-src-all@freebsd.org Fri Jun 16 20:47:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31874D88AA2; Fri, 16 Jun 2017 20:47:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01A736EBB0; Fri, 16 Jun 2017 20:47:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GKlDf2055314; Fri, 16 Jun 2017 20:47:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GKlDEb055313; Fri, 16 Jun 2017 20:47:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706162047.v5GKlDEb055313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 16 Jun 2017 20:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320012 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 20:47:14 -0000 Author: bdrewery Date: Fri Jun 16 20:47:12 2017 New Revision: 320012 URL: https://svnweb.freebsd.org/changeset/base/320012 Log: Fix LIBAMU location to fix 'stale .depend' rebuilds in usr.sbin/amd. This originally came in r275052. Reported by: sbruno MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Fri Jun 16 20:08:44 2017 (r320011) +++ head/share/mk/src.libnames.mk Fri Jun 16 20:47:12 2017 (r320012) @@ -462,7 +462,7 @@ LIBBSNMPTOOLSDIR= ${OBJTOP}/usr.sbin/bsnmpd/tools/libb LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a LIBAMUDIR= ${OBJTOP}/usr.sbin/amd/libamu -LIBAMU?= ${LIBAMUDIR}/libamu/libamu.a +LIBAMU?= ${LIBAMUDIR}/libamu.a # Define a directory for each library. This is useful for adding -L in when # not using a --sysroot or for meta mode bootstrapping when there is no From owner-svn-src-all@freebsd.org Fri Jun 16 21:03:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D518D89156; Fri, 16 Jun 2017 21:03:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE62A6F4BF; Fri, 16 Jun 2017 21:03:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL3Qdp063347; Fri, 16 Jun 2017 21:03:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL3PQc063335; Fri, 16 Jun 2017 21:03:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162103.v5GL3PQc063335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320013 - in vendor/llvm/dist: cmake/modules docs include/llvm/ADT include/llvm/Analysis include/llvm/BinaryFormat include/llvm/Bitcode include/llvm/CodeGen include/llvm/CodeGen/GlobalI... 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:03:28 -0000 Author: dim Date: Fri Jun 16 21:03:24 2017 New Revision: 320013 URL: https://svnweb.freebsd.org/changeset/base/320013 Log: Vendor import of llvm trunk r305575: https://llvm.org/svn/llvm-project/llvm/trunk@305575 Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h (contents, props changed) vendor/llvm/dist/include/llvm/Testing/ vendor/llvm/dist/include/llvm/Testing/Support/ vendor/llvm/dist/include/llvm/Testing/Support/Error.h (contents, props changed) vendor/llvm/dist/include/llvm/Testing/Support/SupportHelpers.h (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/StringsAndChecksums.cpp (contents, props changed) vendor/llvm/dist/lib/Fuzzer/test/inline-8bit-counters/ vendor/llvm/dist/lib/Fuzzer/test/inline-8bit-counters.test vendor/llvm/dist/lib/Fuzzer/test/inline-8bit-counters/CMakeLists.txt (contents, props changed) vendor/llvm/dist/lib/Testing/ vendor/llvm/dist/lib/Testing/CMakeLists.txt (contents, props changed) vendor/llvm/dist/lib/Testing/LLVMBuild.txt (contents, props changed) vendor/llvm/dist/lib/Testing/Support/ vendor/llvm/dist/lib/Testing/Support/CMakeLists.txt (contents, props changed) vendor/llvm/dist/lib/Testing/Support/Error.cpp (contents, props changed) vendor/llvm/dist/lib/Testing/Support/LLVMBuild.txt (contents, props changed) vendor/llvm/dist/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp (contents, props changed) vendor/llvm/dist/test/Analysis/ScalarEvolution/limit-depth.ll vendor/llvm/dist/test/Bitcode/DIExpression-minus-upgrade.ll vendor/llvm/dist/test/Bitcode/DIExpression-minus-upgrade.ll.bc (contents, props changed) vendor/llvm/dist/test/Bitcode/upgrade-linker-options.ll vendor/llvm/dist/test/CodeGen/AArch64/fast-isel-sp-adjust.ll vendor/llvm/dist/test/CodeGen/AMDGPU/GlobalISel/legalize-add.mir vendor/llvm/dist/test/CodeGen/AMDGPU/always-uniform.ll vendor/llvm/dist/test/CodeGen/BPF/rodata_1.ll vendor/llvm/dist/test/CodeGen/BPF/rodata_2.ll vendor/llvm/dist/test/CodeGen/BPF/rodata_3.ll vendor/llvm/dist/test/CodeGen/BPF/rodata_4.ll vendor/llvm/dist/test/CodeGen/Hexagon/loop-idiom/pmpy-shiftconv-fail.ll vendor/llvm/dist/test/CodeGen/Hexagon/mulh.ll vendor/llvm/dist/test/CodeGen/Hexagon/mux-kill.mir vendor/llvm/dist/test/CodeGen/Hexagon/mux-kill2.mir vendor/llvm/dist/test/CodeGen/Hexagon/store-imm-stack-object.ll vendor/llvm/dist/test/CodeGen/Mips/brundef.ll vendor/llvm/dist/test/CodeGen/PowerPC/licm-tocReg.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc64-P9-mod.ll vendor/llvm/dist/test/CodeGen/PowerPC/vec_revb.ll vendor/llvm/dist/test/CodeGen/X86/pr32368.ll vendor/llvm/dist/test/DebugInfo/Inputs/dwarfdump-str-offsets-dwp.x86_64.o (contents, props changed) vendor/llvm/dist/test/DebugInfo/Inputs/dwarfdump-test-zlib.o.elf-x86-64 (contents, props changed) vendor/llvm/dist/test/DebugInfo/PDB/Inputs/unknown-symbol.yaml vendor/llvm/dist/test/DebugInfo/PDB/pdb-unknown-symbol.test vendor/llvm/dist/test/DebugInfo/X86/double-declare.ll vendor/llvm/dist/test/DebugInfo/dwarfdump-str-offsets-dwp.test vendor/llvm/dist/test/Instrumentation/InstrProfiling/always_inline.ll vendor/llvm/dist/test/LTO/Resolution/X86/Inputs/dead-strip-fulllto.ll vendor/llvm/dist/test/LTO/Resolution/X86/dead-strip-fulllto.ll vendor/llvm/dist/test/LibDriver/use-paths.test vendor/llvm/dist/test/MC/AMDGPU/flat-gfx9.s (contents, props changed) vendor/llvm/dist/test/MC/WebAssembly/external-func-address.ll vendor/llvm/dist/test/MC/WebAssembly/func-address.ll vendor/llvm/dist/test/ThinLTO/X86/cfi-icall.ll vendor/llvm/dist/test/Transforms/CodeExtractor/live_shrink.ll vendor/llvm/dist/test/Transforms/CodeExtractor/live_shrink_gep.ll vendor/llvm/dist/test/Transforms/CodeExtractor/live_shrink_hoist.ll vendor/llvm/dist/test/Transforms/CodeExtractor/live_shrink_multiple.ll vendor/llvm/dist/test/Transforms/CodeExtractor/live_shrink_unsafe.ll vendor/llvm/dist/test/Transforms/CrossDSOCFI/cfi_functions.ll vendor/llvm/dist/test/Transforms/EarlyCSE/pr33406.ll vendor/llvm/dist/test/Transforms/GVN/pr32314.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/Inputs/import-icall.yaml vendor/llvm/dist/test/Transforms/LowerTypeTests/export-icall.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/import-icall.ll vendor/llvm/dist/test/Transforms/RewriteStatepointsForGC/drop-invalid-metadata.ll vendor/llvm/dist/test/Transforms/Util/PredicateInfo/pr33456.ll vendor/llvm/dist/test/Transforms/Util/PredicateInfo/pr33457.ll vendor/llvm/dist/test/tools/llvm-cvtres/Inputs/combined.obj.coff (contents, props changed) vendor/llvm/dist/test/tools/llvm-cvtres/Inputs/languages.rc vendor/llvm/dist/test/tools/llvm-cvtres/Inputs/languages.res (contents, props changed) vendor/llvm/dist/test/tools/llvm-cvtres/Inputs/test_resource.obj.coff.arm (contents, props changed) vendor/llvm/dist/test/tools/llvm-cvtres/Inputs/test_resource.obj.coff.x64 (contents, props changed) vendor/llvm/dist/test/tools/llvm-cvtres/combined.test vendor/llvm/dist/test/tools/llvm-cvtres/help.test vendor/llvm/dist/test/tools/llvm-cvtres/machine.test vendor/llvm/dist/test/tools/llvm-dwarfdump/X86/apple_names_verify_buckets.s (contents, props changed) vendor/llvm/dist/tools/llvm-pdbutil/FormatUtil.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbutil/FormatUtil.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbutil/MinimalSymbolDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbutil/MinimalSymbolDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbutil/MinimalTypeDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbutil/MinimalTypeDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbutil/RawOutputStyle.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbutil/RawOutputStyle.h (contents, props changed) vendor/llvm/dist/unittests/Support/DynamicLibrary/ExportedFuncs.cxx (contents, props changed) Deleted: vendor/llvm/dist/test/CodeGen/PowerPC/testComparesinesll.ll vendor/llvm/dist/test/CodeGen/PowerPC/testComparesineull.ll vendor/llvm/dist/test/CodeGen/PowerPC/testComparesllnesll.ll vendor/llvm/dist/test/CodeGen/PowerPC/testComparesllneull.ll vendor/llvm/dist/test/DebugInfo/PDB/pdb-yaml-types.test vendor/llvm/dist/test/tools/llvm-cvtres/basic.test vendor/llvm/dist/test/tools/llvm-pdbdump/raw-stream-data.test vendor/llvm/dist/tools/llvm-pdbutil/LLVMOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbutil/LLVMOutputStyle.h vendor/llvm/dist/unittests/DebugInfo/CodeView/ErrorChecking.h vendor/llvm/dist/unittests/DebugInfo/PDB/ErrorChecking.h Modified: vendor/llvm/dist/cmake/modules/TableGen.cmake vendor/llvm/dist/docs/BranchWeightMetadata.rst vendor/llvm/dist/docs/LangRef.rst vendor/llvm/dist/docs/Lexicon.rst vendor/llvm/dist/docs/Phabricator.rst vendor/llvm/dist/include/llvm/ADT/AllocatorList.h vendor/llvm/dist/include/llvm/ADT/ArrayRef.h vendor/llvm/dist/include/llvm/ADT/BreadthFirstIterator.h vendor/llvm/dist/include/llvm/ADT/DAGDeltaAlgorithm.h vendor/llvm/dist/include/llvm/ADT/DeltaAlgorithm.h vendor/llvm/dist/include/llvm/ADT/DenseMap.h vendor/llvm/dist/include/llvm/ADT/DenseMapInfo.h vendor/llvm/dist/include/llvm/ADT/DenseSet.h vendor/llvm/dist/include/llvm/ADT/DepthFirstIterator.h vendor/llvm/dist/include/llvm/ADT/EquivalenceClasses.h vendor/llvm/dist/include/llvm/ADT/FoldingSet.h vendor/llvm/dist/include/llvm/ADT/GraphTraits.h vendor/llvm/dist/include/llvm/ADT/ImmutableList.h vendor/llvm/dist/include/llvm/ADT/ImmutableMap.h vendor/llvm/dist/include/llvm/ADT/ImmutableSet.h vendor/llvm/dist/include/llvm/ADT/IndexedMap.h vendor/llvm/dist/include/llvm/ADT/IntervalMap.h vendor/llvm/dist/include/llvm/ADT/IntrusiveRefCntPtr.h vendor/llvm/dist/include/llvm/ADT/MapVector.h vendor/llvm/dist/include/llvm/ADT/Optional.h vendor/llvm/dist/include/llvm/ADT/PackedVector.h vendor/llvm/dist/include/llvm/ADT/PointerEmbeddedInt.h vendor/llvm/dist/include/llvm/ADT/PointerUnion.h vendor/llvm/dist/include/llvm/ADT/ScopedHashTable.h vendor/llvm/dist/include/llvm/ADT/SmallBitVector.h vendor/llvm/dist/include/llvm/ADT/SmallSet.h vendor/llvm/dist/include/llvm/ADT/StringExtras.h vendor/llvm/dist/include/llvm/ADT/Triple.h vendor/llvm/dist/include/llvm/ADT/ilist_base.h vendor/llvm/dist/include/llvm/ADT/ilist_iterator.h vendor/llvm/dist/include/llvm/ADT/ilist_node.h vendor/llvm/dist/include/llvm/ADT/iterator.h vendor/llvm/dist/include/llvm/ADT/simple_ilist.h vendor/llvm/dist/include/llvm/Analysis/MemorySSA.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h vendor/llvm/dist/include/llvm/Analysis/TypeMetadataUtils.h vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h vendor/llvm/dist/include/llvm/BinaryFormat/ELF.h vendor/llvm/dist/include/llvm/Bitcode/BitcodeReader.h vendor/llvm/dist/include/llvm/Bitcode/BitcodeWriter.h vendor/llvm/dist/include/llvm/Bitcode/LLVMBitCodes.h vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h vendor/llvm/dist/include/llvm/CodeGen/FunctionLoweringInfo.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h vendor/llvm/dist/include/llvm/CodeGen/RuntimeLibcalls.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h vendor/llvm/dist/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeView.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/Formatters.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeIndex.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFVerifier.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/InfoStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBFile.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PublicsStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/RawConstants.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/SymbolStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h vendor/llvm/dist/include/llvm/IR/Constants.h vendor/llvm/dist/include/llvm/IR/DebugInfoMetadata.h vendor/llvm/dist/include/llvm/IR/GlobalVariable.h vendor/llvm/dist/include/llvm/IR/IRBuilder.h vendor/llvm/dist/include/llvm/IR/InstrTypes.h vendor/llvm/dist/include/llvm/IR/Instructions.h vendor/llvm/dist/include/llvm/IR/IntrinsicInst.h vendor/llvm/dist/include/llvm/IR/Intrinsics.td vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h vendor/llvm/dist/include/llvm/IR/Operator.h vendor/llvm/dist/include/llvm/IR/PatternMatch.h vendor/llvm/dist/include/llvm/LTO/LTO.h vendor/llvm/dist/include/llvm/LTO/legacy/LTOModule.h vendor/llvm/dist/include/llvm/MC/MCSymbolWasm.h vendor/llvm/dist/include/llvm/MC/MCWasmObjectWriter.h vendor/llvm/dist/include/llvm/Object/ArchiveWriter.h vendor/llvm/dist/include/llvm/Object/WindowsResource.h vendor/llvm/dist/include/llvm/ObjectYAML/COFFYAML.h vendor/llvm/dist/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h vendor/llvm/dist/include/llvm/ObjectYAML/CodeViewYAMLTypes.h vendor/llvm/dist/include/llvm/Option/Arg.h vendor/llvm/dist/include/llvm/Option/ArgList.h vendor/llvm/dist/include/llvm/Option/OptSpecifier.h vendor/llvm/dist/include/llvm/Option/OptTable.h vendor/llvm/dist/include/llvm/Option/Option.h vendor/llvm/dist/include/llvm/Support/BinaryStreamArray.h vendor/llvm/dist/include/llvm/Support/DebugCounter.h vendor/llvm/dist/include/llvm/Support/FormatAdapters.h vendor/llvm/dist/include/llvm/Support/FormatCommon.h vendor/llvm/dist/include/llvm/Support/MathExtras.h vendor/llvm/dist/include/llvm/Support/ThreadPool.h vendor/llvm/dist/include/llvm/TableGen/Main.h vendor/llvm/dist/include/llvm/TableGen/Record.h vendor/llvm/dist/include/llvm/TableGen/SetTheory.h vendor/llvm/dist/include/llvm/TableGen/StringMatcher.h vendor/llvm/dist/include/llvm/Target/TargetLoweringObjectFile.h vendor/llvm/dist/include/llvm/Target/TargetRegisterInfo.h vendor/llvm/dist/include/llvm/Transforms/Scalar/GVNExpression.h vendor/llvm/dist/include/llvm/Transforms/Utils/CodeExtractor.h vendor/llvm/dist/include/llvm/Transforms/Utils/Mem2Reg.h vendor/llvm/dist/lib/Analysis/BasicAliasAnalysis.cpp vendor/llvm/dist/lib/Analysis/CallGraphSCCPass.cpp vendor/llvm/dist/lib/Analysis/DivergenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/MemorySSA.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/Bitcode/Reader/BitcodeReader.cpp vendor/llvm/dist/lib/Bitcode/Reader/MetadataLoader.cpp vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/CMakeLists.txt vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfExpression.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfExpression.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfUnit.cpp vendor/llvm/dist/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/LegalizerHelper.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp vendor/llvm/dist/lib/CodeGen/MachineBlockPlacement.cpp vendor/llvm/dist/lib/CodeGen/MachineLICM.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp vendor/llvm/dist/lib/CodeGen/SplitKit.cpp vendor/llvm/dist/lib/CodeGen/StackColoring.cpp vendor/llvm/dist/lib/CodeGen/TargetLoweringBase.cpp vendor/llvm/dist/lib/CodeGen/TargetLoweringObjectFileImpl.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CMakeLists.txt vendor/llvm/dist/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/DebugSubsectionRecord.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/DebugSubsectionVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolDumper.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDatabase.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeIndex.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFContext.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFVerifier.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/InfoStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBFile.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBStringTable.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBStringTableBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PublicsStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/TpiHashing.cpp vendor/llvm/dist/lib/DebugInfo/PDB/UDTLayout.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerDriver.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerLoop.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerTracePC.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerTracePC.h vendor/llvm/dist/lib/Fuzzer/test/AbsNegAndConstant64Test.cpp vendor/llvm/dist/lib/Fuzzer/test/CMakeLists.txt vendor/llvm/dist/lib/Fuzzer/test/FourIndependentBranchesTest.cpp vendor/llvm/dist/lib/Fuzzer/test/FuzzerUnittest.cpp vendor/llvm/dist/lib/Fuzzer/test/ShrinkControlFlowTest.cpp vendor/llvm/dist/lib/Fuzzer/test/SimpleHashTest.cpp vendor/llvm/dist/lib/Fuzzer/test/SingleStrncmpTest.cpp vendor/llvm/dist/lib/Fuzzer/test/TableLookupTest.cpp vendor/llvm/dist/lib/Fuzzer/test/fuzzer-dirs.test vendor/llvm/dist/lib/Fuzzer/test/trace-pc/CMakeLists.txt vendor/llvm/dist/lib/IR/ConstantFold.cpp vendor/llvm/dist/lib/IR/ConstantsContext.h vendor/llvm/dist/lib/IR/DebugInfoMetadata.cpp vendor/llvm/dist/lib/IR/IRBuilder.cpp vendor/llvm/dist/lib/IR/Metadata.cpp vendor/llvm/dist/lib/IR/ModuleSummaryIndex.cpp vendor/llvm/dist/lib/IR/Verifier.cpp vendor/llvm/dist/lib/LLVMBuild.txt vendor/llvm/dist/lib/LTO/LTO.cpp vendor/llvm/dist/lib/LTO/LTOModule.cpp vendor/llvm/dist/lib/MC/MCParser/ELFAsmParser.cpp vendor/llvm/dist/lib/MC/MCSectionELF.cpp vendor/llvm/dist/lib/MC/WasmObjectWriter.cpp vendor/llvm/dist/lib/Object/ArchiveWriter.cpp vendor/llvm/dist/lib/Object/ELF.cpp vendor/llvm/dist/lib/Object/IRSymtab.cpp vendor/llvm/dist/lib/Object/WindowsResource.cpp vendor/llvm/dist/lib/ObjectYAML/COFFYAML.cpp vendor/llvm/dist/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp vendor/llvm/dist/lib/ObjectYAML/CodeViewYAMLSymbols.cpp vendor/llvm/dist/lib/ObjectYAML/CodeViewYAMLTypes.cpp vendor/llvm/dist/lib/ObjectYAML/ELFYAML.cpp vendor/llvm/dist/lib/Option/Arg.cpp vendor/llvm/dist/lib/Option/ArgList.cpp vendor/llvm/dist/lib/Option/OptTable.cpp vendor/llvm/dist/lib/Option/Option.cpp vendor/llvm/dist/lib/Passes/PassBuilder.cpp vendor/llvm/dist/lib/Support/BinaryStreamWriter.cpp vendor/llvm/dist/lib/Support/DebugCounter.cpp vendor/llvm/dist/lib/Support/FoldingSet.cpp vendor/llvm/dist/lib/Support/ThreadPool.cpp vendor/llvm/dist/lib/Support/Unix/Program.inc vendor/llvm/dist/lib/TableGen/Record.cpp vendor/llvm/dist/lib/TableGen/SetTheory.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64.td vendor/llvm/dist/lib/Target/AArch64/AArch64FastISel.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64SchedFalkorDetails.td vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64TargetTransformInfo.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h vendor/llvm/dist/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp vendor/llvm/dist/lib/Target/AMDGPU/FLATInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.td vendor/llvm/dist/lib/Target/ARM/ARMCallLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstrVFP.td vendor/llvm/dist/lib/Target/ARM/ARMLegalizerInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetTransformInfo.h vendor/llvm/dist/lib/Target/BPF/BPFAsmPrinter.cpp vendor/llvm/dist/lib/Target/BPF/BPFISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/BPF/BPFInstrInfo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonGenMux.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonPatterns.td vendor/llvm/dist/lib/Target/Hexagon/HexagonTargetMachine.cpp vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsInstrInfo.cpp vendor/llvm/dist/lib/Target/Mips/MipsLongBranch.cpp vendor/llvm/dist/lib/Target/Mips/MipsSEISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/Mips/MipsSEISelDAGToDAG.h vendor/llvm/dist/lib/Target/Mips/MipsSEISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsSubtarget.h vendor/llvm/dist/lib/Target/PowerPC/PPCISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.h vendor/llvm/dist/lib/Target/PowerPC/PPCInstr64Bit.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrVSX.td vendor/llvm/dist/lib/Target/PowerPC/PPCRegisterInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCRegisterInfo.h vendor/llvm/dist/lib/Target/PowerPC/PPCTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCTargetTransformInfo.h vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetTransformInfo.h vendor/llvm/dist/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h vendor/llvm/dist/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.h vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td vendor/llvm/dist/lib/Target/X86/X86InstrFragmentsSIMD.td vendor/llvm/dist/lib/Target/X86/X86InstrInfo.cpp vendor/llvm/dist/lib/Transforms/IPO/CrossDSOCFI.cpp vendor/llvm/dist/lib/Transforms/IPO/Inliner.cpp vendor/llvm/dist/lib/Transforms/IPO/LowerTypeTests.cpp vendor/llvm/dist/lib/Transforms/IPO/PartialInlining.cpp vendor/llvm/dist/lib/Transforms/IPO/PassManagerBuilder.cpp vendor/llvm/dist/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineInternal.h vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineShifts.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/CMakeLists.txt vendor/llvm/dist/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/InstrProfiling.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/SanitizerCoverage.cpp vendor/llvm/dist/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp vendor/llvm/dist/lib/Transforms/Scalar/EarlyCSE.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVNSink.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopIdiomRecognize.cpp vendor/llvm/dist/lib/Transforms/Scalar/NewGVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp vendor/llvm/dist/lib/Transforms/Scalar/SCCP.cpp vendor/llvm/dist/lib/Transforms/Utils/CodeExtractor.cpp vendor/llvm/dist/lib/Transforms/Utils/PredicateInfo.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyIndVar.cpp vendor/llvm/dist/test/Assembler/diexpression.ll vendor/llvm/dist/test/Bitcode/DIExpression-deref.ll vendor/llvm/dist/test/Bitcode/DIGlobalVariableExpression.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir vendor/llvm/dist/test/CodeGen/AArch64/arm64-sincos.ll vendor/llvm/dist/test/CodeGen/AArch64/misched-fusion-aes.ll vendor/llvm/dist/test/CodeGen/AArch64/sincos-expansion.ll vendor/llvm/dist/test/CodeGen/AArch64/swifterror.ll vendor/llvm/dist/test/CodeGen/AMDGPU/GlobalISel/inst-select-load-flat.mir vendor/llvm/dist/test/CodeGen/AMDGPU/GlobalISel/inst-select-store-flat.mir vendor/llvm/dist/test/CodeGen/AMDGPU/cgp-addressing-modes-flat.ll vendor/llvm/dist/test/CodeGen/AMDGPU/code-object-metadata-kernel-debug-props.ll vendor/llvm/dist/test/CodeGen/AMDGPU/constant-fold-imm-immreg.mir vendor/llvm/dist/test/CodeGen/AMDGPU/flat-address-space.ll vendor/llvm/dist/test/CodeGen/AMDGPU/flat_atomics.ll vendor/llvm/dist/test/CodeGen/AMDGPU/global_smrd_cfg.ll vendor/llvm/dist/test/CodeGen/AMDGPU/inserted-wait-states.mir vendor/llvm/dist/test/CodeGen/AMDGPU/limit-coalesce.mir vendor/llvm/dist/test/CodeGen/AMDGPU/rename-independent-subregs-invalid-mac-operands.mir vendor/llvm/dist/test/CodeGen/AMDGPU/sdwa-scalar-ops.mir vendor/llvm/dist/test/CodeGen/AMDGPU/waitcnt.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-isel-divmod.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-legalize-divmod.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vfma.ll vendor/llvm/dist/test/CodeGen/ARM/debug-info-blocks.ll vendor/llvm/dist/test/CodeGen/ARM/sincos.ll vendor/llvm/dist/test/CodeGen/ARM/swifterror.ll vendor/llvm/dist/test/CodeGen/Mips/2008-06-05-Carry.ll vendor/llvm/dist/test/CodeGen/Mips/dsp-patterns.ll vendor/llvm/dist/test/CodeGen/Mips/llcarry.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/add.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/sub.ll vendor/llvm/dist/test/CodeGen/Mips/longbranch.ll vendor/llvm/dist/test/CodeGen/Mips/madd-msub.ll vendor/llvm/dist/test/CodeGen/PowerPC/atomic-2.ll vendor/llvm/dist/test/CodeGen/PowerPC/atomics-constant.ll vendor/llvm/dist/test/CodeGen/PowerPC/atomics-regression.ll vendor/llvm/dist/test/CodeGen/PowerPC/logic-ops-on-compares.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-sincos-01.ll vendor/llvm/dist/test/CodeGen/X86/2012-01-11-split-cv.ll vendor/llvm/dist/test/CodeGen/X86/StackColoring.ll vendor/llvm/dist/test/CodeGen/X86/add-sub-nsw-nuw.ll vendor/llvm/dist/test/CodeGen/X86/addcarry.ll vendor/llvm/dist/test/CodeGen/X86/avx-vperm2x128.ll vendor/llvm/dist/test/CodeGen/X86/bt.ll vendor/llvm/dist/test/CodeGen/X86/cmov-into-branch.ll vendor/llvm/dist/test/CodeGen/X86/combine-64bit-vec-binop.ll vendor/llvm/dist/test/CodeGen/X86/element-wise-atomic-memory-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/fast-isel-select-sse.ll vendor/llvm/dist/test/CodeGen/X86/fp-logic-replace.ll vendor/llvm/dist/test/CodeGen/X86/fp-logic.ll vendor/llvm/dist/test/CodeGen/X86/fp-select-cmp-and.ll vendor/llvm/dist/test/CodeGen/X86/immediate_merging64.ll vendor/llvm/dist/test/CodeGen/X86/lea-opt-with-debug.mir vendor/llvm/dist/test/CodeGen/X86/loop-search.ll vendor/llvm/dist/test/CodeGen/X86/mask-negated-bool.ll vendor/llvm/dist/test/CodeGen/X86/memset-2.ll vendor/llvm/dist/test/CodeGen/X86/memset-nonzero.ll vendor/llvm/dist/test/CodeGen/X86/memset64-on-x86-32.ll vendor/llvm/dist/test/CodeGen/X86/negate-i1.ll vendor/llvm/dist/test/CodeGen/X86/negate-shift.ll vendor/llvm/dist/test/CodeGen/X86/negate.ll vendor/llvm/dist/test/CodeGen/X86/negative-sin.ll vendor/llvm/dist/test/CodeGen/X86/no-sse2-avg.ll vendor/llvm/dist/test/CodeGen/X86/not-and-simplify.ll vendor/llvm/dist/test/CodeGen/X86/pr13577.ll vendor/llvm/dist/test/CodeGen/X86/pr18014.ll vendor/llvm/dist/test/CodeGen/X86/rem.ll vendor/llvm/dist/test/CodeGen/X86/sar_fold64.ll vendor/llvm/dist/test/CodeGen/X86/select-with-and-or.ll vendor/llvm/dist/test/CodeGen/X86/sext-setcc-self.ll vendor/llvm/dist/test/CodeGen/X86/shift-pcmp.ll vendor/llvm/dist/test/CodeGen/X86/sincos-opt.ll vendor/llvm/dist/test/CodeGen/X86/sse-intrinsics-x86-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/sse41-intrinsics-x86-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/stack-folding-int-avx512.ll vendor/llvm/dist/test/CodeGen/X86/stack-folding-int-avx512vl.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-live-in.ll vendor/llvm/dist/test/CodeGen/X86/swifterror.ll vendor/llvm/dist/test/CodeGen/X86/urem-i8-constant.ll vendor/llvm/dist/test/CodeGen/X86/urem-power-of-two.ll vendor/llvm/dist/test/CodeGen/X86/vec3.ll vendor/llvm/dist/test/CodeGen/X86/vector-compare-combines.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-256-v16.ll vendor/llvm/dist/test/CodeGen/X86/vzero-excess.ll vendor/llvm/dist/test/CodeGen/X86/x86-interleaved-access.ll vendor/llvm/dist/test/DebugInfo/COFF/array-odr-violation.ll vendor/llvm/dist/test/DebugInfo/COFF/inlining-same-name.ll vendor/llvm/dist/test/DebugInfo/Generic/block-asan.ll vendor/llvm/dist/test/DebugInfo/Inputs/dwarfdump-str-offsets.s vendor/llvm/dist/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc vendor/llvm/dist/test/DebugInfo/MIR/ARM/split-superreg-complex.mir vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-debug-subsections.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-headers.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-merge-ids-and-types.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-mergeids.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-mergetypes.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-raw-blocks.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-raw-stream.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-readwrite.test vendor/llvm/dist/test/DebugInfo/X86/block-capture.ll vendor/llvm/dist/test/DebugInfo/X86/debug-info-block-captured-self.ll vendor/llvm/dist/test/DebugInfo/X86/debug-info-blocks.ll vendor/llvm/dist/test/DebugInfo/X86/dw_op_minus.ll vendor/llvm/dist/test/DebugInfo/X86/dw_op_minus_direct.ll vendor/llvm/dist/test/DebugInfo/X86/safestack-byval.ll vendor/llvm/dist/test/DebugInfo/X86/stack-value-dwarf2.ll vendor/llvm/dist/test/DebugInfo/X86/unattached-global.ll vendor/llvm/dist/test/DebugInfo/dwarfdump-zlib.test vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/inline-8bit-counters.ll vendor/llvm/dist/test/LTO/Resolution/X86/symtab-elf.ll vendor/llvm/dist/test/LTO/Resolution/X86/symtab.ll vendor/llvm/dist/test/MC/AMDGPU/flat.s vendor/llvm/dist/test/MC/COFF/cv-compiler-info.ll vendor/llvm/dist/test/MC/COFF/linker-options.ll vendor/llvm/dist/test/MC/Disassembler/PowerPC/ppc64-encoding.txt vendor/llvm/dist/test/MC/Disassembler/PowerPC/ppc64le-encoding.txt vendor/llvm/dist/test/MC/ELF/section.s vendor/llvm/dist/test/MC/MachO/linker-options.ll vendor/llvm/dist/test/MC/PowerPC/ppc64-encoding.s vendor/llvm/dist/test/MC/WebAssembly/external-data.ll vendor/llvm/dist/test/Transforms/GlobalMerge/debug-info.ll vendor/llvm/dist/test/Transforms/Inline/always-inline.ll vendor/llvm/dist/test/Transforms/InstCombine/debuginfo-dce.ll vendor/llvm/dist/test/Transforms/InstCombine/element-atomic-memcpy-to-loads.ll vendor/llvm/dist/test/Transforms/InstCombine/ffs-1.ll vendor/llvm/dist/test/Transforms/InstCombine/lshr.ll vendor/llvm/dist/test/Transforms/InstCombine/onehot_merge.ll vendor/llvm/dist/test/Transforms/InstCombine/or-xor.ll vendor/llvm/dist/test/Transforms/InstCombine/select-with-bitwise-ops.ll vendor/llvm/dist/test/Transforms/InstCombine/shift.ll vendor/llvm/dist/test/Transforms/InstCombine/xor2.ll vendor/llvm/dist/test/Transforms/LoopIdiom/X86/unordered-atomic-memcpy.ll vendor/llvm/dist/test/Transforms/LoopIdiom/unordered-atomic-memcpy-noarch.ll vendor/llvm/dist/test/Transforms/PGOProfile/memop_size_opt.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/X86/arith-add.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/X86/arith-fp.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/X86/arith-mul.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/X86/arith-sub.ll vendor/llvm/dist/test/Transforms/SafeStack/X86/debug-loc.ll vendor/llvm/dist/test/Transforms/SafeStack/X86/debug-loc2.ll vendor/llvm/dist/test/Verifier/element-wise-atomic-memory-intrinsics.ll vendor/llvm/dist/test/lit.cfg vendor/llvm/dist/test/tools/llvm-cvtres/object.test vendor/llvm/dist/test/tools/llvm-cvtres/parse.test vendor/llvm/dist/test/tools/llvm-readobj/resources.test vendor/llvm/dist/tools/llvm-ar/llvm-ar.cpp vendor/llvm/dist/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp vendor/llvm/dist/tools/llvm-cvtres/llvm-cvtres.cpp vendor/llvm/dist/tools/llvm-dwarfdump/llvm-dwarfdump.cpp vendor/llvm/dist/tools/llvm-pdbutil/CMakeLists.txt vendor/llvm/dist/tools/llvm-pdbutil/LinePrinter.cpp vendor/llvm/dist/tools/llvm-pdbutil/LinePrinter.h vendor/llvm/dist/tools/llvm-pdbutil/PrettyClassLayoutGraphicalDumper.cpp vendor/llvm/dist/tools/llvm-pdbutil/YAMLOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbutil/llvm-pdbutil.cpp vendor/llvm/dist/tools/llvm-pdbutil/llvm-pdbutil.h vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/tools/llvm-readobj/ELFDumper.cpp vendor/llvm/dist/tools/llvm-stress/llvm-stress.cpp vendor/llvm/dist/tools/obj2yaml/CMakeLists.txt vendor/llvm/dist/tools/obj2yaml/coff2yaml.cpp vendor/llvm/dist/tools/yaml2obj/CMakeLists.txt vendor/llvm/dist/tools/yaml2obj/yaml2coff.cpp vendor/llvm/dist/tools/yaml2obj/yaml2obj.cpp vendor/llvm/dist/unittests/ADT/SCCIteratorTest.cpp vendor/llvm/dist/unittests/ADT/SmallVectorTest.cpp vendor/llvm/dist/unittests/ADT/StringRefTest.cpp vendor/llvm/dist/unittests/CodeGen/LowLevelTypeTest.cpp vendor/llvm/dist/unittests/DebugInfo/CodeView/CMakeLists.txt vendor/llvm/dist/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp vendor/llvm/dist/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp vendor/llvm/dist/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp vendor/llvm/dist/unittests/DebugInfo/PDB/CMakeLists.txt vendor/llvm/dist/unittests/DebugInfo/PDB/HashTableTest.cpp vendor/llvm/dist/unittests/DebugInfo/PDB/MSFBuilderTest.cpp vendor/llvm/dist/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp vendor/llvm/dist/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp vendor/llvm/dist/unittests/DebugInfo/PDB/TypeServerHandlerTest.cpp vendor/llvm/dist/unittests/IR/MetadataTest.cpp vendor/llvm/dist/unittests/IR/PatternMatch.cpp vendor/llvm/dist/unittests/MI/LiveIntervalTest.cpp vendor/llvm/dist/unittests/Support/BinaryStreamTest.cpp vendor/llvm/dist/unittests/Support/CMakeLists.txt vendor/llvm/dist/unittests/Support/CommandLineTest.cpp vendor/llvm/dist/unittests/Support/DynamicLibrary/CMakeLists.txt vendor/llvm/dist/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp vendor/llvm/dist/unittests/Support/DynamicLibrary/PipSqueak.cxx vendor/llvm/dist/unittests/Support/DynamicLibrary/PipSqueak.h vendor/llvm/dist/unittests/Support/FormatVariadicTest.cpp vendor/llvm/dist/unittests/Target/AArch64/InstSizes.cpp vendor/llvm/dist/unittests/Transforms/Scalar/LoopPassManagerTest.cpp vendor/llvm/dist/utils/TableGen/CodeGenDAGPatterns.cpp vendor/llvm/dist/utils/opt-viewer/opt-diff.py vendor/llvm/dist/utils/opt-viewer/opt-stats.py vendor/llvm/dist/utils/opt-viewer/opt-viewer.py vendor/llvm/dist/utils/release/test-release.sh vendor/llvm/dist/utils/update_test_checks.py Modified: vendor/llvm/dist/cmake/modules/TableGen.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/TableGen.cmake Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/cmake/modules/TableGen.cmake Fri Jun 16 21:03:24 2017 (r320013) @@ -35,38 +35,24 @@ function(tablegen project ofn) # a tablegen change, as cmake does not propagate file-level dependencies # of custom targets. See the following ticket for more information: # https://cmake.org/Bug/view.php?id=15858 - # We could always have just one dependency on both the target and - # the file, but these 2 cases would produce cleaner cmake files. - if (${${project}_TABLEGEN_TARGET} STREQUAL ${${project}_TABLEGEN_EXE}) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp - # Generate tablegen output in a temporary file. - COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR} - ${LLVM_TABLEGEN_FLAGS} - ${LLVM_TARGET_DEFINITIONS_ABSOLUTE} - -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp - # The file in LLVM_TARGET_DEFINITIONS may be not in the current - # directory and local_tds may not contain it, so we must - # explicitly list it here: - DEPENDS ${${project}_TABLEGEN_TARGET} ${local_tds} ${global_tds} - ${LLVM_TARGET_DEFINITIONS_ABSOLUTE} - COMMENT "Building ${ofn}..." - ) - else() - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp - # Generate tablegen output in a temporary file. - COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR} - ${LLVM_TABLEGEN_FLAGS} - ${LLVM_TARGET_DEFINITIONS_ABSOLUTE} - -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp - # The file in LLVM_TARGET_DEFINITIONS may be not in the current - # directory and local_tds may not contain it, so we must - # explicitly list it here: - DEPENDS ${${project}_TABLEGEN_TARGET} ${${project}_TABLEGEN_EXE} - ${local_tds} ${global_tds} - ${LLVM_TARGET_DEFINITIONS_ABSOLUTE} - COMMENT "Building ${ofn}..." - ) - endif() + # The dependency on both, the target and the file, produces the same + # dependency twice in the result file when + # ("${${project}_TABLEGEN_TARGET}" STREQUAL "${${project}_TABLEGEN_EXE}") + # but lets us having smaller and cleaner code here. + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp + # Generate tablegen output in a temporary file. + COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR} + ${LLVM_TABLEGEN_FLAGS} + ${LLVM_TARGET_DEFINITIONS_ABSOLUTE} + -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp + # The file in LLVM_TARGET_DEFINITIONS may be not in the current + # directory and local_tds may not contain it, so we must + # explicitly list it here: + DEPENDS ${${project}_TABLEGEN_TARGET} ${${project}_TABLEGEN_EXE} + ${local_tds} ${global_tds} + ${LLVM_TARGET_DEFINITIONS_ABSOLUTE} + COMMENT "Building ${ofn}..." + ) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn} # Only update the real output file if there are any differences. # This prevents recompilation of all the files depending on it if there Modified: vendor/llvm/dist/docs/BranchWeightMetadata.rst ============================================================================== --- vendor/llvm/dist/docs/BranchWeightMetadata.rst Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/docs/BranchWeightMetadata.rst Fri Jun 16 21:03:24 2017 (r320013) @@ -64,6 +64,20 @@ Branch weights are assigned to every destination. [ , i32 ... ] } +``CallInst`` +^^^^^^^^^^^^^^^^^^ + +Calls may have branch weight metadata, containing the execution count of +the call. It is currently used in SamplePGO mode only, to augment the +block and entry counts which may not be accurate with sampling. + +.. code-block:: none + + !0 = metadata !{ + metadata !"branch_weights", + i32 + } + Other ^^^^^ Modified: vendor/llvm/dist/docs/LangRef.rst ============================================================================== --- vendor/llvm/dist/docs/LangRef.rst Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/docs/LangRef.rst Fri Jun 16 21:03:24 2017 (r320013) @@ -4033,26 +4033,26 @@ DICompileUnit """"""""""""" ``DICompileUnit`` nodes represent a compile unit. The ``enums:``, -``retainedTypes:``, ``subprograms:``, ``globals:``, ``imports:`` and ``macros:`` -fields are tuples containing the debug info to be emitted along with the compile -unit, regardless of code optimizations (some nodes are only emitted if there are -references to them from instructions). The ``debugInfoForProfiling:`` field is a -boolean indicating whether or not line-table discriminators are updated to -provide more-accurate debug info for profiling results. +``retainedTypes:``, ``globals:``, ``imports:`` and ``macros:`` fields are tuples +containing the debug info to be emitted along with the compile unit, regardless +of code optimizations (some nodes are only emitted if there are references to +them from instructions). The ``debugInfoForProfiling:`` field is a boolean +indicating whether or not line-table discriminators are updated to provide +more-accurate debug info for profiling results. .. code-block:: text !0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, flags: "-O2", runtimeVersion: 2, splitDebugFilename: "abc.debug", emissionKind: FullDebug, - enums: !2, retainedTypes: !3, subprograms: !4, - globals: !5, imports: !6, macros: !7, dwoId: 0x0abcd) + enums: !2, retainedTypes: !3, globals: !4, imports: !5, + macros: !6, dwoId: 0x0abcd) Compile unit descriptors provide the root scope for objects declared in a -specific compilation unit. File descriptors are defined using this scope. -These descriptors are collected by a named metadata ``!llvm.dbg.cu``. They -keep track of subprograms, global variables, type information, and imported -entities (declarations and namespaces). +specific compilation unit. File descriptors are defined using this scope. These +descriptors are collected by a named metadata node ``!llvm.dbg.cu``. They keep +track of global variables, type information, and imported entities (declarations +and namespaces). .. _DIFile: @@ -4326,8 +4326,8 @@ and ``scope:``. containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, flags: DIFlagPrototyped, - isOptimized: true, templateParams: !5, - declaration: !6, variables: !7) + isOptimized: true, unit: !5, templateParams: !6, + declaration: !7, variables: !8, thrownTypes: !9) .. _DILexicalBlock: @@ -4404,7 +4404,12 @@ referenced LLVM variable relates to the source languag The current supported vocabulary is limited: - ``DW_OP_deref`` dereferences the top of the expression stack. -- ``DW_OP_plus, 93`` adds ``93`` to the working expression. +- ``DW_OP_plus`` pops the last two entries from the expression stack, adds + them together and appends the result to the expression stack. +- ``DW_OP_minus`` pops the last two entries from the expression stack, subtracts + the last entry from the second last entry and appends the result to the + expression stack. +- ``DW_OP_plus_uconst, 93`` adds ``93`` to the working expression. - ``DW_OP_LLVM_fragment, 16, 8`` specifies the offset and size (``16`` and ``8`` here, respectively) of the variable fragment from the working expression. Note that contrary to DW_OP_bit_piece, the offset is describing the the location @@ -4426,9 +4431,10 @@ combined with a concrete location. .. code-block:: llvm !0 = !DIExpression(DW_OP_deref) - !1 = !DIExpression(DW_OP_plus, 3) + !1 = !DIExpression(DW_OP_plus_uconst, 3) + !1 = !DIExpression(DW_OP_constu, 3, DW_OP_plus) !2 = !DIExpression(DW_OP_bit_piece, 3, 7) - !3 = !DIExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_LLVM_fragment, 3, 7) + !3 = !DIExpression(DW_OP_deref, DW_OP_constu, 3, DW_OP_plus, DW_OP_LLVM_fragment, 3, 7) !4 = !DIExpression(DW_OP_constu, 2, DW_OP_swap, DW_OP_xderef) !5 = !DIExpression(DW_OP_constu, 42, DW_OP_stack_value) @@ -5186,6 +5192,72 @@ Example: !0 = !{i32* @a} +'``prof``' Metadata +^^^^^^^^^^^^^^^^^^^ + +The ``prof`` metadata is used to record profile data in the IR. +The first operand of the metadata node indicates the profile metadata +type. There are currently 3 types: +:ref:`branch_weights`, +:ref:`function_entry_count`, and +:ref:`VP`. + +.. _prof_node_branch_weights: + +branch_weights +"""""""""""""" + +Branch weight metadata attached to a branch, select, switch or call instruction +represents the likeliness of the associated branch being taken. +For more information, see :doc:`BranchWeightMetadata`. + +.. _prof_node_function_entry_count: + +function_entry_count +"""""""""""""""""""" + +Function entry count metadata can be attached to function definitions +to record the number of times the function is called. Used with BFI +information, it is also used to derive the basic block profile count. +For more information, see :doc:`BranchWeightMetadata`. + +.. _prof_node_VP: + +VP +"" + +VP (value profile) metadata can be attached to instructions that have +value profile information. Currently this is indirect calls (where it +records the hottest callees) and calls to memory intrinsics such as memcpy, +memmove, and memset (where it records the hottest byte lengths). + +Each VP metadata node contains "VP" string, then a uint32_t value for the value +profiling kind, a uint64_t value for the total number of times the instruction +is executed, followed by uint64_t value and execution count pairs. +The value profiling kind is 0 for indirect call targets and 1 for memory +operations. For indirect call targets, each profile value is a hash +of the callee function name, and for memory operations each value is the +byte length. + +Note that the value counts do not need to add up to the total count +listed in the third operand (in practice only the top hottest values +are tracked and reported). + +Indirect call example: + +.. code-block:: llvm + + call void %f(), !prof !1 + !1 = !{!"VP", i32 0, i64 1600, i64 7651369219802541373, i64 1030, i64 -4377547752858689819, i64 410} + +Note that the VP type is 0 (the second operand), which indicates this is +an indirect call value profile data. The third operand indicates that the +indirect call executed 1600 times. The 4th and 6th operands give the +hashes of the 2 hottest target functions' names (this is the same hash used +to represent function names in the profile database), and the 5th and 7th +operands give the execution count that each of the respective prior target +functions was called. + Module Flags Metadata ===================== @@ -5352,40 +5424,6 @@ Some important flag interactions: - A module with ``Objective-C Garbage Collection`` set to 0 cannot be merged with a module with ``Objective-C GC Only`` set to 6. -Automatic Linker Flags Module Flags Metadata --------------------------------------------- - -Some targets support embedding flags to the linker inside individual object -files. Typically this is used in conjunction with language extensions which -allow source files to explicitly declare the libraries they depend on, and have -these automatically be transmitted to the linker via object files. - -These flags are encoded in the IR using metadata in the module flags section, -using the ``Linker Options`` key. The merge behavior for this flag is required -to be ``AppendUnique``, and the value for the key is expected to be a metadata -node which should be a list of other metadata nodes, each of which should be a -list of metadata strings defining linker options. - -For example, the following metadata section specifies two separate sets of -linker options, presumably to link against ``libz`` and the ``Cocoa`` -framework:: - - !0 = !{ i32 6, !"Linker Options", - !{ - !{ !"-lz" }, - !{ !"-framework", !"Cocoa" } } } - !llvm.module.flags = !{ !0 } - -The metadata encoding as lists of lists of options, as opposed to a collapsed -list of options, is chosen so that the IR encoding can use multiple option -strings to specify e.g., a single library, while still having that specifier be -preserved as an atomic element that can be recognized by a target specific -assembly writer or object file emitter. - -Each individual option is required to be either a valid option for the target's -linker, or an option that is reserved by the target specific assembly writer or -object file emitter. No other aspect of these options is defined by the IR. - C type width Module Flags Metadata ---------------------------------- @@ -5422,6 +5460,37 @@ enum is the smallest type which can represent all of i !0 = !{i32 1, !"short_wchar", i32 1} !1 = !{i32 1, !"short_enum", i32 0} +Automatic Linker Flags Named Metadata +===================================== + +Some targets support embedding flags to the linker inside individual object +files. Typically this is used in conjunction with language extensions which +allow source files to explicitly declare the libraries they depend on, and have +these automatically be transmitted to the linker via object files. + +These flags are encoded in the IR using named metadata with the name +``!llvm.linker.options``. Each operand is expected to be a metadata node +which should be a list of other metadata nodes, each of which should be a +list of metadata strings defining linker options. + +For example, the following metadata section specifies two separate sets of +linker options, presumably to link against ``libz`` and the ``Cocoa`` +framework:: + + !0 = !{ !"-lz" }, + !1 = !{ !"-framework", !"Cocoa" } } } + !llvm.linker.options = !{ !0, !1 } + +The metadata encoding as lists of lists of options, as opposed to a collapsed +list of options, is chosen so that the IR encoding can use multiple option +strings to specify e.g., a single library, while still having that specifier be +preserved as an atomic element that can be recognized by a target specific +assembly writer or object file emitter. + +Each individual option is required to be either a valid option for the target's +linker, or an option that is reserved by the target specific assembly writer or +object file emitter. No other aspect of these options is defined by the IR. + .. _intrinsicglobalvariables: Intrinsic Global Variables @@ -13999,62 +14068,66 @@ Element Wise Atomic Memory Intrinsics These intrinsics are similar to the standard library memory intrinsics except that they perform memory transfer as a sequence of atomic memory accesses. -.. _int_memcpy_element_atomic: +.. _int_memcpy_element_unordered_atomic: -'``llvm.memcpy.element.atomic``' Intrinsic -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +'``llvm.memcpy.element.unordered.atomic``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Syntax: """"""" -This is an overloaded intrinsic. You can use ``llvm.memcpy.element.atomic`` on +This is an overloaded intrinsic. You can use ``llvm.memcpy.element.unordered.atomic`` on any integer bit width and for different address spaces. Not all targets support all bit widths however. :: - declare void @llvm.memcpy.element.atomic.p0i8.p0i8(i8* , i8* , - i64 , i32 ) + declare void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* , + i8* , + i32 , + i32 ) + declare void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* , + i8* , + i64 , + i32 ) Overview: """"""""" -The '``llvm.memcpy.element.atomic.*``' intrinsic performs copy of a block of -memory from the source location to the destination location as a sequence of -unordered atomic memory accesses where each access is a multiple of -``element_size`` bytes wide and aligned at an element size boundary. For example -each element is accessed atomically in source and destination buffers. +The '``llvm.memcpy.element.unordered.atomic.*``' intrinsic is a specialization of the +'``llvm.memcpy.*``' intrinsic. It differs in that the ``dest`` and ``src`` are treated +as arrays with elements that are exactly ``element_size`` bytes, and the copy between +buffers uses a sequence of :ref:`unordered atomic ` load/store operations +that are a positive integer multiple of the ``element_size`` in size. Arguments: """""""""" -The first argument is a pointer to the destination, the second is a -pointer to the source. The third argument is an integer argument -specifying the number of elements to copy, the fourth argument is size of -the single element in bytes. +The first three arguments are the same as they are in the :ref:`@llvm.memcpy ` +intrinsic, with the added constraint that ``len`` is required to be a positive integer +multiple of the ``element_size``. If ``len`` is not a positive integer multiple of +``element_size``, then the behaviour of the intrinsic is undefined. -``element_size`` should be a power of two, greater than zero and less than -a target-specific atomic access size limit. +``element_size`` must be a compile-time constant positive power of two no greater than +target-specific atomic access size limit. -For each of the input pointers ``align`` parameter attribute must be specified. -It must be a power of two and greater than or equal to the ``element_size``. -Caller guarantees that both the source and destination pointers are aligned to -that boundary. +For each of the input pointers ``align`` parameter attribute must be specified. It +must be a power of two no less than the ``element_size``. Caller guarantees that +both the source and destination pointers are aligned to that boundary. Semantics: """""""""" -The '``llvm.memcpy.element.atomic.*``' intrinsic copies -'``num_elements`` * ``element_size``' bytes of memory from the source location to -the destination location. These locations are not allowed to overlap. Memory copy -is performed as a sequence of unordered atomic memory accesses where each access -is guaranteed to be a multiple of ``element_size`` bytes wide and aligned at an -element size boundary. +The '``llvm.memcpy.element.unordered.atomic.*``' intrinsic copies ``len`` bytes of +memory from the source location to the destination location. These locations are not +allowed to overlap. The memory copy is performed as a sequence of load/store operations +where each access is guaranteed to be a multiple of ``element_size`` bytes wide and +aligned at an ``element_size`` boundary. The order of the copy is unspecified. The same value may be read from the source buffer many times, but only one write is issued to the destination buffer per -element. It is well defined to have concurrent reads and writes to both source -and destination provided those reads and writes are at least unordered atomic. +element. It is well defined to have concurrent reads and writes to both source and +destination provided those reads and writes are unordered atomic when specified. This intrinsic does not provide any additional ordering guarantees over those provided by a set of unordered loads from the source location and stores to the @@ -14063,8 +14136,8 @@ destination. Lowering: """"""""" -In the most general case call to the '``llvm.memcpy.element.atomic.*``' is lowered -to a call to the symbol ``__llvm_memcpy_element_atomic_*``. Where '*' is replaced -with an actual element size. +In the most general case call to the '``llvm.memcpy.element.unordered.atomic.*``' is +lowered to a call to the symbol ``__llvm_memcpy_element_unordered_atomic_*``. Where '*' +is replaced with an actual element size. -Optimizer is allowed to inline memory copy when it's profitable to do so. +The optimizer is allowed to inline the memory copy when it's profitable to do so. Modified: vendor/llvm/dist/docs/Lexicon.rst ============================================================================== --- vendor/llvm/dist/docs/Lexicon.rst Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/docs/Lexicon.rst Fri Jun 16 21:03:24 2017 (r320013) @@ -109,6 +109,13 @@ G Garbage Collection. The practice of using reachability analysis instead of explicit memory management to reclaim unused memory. +**GVN** + Global Value Numbering. GVN is a pass that partitions values computed by a + function into congruence classes. Values ending up in the same congruence + class are guaranteed to be the same for every execution of the program. + In that respect, congruency is a compile-time approximation of equivalence + of values at runtime. + H - Modified: vendor/llvm/dist/docs/Phabricator.rst ============================================================================== --- vendor/llvm/dist/docs/Phabricator.rst Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/docs/Phabricator.rst Fri Jun 16 21:03:24 2017 (r320013) @@ -54,7 +54,8 @@ reviewer understand your code. To get a full diff, use one of the following commands (or just use Arcanist to upload your patch): -* ``git diff -U999999 other-branch`` +* ``git show HEAD -U999999 > mypatch.patch`` +* ``git format-patch -U999999 @{u}`` * ``svn diff --diff-cmd=diff -x -U999999`` To upload a new patch: Modified: vendor/llvm/dist/include/llvm/ADT/AllocatorList.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/AllocatorList.h Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/include/llvm/ADT/AllocatorList.h Fri Jun 16 21:03:24 2017 (r320013) @@ -10,10 +10,16 @@ #ifndef LLVM_ADT_ALLOCATORLIST_H #define LLVM_ADT_ALLOCATORLIST_H +#include "llvm/ADT/ilist_node.h" #include "llvm/ADT/iterator.h" #include "llvm/ADT/simple_ilist.h" #include "llvm/Support/Allocator.h" +#include +#include +#include +#include #include +#include namespace llvm { @@ -39,7 +45,8 @@ template class AllocatorLi T V; }; - typedef simple_ilist list_type; + using list_type = simple_ilist; + list_type List; AllocatorT &getAlloc() { return *this; } @@ -51,13 +58,17 @@ template class AllocatorLi struct Cloner { AllocatorList &AL; + Cloner(AllocatorList &AL) : AL(AL) {} + Node *operator()(const Node &N) const { return AL.create(N.V); } }; struct Disposer { AllocatorList &AL; + Disposer(AllocatorList &AL) : AL(AL) {} + void operator()(Node *N) const { N->~Node(); AL.getAlloc().Deallocate(N); @@ -65,13 +76,13 @@ template class AllocatorLi }; public: - typedef T value_type; - typedef T *pointer; - typedef T &reference; - typedef const T *const_pointer; - typedef const T &const_reference; - typedef typename list_type::size_type size_type; - typedef typename list_type::difference_type difference_type; + using value_type = T; + using pointer = T *; + using reference = T &; + using const_pointer = const T *; + using const_reference = const T &; + using size_type = typename list_type::size_type; + using difference_type = typename list_type::difference_type; private: template @@ -83,20 +94,18 @@ template class AllocatorLi friend class IteratorImpl; friend AllocatorList; - typedef iterator_adaptor_base, - IteratorBase, std::bidirectional_iterator_tag, - ValueT> - base_type; + using base_type = + iterator_adaptor_base, IteratorBase, + std::bidirectional_iterator_tag, ValueT>; public: - typedef ValueT value_type; - typedef ValueT *pointer; - typedef ValueT &reference; + using value_type = ValueT; + using pointer = ValueT *; + using reference = ValueT &; IteratorImpl() = default; IteratorImpl(const IteratorImpl &) = default; IteratorImpl &operator=(const IteratorImpl &) = default; - ~IteratorImpl() = default; explicit IteratorImpl(const IteratorBase &I) : base_type(I) {} @@ -106,6 +115,8 @@ template class AllocatorLi OtherIteratorBase, IteratorBase>::value>::type * = nullptr) : base_type(X.wrapped()) {} + ~IteratorImpl() = default; + reference operator*() const { return base_type::wrapped()->V; } pointer operator->() const { return &operator*(); } @@ -118,30 +129,34 @@ template class AllocatorLi }; public: - typedef IteratorImpl iterator; - typedef IteratorImpl - reverse_iterator; - typedef IteratorImpl - const_iterator; - typedef IteratorImpl - const_reverse_iterator; + using iterator = IteratorImpl; + using reverse_iterator = + IteratorImpl; + using const_iterator = + IteratorImpl; + using const_reverse_iterator = + IteratorImpl; AllocatorList() = default; AllocatorList(AllocatorList &&X) : AllocatorT(std::move(X.getAlloc())), List(std::move(X.List)) {} + AllocatorList(const AllocatorList &X) { List.cloneFrom(X.List, Cloner(*this), Disposer(*this)); } + AllocatorList &operator=(AllocatorList &&X) { clear(); // Dispose of current nodes explicitly. List = std::move(X.List); getAlloc() = std::move(X.getAlloc()); return *this; } + AllocatorList &operator=(const AllocatorList &X) { List.cloneFrom(X.List, Cloner(*this), Disposer(*this)); return *this; } + ~AllocatorList() { clear(); } void swap(AllocatorList &RHS) { Modified: vendor/llvm/dist/include/llvm/ADT/ArrayRef.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/ArrayRef.h Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/include/llvm/ADT/ArrayRef.h Fri Jun 16 21:03:24 2017 (r320013) @@ -1,4 +1,4 @@ -//===--- ArrayRef.h - Array Reference Wrapper -------------------*- C++ -*-===// +//===- ArrayRef.h - Array Reference Wrapper ---------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -12,12 +12,21 @@ #include "llvm/ADT/Hashing.h" #include "llvm/ADT/None.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/Support/Compiler.h" +#include #include +#include +#include +#include +#include +#include +#include #include namespace llvm { + /// ArrayRef - Represent a constant reference to an array (0 or more elements /// consecutively in memory), i.e. a start pointer and a length. It allows /// various APIs to take consecutive elements easily and conveniently. @@ -32,28 +41,27 @@ namespace llvm { template class LLVM_NODISCARD ArrayRef { public: - typedef const T *iterator; - typedef const T *const_iterator; - typedef size_t size_type; + using iterator = const T *; + using const_iterator = const T *; + using size_type = size_t; + using reverse_iterator = std::reverse_iterator; - typedef std::reverse_iterator reverse_iterator; - private: /// The start of the array, in an external buffer. - const T *Data; + const T *Data = nullptr; /// The number of elements. - size_type Length; + size_type Length = 0; public: /// @name Constructors /// @{ /// Construct an empty ArrayRef. - /*implicit*/ ArrayRef() : Data(nullptr), Length(0) {} + /*implicit*/ ArrayRef() = default; /// Construct an empty ArrayRef from None. - /*implicit*/ ArrayRef(NoneType) : Data(nullptr), Length(0) {} + /*implicit*/ ArrayRef(NoneType) {} /// Construct an ArrayRef from a single element. /*implicit*/ ArrayRef(const T &OneElt) @@ -282,10 +290,9 @@ namespace llvm { template class LLVM_NODISCARD MutableArrayRef : public ArrayRef { public: - typedef T *iterator; + using iterator = T *; + using reverse_iterator = std::reverse_iterator; - typedef std::reverse_iterator reverse_iterator; - /// Construct an empty MutableArrayRef. /*implicit*/ MutableArrayRef() : ArrayRef() {} @@ -416,19 +423,23 @@ namespace llvm { /// This is a MutableArrayRef that owns its array. template class OwningArrayRef : public MutableArrayRef { public: - OwningArrayRef() {} + OwningArrayRef() = default; OwningArrayRef(size_t Size) : MutableArrayRef(new T[Size], Size) {} + OwningArrayRef(ArrayRef Data) : MutableArrayRef(new T[Data.size()], Data.size()) { std::copy(Data.begin(), Data.end(), this->begin()); } + OwningArrayRef(OwningArrayRef &&Other) { *this = Other; } + OwningArrayRef &operator=(OwningArrayRef &&Other) { delete[] this->data(); this->MutableArrayRef::operator=(Other); Other.MutableArrayRef::operator=(MutableArrayRef()); return *this; } + ~OwningArrayRef() { delete[] this->data(); } }; @@ -517,13 +528,14 @@ namespace llvm { // ArrayRefs can be treated like a POD type. template struct isPodLike; - template struct isPodLike > { + template struct isPodLike> { static const bool value = true; }; template hash_code hash_value(ArrayRef S) { return hash_combine_range(S.begin(), S.end()); } + } // end namespace llvm #endif // LLVM_ADT_ARRAYREF_H Modified: vendor/llvm/dist/include/llvm/ADT/BreadthFirstIterator.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/BreadthFirstIterator.h Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/include/llvm/ADT/BreadthFirstIterator.h Fri Jun 16 21:03:24 2017 (r320013) @@ -25,7 +25,6 @@ #include "llvm/ADT/iterator_range.h" #include #include -#include #include namespace llvm { @@ -49,13 +48,13 @@ template , public bf_iterator_storage { - typedef std::iterator super; + using super = std::iterator; - typedef typename GT::NodeRef NodeRef; - typedef typename GT::ChildIteratorType ChildItTy; + using NodeRef = typename GT::NodeRef; + using ChildItTy = typename GT::ChildIteratorType; // First element is the node reference, second is the next child to visit. - typedef std::pair> QueueElement; + using QueueElement = std::pair>; // Visit queue - used to maintain BFS ordering. // Optional<> because we need markers for levels. @@ -109,7 +108,7 @@ class bf_iterator (private) } public: - typedef typename super::pointer pointer; + using pointer = typename super::pointer; // Provide static begin and end methods as our public "constructors" static bf_iterator begin(const GraphT &G) { Modified: vendor/llvm/dist/include/llvm/ADT/DAGDeltaAlgorithm.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/DAGDeltaAlgorithm.h Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/include/llvm/ADT/DAGDeltaAlgorithm.h Fri Jun 16 21:03:24 2017 (r320013) @@ -1,4 +1,4 @@ -//===--- DAGDeltaAlgorithm.h - A DAG Minimization Algorithm ----*- C++ -*--===// +//===- DAGDeltaAlgorithm.h - A DAG Minimization Algorithm ------*- C++ -*--===// // // The LLVM Compiler Infrastructure // @@ -40,12 +40,12 @@ class DAGDeltaAlgorithm { virtual void anchor(); public: - typedef unsigned change_ty; - typedef std::pair edge_ty; + using change_ty = unsigned; + using edge_ty = std::pair; // FIXME: Use a decent data structure. - typedef std::set changeset_ty; - typedef std::vector changesetlist_ty; + using changeset_ty = std::set; + using changesetlist_ty = std::vector; public: virtual ~DAGDeltaAlgorithm() = default; Modified: vendor/llvm/dist/include/llvm/ADT/DeltaAlgorithm.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/DeltaAlgorithm.h Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/include/llvm/ADT/DeltaAlgorithm.h Fri Jun 16 21:03:24 2017 (r320013) @@ -1,4 +1,4 @@ -//===--- DeltaAlgorithm.h - A Set Minimization Algorithm -------*- C++ -*--===// +//===- DeltaAlgorithm.h - A Set Minimization Algorithm ---------*- C++ -*--===// // // The LLVM Compiler Infrastructure // @@ -35,10 +35,10 @@ namespace llvm { /// predicate. class DeltaAlgorithm { public: - typedef unsigned change_ty; + using change_ty = unsigned; // FIXME: Use a decent data structure. - typedef std::set changeset_ty; - typedef std::vector changesetlist_ty; + using changeset_ty = std::set; + using changesetlist_ty = std::vector; private: /// Cache of failed test results. Successful test results are never cached @@ -90,4 +90,4 @@ class DeltaAlgorithm { (public) } // end namespace llvm -#endif +#endif // LLVM_ADT_DELTAALGORITHM_H Modified: vendor/llvm/dist/include/llvm/ADT/DenseMap.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/DenseMap.h Fri Jun 16 20:47:12 2017 (r320012) +++ vendor/llvm/dist/include/llvm/ADT/DenseMap.h Fri Jun 16 21:03:24 2017 (r320013) @@ -25,8 +25,8 @@ #include #include #include -#include #include +#include #include namespace llvm { @@ -57,14 +57,15 @@ class DenseMapBase : public DebugEpochBase { using const_arg_type_t = typename const_pointer_or_const_ref::type; public: - typedef unsigned size_type; - typedef KeyT key_type; - typedef ValueT mapped_type; - typedef BucketT value_type; + using size_type = unsigned; + using key_type = KeyT; + using mapped_type = ValueT; + using value_type = BucketT; - typedef DenseMapIterator iterator; - typedef DenseMapIterator - const_iterator; + using iterator = DenseMapIterator; + using const_iterator = + DenseMapIterator; + inline iterator begin() { // When the map is empty, avoid the overhead of AdvancePastEmptyBuckets(). return empty() ? end() : iterator(getBuckets(), getBucketsEnd(), *this); @@ -387,15 +388,18 @@ class DenseMapBase : public DebugEpochBase { static unsigned getHashValue(const KeyT &Val) { return KeyInfoT::getHashValue(Val); } + template static unsigned getHashValue(const LookupKeyT &Val) { return KeyInfoT::getHashValue(Val); } + static const KeyT getEmptyKey() { static_assert(std::is_base_of::value, "Must pass the derived type to this template!"); return KeyInfoT::getEmptyKey(); } + static const KeyT getTombstoneKey() { return KeyInfoT::getTombstoneKey(); } @@ -404,39 +408,51 @@ class DenseMapBase : public DebugEpochBase { unsigned getNumEntries() const { return static_cast(this)->getNumEntries(); } + void setNumEntries(unsigned Num) { static_cast(this)->setNumEntries(Num); } + void incrementNumEntries() { setNumEntries(getNumEntries() + 1); } + void decrementNumEntries() { setNumEntries(getNumEntries() - 1); } + unsigned getNumTombstones() const { return static_cast(this)->getNumTombstones(); } + void setNumTombstones(unsigned Num) { static_cast(this)->setNumTombstones(Num); } + void incrementNumTombstones() { setNumTombstones(getNumTombstones() + 1); } + void decrementNumTombstones() { setNumTombstones(getNumTombstones() - 1); } + const BucketT *getBuckets() const { return static_cast(this)->getBuckets(); } + BucketT *getBuckets() { return static_cast(this)->getBuckets(); } + unsigned getNumBuckets() const { return static_cast(this)->getNumBuckets(); } + BucketT *getBucketsEnd() { return getBuckets() + getNumBuckets(); } + const BucketT *getBucketsEnd() const { return getBuckets() + getNumBuckets(); } @@ -587,10 +603,11 @@ template > class DenseMap : public DenseMapBase, KeyT, ValueT, KeyInfoT, BucketT> { + friend class DenseMapBase; + // Lift some types from the dependent base class into this class for // simplicity of referring to them. - typedef DenseMapBase BaseT; - friend class DenseMapBase; + using BaseT = DenseMapBase; BucketT *Buckets; unsigned NumEntries; @@ -705,6 +722,7 @@ class DenseMap : public DenseMapBase, KeyT, ValueT, KeyInfoT, BucketT> { + friend class DenseMapBase; + // Lift some types from the dependent base class into this class for // simplicity of referring to them. - typedef DenseMapBase BaseT; - friend class DenseMapBase; + using BaseT = DenseMapBase; + static_assert(isPowerOf2_64(InlineBuckets), "InlineBuckets must be a power of 2."); @@ -972,6 +993,7 @@ class SmallDenseMap unsigned getNumEntries() const { return NumEntries; } + void setNumEntries(unsigned Num) { // NumEntries is hardcoded to be 31 bits wide. assert(Num < (1U << 31) && "Cannot support more than 1<<31 entries"); @@ -981,6 +1003,7 @@ class SmallDenseMap unsigned getNumTombstones() const { return NumTombstones; } + void setNumTombstones(unsigned Num) { NumTombstones = Num; } @@ -992,15 +1015,18 @@ class SmallDenseMap // 'storage.buffer' static type is 'char *'. return reinterpret_cast(storage.buffer); } + BucketT *getInlineBuckets() { return const_cast( const_cast(this)->getInlineBuckets()); } + const LargeRep *getLargeRep() const { assert(!Small); // Note, same rule about aliasing as with getInlineBuckets. return reinterpret_cast(storage.buffer); } + LargeRep *getLargeRep() { return const_cast( const_cast(this)->getLargeRep()); @@ -1009,10 +1035,12 @@ class SmallDenseMap const BucketT *getBuckets() const { return Small ? getInlineBuckets() : getLargeRep()->Buckets; } + BucketT *getBuckets() { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 16 21:03:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75043D8915A; Fri, 16 Jun 2017 21:03:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27BB26F4C0; Fri, 16 Jun 2017 21:03:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL3Vcv063394; Fri, 16 Jun 2017 21:03:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL3VX9063393; Fri, 16 Jun 2017 21:03:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162103.v5GL3VX9063393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320014 - vendor/llvm/llvm-trunk-r305575 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:03:32 -0000 Author: dim Date: Fri Jun 16 21:03:31 2017 New Revision: 320014 URL: https://svnweb.freebsd.org/changeset/base/320014 Log: Tag llvm trunk r305575. Added: vendor/llvm/llvm-trunk-r305575/ - copied from r320013, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Fri Jun 16 21:03:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B71D891B3; Fri, 16 Jun 2017 21:03:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D3E86F5C4; Fri, 16 Jun 2017 21:03:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL3kiF063466; Fri, 16 Jun 2017 21:03:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL3iT6063442; Fri, 16 Jun 2017 21:03:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162103.v5GL3iT6063442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320015 - in vendor/clang/dist: docs include/clang/Basic include/clang/Format include/clang/Frontend include/clang/Lex include/clang/Sema lib/AST lib/CodeGen lib/Driver/ToolChains lib/F... 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:03:48 -0000 Author: dim Date: Fri Jun 16 21:03:44 2017 New Revision: 320015 URL: https://svnweb.freebsd.org/changeset/base/320015 Log: Vendor import of clang trunk r305575: https://llvm.org/svn/llvm-project/cfe/trunk@305575 Added: vendor/clang/dist/test/CodeGen/Inputs/thinlto-multi-module.ll vendor/clang/dist/test/CodeGen/mips-debug-info-bitfield.c (contents, props changed) vendor/clang/dist/test/CodeGen/ubsan-volatile.c (contents, props changed) vendor/clang/dist/test/Misc/pr32207.c (contents, props changed) vendor/clang/dist/test/Sema/xray-log-args-class.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/co_await-range-for.cpp (contents, props changed) Modified: vendor/clang/dist/docs/ClangFormatStyleOptions.rst vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst vendor/clang/dist/include/clang/Basic/AllDiagnostics.h vendor/clang/dist/include/clang/Basic/BuiltinsPPC.def vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td vendor/clang/dist/include/clang/Format/Format.h vendor/clang/dist/include/clang/Frontend/FrontendOptions.h vendor/clang/dist/include/clang/Lex/MacroArgs.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/ExprClassification.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/ItaniumMangle.cpp vendor/clang/dist/lib/AST/ODRHash.cpp vendor/clang/dist/lib/CodeGen/BackendUtil.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.h vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist/lib/Format/Format.cpp vendor/clang/dist/lib/Format/NamespaceEndCommentsFixer.cpp vendor/clang/dist/lib/Format/UnwrappedLineFormatter.cpp vendor/clang/dist/lib/Format/UnwrappedLineParser.cpp vendor/clang/dist/lib/Format/WhitespaceManager.h vendor/clang/dist/lib/Frontend/ASTConsumers.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Index/IndexDecl.cpp vendor/clang/dist/lib/Index/IndexSymbol.cpp vendor/clang/dist/lib/Lex/MacroArgs.cpp vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp vendor/clang/dist/lib/Sema/SemaCoroutine.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/lib/Sema/SemaLambda.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTReaderDecl.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/CallEvent.cpp vendor/clang/dist/test/Analysis/DynamicTypePropagation.m vendor/clang/dist/test/Analysis/analyzer_test.py vendor/clang/dist/test/CodeCompletion/member-access.cpp vendor/clang/dist/test/CodeGen/attributes.c vendor/clang/dist/test/CodeGen/avx-builtins.c vendor/clang/dist/test/CodeGen/builtins-ppc-error.c vendor/clang/dist/test/CodeGen/dependent-lib.c vendor/clang/dist/test/CodeGen/linker-option.c vendor/clang/dist/test/CodeGen/pragma-comment.c vendor/clang/dist/test/CodeGen/pragma-detect_mismatch.c vendor/clang/dist/test/CodeGen/thinlto-backend-option.ll vendor/clang/dist/test/CodeGen/thinlto-multi-module.ll vendor/clang/dist/test/CodeGen/ubsan-pointer-overflow.m vendor/clang/dist/test/CodeGenCXX/ms-thread_local.cpp vendor/clang/dist/test/CodeGenCoroutines/coro-await.cpp vendor/clang/dist/test/CodeGenObjC/availability-cf-link-guard.m vendor/clang/dist/test/Coverage/ast-printing.c vendor/clang/dist/test/Coverage/ast-printing.cpp vendor/clang/dist/test/Driver/m_and_mm.c vendor/clang/dist/test/Index/Core/index-source.cpp vendor/clang/dist/test/Index/availability.c vendor/clang/dist/test/Modules/autolink.m vendor/clang/dist/test/Modules/autolinkTBD.m vendor/clang/dist/test/Modules/module-impl-with-link.c vendor/clang/dist/test/Modules/odr_hash.cpp vendor/clang/dist/test/Sema/integer-overflow.c vendor/clang/dist/test/SemaCXX/cxx1z-decomposition.cpp vendor/clang/dist/test/SemaCXX/nested-name-spec.cpp vendor/clang/dist/test/SemaCXX/warn-unused-lambda-capture.cpp vendor/clang/dist/tools/clang-format/git-clang-format vendor/clang/dist/tools/libclang/CIndex.cpp vendor/clang/dist/unittests/AST/CommentLexer.cpp vendor/clang/dist/unittests/ASTMatchers/ASTMatchersTest.h vendor/clang/dist/unittests/Basic/VirtualFileSystemTest.cpp vendor/clang/dist/unittests/Format/FormatTest.cpp vendor/clang/dist/unittests/Format/NamespaceEndCommentsFixerTest.cpp vendor/clang/dist/unittests/Lex/LexerTest.cpp vendor/clang/dist/unittests/Tooling/LookupTest.cpp Modified: vendor/clang/dist/docs/ClangFormatStyleOptions.rst ============================================================================== --- vendor/clang/dist/docs/ClangFormatStyleOptions.rst Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/docs/ClangFormatStyleOptions.rst Fri Jun 16 21:03:44 2017 (r320015) @@ -521,12 +521,12 @@ the configuration (without a prefix: ``Auto``). .. code-block:: c++ true: - class foo {}; - - false: class foo {}; + false: + class foo {}; + * ``bool AfterControlStatement`` Wrap control statements (``if``/``for``/``while``/``switch``/..). .. code-block:: c++ @@ -603,12 +603,12 @@ the configuration (without a prefix: ``Auto``). struct foo { int x; - } + }; false: struct foo { int x; - } + }; * ``bool AfterUnion`` Wrap union definitions. Modified: vendor/clang/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.rst Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/docs/ReleaseNotes.rst Fri Jun 16 21:03:44 2017 (r320015) @@ -187,6 +187,31 @@ Static Analyzer ... +Undefined Behavior Sanitizer (UBSan) +------------------------------------ + +- The Undefined Behavior Sanitizer has a new check for pointer overflow. This + check is on by default. The flag to control this functionality is + -fsanitize=pointer-overflow. + + Pointer overflow is an indicator of undefined behavior: when a pointer + indexing expression wraps around the address space, or produces other + unexpected results, its result may not point to a valid object. + +- UBSan has several new checks which detect violations of nullability + annotations. These checks are off by default. The flag to control this group + of checks is -fsanitize=nullability. The checks can be individially enabled + by -fsanitize=nullability-arg (which checks calls), + -fsanitize=nullability-assign (which checks assignments), and + -fsanitize=nullability-return (which checks return statements). + +- UBSan can now detect invalid loads from bitfields and from ObjC BOOLs. + +- UBSan can now avoid emitting unnecessary type checks in C++ class methods and + in several other cases where the result is known at compile-time. UBSan can + also avoid emitting unnecessary overflow checks in arithmetic expressions + with promoted integer operands. + Core Analysis Improvements ========================== Modified: vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst ============================================================================== --- vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst Fri Jun 16 21:03:44 2017 (r320015) @@ -148,6 +148,12 @@ You can also use the following check groups: nullability does not have undefined behavior, it is often unintentional, so UBSan offers to catch it. +Volatile +-------- + +The ``null``, ``alignment``, ``object-size``, and ``vptr`` checks do not apply +to pointers to types with the ``volatile`` qualifier. + Stack traces and report symbolization ===================================== If you want UBSan to print symbolized stack trace for each error report, you Modified: vendor/clang/dist/include/clang/Basic/AllDiagnostics.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/AllDiagnostics.h Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/include/clang/Basic/AllDiagnostics.h Fri Jun 16 21:03:44 2017 (r320015) @@ -28,7 +28,7 @@ namespace clang { template class StringSizerHelper { - char FIELD_TOO_SMALL[SizeOfStr <= FieldType(~0U) ? 1 : -1]; + static_assert(SizeOfStr <= FieldType(~0U), "Field too small!"); public: enum { Size = SizeOfStr }; }; Modified: vendor/clang/dist/include/clang/Basic/BuiltinsPPC.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsPPC.def Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/include/clang/Basic/BuiltinsPPC.def Fri Jun 16 21:03:44 2017 (r320015) @@ -51,10 +51,10 @@ BUILTIN(__builtin_altivec_vavguw, "V4UiV4UiV4Ui", "") BUILTIN(__builtin_altivec_vrfip, "V4fV4f", "") -BUILTIN(__builtin_altivec_vcfsx, "V4fV4ii", "") -BUILTIN(__builtin_altivec_vcfux, "V4fV4ii", "") -BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fi", "") -BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fi", "") +BUILTIN(__builtin_altivec_vcfsx, "V4fV4iIi", "") +BUILTIN(__builtin_altivec_vcfux, "V4fV4iIi", "") +BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fIi", "") +BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fIi", "") BUILTIN(__builtin_altivec_dss, "vUi", "") BUILTIN(__builtin_altivec_dssall, "v", "") Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Fri Jun 16 21:03:44 2017 (r320015) @@ -121,10 +121,12 @@ def err_module_odr_violation_mismatch_decl : Error< "%q0 has different definitions in different modules; first difference is " "%select{definition in module '%2'|defined here}1 found " "%select{end of class|public access specifier|private access specifier|" - "protected access specifier|static assert|field|method}3">; + "protected access specifier|static assert|field|method|type alias|typedef|" + "data member}3">; def note_module_odr_violation_mismatch_decl : Note<"but in '%0' found " "%select{end of class|public access specifier|private access specifier|" - "protected access specifier|static assert|field|method}1">; + "protected access specifier|static assert|field|method|type alias|typedef|" + "data member}1">; def err_module_odr_violation_mismatch_decl_diff : Error< "%q0 has different definitions in different modules; first difference is " @@ -149,7 +151,17 @@ def err_module_odr_violation_mismatch_decl_diff : Erro "method %4 is %select{not inline|inline}5|" "method %4 that has %5 parameter%s5|" "method %4 with %ordinal5 parameter of type %6%select{| decayed from %8}7|" - "method %4 with %ordinal5 parameter named %6}3">; + "method %4 with %ordinal5 parameter named %6|" + "method %4 with %ordinal5 parameter with%select{out|}6 a default argument|" + "method %4 with %ordinal5 parameter with a default argument|" + "%select{typedef|type alias}4 name %5|" + "%select{typedef|type alias}4 %5 with underlying type %6|" + "data member with name %4|" + "data member %4 with type %5|" + "data member %4 with%select{out|}5 an initializer|" + "data member %4 with an initializer|" + "data member %4 %select{is constexpr|is not constexpr}5|" + "}3">; def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " "%select{" @@ -172,15 +184,27 @@ def note_module_odr_violation_mismatch_decl_diff : Not "method %2 is %select{not inline|inline}3|" "method %2 that has %3 parameter%s3|" "method %2 with %ordinal3 parameter of type %4%select{| decayed from %6}5|" - "method %2 with %ordinal3 parameter named %4}1">; + "method %2 with %ordinal3 parameter named %4|" + "method %2 with %ordinal3 parameter with%select{out|}4 a default argument|" + "method %2 with %ordinal3 parameter with a different default argument|" + "%select{typedef|type alias}2 name %3|" + "%select{typedef|type alias}2 %3 with different underlying type %4|" + "data member with name %2|" + "data member %2 with different type %3|" + "data member %2 with%select{out|}3 an initializer|" + "data member %2 with a different initializer|" + "data member %2 %select{is constexpr|is not constexpr}3|" + "}1">; def err_module_odr_violation_mismatch_decl_unknown : Error< "%q0 %select{with definition in module '%2'|defined here}1 has different " "definitions in different modules; first difference is this " - "%select{||||static assert|field|method|unexpected decl}3">; + "%select{||||static assert|field|method|type alias|typedef|data member|" + "unexpected decl}3">; def note_module_odr_violation_mismatch_decl_unknown : Note< "but in '%0' found " "%select{||||different static assert|different field|different method|" + "different type alias|different typedef|different data member|" "another unexpected decl}1">; def warn_duplicate_module_file_extension : Warning< Modified: vendor/clang/dist/include/clang/Format/Format.h ============================================================================== --- vendor/clang/dist/include/clang/Format/Format.h Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/include/clang/Format/Format.h Fri Jun 16 21:03:44 2017 (r320015) @@ -688,6 +688,18 @@ struct FormatStyle { bool BeforeElse; /// \brief Indent the wrapped braces themselves. bool IndentBraces; + /// \brief If ``false``, empty function body can be put on a single line. + /// This option is used only if the opening brace of the function has + /// already been wrapped, i.e. the `AfterFunction` brace wrapping mode is + /// set, and the function could/should not be put on a single line (as per + /// `AllowShortFunctionsOnASingleLine` and constructor formatting options). + /// \code + /// int f() vs. inf f() + /// {} { + /// } + /// \endcode + /// + bool SplitEmptyFunctionBody; }; /// \brief Control of individual brace wrapping cases. @@ -779,6 +791,29 @@ struct FormatStyle { /// \endcode bool BreakBeforeInheritanceComma; + /// \brief If ``true``, consecutive namespace declarations will be on the same + /// line. If ``false``, each namespace is declared on a new line. + /// \code + /// true: + /// namespace Foo { namespace Bar { + /// }} + /// + /// false: + /// namespace Foo { + /// namespace Bar { + /// } + /// } + /// \endcode + /// + /// If it does not fit on a single line, the overflowing namespaces get + /// wrapped: + /// \code + /// namespace Foo { namespace Bar { + /// namespace Extra { + /// }}} + /// \endcode + bool CompactNamespaces; + /// \brief If the constructor initializers don't fit on a line, put each /// initializer on its own line. /// \code @@ -1410,6 +1445,7 @@ struct FormatStyle { BreakBeforeBraces == R.BreakBeforeBraces && BreakBeforeTernaryOperators == R.BreakBeforeTernaryOperators && BreakConstructorInitializers == R.BreakConstructorInitializers && + CompactNamespaces == R.CompactNamespaces && BreakAfterJavaFieldAnnotations == R.BreakAfterJavaFieldAnnotations && BreakStringLiterals == R.BreakStringLiterals && ColumnLimit == R.ColumnLimit && CommentPragmas == R.CommentPragmas && Modified: vendor/clang/dist/include/clang/Frontend/FrontendOptions.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/FrontendOptions.h Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/include/clang/Frontend/FrontendOptions.h Fri Jun 16 21:03:44 2017 (r320015) @@ -317,8 +317,8 @@ class FrontendOptions { (public) /// \brief Auxiliary triple for CUDA compilation. std::string AuxTriple; - /// \brief If non-empty, search the pch input file as it was a header - // included by this file. + /// \brief If non-empty, search the pch input file as if it was a header + /// included by this file. std::string FindPchSource; /// Filename to write statistics to. Modified: vendor/clang/dist/include/clang/Lex/MacroArgs.h ============================================================================== --- vendor/clang/dist/include/clang/Lex/MacroArgs.h Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/include/clang/Lex/MacroArgs.h Fri Jun 16 21:03:44 2017 (r320015) @@ -53,9 +53,12 @@ class MacroArgs { /// Preprocessor owns which we use to avoid thrashing malloc/free. MacroArgs *ArgCache; - MacroArgs(unsigned NumToks, bool varargsElided) - : NumUnexpArgTokens(NumToks), VarargsElided(varargsElided), - ArgCache(nullptr) {} + /// MacroArgs - The number of arguments the invoked macro expects. + unsigned NumMacroArgs; + + MacroArgs(unsigned NumToks, bool varargsElided, unsigned MacroArgs) + : NumUnexpArgTokens(NumToks), VarargsElided(varargsElided), + ArgCache(nullptr), NumMacroArgs(MacroArgs) {} ~MacroArgs() = default; public: @@ -94,10 +97,9 @@ class MacroArgs { SourceLocation ExpansionLocStart, SourceLocation ExpansionLocEnd); - /// getNumArguments - Return the number of arguments passed into this macro - /// invocation. - unsigned getNumArguments() const { return NumUnexpArgTokens; } - + /// getNumMacroArguments - Return the number of arguments the invoked macro + /// expects. + unsigned getNumMacroArguments() const { return NumMacroArgs; } /// isVarargsElidedUse - Return true if this is a C99 style varargs macro /// invocation and there was no argument specified for the "..." argument. If Modified: vendor/clang/dist/include/clang/Sema/Sema.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Sema.h Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/include/clang/Sema/Sema.h Fri Jun 16 21:03:44 2017 (r320015) @@ -8364,6 +8364,8 @@ class Sema { (public) //===--------------------------------------------------------------------===// // C++ Coroutines TS // + bool ActOnCoroutineBodyStart(Scope *S, SourceLocation KwLoc, + StringRef Keyword); ExprResult ActOnCoawaitExpr(Scope *S, SourceLocation KwLoc, Expr *E); ExprResult ActOnCoyieldExpr(Scope *S, SourceLocation KwLoc, Expr *E); StmtResult ActOnCoreturnStmt(Scope *S, SourceLocation KwLoc, Expr *E); Modified: vendor/clang/dist/lib/AST/ASTContext.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ASTContext.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/AST/ASTContext.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -3565,7 +3565,7 @@ QualType ASTContext::getSubstTemplateTypeParmPackType( = new (*this, TypeAlignment) SubstTemplateTypeParmPackType(Parm, Canon, ArgPack); Types.push_back(SubstParm); - SubstTemplateTypeParmTypes.InsertNode(SubstParm, InsertPos); + SubstTemplateTypeParmPackTypes.InsertNode(SubstParm, InsertPos); return QualType(SubstParm, 0); } @@ -8547,6 +8547,7 @@ static QualType DecodeTypeFromStr(const char *&Str, co HowLong = 2; break; } + break; } } Modified: vendor/clang/dist/lib/AST/ExprClassification.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ExprClassification.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/AST/ExprClassification.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -190,7 +190,6 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, con case Expr::ArrayInitIndexExprClass: case Expr::NoInitExprClass: case Expr::DesignatedInitUpdateExprClass: - case Expr::CoyieldExprClass: return Cl::CL_PRValue; // Next come the complicated cases. @@ -414,7 +413,8 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, con return ClassifyInternal(Ctx, cast(E)->getInit(0)); case Expr::CoawaitExprClass: - return ClassifyInternal(Ctx, cast(E)->getResumeExpr()); + case Expr::CoyieldExprClass: + return ClassifyInternal(Ctx, cast(E)->getResumeExpr()); } llvm_unreachable("unhandled expression kind in classification"); Modified: vendor/clang/dist/lib/AST/ExprConstant.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ExprConstant.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/AST/ExprConstant.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -4588,7 +4588,7 @@ class ExprEvaluatorBase (public) } bool handleCallExpr(const CallExpr *E, APValue &Result, - const LValue *ResultSlot) { + const LValue *ResultSlot) { const Expr *Callee = E->getCallee()->IgnoreParens(); QualType CalleeType = Callee->getType(); @@ -4597,23 +4597,6 @@ class ExprEvaluatorBase (public) auto Args = llvm::makeArrayRef(E->getArgs(), E->getNumArgs()); bool HasQualifier = false; - struct EvaluateIgnoredRAII { - public: - EvaluateIgnoredRAII(EvalInfo &Info, llvm::ArrayRef ToEval) - : Info(Info), ToEval(ToEval) {} - ~EvaluateIgnoredRAII() { - if (Info.noteFailure()) { - for (auto E : ToEval) - EvaluateIgnoredValue(Info, E); - } - } - void cancel() { ToEval = {}; } - void drop_front() { ToEval = ToEval.drop_front(); } - private: - EvalInfo &Info; - llvm::ArrayRef ToEval; - } EvalArguments(Info, Args); - // Extract function decl and 'this' pointer from the callee. if (CalleeType->isSpecificBuiltinType(BuiltinType::BoundMember)) { const ValueDecl *Member = nullptr; @@ -4663,12 +4646,10 @@ class ExprEvaluatorBase (public) if (Args.empty()) return Error(E); - const Expr *FirstArg = Args[0]; - Args = Args.drop_front(); - EvalArguments.drop_front(); - if (!EvaluateObjectArgument(Info, FirstArg, ThisVal)) + if (!EvaluateObjectArgument(Info, Args[0], ThisVal)) return false; This = &ThisVal; + Args = Args.slice(1); } else if (MD && MD->isLambdaStaticInvoker()) { // Map the static invoker for the lambda back to the call operator. // Conveniently, we don't have to slice out the 'this' argument (as is @@ -4720,12 +4701,8 @@ class ExprEvaluatorBase (public) const FunctionDecl *Definition = nullptr; Stmt *Body = FD->getBody(Definition); - if (!CheckConstexprFunction(Info, E->getExprLoc(), FD, Definition, Body)) - return false; - - EvalArguments.cancel(); - - if (!HandleFunctionCall(E->getExprLoc(), Definition, This, Args, Body, Info, + if (!CheckConstexprFunction(Info, E->getExprLoc(), FD, Definition, Body) || + !HandleFunctionCall(E->getExprLoc(), Definition, This, Args, Body, Info, Result, ResultSlot)) return false; Modified: vendor/clang/dist/lib/AST/ItaniumMangle.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ItaniumMangle.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/AST/ItaniumMangle.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -4550,9 +4550,11 @@ CXXNameMangler::makeFunctionReturnTypeTags(const Funct const FunctionProtoType *Proto = cast(FD->getType()->getAs()); + FunctionTypeDepthState saved = TrackReturnTypeTags.FunctionTypeDepth.push(); TrackReturnTypeTags.FunctionTypeDepth.enterResultType(); TrackReturnTypeTags.mangleType(Proto->getReturnType()); TrackReturnTypeTags.FunctionTypeDepth.leaveResultType(); + TrackReturnTypeTags.FunctionTypeDepth.pop(saved); return TrackReturnTypeTags.AbiTagsRoot.getSortedUniqueUsedAbiTags(); } Modified: vendor/clang/dist/lib/AST/ODRHash.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ODRHash.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/AST/ODRHash.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -140,7 +140,33 @@ void ODRHash::AddTemplateName(TemplateName Name) { } } -void ODRHash::AddTemplateArgument(TemplateArgument TA) {} +void ODRHash::AddTemplateArgument(TemplateArgument TA) { + const auto Kind = TA.getKind(); + ID.AddInteger(Kind); + + switch (Kind) { + case TemplateArgument::Null: + case TemplateArgument::Type: + case TemplateArgument::Declaration: + case TemplateArgument::NullPtr: + case TemplateArgument::Integral: + break; + case TemplateArgument::Template: + case TemplateArgument::TemplateExpansion: + AddTemplateName(TA.getAsTemplateOrTemplatePattern()); + break; + case TemplateArgument::Expression: + AddStmt(TA.getAsExpr()); + break; + case TemplateArgument::Pack: + ID.AddInteger(TA.pack_size()); + for (auto SubTA : TA.pack_elements()) { + AddTemplateArgument(SubTA); + } + break; + } +} + void ODRHash::AddTemplateParameterList(const TemplateParameterList *TPL) {} void ODRHash::clear() { @@ -226,6 +252,17 @@ class ODRDeclVisitor : public ConstDeclVisitorisStaticLocal()); + Hash.AddBoolean(D->isConstexpr()); + const bool HasInit = D->hasInit(); + Hash.AddBoolean(HasInit); + if (HasInit) { + AddStmt(D->getInit()); + } + Inherited::VisitVarDecl(D); + } + void VisitParmVarDecl(const ParmVarDecl *D) { // TODO: Handle default arguments. Inherited::VisitParmVarDecl(D); @@ -310,6 +347,7 @@ bool ODRHash::isWhitelistedDecl(const Decl *D, const C case Decl::StaticAssert: case Decl::TypeAlias: case Decl::Typedef: + case Decl::Var: return true; } } @@ -526,6 +564,13 @@ class ODRTypeVisitor : public TypeVisitorgetTemplateName()); VisitType(T); + } + + void VisitTemplateTypeParmType(const TemplateTypeParmType *T) { + ID.AddInteger(T->getDepth()); + ID.AddInteger(T->getIndex()); + Hash.AddBoolean(T->isParameterPack()); + AddDecl(T->getDecl()); } }; Modified: vendor/clang/dist/lib/CodeGen/BackendUtil.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/BackendUtil.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/CodeGen/BackendUtil.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -964,11 +964,11 @@ Expected clang::FindThinLTOModule(Memor if (!BMsOrErr) return BMsOrErr.takeError(); - // The bitcode file may contain multiple modules, we want the one with a - // summary. + // The bitcode file may contain multiple modules, we want the one that is + // marked as being the ThinLTO module. for (BitcodeModule &BM : *BMsOrErr) { - Expected HasSummary = BM.hasSummary(); - if (HasSummary && *HasSummary) + Expected LTOInfo = BM.getLTOInfo(); + if (LTOInfo && LTOInfo->IsThinLTO) return BM; } Modified: vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -7923,6 +7923,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned Bu } // We can't handle 8-31 immediates with native IR, use the intrinsic. + // Except for predicates that create constants. Intrinsic::ID ID; switch (BuiltinID) { default: llvm_unreachable("Unsupported intrinsic!"); @@ -7930,12 +7931,32 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned Bu ID = Intrinsic::x86_sse_cmp_ps; break; case X86::BI__builtin_ia32_cmpps256: + // _CMP_TRUE_UQ, _CMP_TRUE_US produce -1,-1... vector + // on any input and _CMP_FALSE_OQ, _CMP_FALSE_OS produce 0, 0... + if (CC == 0xf || CC == 0xb || CC == 0x1b || CC == 0x1f) { + Value *Constant = (CC == 0xf || CC == 0x1f) ? + llvm::Constant::getAllOnesValue(Builder.getInt32Ty()) : + llvm::Constant::getNullValue(Builder.getInt32Ty()); + Value *Vec = Builder.CreateVectorSplat( + Ops[0]->getType()->getVectorNumElements(), Constant); + return Builder.CreateBitCast(Vec, Ops[0]->getType()); + } ID = Intrinsic::x86_avx_cmp_ps_256; break; case X86::BI__builtin_ia32_cmppd: ID = Intrinsic::x86_sse2_cmp_pd; break; case X86::BI__builtin_ia32_cmppd256: + // _CMP_TRUE_UQ, _CMP_TRUE_US produce -1,-1... vector + // on any input and _CMP_FALSE_OQ, _CMP_FALSE_OS produce 0, 0... + if (CC == 0xf || CC == 0xb || CC == 0x1b || CC == 0x1f) { + Value *Constant = (CC == 0xf || CC == 0x1f) ? + llvm::Constant::getAllOnesValue(Builder.getInt64Ty()) : + llvm::Constant::getNullValue(Builder.getInt64Ty()); + Value *Vec = Builder.CreateVectorSplat( + Ops[0]->getType()->getVectorNumElements(), Constant); + return Builder.CreateBitCast(Vec, Ops[0]->getType()); + } ID = Intrinsic::x86_avx_cmp_pd_256; break; } Modified: vendor/clang/dist/lib/CodeGen/CGCall.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGCall.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/CodeGen/CGCall.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -1795,6 +1795,8 @@ void CodeGenModule::ConstructAttributeList( FuncAttrs.addAttribute(llvm::Attribute::NoUnwind); if (TargetDecl->hasAttr()) FuncAttrs.addAttribute(llvm::Attribute::NoReturn); + if (TargetDecl->hasAttr()) + FuncAttrs.addAttribute(llvm::Attribute::Cold); if (TargetDecl->hasAttr()) FuncAttrs.addAttribute(llvm::Attribute::NoDuplicate); if (TargetDecl->hasAttr()) Modified: vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -148,25 +148,18 @@ static SmallString<32> buildSuspendPrefixStr(CGCoroDat // // See llvm's docs/Coroutines.rst for more details. // -static RValue emitSuspendExpression(CodeGenFunction &CGF, CGCoroData &Coro, +namespace { + struct LValueOrRValue { + LValue LV; + RValue RV; + }; +} +static LValueOrRValue emitSuspendExpression(CodeGenFunction &CGF, CGCoroData &Coro, CoroutineSuspendExpr const &S, AwaitKind Kind, AggValueSlot aggSlot, - bool ignoreResult) { + bool ignoreResult, bool forLValue) { auto *E = S.getCommonExpr(); - // FIXME: rsmith 5/22/2017. Does it still make sense for us to have a - // UO_Coawait at all? As I recall, the only purpose it ever had was to - // represent a dependent co_await expression that couldn't yet be resolved to - // a CoawaitExpr. But now we have (and need!) a separate DependentCoawaitExpr - // node to store unqualified lookup results, it seems that the UnaryOperator - // portion of the representation serves no purpose (and as seen in this patch, - // it's getting in the way). Can we remove it? - - // Skip passthrough operator co_await (present when awaiting on an LValue). - if (auto *UO = dyn_cast(E)) - if (UO->getOpcode() == UO_Coawait) - E = UO->getSubExpr(); - auto Binder = CodeGenFunction::OpaqueValueMappingData::bind(CGF, S.getOpaqueValue(), E); auto UnbindOnExit = llvm::make_scope_exit([&] { Binder.unbind(CGF); }); @@ -217,7 +210,12 @@ static RValue emitSuspendExpression(CodeGenFunction &C // Emit await_resume expression. CGF.EmitBlock(ReadyBlock); - return CGF.EmitAnyExpr(S.getResumeExpr(), aggSlot, ignoreResult); + LValueOrRValue Res; + if (forLValue) + Res.LV = CGF.EmitLValue(S.getResumeExpr()); + else + Res.RV = CGF.EmitAnyExpr(S.getResumeExpr(), aggSlot, ignoreResult); + return Res; } RValue CodeGenFunction::EmitCoawaitExpr(const CoawaitExpr &E, @@ -225,19 +223,51 @@ RValue CodeGenFunction::EmitCoawaitExpr(const CoawaitE bool ignoreResult) { return emitSuspendExpression(*this, *CurCoro.Data, E, CurCoro.Data->CurrentAwaitKind, aggSlot, - ignoreResult); + ignoreResult, /*forLValue*/false).RV; } RValue CodeGenFunction::EmitCoyieldExpr(const CoyieldExpr &E, AggValueSlot aggSlot, bool ignoreResult) { return emitSuspendExpression(*this, *CurCoro.Data, E, AwaitKind::Yield, - aggSlot, ignoreResult); + aggSlot, ignoreResult, /*forLValue*/false).RV; } void CodeGenFunction::EmitCoreturnStmt(CoreturnStmt const &S) { ++CurCoro.Data->CoreturnCount; EmitStmt(S.getPromiseCall()); EmitBranchThroughCleanup(CurCoro.Data->FinalJD); +} + + +#ifndef NDEBUG +static QualType getCoroutineSuspendExprReturnType(const ASTContext &Ctx, + const CoroutineSuspendExpr *E) { + const auto *RE = E->getResumeExpr(); + // Is it possible for RE to be a CXXBindTemporaryExpr wrapping + // a MemberCallExpr? + assert(isa(RE) && "unexpected suspend expression type"); + return cast(RE)->getCallReturnType(Ctx); +} +#endif + +LValue +CodeGenFunction::EmitCoawaitLValue(const CoawaitExpr *E) { + assert(getCoroutineSuspendExprReturnType(getContext(), E)->isReferenceType() && + "Can't have a scalar return unless the return type is a " + "reference type!"); + return emitSuspendExpression(*this, *CurCoro.Data, *E, + CurCoro.Data->CurrentAwaitKind, AggValueSlot::ignored(), + /*ignoreResult*/false, /*forLValue*/true).LV; +} + +LValue +CodeGenFunction::EmitCoyieldLValue(const CoyieldExpr *E) { + assert(getCoroutineSuspendExprReturnType(getContext(), E)->isReferenceType() && + "Can't have a scalar return unless the return type is a " + "reference type!"); + return emitSuspendExpression(*this, *CurCoro.Data, *E, + AwaitKind::Yield, AggValueSlot::ignored(), + /*ignoreResult*/false, /*forLValue*/true).LV; } // Hunts for the parameter reference in the parameter copy/move declaration. Modified: vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -1041,7 +1041,13 @@ llvm::DIType *CGDebugInfo::createBitFieldType(const Fi assert(SizeInBits > 0 && "found named 0-width bitfield"); uint64_t StorageOffsetInBits = CGM.getContext().toBits(BitFieldInfo.StorageOffset); - uint64_t OffsetInBits = StorageOffsetInBits + BitFieldInfo.Offset; + uint64_t Offset = BitFieldInfo.Offset; + // The bit offsets for big endian machines are reversed for big + // endian target, compensate for that as the DIDerivedType requires + // un-reversed offsets. + if (CGM.getDataLayout().isBigEndian()) + Offset = BitFieldInfo.StorageSize - BitFieldInfo.Size - Offset; + uint64_t OffsetInBits = StorageOffsetInBits + Offset; llvm::DINode::DIFlags Flags = getAccessFlag(BitFieldDecl->getAccess(), RD); return DBuilder.createBitFieldMemberType( RecordTy, Name, File, Line, SizeInBits, OffsetInBits, StorageOffsetInBits, @@ -3484,13 +3490,13 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, llvm: if (VD->hasAttr()) { // Here, we need an offset *into* the alloca. CharUnits offset = CharUnits::fromQuantity(32); - Expr.push_back(llvm::dwarf::DW_OP_plus); + Expr.push_back(llvm::dwarf::DW_OP_plus_uconst); // offset of __forwarding field offset = CGM.getContext().toCharUnitsFromBits( CGM.getTarget().getPointerWidth(0)); Expr.push_back(offset.getQuantity()); Expr.push_back(llvm::dwarf::DW_OP_deref); - Expr.push_back(llvm::dwarf::DW_OP_plus); + Expr.push_back(llvm::dwarf::DW_OP_plus_uconst); // offset of x field offset = CGM.getContext().toCharUnitsFromBits(XOffset); Expr.push_back(offset.getQuantity()); @@ -3599,17 +3605,17 @@ void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable( SmallVector addr; addr.push_back(llvm::dwarf::DW_OP_deref); - addr.push_back(llvm::dwarf::DW_OP_plus); + addr.push_back(llvm::dwarf::DW_OP_plus_uconst); addr.push_back(offset.getQuantity()); if (isByRef) { addr.push_back(llvm::dwarf::DW_OP_deref); - addr.push_back(llvm::dwarf::DW_OP_plus); + addr.push_back(llvm::dwarf::DW_OP_plus_uconst); // offset of __forwarding field offset = CGM.getContext().toCharUnitsFromBits(target.getPointerSizeInBits(0)); addr.push_back(offset.getQuantity()); addr.push_back(llvm::dwarf::DW_OP_deref); - addr.push_back(llvm::dwarf::DW_OP_plus); + addr.push_back(llvm::dwarf::DW_OP_plus_uconst); // offset of x field offset = CGM.getContext().toCharUnitsFromBits(XOffset); addr.push_back(offset.getQuantity()); Modified: vendor/clang/dist/lib/CodeGen/CGExpr.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGExpr.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/CodeGen/CGExpr.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -549,6 +549,11 @@ void CodeGenFunction::EmitTypeCheck(TypeCheckKind TCK, if (Ptr->getType()->getPointerAddressSpace()) return; + // Don't check pointers to volatile data. The behavior here is implementation- + // defined. + if (Ty.isVolatileQualified()) + return; + SanitizerScope SanScope(this); SmallVector, 3> Checks; @@ -1158,6 +1163,11 @@ LValue CodeGenFunction::EmitLValue(const Expr *E) { case Expr::MaterializeTemporaryExprClass: return EmitMaterializeTemporaryExpr(cast(E)); + + case Expr::CoawaitExprClass: + return EmitCoawaitLValue(cast(E)); + case Expr::CoyieldExprClass: + return EmitCoyieldLValue(cast(E)); } } @@ -3002,10 +3012,11 @@ static llvm::Value *emitArraySubscriptGEP(CodeGenFunct llvm::Value *ptr, ArrayRef indices, bool inbounds, + bool signedIndices, SourceLocation loc, const llvm::Twine &name = "arrayidx") { if (inbounds) { - return CGF.EmitCheckedInBoundsGEP(ptr, indices, loc, name); + return CGF.EmitCheckedInBoundsGEP(ptr, indices, signedIndices, loc, name); } else { return CGF.Builder.CreateGEP(ptr, indices, name); } @@ -3038,7 +3049,7 @@ static QualType getFixedSizeElementType(const ASTConte static Address emitArraySubscriptGEP(CodeGenFunction &CGF, Address addr, ArrayRef indices, QualType eltType, bool inbounds, - SourceLocation loc, + bool signedIndices, SourceLocation loc, const llvm::Twine &name = "arrayidx") { // All the indices except that last must be zero. #ifndef NDEBUG @@ -3058,8 +3069,8 @@ static Address emitArraySubscriptGEP(CodeGenFunction & CharUnits eltAlign = getArrayElementAlign(addr.getAlignment(), indices.back(), eltSize); - llvm::Value *eltPtr = - emitArraySubscriptGEP(CGF, addr.getPointer(), indices, inbounds, loc, name); + llvm::Value *eltPtr = emitArraySubscriptGEP( + CGF, addr.getPointer(), indices, inbounds, signedIndices, loc, name); return Address(eltPtr, eltAlign); } @@ -3069,6 +3080,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A // in lexical order (this complexity is, sadly, required by C++17). llvm::Value *IdxPre = (E->getLHS() == E->getIdx()) ? EmitScalarExpr(E->getIdx()) : nullptr; + bool SignedIndices = false; auto EmitIdxAfterBase = [&, IdxPre](bool Promote) -> llvm::Value * { auto *Idx = IdxPre; if (E->getLHS() != E->getIdx()) { @@ -3078,6 +3090,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A QualType IdxTy = E->getIdx()->getType(); bool IdxSigned = IdxTy->isSignedIntegerOrEnumerationType(); + SignedIndices |= IdxSigned; if (SanOpts.has(SanitizerKind::ArrayBounds)) EmitBoundsCheck(E, E->getBase(), Idx, IdxTy, Accessed); @@ -3113,7 +3126,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A QualType EltType = LV.getType()->castAs()->getElementType(); Addr = emitArraySubscriptGEP(*this, Addr, Idx, EltType, /*inbounds*/ true, - E->getExprLoc()); + SignedIndices, E->getExprLoc()); return MakeAddrLValue(Addr, EltType, LV.getBaseInfo()); } @@ -3142,7 +3155,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A Addr = emitArraySubscriptGEP(*this, Addr, Idx, vla->getElementType(), !getLangOpts().isSignedOverflowDefined(), - E->getExprLoc()); + SignedIndices, E->getExprLoc()); } else if (const ObjCObjectType *OIT = E->getType()->getAs()){ // Indexing over an interface, as in "NSString *P; P[4];" @@ -3167,8 +3180,9 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A // Do the GEP. CharUnits EltAlign = getArrayElementAlign(Addr.getAlignment(), Idx, InterfaceSize); - llvm::Value *EltPtr = emitArraySubscriptGEP( - *this, Addr.getPointer(), ScaledIdx, false, E->getExprLoc()); + llvm::Value *EltPtr = + emitArraySubscriptGEP(*this, Addr.getPointer(), ScaledIdx, false, + SignedIndices, E->getExprLoc()); Addr = Address(EltPtr, EltAlign); // Cast back. @@ -3190,11 +3204,10 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A auto *Idx = EmitIdxAfterBase(/*Promote*/true); // Propagate the alignment from the array itself to the result. - Addr = emitArraySubscriptGEP(*this, ArrayLV.getAddress(), - {CGM.getSize(CharUnits::Zero()), Idx}, - E->getType(), - !getLangOpts().isSignedOverflowDefined(), - E->getExprLoc()); + Addr = emitArraySubscriptGEP( + *this, ArrayLV.getAddress(), {CGM.getSize(CharUnits::Zero()), Idx}, + E->getType(), !getLangOpts().isSignedOverflowDefined(), SignedIndices, + E->getExprLoc()); BaseInfo = ArrayLV.getBaseInfo(); } else { // The base must be a pointer; emit it with an estimate of its alignment. @@ -3202,7 +3215,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A auto *Idx = EmitIdxAfterBase(/*Promote*/true); Addr = emitArraySubscriptGEP(*this, Addr, Idx, E->getType(), !getLangOpts().isSignedOverflowDefined(), - E->getExprLoc()); + SignedIndices, E->getExprLoc()); } LValue LV = MakeAddrLValue(Addr, E->getType(), BaseInfo); @@ -3375,7 +3388,7 @@ LValue CodeGenFunction::EmitOMPArraySectionExpr(const Idx = Builder.CreateNSWMul(Idx, NumElements); EltPtr = emitArraySubscriptGEP(*this, Base, Idx, VLA->getElementType(), !getLangOpts().isSignedOverflowDefined(), - E->getExprLoc()); + /*SignedIndices=*/false, E->getExprLoc()); } else if (const Expr *Array = isSimpleArrayDecayOperand(E->getBase())) { // If this is A[i] where A is an array, the frontend will have decayed the // base to be a ArrayToPointerDecay implicit cast. While correct, it is @@ -3395,14 +3408,14 @@ LValue CodeGenFunction::EmitOMPArraySectionExpr(const EltPtr = emitArraySubscriptGEP( *this, ArrayLV.getAddress(), {CGM.getSize(CharUnits::Zero()), Idx}, ResultExprTy, !getLangOpts().isSignedOverflowDefined(), - E->getExprLoc()); + /*SignedIndices=*/false, E->getExprLoc()); BaseInfo = ArrayLV.getBaseInfo(); } else { Address Base = emitOMPArraySectionBase(*this, E->getBase(), BaseInfo, BaseTy, ResultExprTy, IsLowerBound); EltPtr = emitArraySubscriptGEP(*this, Base, Idx, ResultExprTy, !getLangOpts().isSignedOverflowDefined(), - E->getExprLoc()); + /*SignedIndices=*/false, E->getExprLoc()); } return MakeAddrLValue(EltPtr, ResultExprTy, BaseInfo); Modified: vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp Fri Jun 16 21:03:31 2017 (r320014) +++ vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp Fri Jun 16 21:03:44 2017 (r320015) @@ -1851,6 +1851,7 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const Unary llvm::Value *input; int amount = (isInc ? 1 : -1); + bool signedIndex = !isInc; if (const AtomicType *atomicTy = type->getAs()) { type = atomicTy->getValueType(); @@ -1940,8 +1941,8 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const Unary if (CGF.getLangOpts().isSignedOverflowDefined()) value = Builder.CreateGEP(value, numElts, "vla.inc"); else - value = CGF.EmitCheckedInBoundsGEP(value, numElts, E->getExprLoc(), - "vla.inc"); + value = CGF.EmitCheckedInBoundsGEP(value, numElts, signedIndex, + E->getExprLoc(), "vla.inc"); // Arithmetic on function pointers (!) is just +-1. } else if (type->isFunctionType()) { @@ -1951,8 +1952,8 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const Unary if (CGF.getLangOpts().isSignedOverflowDefined()) value = Builder.CreateGEP(value, amt, "incdec.funcptr"); else - value = CGF.EmitCheckedInBoundsGEP(value, amt, E->getExprLoc(), - "incdec.funcptr"); + value = CGF.EmitCheckedInBoundsGEP(value, amt, signedIndex, + E->getExprLoc(), "incdec.funcptr"); value = Builder.CreateBitCast(value, input->getType()); // For everything else, we can just do a simple increment. @@ -1961,8 +1962,8 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const Unary if (CGF.getLangOpts().isSignedOverflowDefined()) value = Builder.CreateGEP(value, amt, "incdec.ptr"); else - value = CGF.EmitCheckedInBoundsGEP(value, amt, E->getExprLoc(), - "incdec.ptr"); + value = CGF.EmitCheckedInBoundsGEP(value, amt, signedIndex, + E->getExprLoc(), "incdec.ptr"); } // Vector increment/decrement. @@ -2043,8 +2044,8 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const Unary if (CGF.getLangOpts().isSignedOverflowDefined()) value = Builder.CreateGEP(value, sizeValue, "incdec.objptr"); else - value = CGF.EmitCheckedInBoundsGEP(value, sizeValue, E->getExprLoc(), - "incdec.objptr"); + value = CGF.EmitCheckedInBoundsGEP(value, sizeValue, signedIndex, + E->getExprLoc(), "incdec.objptr"); value = Builder.CreateBitCast(value, input->getType()); } @@ -2661,13 +2662,15 @@ static Value *emitPointerArithmetic(CodeGenFunction &C std::swap(pointerOperand, indexOperand); } + bool isSigned = indexOperand->getType()->isSignedIntegerOrEnumerationType(); + bool mayHaveNegativeGEPIndex = isSigned || isSubtraction; + unsigned width = cast(index->getType())->getBitWidth(); auto &DL = CGF.CGM.getDataLayout(); auto PtrTy = cast(pointer->getType()); if (width != DL.getTypeSizeInBits(PtrTy)) { // Zero-extend or sign-extend the pointer value according to // whether the index is signed or not. - bool isSigned = indexOperand->getType()->isSignedIntegerOrEnumerationType(); index = CGF.Builder.CreateIntCast(index, DL.getIntPtrType(PtrTy), isSigned, "idx.ext"); } @@ -2711,8 +2714,9 @@ static Value *emitPointerArithmetic(CodeGenFunction &C pointer = CGF.Builder.CreateGEP(pointer, index, "add.ptr"); } else { index = CGF.Builder.CreateNSWMul(index, numElements, "vla.index"); - pointer = CGF.EmitCheckedInBoundsGEP(pointer, index, op.E->getExprLoc(), - "add.ptr"); + pointer = + CGF.EmitCheckedInBoundsGEP(pointer, index, mayHaveNegativeGEPIndex, + op.E->getExprLoc(), "add.ptr"); } return pointer; } @@ -2729,8 +2733,8 @@ static Value *emitPointerArithmetic(CodeGenFunction &C if (CGF.getLangOpts().isSignedOverflowDefined()) return CGF.Builder.CreateGEP(pointer, index, "add.ptr"); - return CGF.EmitCheckedInBoundsGEP(pointer, index, op.E->getExprLoc(), - "add.ptr"); + return CGF.EmitCheckedInBoundsGEP(pointer, index, mayHaveNegativeGEPIndex, + op.E->getExprLoc(), "add.ptr"); } // Construct an fmuladd intrinsic to represent a fused mul-add of MulOp and @@ -3848,6 +3852,7 @@ LValue CodeGenFunction::EmitCompoundAssignmentLValue( Value *CodeGenFunction::EmitCheckedInBoundsGEP(Value *Ptr, ArrayRef IdxList, + bool SignedIndices, SourceLocation Loc, const Twine &Name) { Value *GEPVal = Builder.CreateInBoundsGEP(Ptr, IdxList, Name); @@ -3905,7 +3910,7 @@ Value *CodeGenFunction::EmitCheckedInBoundsGEP(Value * auto *ResultAndOverflow = Builder.CreateCall( (Opcode == BO_Add) ? SAddIntrinsic : SMulIntrinsic, {LHS, RHS}); OffsetOverflows = Builder.CreateOr( - OffsetOverflows, Builder.CreateExtractValue(ResultAndOverflow, 1)); + Builder.CreateExtractValue(ResultAndOverflow, 1), OffsetOverflows); return Builder.CreateExtractValue(ResultAndOverflow, 0); }; @@ -3951,12 +3956,18 @@ Value *CodeGenFunction::EmitCheckedInBoundsGEP(Value * // 1) The total offset doesn't overflow, and // 2) The sign of the difference between the computed address and the base // pointer matches the sign of the total offset. - llvm::Value *PosOrZeroValid = Builder.CreateICmpUGE(ComputedGEP, IntPtr); - llvm::Value *NegValid = Builder.CreateICmpULT(ComputedGEP, IntPtr); - auto *PosOrZeroOffset = Builder.CreateICmpSGE(TotalOffset, Zero); - llvm::Value *ValidGEP = Builder.CreateAnd( - Builder.CreateNot(OffsetOverflows), - Builder.CreateSelect(PosOrZeroOffset, PosOrZeroValid, NegValid)); + llvm::Value *ValidGEP; + auto *NoOffsetOverflow = Builder.CreateNot(OffsetOverflows); + auto *PosOrZeroValid = Builder.CreateICmpUGE(ComputedGEP, IntPtr); + if (SignedIndices) { + auto *PosOrZeroOffset = Builder.CreateICmpSGE(TotalOffset, Zero); + llvm::Value *NegValid = Builder.CreateICmpULT(ComputedGEP, IntPtr); + ValidGEP = Builder.CreateAnd( *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 16 21:03:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE4BCD891C9; Fri, 16 Jun 2017 21:03:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84F1A6F605; Fri, 16 Jun 2017 21:03:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL3o6J063514; Fri, 16 Jun 2017 21:03:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL3odq063513; Fri, 16 Jun 2017 21:03:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162103.v5GL3odq063513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320016 - vendor/clang/clang-trunk-r305575 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:03:51 -0000 Author: dim Date: Fri Jun 16 21:03:50 2017 New Revision: 320016 URL: https://svnweb.freebsd.org/changeset/base/320016 Log: Tag clang trunk r305575. Added: vendor/clang/clang-trunk-r305575/ - copied from r320015, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Fri Jun 16 21:04:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 626ECD89235; Fri, 16 Jun 2017 21:04:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AED86F6F0; Fri, 16 Jun 2017 21:04:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL40rM063643; Fri, 16 Jun 2017 21:04:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL40Wh063642; Fri, 16 Jun 2017 21:04:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162104.v5GL40Wh063642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320018 - vendor/compiler-rt/compiler-rt-trunk-r305575 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:04:01 -0000 Author: dim Date: Fri Jun 16 21:04:00 2017 New Revision: 320018 URL: https://svnweb.freebsd.org/changeset/base/320018 Log: Tag compiler-rt trunk r305575. Added: vendor/compiler-rt/compiler-rt-trunk-r305575/ - copied from r320017, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Fri Jun 16 21:03:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5870D891FC; Fri, 16 Jun 2017 21:03:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 967F36F696; Fri, 16 Jun 2017 21:03:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL3uki063592; Fri, 16 Jun 2017 21:03:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL3rvO063560; Fri, 16 Jun 2017 21:03:53 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162103.v5GL3rvO063560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320017 - in vendor/compiler-rt/dist: lib/asan lib/sanitizer_common lib/tsan/rtl lib/ubsan test/asan/TestCases/Linux test/asan/TestCases/Posix test/cfi/cross-dso test/cfi/cross-dso/ical... 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:03:58 -0000 Author: dim Date: Fri Jun 16 21:03:53 2017 New Revision: 320017 URL: https://svnweb.freebsd.org/changeset/base/320017 Log: Vendor import of compiler-rt trunk r305575: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305575 Added: vendor/compiler-rt/dist/test/asan/TestCases/Linux/allocator_oom_test.cc (contents, props changed) vendor/compiler-rt/dist/test/cfi/icall/wrong-signature-mixed-lto.c (contents, props changed) vendor/compiler-rt/dist/test/tsan/custom_mutex3.cc (contents, props changed) vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/unsigned-index-expression.cpp (contents, props changed) vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/Linux/ vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/Linux/PR33221.cpp (contents, props changed) vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg vendor/compiler-rt/dist/test/xray/TestCases/Linux/arg1-logging-implicit-this.cc (contents, props changed) Modified: vendor/compiler-rt/dist/lib/asan/asan_allocator.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_combined.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_secondary.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_sync.h vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash_itanium.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/allow_user_segv.cc vendor/compiler-rt/dist/test/cfi/cross-dso/icall/lit.local.cfg vendor/compiler-rt/dist/test/cfi/cross-dso/stats.cpp vendor/compiler-rt/dist/test/cfi/icall/lit.local.cfg vendor/compiler-rt/dist/test/tsan/custom_mutex.h vendor/compiler-rt/dist/test/tsan/custom_mutex0.cc vendor/compiler-rt/dist/test/tsan/custom_mutex1.cc vendor/compiler-rt/dist/test/tsan/custom_mutex2.cc vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/PR33221.cpp Modified: vendor/compiler-rt/dist/lib/asan/asan_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_allocator.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/asan/asan_allocator.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -235,6 +235,8 @@ struct Allocator { AllocatorCache fallback_allocator_cache; QuarantineCache fallback_quarantine_cache; + atomic_uint8_t rss_limit_exceeded; + // ------------------- Options -------------------------- atomic_uint16_t min_redzone; atomic_uint16_t max_redzone; @@ -268,6 +270,14 @@ struct Allocator { SharedInitCode(options); } + bool RssLimitExceeded() { + return atomic_load(&rss_limit_exceeded, memory_order_relaxed); + } + + void SetRssLimitExceeded(bool limit_exceeded) { + atomic_store(&rss_limit_exceeded, limit_exceeded, memory_order_relaxed); + } + void RePoisonChunk(uptr chunk) { // This could be a user-facing chunk (with redzones), or some internal // housekeeping chunk, like TransferBatch. Start by assuming the former. @@ -363,6 +373,8 @@ struct Allocator { AllocType alloc_type, bool can_fill) { if (UNLIKELY(!asan_inited)) AsanInitFromRtl(); + if (RssLimitExceeded()) + return allocator.ReturnNullOrDieOnOOM(); Flags &fl = *flags(); CHECK(stack); const uptr min_alignment = SHADOW_GRANULARITY; @@ -400,16 +412,15 @@ struct Allocator { AsanThread *t = GetCurrentThread(); void *allocated; - bool check_rss_limit = true; if (t) { AllocatorCache *cache = GetAllocatorCache(&t->malloc_storage()); allocated = - allocator.Allocate(cache, needed_size, 8, false, check_rss_limit); + allocator.Allocate(cache, needed_size, 8, false); } else { SpinMutexLock l(&fallback_mutex); AllocatorCache *cache = &fallback_allocator_cache; allocated = - allocator.Allocate(cache, needed_size, 8, false, check_rss_limit); + allocator.Allocate(cache, needed_size, 8, false); } if (!allocated) return allocator.ReturnNullOrDieOnOOM(); @@ -866,8 +877,8 @@ void asan_mz_force_unlock() { instance.ForceUnlock(); } -void AsanSoftRssLimitExceededCallback(bool exceeded) { - instance.allocator.SetRssLimitIsExceeded(exceeded); +void AsanSoftRssLimitExceededCallback(bool limit_exceeded) { + instance.SetRssLimitExceeded(limit_exceeded); } } // namespace __asan Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_combined.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_combined.h Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_combined.h Fri Jun 16 21:03:53 2017 (r320017) @@ -43,12 +43,12 @@ class CombinedAllocator { } void *Allocate(AllocatorCache *cache, uptr size, uptr alignment, - bool cleared = false, bool check_rss_limit = false) { + bool cleared = false) { // Returning 0 on malloc(0) may break a lot of code. if (size == 0) size = 1; - if (size + alignment < size) return ReturnNullOrDieOnBadRequest(); - if (check_rss_limit && RssLimitIsExceeded()) return ReturnNullOrDieOnOOM(); + if (size + alignment < size) + return ReturnNullOrDieOnBadRequest(); uptr original_size = size; // If alignment requirements are to be fulfilled by the frontend allocator // rather than by the primary or secondary, passing an alignment lower than @@ -89,7 +89,8 @@ class CombinedAllocator { } void *ReturnNullOrDieOnOOM() { - if (MayReturnNull()) return nullptr; + if (MayReturnNull()) + return nullptr; ReportAllocatorCannotReturnNull(true); } @@ -106,15 +107,6 @@ class CombinedAllocator { primary_.SetReleaseToOSIntervalMs(release_to_os_interval_ms); } - bool RssLimitIsExceeded() { - return atomic_load(&rss_limit_is_exceeded_, memory_order_acquire); - } - - void SetRssLimitIsExceeded(bool rss_limit_is_exceeded) { - atomic_store(&rss_limit_is_exceeded_, rss_limit_is_exceeded, - memory_order_release); - } - void Deallocate(AllocatorCache *cache, void *p) { if (!p) return; if (primary_.PointerIsMine(p)) @@ -228,6 +220,5 @@ class CombinedAllocator { SecondaryAllocator secondary_; AllocatorGlobalStats stats_; atomic_uint8_t may_return_null_; - atomic_uint8_t rss_limit_is_exceeded_; }; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_secondary.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_secondary.h Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_secondary.h Fri Jun 16 21:03:53 2017 (r320017) @@ -36,9 +36,12 @@ class LargeMmapAllocator { if (alignment > page_size_) map_size += alignment; // Overflow. - if (map_size < size) return ReturnNullOrDieOnBadRequest(); + if (map_size < size) + return ReturnNullOrDieOnBadRequest(); uptr map_beg = reinterpret_cast( - MmapOrDie(map_size, "LargeMmapAllocator")); + MmapOrDieOnFatalError(map_size, "LargeMmapAllocator")); + if (!map_beg) + return ReturnNullOrDieOnOOM(); CHECK(IsAligned(map_beg, page_size_)); MapUnmapCallback().OnMap(map_beg, map_size); uptr map_end = map_beg + map_size; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h Fri Jun 16 21:03:53 2017 (r320017) @@ -85,6 +85,9 @@ INLINE void *MmapOrDieQuietly(uptr size, const char *m return MmapOrDie(size, mem_type, /*raw_report*/ true); } void UnmapOrDie(void *addr, uptr size); +// Behaves just like MmapOrDie, but tolerates out of memory condition, in that +// case returns nullptr. +void *MmapOrDieOnFatalError(uptr size, const char *mem_type); void *MmapFixedNoReserve(uptr fixed_addr, uptr size, const char *name = nullptr); void *MmapNoReserveOrDie(uptr size, const char *mem_type); Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Fri Jun 16 21:03:53 2017 (r320017) @@ -93,6 +93,9 @@ COMMON_FLAG(HandleSignalMode, handle_sigill, kHandleSi COMMON_FLAG(HandleSignalMode, handle_sigfpe, kHandleSignalYes, COMMON_FLAG_HANDLE_SIGNAL_HELP(SIGFPE)) #undef COMMON_FLAG_HANDLE_SIGNAL_HELP +COMMON_FLAG(bool, allow_user_segv_handler, true, + "Deprecated. True has no effect, use handle_sigbus=1. If false, " + "handle_*=1 will be upgraded to handle_*=2.") COMMON_FLAG(bool, use_sigaltstack, true, "If set, uses alternate stack for signal handling.") COMMON_FLAG(bool, detect_deadlocks, false, Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -1396,7 +1396,7 @@ AndroidApiLevel AndroidGetApiLevel() { #endif -HandleSignalMode GetHandleSignalMode(int signum) { +static HandleSignalMode GetHandleSignalModeImpl(int signum) { switch (signum) { case SIGABRT: return common_flags()->handle_abort; @@ -1410,6 +1410,13 @@ HandleSignalMode GetHandleSignalMode(int signum) { return common_flags()->handle_sigbus; } return kHandleSignalNo; +} + +HandleSignalMode GetHandleSignalMode(int signum) { + HandleSignalMode result = GetHandleSignalModeImpl(signum); + if (result == kHandleSignalYes && !common_flags()->allow_user_segv_handler) + return kHandleSignalExclusive; + return result; } #if !SANITIZER_GO Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -113,7 +113,6 @@ void GetThreadStackTopAndBottom(bool at_initialization my_pthread_attr_getstack(&attr, &stackaddr, &stacksize); pthread_attr_destroy(&attr); - CHECK_LE(stacksize, kMaxThreadStackSize); // Sanity check. *stack_top = (uptr)stackaddr + stacksize; *stack_bottom = (uptr)stackaddr; } Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -414,10 +414,7 @@ void ListOfModules::init() { memory_mapping.DumpListOfModules(&modules_); } -HandleSignalMode GetHandleSignalMode(int signum) { - // Handling fatal signals on watchOS and tvOS devices is disallowed. - if ((SANITIZER_WATCHOS || SANITIZER_TVOS) && !(SANITIZER_IOSSIM)) - return kHandleSignalNo; +static HandleSignalMode GetHandleSignalModeImpl(int signum) { switch (signum) { case SIGABRT: return common_flags()->handle_abort; @@ -431,6 +428,16 @@ HandleSignalMode GetHandleSignalMode(int signum) { return common_flags()->handle_sigbus; } return kHandleSignalNo; +} + +HandleSignalMode GetHandleSignalMode(int signum) { + // Handling fatal signals on watchOS and tvOS devices is disallowed. + if ((SANITIZER_WATCHOS || SANITIZER_TVOS) && !(SANITIZER_IOSSIM)) + return kHandleSignalNo; + HandleSignalMode result = GetHandleSignalModeImpl(signum); + if (result == kHandleSignalYes && !common_flags()->allow_user_segv_handler) + return kHandleSignalExclusive; + return result; } MacosVersion cached_macos_version = MACOS_VERSION_UNINITIALIZED; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -22,6 +22,7 @@ #include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" +#include #include #include #include @@ -143,6 +144,21 @@ void UnmapOrDie(void *addr, uptr size) { CHECK("unable to unmap" && 0); } DecreaseTotalMmap(size); +} + +void *MmapOrDieOnFatalError(uptr size, const char *mem_type) { + size = RoundUpTo(size, GetPageSizeCached()); + uptr res = internal_mmap(nullptr, size, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANON, -1, 0); + int reserrno; + if (internal_iserror(res, &reserrno)) { + if (reserrno == ENOMEM) + return nullptr; + ReportMmapFailureAndDie(size, mem_type, "allocate", reserrno); + } + IncreaseTotalMmap(size); + return (void *)res; } // We want to map a chunk of address space aligned to 'alignment'. Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -131,6 +131,16 @@ void UnmapOrDie(void *addr, uptr size) { } } +void *MmapOrDieOnFatalError(uptr size, const char *mem_type) { + void *rv = VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + if (rv == 0) { + error_t last_error = GetLastError(); + if (last_error != ERROR_NOT_ENOUGH_MEMORY) + ReportMmapFailureAndDie(size, mem_type, "allocate", last_error); + } + return rv; +} + // We want to map a chunk of address space aligned to 'alignment'. void *MmapAlignedOrDie(uptr size, uptr alignment, const char *mem_type) { CHECK(IsPowerOfTwo(size)); Modified: vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.cc ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -92,7 +92,8 @@ static const char *ReportTypeString(ReportType typ, up if (typ == ReportTypeVptrUseAfterFree) return "heap-use-after-free (virtual call vs free)"; if (typ == ReportTypeExternalRace) { - return GetReportHeaderFromTag(tag) ?: "race on external object"; + const char *str = GetReportHeaderFromTag(tag); + return str ? str : "race on external object"; } if (typ == ReportTypeThreadLeak) return "thread leak"; @@ -170,8 +171,9 @@ static void PrintMop(const ReportMop *mop, bool first) MopDesc(first, mop->write, mop->atomic), mop->size, (void *)mop->addr, thread_name(thrbuf, mop->tid)); } else { - const char *object_type = - GetObjectTypeFromTag(mop->external_tag) ?: "external object"; + const char *object_type = GetObjectTypeFromTag(mop->external_tag); + if (object_type == nullptr) + object_type = "external object"; Printf(" %s access of %s at %p by %s", ExternalMopDesc(first, mop->write), object_type, (void *)mop->addr, thread_name(thrbuf, mop->tid)); Modified: vendor/compiler-rt/dist/lib/tsan/rtl/tsan_sync.h ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/rtl/tsan_sync.h Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/tsan/rtl/tsan_sync.h Fri Jun 16 21:03:53 2017 (r320017) @@ -83,7 +83,7 @@ struct SyncVar { } bool IsFlagSet(u32 f) const { - return atomic_load_relaxed(&flags); + return atomic_load_relaxed(&flags) & f; } void SetFlags(u32 f) { Modified: vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc ============================================================================== --- vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -566,8 +566,14 @@ static void handlePointerOverflowImpl(PointerOverflowD ScopedReport R(Opts, Loc, ET); - Diag(Loc, DL_Error, "pointer index expression with base %0 overflowed to %1") - << (void *)Base << (void*)Result; + if ((sptr(Base) >= 0) == (sptr(Result) >= 0)) + Diag(Loc, DL_Error, "unsigned pointer index expression result is %0, " + "preceding its base %1") + << (void *)Result << (void *)Base; + else + Diag(Loc, DL_Error, + "pointer index expression with base %0 overflowed to %1") + << (void *)Base << (void *)Result; } void __ubsan::__ubsan_handle_pointer_overflow(PointerOverflowData *Data, Modified: vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash_itanium.cc ============================================================================== --- vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash_itanium.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash_itanium.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -197,9 +197,9 @@ struct VtablePrefix { }; VtablePrefix *getVtablePrefix(void *Vtable) { VtablePrefix *Vptr = reinterpret_cast(Vtable); - if (!IsAccessibleMemoryRange((uptr)Vptr, sizeof(VtablePrefix))) - return nullptr; VtablePrefix *Prefix = Vptr - 1; + if (!IsAccessibleMemoryRange((uptr)Prefix, sizeof(VtablePrefix))) + return nullptr; if (!Prefix->TypeInfo) // This can't possibly be a valid vtable. return nullptr; Added: vendor/compiler-rt/dist/test/asan/TestCases/Linux/allocator_oom_test.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/asan/TestCases/Linux/allocator_oom_test.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -0,0 +1,82 @@ +// Test the behavior of malloc/calloc/realloc when the allocation causes OOM +// in the secondary allocator. +// By default (allocator_may_return_null=0) the process should crash. +// With allocator_may_return_null=1 the allocator should return 0. +// Set the limit to 20.5T on 64 bits to account for ASan shadow memory, +// allocator buffers etc. so that the test allocation of ~1T will trigger OOM. +// Limit this test to Linux since we're relying on allocator internal +// limits (shadow memory size, allocation limits etc.) + +// RUN: %clangxx_asan -O0 %s -o %t +// RUN: ulimit -v 22024290304 +// RUN: not %run %t malloc 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC,CHECK-CRASH +// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t malloc 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC,CHECK-CRASH +// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t malloc 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC,CHECK-NULL +// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t calloc 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK-CALLOC,CHECK-CRASH +// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t calloc 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK-CALLOC,CHECK-NULL +// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t realloc 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK-REALLOC,CHECK-CRASH +// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t realloc 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK-REALLOC,CHECK-NULL +// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC-REALLOC,CHECK-CRASH +// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t realloc-after-malloc 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC-REALLOC,CHECK-NULL + +#include +#include +#include +#include + +int main(int argc, char **argv) { + assert(argc == 2); + const char *action = argv[1]; + fprintf(stderr, "%s:\n", action); + + // Allocate just a bit less than max allocation size enforced by ASan's + // allocator (currently 1T and 3G). + const size_t size = +#if __LP64__ + (1ULL << 40) - (1ULL << 30); +#else + (3ULL << 30) - (1ULL << 20); +#endif + + void *x = 0; + + if (!strcmp(action, "malloc")) { + x = malloc(size); + } else if (!strcmp(action, "calloc")) { + x = calloc(size / 4, 4); + } else if (!strcmp(action, "realloc")) { + x = realloc(0, size); + } else if (!strcmp(action, "realloc-after-malloc")) { + char *t = (char*)malloc(100); + *t = 42; + x = realloc(t, size); + assert(*t == 42); + free(t); + } else { + assert(0); + } + + // The NULL pointer is printed differently on different systems, while (long)0 + // is always the same. + fprintf(stderr, "x: %lx\n", (long)x); + free(x); + + return x != 0; +} + +// CHECK-MALLOC: malloc: +// CHECK-CALLOC: calloc: +// CHECK-REALLOC: realloc: +// CHECK-MALLOC-REALLOC: realloc-after-malloc: + +// CHECK-CRASH: AddressSanitizer's allocator is terminating the process +// CHECK-NULL: x: 0 Modified: vendor/compiler-rt/dist/test/asan/TestCases/Posix/allow_user_segv.cc ============================================================================== --- vendor/compiler-rt/dist/test/asan/TestCases/Posix/allow_user_segv.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/test/asan/TestCases/Posix/allow_user_segv.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -10,6 +10,14 @@ // RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=handle_segv=2 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %clangxx_asan -O2 %s -o %t && %env_asan_opts=handle_segv=2 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=handle_segv=0:allow_user_segv_handler=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=handle_segv=1:allow_user_segv_handler=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=handle_segv=2:allow_user_segv_handler=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 + +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=handle_segv=0:allow_user_segv_handler=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=handle_segv=1:allow_user_segv_handler=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=handle_segv=2:allow_user_segv_handler=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 + #include #include #include Modified: vendor/compiler-rt/dist/test/cfi/cross-dso/icall/lit.local.cfg ============================================================================== --- vendor/compiler-rt/dist/test/cfi/cross-dso/icall/lit.local.cfg Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/test/cfi/cross-dso/icall/lit.local.cfg Fri Jun 16 21:03:53 2017 (r320017) @@ -1,6 +1,3 @@ # The cfi-icall checker is only supported on x86 and x86_64 for now. if config.root.host_arch not in ['x86', 'x86_64']: config.unsupported = True - -if config.root.use_thinlto: - config.unsupported = True Modified: vendor/compiler-rt/dist/test/cfi/cross-dso/stats.cpp ============================================================================== --- vendor/compiler-rt/dist/test/cfi/cross-dso/stats.cpp Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/test/cfi/cross-dso/stats.cpp Fri Jun 16 21:03:53 2017 (r320017) @@ -5,7 +5,6 @@ // CFI-icall is not implemented in thinlto mode => ".cfi" suffixes are missing // in sanstats output. -// XFAIL: thinlto struct ABase {}; Modified: vendor/compiler-rt/dist/test/cfi/icall/lit.local.cfg ============================================================================== --- vendor/compiler-rt/dist/test/cfi/icall/lit.local.cfg Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/test/cfi/icall/lit.local.cfg Fri Jun 16 21:03:53 2017 (r320017) @@ -1,6 +1,3 @@ # The cfi-icall checker is only supported on x86 and x86_64 for now. if config.root.host_arch not in ['x86', 'x86_64']: config.unsupported = True - -if config.use_thinlto: - config.unsupported = True Added: vendor/compiler-rt/dist/test/cfi/icall/wrong-signature-mixed-lto.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/cfi/icall/wrong-signature-mixed-lto.c Fri Jun 16 21:03:53 2017 (r320017) @@ -0,0 +1,41 @@ +// Test that the checking is done with the actual type of f() even when the +// calling module has an incorrect declaration. Test a mix of lto types. +// +// -flto below overrides -flto=thin in %clang_cfi +// RUN: %clang_cfi %s -DMODULE_A -c -o %t1_a.o +// RUN: %clang_cfi %s -DMODULE_B -c -o %t1_b.o -flto +// RUN: %clang_cfi %t1_a.o %t1_b.o -o %t1 +// RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s +// +// RUN: %clang_cfi %s -DMODULE_A -c -o %t2_a.o -flto +// RUN: %clang_cfi %s -DMODULE_B -c -o %t2_b.o +// RUN: %clang_cfi %t2_a.o %t2_b.o -o %t2 +// RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s +// +// RUN: %clang_cfi %s -DMODULE_A -c -o %t3_a.o +// RUN: %clang_cfi %s -DMODULE_B -c -o %t3_b.o +// RUN: %clang_cfi %t3_a.o %t3_b.o -o %t3 +// RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s +// +// REQUIRES: thinlto + +#include + +#if defined(MODULE_B) +int f() { + return 42; +} +#elif defined(MODULE_A) +void f(); + +int main() { + // CFI: 1 + fprintf(stderr, "1\n"); + + void (*volatile p)() = &f; + p(); + + // CFI-NOT: 2 + fprintf(stderr, "2\n"); +} +#endif Modified: vendor/compiler-rt/dist/test/tsan/custom_mutex.h ============================================================================== --- vendor/compiler-rt/dist/test/tsan/custom_mutex.h Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/test/tsan/custom_mutex.h Fri Jun 16 21:03:53 2017 (r320017) @@ -6,11 +6,11 @@ // A very primitive mutex annotated with tsan annotations. class Mutex { public: - Mutex(bool prof = true) + Mutex(bool prof, unsigned flags) : prof_(prof) , locked_(false) , seq_(0) { - __tsan_mutex_create(this, 0); + __tsan_mutex_create(this, flags); } ~Mutex() { @@ -87,5 +87,5 @@ class Mutex { } }; -Mutex Mutex::prof_mu_(false); +Mutex Mutex::prof_mu_(false, __tsan_mutex_linker_init); int Mutex::prof_data_; Modified: vendor/compiler-rt/dist/test/tsan/custom_mutex0.cc ============================================================================== --- vendor/compiler-rt/dist/test/tsan/custom_mutex0.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/test/tsan/custom_mutex0.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -4,7 +4,7 @@ // Test that custom annoations provide normal mutex synchronization // (no race reports for properly protected critical sections). -Mutex mu; +Mutex mu(true, 0); long data; void *thr(void *arg) { Modified: vendor/compiler-rt/dist/test/tsan/custom_mutex1.cc ============================================================================== --- vendor/compiler-rt/dist/test/tsan/custom_mutex1.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/test/tsan/custom_mutex1.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -3,7 +3,7 @@ // Test that failed TryLock does not induce parasitic synchronization. -Mutex mu; +Mutex mu(true, 0); long data; void *thr(void *arg) { Modified: vendor/compiler-rt/dist/test/tsan/custom_mutex2.cc ============================================================================== --- vendor/compiler-rt/dist/test/tsan/custom_mutex2.cc Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/test/tsan/custom_mutex2.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -3,7 +3,7 @@ // Test that Broadcast does not induce parasitic synchronization. -Mutex mu; +Mutex mu(true, 0); long data; void *thr(void *arg) { Added: vendor/compiler-rt/dist/test/tsan/custom_mutex3.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/tsan/custom_mutex3.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -0,0 +1,46 @@ +// RUN: %clangxx_tsan -O1 --std=c++11 %s -o %t +// RUN: %env_tsan_opts=report_destroy_locked=0 %run %t 2>&1 | FileCheck %s +#include "custom_mutex.h" + +// Regression test for a bug. +// Thr1 destroys a locked mutex, previously such mutex was not removed from +// sync map and as the result subsequent uses of a mutex located at the same +// address caused false race reports. + +Mutex mu(false, __tsan_mutex_write_reentrant); +long data; + +void *thr1(void *arg) { + mu.Lock(); + mu.~Mutex(); + new(&mu) Mutex(true, __tsan_mutex_write_reentrant); + return 0; +} + +void *thr2(void *arg) { + barrier_wait(&barrier); + mu.Lock(); + data++; + mu.Unlock(); + return 0; +} + +int main() { + barrier_init(&barrier, 2); + pthread_t th; + pthread_create(&th, 0, thr1, 0); + pthread_join(th, 0); + + barrier_init(&barrier, 2); + pthread_create(&th, 0, thr2, 0); + mu.Lock(); + data++; + mu.Unlock(); + barrier_wait(&barrier); + pthread_join(th, 0); + fprintf(stderr, "DONE\n"); + return 0; +} + +// CHECK-NOT: WARNING: ThreadSanitizer: data race +// CHECK: DONE Added: vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/unsigned-index-expression.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/unsigned-index-expression.cpp Fri Jun 16 21:03:53 2017 (r320017) @@ -0,0 +1,13 @@ +// RUN: %clangxx -fsanitize=pointer-overflow %s -o %t +// RUN: %t 2>&1 | FileCheck %s + +int main(int argc, char *argv[]) { + char c; + char *p = &c; + unsigned long long offset = -1; + + // CHECK: unsigned-index-expression.cpp:[[@LINE+1]]:15: runtime error: unsigned pointer index expression result is 0x{{.*}}, preceding its base 0x{{.*}} + char *q = p + offset; + + return 0; +} Added: vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/Linux/PR33221.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/Linux/PR33221.cpp Fri Jun 16 21:03:53 2017 (r320017) @@ -0,0 +1,50 @@ +// RUN: %clangxx -std=c++11 -frtti -fsanitize=vptr -g %s -O3 -o %t +// RUN: %run %t &> %t.log +// RUN: cat %t.log | not count 0 && FileCheck --input-file %t.log %s || cat %t.log | count 0 + +// REQUIRES: cxxabi + +#include +#include + +class Base { +public: + int i; + virtual void print() {} +}; + +class Derived : public Base { +public: + void print() {} +}; + + +int main() { + int page_size = getpagesize(); + + void *non_accessible = mmap(nullptr, page_size, PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + + if (non_accessible == MAP_FAILED) + return 0; + + void *accessible = mmap((char*)non_accessible + page_size, page_size, + PROT_READ | PROT_WRITE, + MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (accessible == MAP_FAILED) + return 0; + + char *c = new char[sizeof(Derived)]; + + // The goal is to trigger a condition when Vptr points to accessible memory, + // but VptrPrefix does not. That has been triggering SIGSEGV in UBSan code. + void **vtable_ptr = reinterpret_cast(c); + *vtable_ptr = (void*)accessible; + + Derived *list = (Derived *)c; + +// CHECK: PR33221.cpp:[[@LINE+2]]:19: runtime error: member access within address {{.*}} which does not point to an object of type 'Base' +// CHECK-NEXT: invalid vptr + int foo = list->i; + return 0; +} Added: vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg Fri Jun 16 21:03:53 2017 (r320017) @@ -0,0 +1,9 @@ +def getRoot(config): + if not config.parent: + return config + return getRoot(config.parent) + +root = getRoot(config) + +if root.host_os not in ['Linux']: + config.unsupported = True Modified: vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/PR33221.cpp ============================================================================== --- vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/PR33221.cpp Fri Jun 16 21:03:50 2017 (r320016) +++ vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/PR33221.cpp Fri Jun 16 21:03:53 2017 (r320017) @@ -18,7 +18,7 @@ class Derived : public Base { (public) int main() { char *c = new char[sizeof(Derived)]; - memset((void *)c, 0, sizeof(Derived)); + memset((void *)c, 0xFF, sizeof(Derived)); Derived *list = (Derived *)c; // CHECK: PR33221.cpp:[[@LINE+2]]:19: runtime error: member access within address {{.*}} which does not point to an object of type 'Base' Added: vendor/compiler-rt/dist/test/xray/TestCases/Linux/arg1-logging-implicit-this.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/xray/TestCases/Linux/arg1-logging-implicit-this.cc Fri Jun 16 21:03:53 2017 (r320017) @@ -0,0 +1,31 @@ +// Intercept the implicit 'this' argument of class member functions. +// +// RUN: %clangxx_xray -g -std=c++11 %s -o %t +// RUN: rm log-args-this-* || true +// RUN: XRAY_OPTIONS="patch_premain=true verbosity=1 xray_logfile_base=log-args-this-" %run %t +// +// XFAIL: arm || aarch64 || mips +// UNSUPPORTED: powerpc64le +#include "xray/xray_interface.h" +#include + +class A { + public: + [[clang::xray_always_instrument, clang::xray_log_args(1)]] void f() { + // does nothing. + } +}; + +volatile uint64_t captured = 0; + +void handler(int32_t, XRayEntryType, uint64_t arg1) { + captured = arg1; +} + +int main() { + __xray_set_handler_arg1(handler); + A instance; + instance.f(); + __xray_remove_handler_arg1(); + assert(captured == (uint64_t)&instance); +} From owner-svn-src-all@freebsd.org Fri Jun 16 21:04:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89D0ED89294; Fri, 16 Jun 2017 21:04:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF006F7B6; Fri, 16 Jun 2017 21:04:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL47Rj063716; Fri, 16 Jun 2017 21:04:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL44xh063692; Fri, 16 Jun 2017 21:04:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162104.v5GL44xh063692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320019 - in vendor/libc++/dist: benchmarks include include/experimental include/support/newlib lib src src/experimental/filesystem test/libcxx test/libcxx/algorithms/alg.modifying.oper... 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:04:08 -0000 Author: dim Date: Fri Jun 16 21:04:04 2017 New Revision: 320019 URL: https://svnweb.freebsd.org/changeset/base/320019 Log: Vendor import of libc++ trunk r305575: https://llvm.org/svn/llvm-project/libcxx/trunk@305575 Added: vendor/libc++/dist/benchmarks/stringstream.bench.cpp (contents, props changed) vendor/libc++/dist/src/vector.cpp (contents, props changed) vendor/libc++/dist/test/libcxx/include_as_c.sh.cpp (contents, props changed) vendor/libc++/dist/test/libcxx/utilities/utility/__is_inplace_index.pass.cpp (contents, props changed) vendor/libc++/dist/test/libcxx/utilities/utility/__is_inplace_type.pass.cpp (contents, props changed) vendor/libc++/dist/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp (contents, props changed) vendor/libc++/dist/test/libcxx/utilities/variant/variant.variant/variant.helper/ vendor/libc++/dist/test/libcxx/utilities/variant/variant.variant/variant.helper/variant_alternative.fail.cpp (contents, props changed) vendor/libc++/dist/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp (contents, props changed) vendor/libc++/dist/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/numerics/numeric.ops/reduce/ vendor/libc++/dist/test/std/numerics/numeric.ops/reduce/reduce.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/numerics/numeric.ops/reduce/reduce_init.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/numerics/numeric.ops/reduce/reduce_init_op.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/numerics/numeric.ops/transform.reduce/ vendor/libc++/dist/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp (contents, props changed) Deleted: vendor/libc++/dist/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_iter_iter_iter.pass.cpp vendor/libc++/dist/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_iter_iter_iter_init_op.pass.cpp vendor/libc++/dist/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_iter_iter_iter_init_bop_uop.pass.cpp Modified: vendor/libc++/dist/include/__bsd_locale_fallbacks.h vendor/libc++/dist/include/__config vendor/libc++/dist/include/__functional_03 vendor/libc++/dist/include/__functional_base vendor/libc++/dist/include/array vendor/libc++/dist/include/experimental/coroutine vendor/libc++/dist/include/fstream vendor/libc++/dist/include/functional vendor/libc++/dist/include/locale vendor/libc++/dist/include/memory vendor/libc++/dist/include/numeric vendor/libc++/dist/include/support/newlib/xlocale.h vendor/libc++/dist/include/utility vendor/libc++/dist/include/variant vendor/libc++/dist/lib/CMakeLists.txt vendor/libc++/dist/src/experimental/filesystem/operations.cpp vendor/libc++/dist/src/locale.cpp vendor/libc++/dist/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp vendor/libc++/dist/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp vendor/libc++/dist/test/std/containers/associative/map/map.ops/count0.pass.cpp vendor/libc++/dist/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp vendor/libc++/dist/test/std/containers/associative/map/map.ops/find0.pass.cpp vendor/libc++/dist/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp vendor/libc++/dist/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp vendor/libc++/dist/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp vendor/libc++/dist/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp vendor/libc++/dist/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp vendor/libc++/dist/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp vendor/libc++/dist/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp vendor/libc++/dist/test/support/allocators.h vendor/libc++/dist/test/support/is_transparent.h vendor/libc++/dist/utils/libcxx/test/config.py Added: vendor/libc++/dist/benchmarks/stringstream.bench.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/benchmarks/stringstream.bench.cpp Fri Jun 16 21:04:04 2017 (r320019) @@ -0,0 +1,38 @@ +#include "benchmark/benchmark_api.h" + +#include +double __attribute__((noinline)) istream_numbers(); + +double istream_numbers() { + const char *a[] = { + "-6 69 -71 2.4882e-02 -100 101 -2.00005 5000000 -50000000", + "-25 71 7 -9.3262e+01 -100 101 -2.00005 5000000 -50000000", + "-14 53 46 -6.7026e-02 -100 101 -2.00005 5000000 -50000000" + }; + + int a1, a2, a3, a4, a5, a6, a7; + double f1 = 0.0, f2 = 0.0, q = 0.0; + for (int i=0; i < 3; i++) { + std::istringstream s(a[i]); + s >> a1 + >> a2 + >> a3 + >> f1 + >> a4 + >> a5 + >> f2 + >> a6 + >> a7; + q += (a1 + a2 + a3 + a4 + a5 + a6 + a7 + f1 + f2)/1000000; + } + return q; +} + +static void BM_Istream_numbers(benchmark::State &state) { + double i = 0; + while (state.KeepRunning()) + benchmark::DoNotOptimize(i += istream_numbers()); +} + +BENCHMARK(BM_Istream_numbers)->RangeMultiplier(2)->Range(1024, 4096); +BENCHMARK_MAIN() Modified: vendor/libc++/dist/include/__bsd_locale_fallbacks.h ============================================================================== --- vendor/libc++/dist/include/__bsd_locale_fallbacks.h Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/__bsd_locale_fallbacks.h Fri Jun 16 21:04:04 2017 (r320019) @@ -15,6 +15,7 @@ #define _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H #include +#include #include _LIBCPP_BEGIN_NAMESPACE_STD Modified: vendor/libc++/dist/include/__config ============================================================================== --- vendor/libc++/dist/include/__config Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/__config Fri Jun 16 21:04:04 2017 (r320019) @@ -76,6 +76,9 @@ // its vtable and typeinfo to libc++ rather than having all other libraries // using that class define their own copies. #define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION + +// Enable optimized version of __do_get_(un)signed which avoids redundant copies. +#define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET #elif _LIBCPP_ABI_VERSION == 1 #if !defined(_LIBCPP_OBJECT_FORMAT_COFF) // Enable compiling copies of now inline methods into the dylib to support @@ -289,7 +292,7 @@ # endif #endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) -#if __has_attribute(__no_sanitize__) +#if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC) #define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi"))) #else #define _LIBCPP_NO_CFI @@ -1132,8 +1135,6 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_ # define _LIBCPP_HAS_NO_COROUTINES #endif -#endif // __cplusplus - // Decide whether to use availability macros. #if !defined(_LIBCPP_BUILDING_LIBRARY) && \ !defined(_LIBCPP_DISABLE_AVAILABILITY) && \ @@ -1236,5 +1237,8 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_ _Pragma("pop_macro(\"max\")") # endif #endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + + +#endif // __cplusplus #endif // _LIBCPP_CONFIG Modified: vendor/libc++/dist/include/__functional_03 ============================================================================== --- vendor/libc++/dist/include/__functional_03 Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/__functional_03 Fri Jun 16 21:04:04 2017 (r320019) @@ -704,7 +704,7 @@ function<_Rp()>::target() { if (__f_ == 0) return (_Tp*)0; - return (_Tp*)__f_->target(typeid(_Tp)); + return (_Tp*) const_cast(__f_->target(typeid(_Tp))); } template @@ -980,7 +980,7 @@ function<_Rp(_A0)>::target() { if (__f_ == 0) return (_Tp*)0; - return (_Tp*)__f_->target(typeid(_Tp)); + return (_Tp*) const_cast(__f_->target(typeid(_Tp))); } template @@ -1256,7 +1256,7 @@ function<_Rp(_A0, _A1)>::target() { if (__f_ == 0) return (_Tp*)0; - return (_Tp*)__f_->target(typeid(_Tp)); + return (_Tp*) const_cast(__f_->target(typeid(_Tp))); } template @@ -1532,7 +1532,7 @@ function<_Rp(_A0, _A1, _A2)>::target() { if (__f_ == 0) return (_Tp*)0; - return (_Tp*)__f_->target(typeid(_Tp)); + return (_Tp*) const_cast(__f_->target(typeid(_Tp))); } template Modified: vendor/libc++/dist/include/__functional_base ============================================================================== --- vendor/libc++/dist/include/__functional_base Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/__functional_base Fri Jun 16 21:04:04 2017 (r320019) @@ -548,16 +548,13 @@ template void cref(const _Tp&&) = delete; #endif #if _LIBCPP_STD_VER > 11 -template -struct __is_transparent -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::is_transparent* = 0); -public: - static const bool value = sizeof(__test<_Tp1>(0)) == 1; -}; +template +struct __is_transparent : false_type {}; + +template +struct __is_transparent<_Tp, _Up, + typename __void_t::type> + : true_type {}; #endif // allocator_arg_t Modified: vendor/libc++/dist/include/array ============================================================================== --- vendor/libc++/dist/include/array Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/array Fri Jun 16 21:04:04 2017 (r320019) @@ -296,6 +296,7 @@ class _LIBCPP_TEMPLATE_VIS tuple_size class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, array<_Tp, _Size> > { + static_assert(_Ip < _Size, "Index out of bounds in std::tuple_element<> (std::array)"); public: typedef _Tp type; }; Modified: vendor/libc++/dist/include/experimental/coroutine ============================================================================== --- vendor/libc++/dist/include/experimental/coroutine Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/experimental/coroutine Fri Jun 16 21:04:04 2017 (r320019) @@ -250,9 +250,11 @@ class _LIBCPP_TEMPLATE_VIS coroutine_handle : public c _LIBCPP_ALWAYS_INLINE static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT { + typedef typename remove_cv<_Promise>::type _RawPromise; coroutine_handle __tmp; - __tmp.__handle_ = __builtin_coro_promise(_VSTD::addressof(__promise), - __alignof(_Promise), true); + __tmp.__handle_ = __builtin_coro_promise( + _VSTD::addressof(const_cast<_RawPromise&>(__promise)), + __alignof(_Promise), true); return __tmp; } }; Modified: vendor/libc++/dist/include/fstream ============================================================================== --- vendor/libc++/dist/include/fstream Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/fstream Fri Jun 16 21:04:04 2017 (r320019) @@ -617,7 +617,7 @@ basic_filebuf<_CharT, _Traits>::underflow() static_cast(__extbufend_ - __extbufnext_)); codecvt_base::result __r; __st_last_ = __st_; - size_t __nr = fread((void*)__extbufnext_, 1, __nmemb, __file_); + size_t __nr = fread((void*) const_cast(__extbufnext_), 1, __nmemb, __file_); if (__nr != 0) { if (!__cv_) @@ -630,7 +630,8 @@ basic_filebuf<_CharT, _Traits>::underflow() this->eback() + __ibs_, __inext); if (__r == codecvt_base::noconv) { - this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, (char_type*)__extbufend_); + this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, + (char_type*)const_cast(__extbufend_)); __c = traits_type::to_int_type(*this->gptr()); } else if (__inext != this->eback() + __unget_sz) @@ -722,7 +723,7 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c) return traits_type::eof(); if (__r == codecvt_base::partial) { - this->setp((char_type*)__e, this->pptr()); + this->setp(const_cast(__e), this->pptr()); this->pbump(this->epptr() - this->pbase()); } } Modified: vendor/libc++/dist/include/functional ============================================================================== --- vendor/libc++/dist/include/functional Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/functional Fri Jun 16 21:04:04 2017 (r320019) @@ -1941,8 +1941,8 @@ _Tp* function<_Rp(_ArgTypes...)>::target() _NOEXCEPT { if (__f_ == 0) - return (_Tp*)0; - return (_Tp*)__f_->target(typeid(_Tp)); + return nullptr; + return (_Tp*) const_cast(__f_->target(typeid(_Tp))); } template @@ -1951,7 +1951,7 @@ const _Tp* function<_Rp(_ArgTypes...)>::target() const _NOEXCEPT { if (__f_ == 0) - return (const _Tp*)0; + return nullptr; return (const _Tp*)__f_->target(typeid(_Tp)); } Modified: vendor/libc++/dist/include/locale ============================================================================== --- vendor/libc++/dist/include/locale Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/locale Fri Jun 16 21:04:04 2017 (r320019) @@ -372,19 +372,57 @@ template struct __num_get : protected __num_get_base { - static string __stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep); static string __stage2_float_prep(ios_base& __iob, _CharT* __atoms, _CharT& __decimal_point, _CharT& __thousands_sep); - static int __stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end, - unsigned& __dc, _CharT __thousands_sep, const string& __grouping, - unsigned* __g, unsigned*& __g_end, _CharT* __atoms); + static int __stage2_float_loop(_CharT __ct, bool& __in_units, char& __exp, char* __a, char*& __a_end, _CharT __decimal_point, _CharT __thousands_sep, const string& __grouping, unsigned* __g, unsigned*& __g_end, unsigned& __dc, _CharT* __atoms); +#ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET + static string __stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep); + static int __stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end, + unsigned& __dc, _CharT __thousands_sep, const string& __grouping, + unsigned* __g, unsigned*& __g_end, _CharT* __atoms); + +#else + static string __stage2_int_prep(ios_base& __iob, _CharT& __thousands_sep) + { + locale __loc = __iob.getloc(); + const numpunct<_CharT>& __np = use_facet >(__loc); + __thousands_sep = __np.thousands_sep(); + return __np.grouping(); + } + + const _CharT* __do_widen(ios_base& __iob, _CharT* __atoms) const + { + return __do_widen_p(__iob, __atoms); + } + + + static int __stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end, + unsigned& __dc, _CharT __thousands_sep, const string& __grouping, + unsigned* __g, unsigned*& __g_end, const _CharT* __atoms); +private: + template + const T* __do_widen_p(ios_base& __iob, T* __atoms) const + { + locale __loc = __iob.getloc(); + use_facet >(__loc).widen(__src, __src + 26, __atoms); + return __atoms; + } + + const char* __do_widen_p(ios_base& __iob, char* __atoms) const + { + (void)__iob; + (void)__atoms; + return __src; + } +#endif }; +#ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET template string __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep) @@ -395,6 +433,7 @@ __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, __thousands_sep = __np.thousands_sep(); return __np.grouping(); } +#endif template string @@ -411,9 +450,16 @@ __num_get<_CharT>::__stage2_float_prep(ios_base& __iob template int +#ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET __num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end, unsigned& __dc, _CharT __thousands_sep, const string& __grouping, unsigned* __g, unsigned*& __g_end, _CharT* __atoms) +#else +__num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end, + unsigned& __dc, _CharT __thousands_sep, const string& __grouping, + unsigned* __g, unsigned*& __g_end, const _CharT* __atoms) + +#endif { if (__a_end == __a && (__ct == __atoms[24] || __ct == __atoms[25])) { @@ -849,9 +895,16 @@ num_get<_CharT, _InputIterator>::__do_get_signed(iter_ // Stage 1 int __base = this->__get_base(__iob); // Stage 2 - char_type __atoms[26]; char_type __thousands_sep; + const int __atoms_size = 26; +#ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET + char_type __atoms1[__atoms_size]; + const char_type *__atoms = this->__do_widen(__iob, __atoms1); + string __grouping = this->__stage2_int_prep(__iob, __thousands_sep); +#else + char_type __atoms[__atoms_size]; string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep); +#endif string __buf; __buf.resize(__buf.capacity()); char* __a = &__buf[0]; @@ -899,9 +952,16 @@ num_get<_CharT, _InputIterator>::__do_get_unsigned(ite // Stage 1 int __base = this->__get_base(__iob); // Stage 2 - char_type __atoms[26]; char_type __thousands_sep; + const int __atoms_size = 26; +#ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET + char_type __atoms1[__atoms_size]; + const char_type *__atoms = this->__do_widen(__iob, __atoms1); + string __grouping = this->__stage2_int_prep(__iob, __thousands_sep); +#else + char_type __atoms[__atoms_size]; string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep); +#endif string __buf; __buf.resize(__buf.capacity()); char* __a = &__buf[0]; @@ -3960,7 +4020,8 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow() this->egptr(), __inext); if (__r == codecvt_base::noconv) { - this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, (char_type*)__extbufend_); + this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, + (char_type*) const_cast(__extbufend_)); __c = *this->gptr(); } else if (__inext != this->eback() + __unget_sz) @@ -4048,7 +4109,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::overflow(int_ty return traits_type::eof(); if (__r == codecvt_base::partial) { - this->setp((char_type*)__e, this->pptr()); + this->setp(const_cast(__e), this->pptr()); this->pbump(this->epptr() - this->pbase()); } } Modified: vendor/libc++/dist/include/memory ============================================================================== --- vendor/libc++/dist/include/memory Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/memory Fri Jun 16 21:04:04 2017 (r320019) @@ -720,16 +720,12 @@ class _LIBCPP_TEMPLATE_VIS allocator (publ // pointer_traits +template +struct __has_element_type : false_type {}; + template -struct __has_element_type -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::element_type* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; +struct __has_element_type<_Tp, + typename __void_t::type> : true_type {}; template ::value> struct __pointer_traits_element_type; @@ -808,16 +804,12 @@ struct __pointer_traits_element_type<_Sp<_Tp, _A0, _A1 #endif // _LIBCPP_HAS_NO_VARIADICS +template +struct __has_difference_type : false_type {}; + template -struct __has_difference_type -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::difference_type* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; +struct __has_difference_type<_Tp, + typename __void_t::type> : true_type {}; template ::value> struct __pointer_traits_difference_type @@ -998,17 +990,12 @@ struct __rebind_pointer { // allocator_traits -struct __has_pointer_type_imp -{ - template static __two __test(...); - template static char __test(typename _Up::pointer* = 0); -}; +template +struct __has_pointer_type : false_type {}; template -struct __has_pointer_type - : public integral_constant(0)) == 1> -{ -}; +struct __has_pointer_type<_Tp, + typename __void_t::type> : true_type {}; namespace __pointer_type_imp { @@ -1033,16 +1020,12 @@ struct __pointer_type typedef typename __pointer_type_imp::__pointer_type<_Tp, typename remove_reference<_Dp>::type>::type type; }; +template +struct __has_const_pointer : false_type {}; + template -struct __has_const_pointer -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::const_pointer* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; +struct __has_const_pointer<_Tp, + typename __void_t::type> : true_type {}; template ::value> struct __const_pointer @@ -1060,16 +1043,12 @@ struct __const_pointer<_Tp, _Ptr, _Alloc, false> #endif }; +template +struct __has_void_pointer : false_type {}; + template -struct __has_void_pointer -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::void_pointer* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; +struct __has_void_pointer<_Tp, + typename __void_t::type> : true_type {}; template ::value> struct __void_pointer @@ -1087,16 +1066,12 @@ struct __void_pointer<_Ptr, _Alloc, false> #endif }; +template +struct __has_const_void_pointer : false_type {}; + template -struct __has_const_void_pointer -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::const_void_pointer* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; +struct __has_const_void_pointer<_Tp, + typename __void_t::type> : true_type {}; template ::value> struct __const_void_pointer @@ -1130,16 +1105,12 @@ __to_raw_pointer(_Pointer __p) _NOEXCEPT return _VSTD::__to_raw_pointer(__p.operator->()); } +template +struct __has_size_type : false_type {}; + template -struct __has_size_type -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::size_type* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; +struct __has_size_type<_Tp, + typename __void_t::type> : true_type {}; template ::value> struct __size_type @@ -1153,16 +1124,13 @@ struct __size_type<_Alloc, _DiffType, true> typedef typename _Alloc::size_type type; }; +template +struct __has_propagate_on_container_copy_assignment : false_type {}; + template -struct __has_propagate_on_container_copy_assignment -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::propagate_on_container_copy_assignment* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; +struct __has_propagate_on_container_copy_assignment<_Tp, + typename __void_t::type> + : true_type {}; template ::value> struct __propagate_on_container_copy_assignment @@ -1176,16 +1144,13 @@ struct __propagate_on_container_copy_assignment<_Alloc typedef typename _Alloc::propagate_on_container_copy_assignment type; }; +template +struct __has_propagate_on_container_move_assignment : false_type {}; + template -struct __has_propagate_on_container_move_assignment -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::propagate_on_container_move_assignment* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; +struct __has_propagate_on_container_move_assignment<_Tp, + typename __void_t::type> + : true_type {}; template ::value> struct __propagate_on_container_move_assignment @@ -1199,16 +1164,13 @@ struct __propagate_on_container_move_assignment<_Alloc typedef typename _Alloc::propagate_on_container_move_assignment type; }; +template +struct __has_propagate_on_container_swap : false_type {}; + template -struct __has_propagate_on_container_swap -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::propagate_on_container_swap* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; +struct __has_propagate_on_container_swap<_Tp, + typename __void_t::type> + : true_type {}; template ::value> struct __propagate_on_container_swap @@ -1222,16 +1184,13 @@ struct __propagate_on_container_swap<_Alloc, true> typedef typename _Alloc::propagate_on_container_swap type; }; +template +struct __has_is_always_equal : false_type {}; + template -struct __has_is_always_equal -{ -private: - struct __two {char __lx; char __lxx;}; - template static __two __test(...); - template static char __test(typename _Up::is_always_equal* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; +struct __has_is_always_equal<_Tp, + typename __void_t::type> + : true_type {}; template ::value> struct __is_always_equal @@ -1884,7 +1843,7 @@ class _LIBCPP_TEMPLATE_VIS allocator (publi return static_cast(_VSTD::__allocate(__n * sizeof(_Tp))); } _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT - {_VSTD::__libcpp_deallocate((void*)__p);} + {_VSTD::__libcpp_deallocate((void*) const_cast<_Tp *>(__p));} _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {return size_type(~0) / sizeof(_Tp);} #if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) @@ -1900,7 +1859,7 @@ class _LIBCPP_TEMPLATE_VIS allocator (publi void construct(pointer __p) { - ::new((void*)__p) _Tp(); + ::new((void*) const_cast<_Tp *>(__p)) _Tp(); } # if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) @@ -1909,14 +1868,14 @@ class _LIBCPP_TEMPLATE_VIS allocator (publi void construct(pointer __p, _A0& __a0) { - ::new((void*)__p) _Tp(__a0); + ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0); } template _LIBCPP_INLINE_VISIBILITY void construct(pointer __p, const _A0& __a0) { - ::new((void*)__p) _Tp(__a0); + ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0); } # endif // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) template @@ -1924,28 +1883,28 @@ class _LIBCPP_TEMPLATE_VIS allocator (publi void construct(pointer __p, _A0& __a0, _A1& __a1) { - ::new((void*)__p) _Tp(__a0, __a1); + ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1); } template _LIBCPP_INLINE_VISIBILITY void construct(pointer __p, const _A0& __a0, _A1& __a1) { - ::new((void*)__p) _Tp(__a0, __a1); + ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1); } template _LIBCPP_INLINE_VISIBILITY void construct(pointer __p, _A0& __a0, const _A1& __a1) { - ::new((void*)__p) _Tp(__a0, __a1); + ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1); } template _LIBCPP_INLINE_VISIBILITY void construct(pointer __p, const _A0& __a0, const _A1& __a1) { - ::new((void*)__p) _Tp(__a0, __a1); + ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1); } #endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();} @@ -3890,7 +3849,9 @@ class _LIBCPP_TEMPLATE_VIS shared_ptr (public) template _LIBCPP_INLINE_VISIBILITY _Dp* __get_deleter() const _NOEXCEPT - {return (_Dp*)(__cntrl_ ? __cntrl_->__get_deleter(typeid(_Dp)) : 0);} + {return static_cast<_Dp*>(__cntrl_ + ? const_cast(__cntrl_->__get_deleter(typeid(_Dp))) + : nullptr);} #endif // _LIBCPP_NO_RTTI #ifndef _LIBCPP_HAS_NO_VARIADICS Modified: vendor/libc++/dist/include/numeric ============================================================================== --- vendor/libc++/dist/include/numeric Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/numeric Fri Jun 16 21:04:04 2017 (r320019) @@ -25,6 +25,18 @@ template + typename iterator_traits::value_type + reduce(InputIterator first, InputIterator last); // C++17 + +template + T + reduce(InputIterator first, InputIterator last, T init); // C++17 + +template + T + reduce(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); // C++17 + template T inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init); @@ -34,6 +46,23 @@ template + T + transform_reduce(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, T init); // C++17 + +template + T + transform_reduce(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, T init, + BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); // C++17 + +template + T + transform_reduce(InputIterator first, InputIterator last, T init, + BinaryOperation binary_op, UnaryOperation unary_op); // C++17 + template OutputIterator partial_sum(InputIterator first, InputIterator last, OutputIterator result); @@ -114,6 +143,35 @@ accumulate(_InputIterator __first, _InputIterator __la return __init; } +#if _LIBCPP_STD_VER > 14 +template +inline _LIBCPP_INLINE_VISIBILITY +_Tp +reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b) +{ + for (; __first != __last; ++__first) + __init = __b(__init, *__first); + return __init; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +_Tp +reduce(_InputIterator __first, _InputIterator __last, _Tp __init) +{ + return _VSTD::reduce(__first, __last, __init, _VSTD::plus<>()); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +typename iterator_traits<_InputIterator>::value_type +reduce(_InputIterator __first, _InputIterator __last) +{ + return _VSTD::reduce(__first, __last, + typename iterator_traits<_InputIterator>::value_type{}); +} +#endif + template inline _LIBCPP_INLINE_VISIBILITY _Tp @@ -134,6 +192,41 @@ inner_product(_InputIterator1 __first1, _InputIterator __init = __binary_op1(__init, __binary_op2(*__first1, *__first2)); return __init; } + +#if _LIBCPP_STD_VER > 14 +template +inline _LIBCPP_INLINE_VISIBILITY +_Tp +transform_reduce(_InputIterator __first, _InputIterator __last, + _Tp __init, _BinaryOp __b, _UnaryOp __u) +{ + for (; __first != __last; ++__first) + __init = __b(__init, __u(*__first)); + return __init; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +_Tp +transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _Tp __init, _BinaryOp1 __b1, _BinaryOp2 __b2) +{ + for (; __first1 != __last1; ++__first1, (void) ++__first2) + __init = __b1(__init, __b2(*__first1, *__first2)); + return __init; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +_Tp +transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _Tp __init) +{ + return _VSTD::transform_reduce(__first1, __last1, __first2, __init, + _VSTD::plus<>(), _VSTD::multiplies<>()); +} +#endif template inline _LIBCPP_INLINE_VISIBILITY Modified: vendor/libc++/dist/include/support/newlib/xlocale.h ============================================================================== --- vendor/libc++/dist/include/support/newlib/xlocale.h Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/support/newlib/xlocale.h Fri Jun 16 21:04:04 2017 (r320019) @@ -16,7 +16,10 @@ #include #include #include +#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \ + __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5 #include +#endif #include #include Modified: vendor/libc++/dist/include/utility ============================================================================== --- vendor/libc++/dist/include/utility Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/utility Fri Jun 16 21:04:04 2017 (r320019) @@ -653,6 +653,12 @@ template class _LIBCPP_TEMPLATE_VIS tuple_size > : public integral_constant {}; +template +class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> > +{ + static_assert(_Ip < 2, "Index out of bounds in std::tuple_element>"); +}; + template class _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> > { @@ -923,6 +929,12 @@ template struct __is_inplace_type_imp using __is_inplace_type = __is_inplace_type_imp<__uncvref_t<_Tp>>; + +template struct __is_inplace_index_imp : false_type {}; +template struct __is_inplace_index_imp> : true_type {}; + +template +using __is_inplace_index = __is_inplace_index_imp<__uncvref_t<_Tp>>; #endif // _LIBCPP_STD_VER > 14 Modified: vendor/libc++/dist/include/variant ============================================================================== --- vendor/libc++/dist/include/variant Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/include/variant Fri Jun 16 21:04:04 2017 (r320019) @@ -278,7 +278,7 @@ struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, c template struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, variant<_Types...>> { - static_assert(_Ip < sizeof...(_Types)); + static_assert(_Ip < sizeof...(_Types), "Index out of bounds in std::variant_alternative<>"); using type = __type_pack_element<_Ip, _Types...>; }; Modified: vendor/libc++/dist/lib/CMakeLists.txt ============================================================================== --- vendor/libc++/dist/lib/CMakeLists.txt Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/lib/CMakeLists.txt Fri Jun 16 21:04:04 2017 (r320019) @@ -1,6 +1,7 @@ set(LIBCXX_LIB_CMAKEFILES_DIR "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}" PARENT_SCOPE) # Get sources +# FIXME: Don't use glob here file(GLOB LIBCXX_SOURCES ../src/*.cpp) if(WIN32) file(GLOB LIBCXX_WIN32_SOURCES ../src/support/win32/*.cpp) Modified: vendor/libc++/dist/src/experimental/filesystem/operations.cpp ============================================================================== --- vendor/libc++/dist/src/experimental/filesystem/operations.cpp Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/src/experimental/filesystem/operations.cpp Fri Jun 16 21:04:04 2017 (r320019) @@ -842,7 +842,7 @@ void __rename(const path& from, const path& to, std::e } void __resize_file(const path& p, std::uintmax_t size, std::error_code *ec) { - if (::truncate(p.c_str(), static_cast(size)) == -1) + if (::truncate(p.c_str(), static_cast<::off_t>(size)) == -1) set_or_throw(ec, "resize_file", p); else if (ec) ec->clear(); Modified: vendor/libc++/dist/src/locale.cpp ============================================================================== --- vendor/libc++/dist/src/locale.cpp Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/src/locale.cpp Fri Jun 16 21:04:04 2017 (r320019) @@ -6158,6 +6158,4 @@ template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VI template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __vector_base_common; - _LIBCPP_END_NAMESPACE_STD Added: vendor/libc++/dist/src/vector.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/src/vector.cpp Fri Jun 16 21:04:04 2017 (r320019) @@ -0,0 +1,16 @@ +//===------------------------- vector.cpp ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "vector" + +_LIBCPP_BEGIN_NAMESPACE_STD + +template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __vector_base_common; + +_LIBCPP_END_NAMESPACE_STD Modified: vendor/libc++/dist/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp ============================================================================== --- vendor/libc++/dist/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp Fri Jun 16 21:04:04 2017 (r320019) @@ -23,6 +23,7 @@ // However, for backwards compatibility, if _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE // is defined before including , then random_shuffle will be restored. +// MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE #define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE #include Modified: vendor/libc++/dist/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp ============================================================================== --- vendor/libc++/dist/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp Fri Jun 16 21:04:00 2017 (r320018) +++ vendor/libc++/dist/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp Fri Jun 16 21:04:04 2017 (r320019) @@ -14,6 +14,7 @@ // However, for backwards compatibility, if _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS // is defined before including , then they will be restored. +// MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS #define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS #include Added: vendor/libc++/dist/test/libcxx/include_as_c.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/libcxx/include_as_c.sh.cpp Fri Jun 16 21:04:04 2017 (r320019) @@ -0,0 +1,37 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// Test that the C wrapper headers can be included when compiling them as C. + +// NOTE: It's not common or recommended to have libc++ in the header search +// path when compiling C files, but it does happen often enough. + +// RUN: %cxx -c -xc %s -fsyntax-only %flags %compile_flags -std=c99 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main() {} Added: vendor/libc++/dist/test/libcxx/utilities/utility/__is_inplace_index.pass.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/libcxx/utilities/utility/__is_inplace_index.pass.cpp Fri Jun 16 21:04:04 2017 (r320019) @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 16 21:04:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21506D89357; Fri, 16 Jun 2017 21:04:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B83B16F8F8; Fri, 16 Jun 2017 21:04:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL4IVR063865; Fri, 16 Jun 2017 21:04:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL4IDN063864; Fri, 16 Jun 2017 21:04:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162104.v5GL4IDN063864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320022 - vendor/lld/lld-trunk-r305575 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:04:20 -0000 Author: dim Date: Fri Jun 16 21:04:18 2017 New Revision: 320022 URL: https://svnweb.freebsd.org/changeset/base/320022 Log: Tag lld trunk r305575. Added: vendor/lld/lld-trunk-r305575/ - copied from r320021, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Fri Jun 16 21:04:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FFF8D892C8; Fri, 16 Jun 2017 21:04:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1F696F812; Fri, 16 Jun 2017 21:04:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL4APg063763; Fri, 16 Jun 2017 21:04:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL4ACp063762; Fri, 16 Jun 2017 21:04:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162104.v5GL4ACp063762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320020 - vendor/libc++/libc++-trunk-r305575 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:04:12 -0000 Author: dim Date: Fri Jun 16 21:04:10 2017 New Revision: 320020 URL: https://svnweb.freebsd.org/changeset/base/320020 Log: Tag libc++ trunk r305575. Added: vendor/libc++/libc++-trunk-r305575/ - copied from r320019, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Fri Jun 16 21:04:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88FFED893AE; Fri, 16 Jun 2017 21:04:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F1476F9AC; Fri, 16 Jun 2017 21:04:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL4PZQ063941; Fri, 16 Jun 2017 21:04:25 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL4MZT063914; Fri, 16 Jun 2017 21:04:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162104.v5GL4MZT063914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320023 - in vendor/lldb/dist: include/lldb/Core include/lldb/Target include/lldb/Utility packages/Python/lldbsuite/test/expression_command/call-restarts packages/Python/lldbsuite/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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:04:26 -0000 Author: dim Date: Fri Jun 16 21:04:22 2017 New Revision: 320023 URL: https://svnweb.freebsd.org/changeset/base/320023 Log: Vendor import of lldb trunk r305575: https://llvm.org/svn/llvm-project/lldb/trunk@305575 Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/bundle.c (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/main.c (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Info.plist vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/MyFramework.h (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/myframework.c (contents, props changed) Modified: vendor/lldb/dist/include/lldb/Core/Debugger.h vendor/lldb/dist/include/lldb/Target/StackFrame.h vendor/lldb/dist/include/lldb/Target/StackFrameList.h vendor/lldb/dist/include/lldb/Target/Thread.h vendor/lldb/dist/include/lldb/Utility/Status.h vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/main.cpp vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/test.c vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteSingleStep.py vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vCont.py vendor/lldb/dist/scripts/lldb.swig vendor/lldb/dist/source/Commands/CommandObjectThread.cpp vendor/lldb/dist/source/Core/Debugger.cpp vendor/lldb/dist/source/Host/common/Symbols.cpp vendor/lldb/dist/source/Target/StackFrame.cpp vendor/lldb/dist/source/Target/StackFrameList.cpp vendor/lldb/dist/source/Target/Thread.cpp vendor/lldb/dist/source/Utility/Status.cpp vendor/lldb/dist/unittests/Utility/StatusTest.cpp Modified: vendor/lldb/dist/include/lldb/Core/Debugger.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/Debugger.h Fri Jun 16 21:04:18 2017 (r320022) +++ vendor/lldb/dist/include/lldb/Core/Debugger.h Fri Jun 16 21:04:22 2017 (r320023) @@ -249,6 +249,8 @@ class Debugger : public std::enable_shared_from_this= 4, + num_threads >= 13, 'Number of expected threads and actual threads do not match.') + + def test_unique_stacks(self): + """Test backtrace unique with multiple threads executing the same stack.""" + self.build() + exe = os.path.join(os.getcwd(), "a.out") + self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) + + # Set a break point on the thread3 notify all (should get hit on threads 4-13). + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.thread3_before_lock_line, num_expected_locations=1) + + # Run the program. + self.runCmd("run", RUN_SUCCEEDED) + + # Stopped once. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs=["stop reason = breakpoint 1."]) + + process = self.process() + + # Get the number of threads + num_threads = process.GetNumThreads() + + # Using std::thread may involve extra threads, so we assert that there are + # at least 10 thread3's rather than exactly 10. + self.assertTrue( + num_threads >= 10, + 'Number of expected threads and actual threads do not match.') + + # Attempt to walk each of the thread's executing the thread3 function to + # the same breakpoint. + def is_thread3(thread): + for frame in thread: + if "thread3" in frame.GetFunctionName(): return True + return False + + expect_threads = "" + for i in range(num_threads): + thread = process.GetThreadAtIndex(i) + self.assertTrue(thread.IsValid()) + if not is_thread3(thread): + continue + + # If we aren't stopped out the thread breakpoint try to resume. + if thread.GetStopReason() != lldb.eStopReasonBreakpoint: + self.runCmd("thread continue %d"%(i+1)) + self.assertEqual(thread.GetStopReason(), lldb.eStopReasonBreakpoint) + + expect_threads += " #%d"%(i+1) + + # Construct our expected back trace string + expect_string = "10 thread(s)%s" % (expect_threads) + + # Now that we are stopped, we should have 10 threads waiting in the + # thread3 function. All of these threads should show as one stack. + self.expect("thread backtrace unique", + "Backtrace with unique stack shown correctly", + substrs=[expect_string, + "main.cpp:%d"%self.thread3_before_lock_line]) Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/main.cpp ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/main.cpp Fri Jun 16 21:04:18 2017 (r320022) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/main.cpp Fri Jun 16 21:04:22 2017 (r320023) @@ -1,15 +1,19 @@ +#include "pseudo_barrier.h" #include #include #include +#include std::mutex mutex; std::condition_variable cond; +pseudo_barrier_t thread3_barrier; void * thread3(void *input) { - std::unique_lock lock(mutex); - cond.notify_all(); // Set break point at this line. + pseudo_barrier_wait(thread3_barrier); + std::unique_lock lock(mutex); // Set thread3 break point on lock at this line. + cond.notify_all(); // Set thread3 break point on notify_all at this line. return NULL; } @@ -17,7 +21,7 @@ void * thread2(void *input) { std::unique_lock lock(mutex); - cond.notify_all(); + cond.notify_all(); // release main thread cond.wait(lock); return NULL; } @@ -36,15 +40,23 @@ int main() std::unique_lock lock(mutex); std::thread thread_1(thread1, nullptr); - cond.wait(lock); + cond.wait(lock); // wait for thread2 - std::thread thread_3(thread3, nullptr); - cond.wait(lock); + pseudo_barrier_init(thread3_barrier, 10); + std::vector thread_3s; + for (int i = 0; i < 10; i++) { + thread_3s.push_back(std::thread(thread3, nullptr)); + } + + cond.wait(lock); // wait for thread_3s + lock.unlock(); thread_1.join(); - thread_3.join(); + for (auto &t : thread_3s){ + t.join(); + } return 0; } Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py Fri Jun 16 21:04:18 2017 (r320022) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py Fri Jun 16 21:04:22 2017 (r320023) @@ -19,6 +19,7 @@ class NoreturnUnwind(TestBase): @skipIfWindows # clang-cl does not support gcc style attributes. # clang does not preserve LR in noreturn functions, making unwinding impossible @skipIf(compiler="clang", archs=['arm'], oslist=['linux']) + @expectedFailureAll(bugnumber="llvm.org/pr33452", triple='^mips') def test(self): """Test that we can backtrace correctly with 'noreturn' functions on the stack""" self.build() Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/test.c ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/test.c Fri Jun 16 21:04:18 2017 (r320022) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/test.c Fri Jun 16 21:04:22 2017 (r320023) @@ -1,6 +1,6 @@ #include -#if defined(__arm__) || defined(__aarch64__) +#if defined(__arm__) || defined(__aarch64__) || defined (__mips__) // Clang does not accept regparm attribute on these platforms. // Fortunately, the default calling convention passes arguments in registers // anyway. Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Fri Jun 16 21:04:18 2017 (r320022) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Fri Jun 16 21:04:22 2017 (r320023) @@ -121,6 +121,8 @@ class ObjCNewSyntaxTestCase(TestBase): '7.0.0']) @skipIf(macos_version=["<", "10.12"]) @expectedFailureAll(archs=["i[3-6]86"]) + @expectedFailureAll( + bugnumber="rdar://32777981") def test_update_dictionary(self): self.runToBreakpoint() @@ -163,6 +165,8 @@ class ObjCNewSyntaxTestCase(TestBase): '7.0.0']) @skipIf(macos_version=["<", "10.12"]) @expectedFailureAll(archs=["i[3-6]86"]) + @expectedFailureAll( + bugnumber="rdar://32777981") def test_dictionary_literal(self): self.runToBreakpoint() Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile Fri Jun 16 21:04:22 2017 (r320023) @@ -0,0 +1,21 @@ +CC ?= clang + +ifeq "$(ARCH)" "" + ARCH = x86_64 +endif + +CFLAGS ?= -g -O0 -arch $(ARCH) + +all: clean + $(CC) $(CFLAGS) -dynamiclib -o com.apple.sbd bundle.c + mkdir com.apple.sbd.xpc + mv com.apple.sbd com.apple.sbd.xpc/ + mkdir -p com.apple.sbd.xpc.dSYM/Contents/Resources/DWARF + mv com.apple.sbd.dSYM/Contents/Resources/DWARF/com.apple.sbd com.apple.sbd.xpc.dSYM/Contents/Resources/DWARF/ + rm -rf com.apple.sbd.dSYM + mkdir hide.app + tar cf - com.apple.sbd.xpc com.apple.sbd.xpc.dSYM | ( cd hide.app;tar xBpf -) + $(CC) $(CFLAGS) -o find-bundle-with-dots-in-fn main.c + +clean: + rm -rf a.out a.out.dSYM hide.app com.apple.sbd com.apple.sbd.dSYM com.apple.sbd.xpc com.apple.sbd.xpc.dSYM find-bundle-with-dots-in-fn find-bundle-with-dots-in-fn.dSYM Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py Fri Jun 16 21:04:22 2017 (r320023) @@ -0,0 +1,71 @@ +"""Test that a dSYM can be found when a binary is in a bundle hnd has dots in the filename.""" + +from __future__ import print_function + +#import unittest2 +import os.path +from time import sleep + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +exe_name = 'find-bundle-with-dots-in-fn' # must match Makefile + +class BundleWithDotInFilenameTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipIfRemote + @skipUnlessDarwin + # This test is explicitly a dSYM test, it doesn't need to run for any other config, but + # the following doesn't work, fixme. + # @skipIf(debug_info=no_match(["dsym"]), bugnumber="This test is looking explicitly for a dSYM") + + def setUp(self): + TestBase.setUp(self) + self.source = 'main.c' + + def tearDown(self): + # Destroy process before TestBase.tearDown() + self.dbg.GetSelectedTarget().GetProcess().Destroy() + + # Call super's tearDown(). + TestBase.tearDown(self) + + def test_attach_and_check_dsyms(self): + """Test attach to binary, see if the bundle dSYM is found""" + exe = os.path.join(os.getcwd(), exe_name) + self.build() + popen = self.spawnSubprocess(exe) + self.addTearDownHook(self.cleanupSubprocesses) + + # Give the inferior time to start up, dlopen a bundle, remove the bundle it linked in + sleep(5) + + # Since the library that was dlopen()'ed is now removed, lldb will need to find the + # binary & dSYM via target.exec-search-paths + settings_str = "settings set target.exec-search-paths " + self.get_process_working_directory() + "/hide.app" + self.runCmd(settings_str) + + self.runCmd("process attach -p " + str(popen.pid)) + + target = self.dbg.GetSelectedTarget() + self.assertTrue(target.IsValid(), 'Should have a valid Target after attaching to process') + + setup_complete = target.FindFirstGlobalVariable("setup_is_complete") + self.assertTrue(setup_complete.GetValueAsUnsigned() == 1, 'Check that inferior process has completed setup') + + # Find the bundle module, see if we found the dSYM too (they're both in "hide.app") + i = 0 + while i < target.GetNumModules(): + mod = target.GetModuleAtIndex(i) + if mod.GetFileSpec().GetFilename() == 'com.apple.sbd': + dsym_name = mod.GetSymbolFileSpec().GetFilename() + self.assertTrue (dsym_name == 'com.apple.sbd', "Check that we found the dSYM for the bundle that was loaded") + i=i+1 + +if __name__ == '__main__': + unittest.main() Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/bundle.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/bundle.c Fri Jun 16 21:04:22 2017 (r320023) @@ -0,0 +1,4 @@ +int foo () +{ + return 5; +} Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/main.c Fri Jun 16 21:04:22 2017 (r320023) @@ -0,0 +1,28 @@ +#include +#include +#include + +int setup_is_complete = 0; + +int main() +{ + + void *handle = dlopen ("com.apple.sbd.xpc/com.apple.sbd", RTLD_NOW); + if (handle) + { + if (dlsym(handle, "foo")) + { + system ("/bin/rm -rf com.apple.sbd.xpc com.apple.sbd.xpc.dSYM"); + setup_is_complete = 1; + + // At this point we want lldb to attach to the process. If lldb attaches + // before we've removed the dlopen'ed bundle, lldb will find the bundle + // at its actual filepath and not have to do any tricky work, invalidating + // the test. + + for (int loop_limiter = 0; loop_limiter < 100; loop_limiter++) + sleep (1); + } + } + return 0; +} Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Info.plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Info.plist Fri Jun 16 21:04:22 2017 (r320023) @@ -0,0 +1,44 @@ + + + + + BuildMachineOSBuild + 16B2657 + CFBundleDevelopmentRegion + en + CFBundleExecutable + MyFramework + CFBundleIdentifier + com.apple.test.framework + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + MyFramework + CFBundlePackageType + FMWK + CFBundleShortVersionString + 113 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 113 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 9L120i + DTPlatformVersion + GM + DTSDKBuild + 17A261x + DTSDKName + macosx10.13 + DTXcode + 0900 + DTXcodeBuild + 9L120i + + Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile Fri Jun 16 21:04:22 2017 (r320023) @@ -0,0 +1,28 @@ +CC ?= clang + +ifeq "$(ARCH)" "" + ARCH = x86_64 +endif + +CFLAGS ?= -g -O0 -arch $(ARCH) + +all: clean + $(CC) $(CFLAGS) -install_name $(PWD)/MyFramework.framework/Versions/A/MyFramework -dynamiclib -o MyFramework myframework.c + mkdir -p MyFramework.framework/Versions/A/Headers + mkdir -p MyFramework.framework/Versions/A/Resources + cp MyFramework MyFramework.framework/Versions/A + cp MyFramework.h MyFramework.framework/Versions/A/Headers + cp Info.plist MyFramework.framework/Versions/A/Resources + ( cd MyFramework.framework/Versions ; ln -s A Current ) + ( cd MyFramework.framework/ ; ln -s Versions/Current/Headers . ) + ( cd MyFramework.framework/ ; ln -s Versions/Current/MyFramework . ) + ( cd MyFramework.framework/ ; ln -s Versions/Current/Resources . ) + mv MyFramework.dSYM MyFramework.framework.dSYM + mkdir hide.app + rm -f MyFramework + tar cf - MyFramework.framework MyFramework.framework.dSYM | ( cd hide.app;tar xBpf -) + $(CC) $(CFLAGS) -o deep-bundle main.c -F. -framework MyFramework + + +clean: + rm -rf a.out a.out.dSYM deep-bundle deep-bundle.dSYM MyFramework.framework MyFramework.framework.dSYM MyFramework MyFramework.dSYM hide.app Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/MyFramework.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/MyFramework.h Fri Jun 16 21:04:22 2017 (r320023) @@ -0,0 +1 @@ +int foo (); Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py Fri Jun 16 21:04:22 2017 (r320023) @@ -0,0 +1,75 @@ +"""Test that a dSYM can be found when a binary is in a deep bundle with multiple pathname components.""" + +from __future__ import print_function + +#import unittest2 +import os.path +from time import sleep + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +exe_name = 'deep-bundle' # must match Makefile + +class DeepBundleTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipIfRemote + @skipUnlessDarwin + # This test is explicitly a dSYM test, it doesn't need to run for any other config, but + # the following doesn't work, fixme. + # @skipIf(debug_info=no_match(["dsym"]), bugnumber="This test is looking explicitly for a dSYM") + + def setUp(self): + TestBase.setUp(self) + self.source = 'main.c' + + def tearDown(self): + # Destroy process before TestBase.tearDown() + self.dbg.GetSelectedTarget().GetProcess().Destroy() + + # Call super's tearDown(). + TestBase.tearDown(self) + + def test_attach_and_check_dsyms(self): + """Test attach to binary, see if the framework dSYM is found""" + exe = os.path.join(os.getcwd(), exe_name) + self.build() + popen = self.spawnSubprocess(exe) + self.addTearDownHook(self.cleanupSubprocesses) + + # Give the inferior time to start up, dlopen a bundle, remove the bundle it linked in + sleep(5) + + # Since the library that was dlopen()'ed is now removed, lldb will need to find the + # binary & dSYM via target.exec-search-paths + settings_str = "settings set target.exec-search-paths " + self.get_process_working_directory() + "/hide.app" + self.runCmd(settings_str) + + self.runCmd("process attach -p " + str(popen.pid)) + + target = self.dbg.GetSelectedTarget() + self.assertTrue(target.IsValid(), 'Should have a valid Target after attaching to process') + + setup_complete = target.FindFirstGlobalVariable("setup_is_complete") + self.assertTrue(setup_complete.GetValueAsUnsigned() == 1, 'Check that inferior process has completed setup') + + # Find the bundle module, see if we found the dSYM too (they're both in "hide.app") + i = 0 + found_module = False + while i < target.GetNumModules(): + mod = target.GetModuleAtIndex(i) + if mod.GetFileSpec().GetFilename() == 'MyFramework': + found_module = True + dsym_name = mod.GetSymbolFileSpec().GetFilename() + self.assertTrue (dsym_name == 'MyFramework', "Check that we found the dSYM for the bundle that was loaded") + i=i+1 + + self.assertTrue(found_module, "Check that we found the framework loaded in lldb's image list") + +if __name__ == '__main__': + unittest.main() Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c Fri Jun 16 21:04:22 2017 (r320023) @@ -0,0 +1,22 @@ +#include +#include +#include + +int setup_is_complete = 0; + +int main() +{ + system ("/bin/rm -rf MyFramework MyFramework.framework MyFramework.framework.dSYM"); + + setup_is_complete = 1; + + // At this point we want lldb to attach to the process. If lldb attaches + // before we've removed the framework we're running against, it will be + // easy for lldb to find the binary & dSYM without using target.exec-search-paths, + // which is the point of this test. + + for (int loop_limiter = 0; loop_limiter < 100; loop_limiter++) + sleep (1); + + return foo(); +} Added: vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/myframework.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/myframework.c Fri Jun 16 21:04:22 2017 (r320023) @@ -0,0 +1,4 @@ +int foo () +{ + return 5; +} Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteSingleStep.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteSingleStep.py Fri Jun 16 21:04:18 2017 (r320022) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteSingleStep.py Fri Jun 16 21:04:22 2017 (r320023) @@ -31,6 +31,7 @@ class TestGdbRemoteSingleStep(gdbremote_testcase.GdbRe "arm", "aarch64"], bugnumber="llvm.org/pr24739") + @skipIf(triple='^mips') def test_single_step_only_steps_one_instruction_with_s_llgs(self): self.init_llgs_test() self.build() Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vCont.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vCont.py Fri Jun 16 21:04:18 2017 (r320022) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vCont.py Fri Jun 16 21:04:22 2017 (r320023) @@ -108,6 +108,7 @@ class TestGdbRemote_vCont(gdbremote_testcase.GdbRemote "arm", "aarch64"], bugnumber="llvm.org/pr24739") + @skipIf(triple='^mips') def test_single_step_only_steps_one_instruction_with_Hc_vCont_s_llgs(self): self.init_llgs_test() self.build() @@ -136,6 +137,7 @@ class TestGdbRemote_vCont(gdbremote_testcase.GdbRemote "arm", "aarch64"], bugnumber="llvm.org/pr24739") + @skipIf(triple='^mips') def test_single_step_only_steps_one_instruction_with_vCont_s_thread_llgs( self): self.init_llgs_test() Modified: vendor/lldb/dist/scripts/lldb.swig ============================================================================== --- vendor/lldb/dist/scripts/lldb.swig Fri Jun 16 21:04:18 2017 (r320022) +++ vendor/lldb/dist/scripts/lldb.swig Fri Jun 16 21:04:22 2017 (r320023) @@ -40,7 +40,13 @@ us to override the module import logic to suit our nee Older swig versions will simply ignore this setting. */ %define MODULEIMPORT -"from . import $module" +"try: + # Try a relative import first + from . import $module +except ImportError: + # Maybe absolute import will work (if we're being loaded from lldb, it + # should). + import $module" %enddef // These versions will not generate working python modules, so error out early. #if SWIG_VERSION >= 0x030009 && SWIG_VERSION < 0x030011 Modified: vendor/lldb/dist/source/Commands/CommandObjectThread.cpp ============================================================================== --- vendor/lldb/dist/source/Commands/CommandObjectThread.cpp Fri Jun 16 21:04:18 2017 (r320022) +++ vendor/lldb/dist/source/Commands/CommandObjectThread.cpp Fri Jun 16 21:04:22 2017 (r320023) @@ -42,10 +42,44 @@ using namespace lldb; using namespace lldb_private; //------------------------------------------------------------------------- -// CommandObjectThreadBacktrace +// CommandObjectIterateOverThreads //------------------------------------------------------------------------- class CommandObjectIterateOverThreads : public CommandObjectParsed { + + class UniqueStack { + + public: + UniqueStack(std::stack stack_frames, uint32_t thread_index_id) + : m_stack_frames(stack_frames) { + m_thread_index_ids.push_back(thread_index_id); + } + + void AddThread(uint32_t thread_index_id) const { + m_thread_index_ids.push_back(thread_index_id); + } + + const std::vector &GetUniqueThreadIndexIDs() const { + return m_thread_index_ids; + } + + lldb::tid_t GetRepresentativeThread() const { + return m_thread_index_ids.front(); + } + + friend bool inline operator<(const UniqueStack &lhs, + const UniqueStack &rhs) { + return lhs.m_stack_frames < rhs.m_stack_frames; + } + + protected: + // Mark the thread index as mutable, as we don't care about it from a const + // perspective, we only care about m_stack_frames so we keep our std::set + // sorted. + mutable std::vector m_thread_index_ids; + std::stack m_stack_frames; + }; + public: CommandObjectIterateOverThreads(CommandInterpreter &interpreter, const char *name, const char *help, @@ -57,11 +91,15 @@ class CommandObjectIterateOverThreads : public Command bool DoExecute(Args &command, CommandReturnObject &result) override { result.SetStatus(m_success_return); + bool all_threads = false; if (command.GetArgumentCount() == 0) { Thread *thread = m_exe_ctx.GetThreadPtr(); if (!HandleOneThread(thread->GetID(), result)) return false; return result.Succeeded(); + } else if (command.GetArgumentCount() == 1) { + all_threads = ::strcmp(command.GetArgumentAtIndex(0), "all") == 0; + m_unique_stacks = ::strcmp(command.GetArgumentAtIndex(0), "unique") == 0; } // Use tids instead of ThreadSPs to prevent deadlocking problems which @@ -69,8 +107,7 @@ class CommandObjectIterateOverThreads : public Command // code while iterating over the (locked) ThreadSP list. std::vector tids; - if (command.GetArgumentCount() == 1 && - ::strcmp(command.GetArgumentAtIndex(0), "all") == 0) { + if (all_threads || m_unique_stacks) { Process *process = m_exe_ctx.GetProcessPtr(); for (ThreadSP thread_sp : process->Threads()) @@ -108,15 +145,47 @@ class CommandObjectIterateOverThreads : public Command } } - uint32_t idx = 0; - for (const lldb::tid_t &tid : tids) { - if (idx != 0 && m_add_return) - result.AppendMessage(""); + if (m_unique_stacks) { + // Iterate over threads, finding unique stack buckets. + std::set unique_stacks; + for (const lldb::tid_t &tid : tids) { + if (!BucketThread(tid, unique_stacks, result)) { + return false; + } + } - if (!HandleOneThread(tid, result)) - return false; + // Write the thread id's and unique call stacks to the output stream + Stream &strm = result.GetOutputStream(); + Process *process = m_exe_ctx.GetProcessPtr(); + for (const UniqueStack &stack : unique_stacks) { + // List the common thread ID's + const std::vector &thread_index_ids = + stack.GetUniqueThreadIndexIDs(); + strm.Printf("%lu thread(s) ", thread_index_ids.size()); + for (const uint32_t &thread_index_id : thread_index_ids) { + strm.Printf("#%u ", thread_index_id); + } + strm.EOL(); - ++idx; + // List the shared call stack for this set of threads + uint32_t representative_thread_id = stack.GetRepresentativeThread(); + ThreadSP thread = process->GetThreadList().FindThreadByIndexID( + representative_thread_id); + if (!HandleOneThread(thread->GetID(), result)) { + return false; + } + } + } else { + uint32_t idx = 0; + for (const lldb::tid_t &tid : tids) { + if (idx != 0 && m_add_return) + result.AppendMessage(""); + + if (!HandleOneThread(tid, result)) + return false; + + ++idx; + } } return result.Succeeded(); } @@ -134,7 +203,43 @@ class CommandObjectIterateOverThreads : public Command virtual bool HandleOneThread(lldb::tid_t, CommandReturnObject &result) = 0; + bool BucketThread(lldb::tid_t tid, std::set &unique_stacks, + CommandReturnObject &result) { + // Grab the corresponding thread for the given thread id. + Process *process = m_exe_ctx.GetProcessPtr(); + Thread *thread = process->GetThreadList().FindThreadByID(tid).get(); + if (thread == nullptr) { + result.AppendErrorWithFormat("Failed to process thread# %lu.\n", tid); + result.SetStatus(eReturnStatusFailed); + return false; + } + + // Collect the each frame's address for this call-stack + std::stack stack_frames; + const uint32_t frame_count = thread->GetStackFrameCount(); + for (uint32_t frame_index = 0; frame_index < frame_count; frame_index++) { + const lldb::StackFrameSP frame_sp = + thread->GetStackFrameAtIndex(frame_index); + const lldb::addr_t pc = frame_sp->GetStackID().GetPC(); + stack_frames.push(pc); + } + + uint32_t thread_index_id = thread->GetIndexID(); + UniqueStack new_unique_stack(stack_frames, thread_index_id); + + // Try to match the threads stack to and existing entry. + std::set::iterator matching_stack = + unique_stacks.find(new_unique_stack); + if (matching_stack != unique_stacks.end()) { + matching_stack->AddThread(thread_index_id); + } else { + unique_stacks.insert(new_unique_stack); + } + return true; + } + ReturnStatus m_success_return = eReturnStatusSuccessFinishResult; + bool m_unique_stacks = false; bool m_add_return = true; }; @@ -218,9 +323,10 @@ class CommandObjectThreadBacktrace : public CommandObj : CommandObjectIterateOverThreads( interpreter, "thread backtrace", "Show thread call stacks. Defaults to the current thread, thread " - "indexes can be specified as arguments. Use the thread-index " - "\"all\" " - "to see all threads.", + "indexes can be specified as arguments.\n" + "Use the thread-index \"all\" to see all threads.\n" + "Use the thread-index \"unique\" to see threads grouped by unique " + "call stacks.", nullptr, eCommandRequiresProcess | eCommandRequiresThread | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched | @@ -270,11 +376,14 @@ class CommandObjectThreadBacktrace : public CommandObj Stream &strm = result.GetOutputStream(); + // Only dump stack info if we processing unique stacks. + const bool only_stacks = m_unique_stacks; + // Don't show source context when doing backtraces. const uint32_t num_frames_with_source = 0; const bool stop_format = true; if (!thread->GetStatus(strm, m_options.m_start, m_options.m_count, - num_frames_with_source, stop_format)) { + num_frames_with_source, stop_format, only_stacks)) { result.AppendErrorWithFormat( "error displaying backtrace for thread: \"0x%4.4x\"\n", thread->GetIndexID()); Modified: vendor/lldb/dist/source/Core/Debugger.cpp ============================================================================== --- vendor/lldb/dist/source/Core/Debugger.cpp Fri Jun 16 21:04:18 2017 (r320022) +++ vendor/lldb/dist/source/Core/Debugger.cpp Fri Jun 16 21:04:22 2017 (r320023) @@ -112,6 +112,12 @@ OptionEnumValueElement g_language_enumerators[] = { "{ " \ "${module.file.basename}{`${function.name-with-args}" \ "{${frame.no-debug}${function.pc-offset}}}}" + +#define MODULE_WITH_FUNC_NO_ARGS \ + "{ " \ + "${module.file.basename}{`${function.name-without-args}" \ + "{${frame.no-debug}${function.pc-offset}}}}" + #define FILE_AND_LINE "{ at ${line.file.basename}:${line.number}}" #define IS_OPTIMIZED "{${function.is-optimized} [opt]}" @@ -141,6 +147,10 @@ OptionEnumValueElement g_language_enumerators[] = { "frame #${frame.index}: ${frame.pc}" MODULE_WITH_FUNC FILE_AND_LINE \ IS_OPTIMIZED "\\n" +#define DEFAULT_FRAME_FORMAT_NO_ARGS \ + "frame #${frame.index}: ${frame.pc}" MODULE_WITH_FUNC_NO_ARGS FILE_AND_LINE \ + IS_OPTIMIZED "\\n" + // Three parts to this disassembly format specification: // 1. If this is a new function/symbol (no previous symbol/function), print // dylib`funcname:\n @@ -186,13 +196,15 @@ static PropertyDefinition g_properties[] = { {"auto-confirm", OptionValue::eTypeBoolean, true, false, nullptr, nullptr, "If true all confirmation prompts will receive their default reply."}, {"disassembly-format", OptionValue::eTypeFormatEntity, true, 0, - DEFAULT_DISASSEMBLY_FORMAT, nullptr, "The default disassembly format " - "string to use when disassembling " - "instruction sequences."}, + DEFAULT_DISASSEMBLY_FORMAT, nullptr, + "The default disassembly format " + "string to use when disassembling " + "instruction sequences."}, {"frame-format", OptionValue::eTypeFormatEntity, true, 0, - DEFAULT_FRAME_FORMAT, nullptr, "The default frame format string to use " - "when displaying stack frame information " - "for threads."}, + DEFAULT_FRAME_FORMAT, nullptr, + "The default frame format string to use " + "when displaying stack frame information " + "for threads."}, {"notify-void", OptionValue::eTypeBoolean, true, false, nullptr, nullptr, "Notify the user explicitly if an expression returns void (default: " "false)."}, @@ -203,18 +215,21 @@ static PropertyDefinition g_properties[] = { nullptr, g_language_enumerators, "The script language to be used for evaluating user-written scripts."}, {"stop-disassembly-count", OptionValue::eTypeSInt64, true, 4, nullptr, - nullptr, "The number of disassembly lines to show when displaying a " - "stopped context."}, + nullptr, + "The number of disassembly lines to show when displaying a " + "stopped context."}, {"stop-disassembly-display", OptionValue::eTypeEnum, true, Debugger::eStopDisassemblyTypeNoDebugInfo, nullptr, g_show_disassembly_enum_values, "Control when to display disassembly when displaying a stopped context."}, {"stop-line-count-after", OptionValue::eTypeSInt64, true, 3, nullptr, - nullptr, "The number of sources lines to display that come after the " - "current source line when displaying a stopped context."}, + nullptr, + "The number of sources lines to display that come after the " + "current source line when displaying a stopped context."}, {"stop-line-count-before", OptionValue::eTypeSInt64, true, 3, nullptr, - nullptr, "The number of sources lines to display that come before the " - "current source line when displaying a stopped context."}, + nullptr, + "The number of sources lines to display that come before the " + "current source line when displaying a stopped context."}, {"stop-show-column", OptionValue::eTypeEnum, false, eStopShowColumnAnsiOrCaret, nullptr, s_stop_show_column_values, "If true, LLDB will use the column information from the debug info to " @@ -232,19 +247,22 @@ static PropertyDefinition g_properties[] = { {"term-width", OptionValue::eTypeSInt64, true, 80, nullptr, nullptr, "The maximum number of columns to use for displaying text."}, {"thread-format", OptionValue::eTypeFormatEntity, true, 0, - DEFAULT_THREAD_FORMAT, nullptr, "The default thread format string to use " - "when displaying thread information."}, + DEFAULT_THREAD_FORMAT, nullptr, + "The default thread format string to use " + "when displaying thread information."}, {"thread-stop-format", OptionValue::eTypeFormatEntity, true, 0, - DEFAULT_THREAD_STOP_FORMAT, nullptr, "The default thread format " - "string to usewhen displaying thread " - "information as part of the stop display."}, + DEFAULT_THREAD_STOP_FORMAT, nullptr, + "The default thread format " + "string to use when displaying thread " + "information as part of the stop display."}, {"use-external-editor", OptionValue::eTypeBoolean, true, false, nullptr, nullptr, "Whether to use an external editor or not."}, {"use-color", OptionValue::eTypeBoolean, true, true, nullptr, nullptr, "Whether to use Ansi color codes or not."}, {"auto-one-line-summaries", OptionValue::eTypeBoolean, true, true, nullptr, - nullptr, "If true, LLDB will automatically display small structs in " - "one-liner format (default: true)."}, + nullptr, + "If true, LLDB will automatically display small structs in " + "one-liner format (default: true)."}, {"auto-indent", OptionValue::eTypeBoolean, true, true, nullptr, nullptr, "If true, LLDB will auto indent/outdent code. Currently only supported in " "the REPL (default: true)."}, @@ -255,8 +273,13 @@ static PropertyDefinition g_properties[] = { "The tab size to use when indenting code in multi-line input mode " "(default: 4)."}, {"escape-non-printables", OptionValue::eTypeBoolean, true, true, nullptr, - nullptr, "If true, LLDB will automatically escape non-printable and " - "escape characters when formatting strings."}, + nullptr, + "If true, LLDB will automatically escape non-printable and " + "escape characters when formatting strings."}, + {"frame-format-unique", OptionValue::eTypeFormatEntity, true, 0, + DEFAULT_FRAME_FORMAT_NO_ARGS, nullptr, + "The default frame format string to use when displaying stack frame" + "information for threads from thread backtrace unique."}, {nullptr, OptionValue::eTypeInvalid, true, 0, nullptr, nullptr, nullptr}}; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 16 21:04:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C5FAD8930D; Fri, 16 Jun 2017 21:04:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C0986F885; Fri, 16 Jun 2017 21:04:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL4FHH063819; Fri, 16 Jun 2017 21:04:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL4E3H063811; Fri, 16 Jun 2017 21:04:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162104.v5GL4E3H063811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320021 - in vendor/lld/dist: COFF ELF ELF/Arch docs test test/COFF test/COFF/Inputs test/ELF test/ELF/Inputs test/ELF/linkerscript 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:04:16 -0000 Author: dim Date: Fri Jun 16 21:04:14 2017 New Revision: 320021 URL: https://svnweb.freebsd.org/changeset/base/320021 Log: Vendor import of lld trunk r305575: https://llvm.org/svn/llvm-project/lld/trunk@305575 Added: vendor/lld/dist/ELF/Arch/ vendor/lld/dist/ELF/Arch/AArch64.cpp (contents, props changed) vendor/lld/dist/ELF/Arch/AMDGPU.cpp (contents, props changed) vendor/lld/dist/ELF/Arch/ARM.cpp (contents, props changed) vendor/lld/dist/ELF/Arch/AVR.cpp (contents, props changed) vendor/lld/dist/ELF/Arch/Mips.cpp (contents, props changed) vendor/lld/dist/ELF/Arch/PPC.cpp (contents, props changed) vendor/lld/dist/ELF/Arch/PPC64.cpp (contents, props changed) vendor/lld/dist/ELF/Arch/X86.cpp (contents, props changed) vendor/lld/dist/ELF/Arch/X86_64.cpp (contents, props changed) vendor/lld/dist/test/COFF/Inputs/library.def vendor/lld/dist/test/COFF/lib.test vendor/lld/dist/test/COFF/pdb-lib.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/icf-merge-sec.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/icf-merge.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/icf-merge2.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/icf-merge3.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/sht-group-gold-r.elf (contents, props changed) vendor/lld/dist/test/ELF/Inputs/sht-group-gold-r.s (contents, props changed) vendor/lld/dist/test/ELF/basic-avr.s (contents, props changed) vendor/lld/dist/test/ELF/icf-merge-sec.s (contents, props changed) vendor/lld/dist/test/ELF/icf-merge.s (contents, props changed) vendor/lld/dist/test/ELF/linkerscript/data-commands-gc.s (contents, props changed) vendor/lld/dist/test/ELF/sht-group-gold-r.test Modified: vendor/lld/dist/COFF/Driver.cpp vendor/lld/dist/COFF/DriverUtils.cpp vendor/lld/dist/COFF/InputFiles.h vendor/lld/dist/COFF/PDB.cpp vendor/lld/dist/ELF/CMakeLists.txt vendor/lld/dist/ELF/Driver.cpp vendor/lld/dist/ELF/ICF.cpp vendor/lld/dist/ELF/InputFiles.cpp vendor/lld/dist/ELF/InputFiles.h vendor/lld/dist/ELF/InputSection.cpp vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/LinkerScript.h vendor/lld/dist/ELF/MarkLive.cpp vendor/lld/dist/ELF/OutputSections.cpp vendor/lld/dist/ELF/OutputSections.h vendor/lld/dist/ELF/Relocations.cpp vendor/lld/dist/ELF/Relocations.h vendor/lld/dist/ELF/Strings.h vendor/lld/dist/ELF/SyntheticSections.cpp vendor/lld/dist/ELF/SyntheticSections.h vendor/lld/dist/ELF/Target.cpp vendor/lld/dist/ELF/Target.h vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/docs/windows_support.rst vendor/lld/dist/test/COFF/Inputs/constant-export.ll vendor/lld/dist/test/COFF/Inputs/pdb1.yaml vendor/lld/dist/test/COFF/Inputs/pdb2.yaml vendor/lld/dist/test/COFF/include-lto.ll vendor/lld/dist/test/COFF/lto-linker-opts.ll vendor/lld/dist/test/COFF/pdb-none.test vendor/lld/dist/test/COFF/pdb-options.test vendor/lld/dist/test/COFF/pdb.test vendor/lld/dist/test/COFF/sort-debug.test vendor/lld/dist/test/ELF/aarch64-undefined-weak.s vendor/lld/dist/test/ELF/arm-thumb-no-undefined-thunk.s vendor/lld/dist/test/ELF/arm-thumb-undefined-weak.s vendor/lld/dist/test/ELF/arm-undefined-weak.s vendor/lld/dist/test/ELF/linkerscript/locationcountererr2.s vendor/lld/dist/test/ELF/linkerscript/symbols-non-alloc.s vendor/lld/dist/test/lit.cfg Modified: vendor/lld/dist/COFF/Driver.cpp ============================================================================== --- vendor/lld/dist/COFF/Driver.cpp Fri Jun 16 21:04:10 2017 (r320020) +++ vendor/lld/dist/COFF/Driver.cpp Fri Jun 16 21:04:14 2017 (r320021) @@ -429,7 +429,7 @@ static std::string getImplibPath() { return Out.str(); } -std::vector createCOFFShortExportFromConfig() { +static void createImportLibrary() { std::vector Exports; for (Export &E1 : Config->Exports) { COFFShortExport E2; @@ -443,11 +443,7 @@ std::vector createCOFFShortExportFrom E2.Constant = E1.Constant; Exports.push_back(E2); } - return Exports; -} -static void createImportLibrary() { - std::vector Exports = createCOFFShortExportFromConfig(); std::string DLLName = sys::path::filename(Config->OutputFile); std::string Path = getImplibPath(); writeImportLibrary(DLLName, Path, Exports, Config->Machine); @@ -707,8 +703,12 @@ void LinkerDriver::link(ArrayRef ArgsArr } } - if (!Args.hasArgNoClaim(OPT_INPUT)) - fatal("no input files"); + if (!Args.hasArgNoClaim(OPT_INPUT)) { + if (Args.hasArgNoClaim(OPT_deffile)) + Config->NoEntry = true; + else + fatal("no input files"); + } // Construct search path list. SearchPaths.push_back(""); @@ -988,6 +988,13 @@ void LinkerDriver::link(ArrayRef ArgsArr if (auto *Arg = Args.getLastArg(OPT_deffile)) { // parseModuleDefs mutates Config object. parseModuleDefs(Arg->getValue()); + } + + // Handle generation of import library from a def file. + if (!Args.hasArgNoClaim(OPT_INPUT)) { + fixupExports(); + createImportLibrary(); + exit(0); } // Handle /delayload Modified: vendor/lld/dist/COFF/DriverUtils.cpp ============================================================================== --- vendor/lld/dist/COFF/DriverUtils.cpp Fri Jun 16 21:04:10 2017 (r320020) +++ vendor/lld/dist/COFF/DriverUtils.cpp Fri Jun 16 21:04:14 2017 (r320021) @@ -522,7 +522,7 @@ void fixupExports() { for (Export &E : Config->Exports) { SymbolBody *Sym = E.Sym; - if (!E.ForwardTo.empty()) { + if (!E.ForwardTo.empty() || !Sym) { E.SymbolName = E.Name; } else { if (auto *U = dyn_cast(Sym)) Modified: vendor/lld/dist/COFF/InputFiles.h ============================================================================== --- vendor/lld/dist/COFF/InputFiles.h Fri Jun 16 21:04:10 2017 (r320020) +++ vendor/lld/dist/COFF/InputFiles.h Fri Jun 16 21:04:14 2017 (r320021) @@ -22,6 +22,12 @@ #include #include +namespace llvm { +namespace pdb { +class DbiModuleDescriptorBuilder; +} +} + namespace lld { namespace coff { @@ -121,6 +127,12 @@ class ObjectFile : public InputFile { (public) // The list of safe exception handlers listed in .sxdata section. // COFF-specific and x86-only. std::set SEHandlers; + + // Pointer to the PDB module descriptor builder. Various debug info records + // will reference object files by "module index", which is here. Things like + // source files and section contributions are also recorded here. Will be null + // if we are not producing a PDB. + llvm::pdb::DbiModuleDescriptorBuilder *ModuleDBI = nullptr; private: void initializeChunks(); Modified: vendor/lld/dist/COFF/PDB.cpp ============================================================================== --- vendor/lld/dist/COFF/PDB.cpp Fri Jun 16 21:04:10 2017 (r320020) +++ vendor/lld/dist/COFF/PDB.cpp Fri Jun 16 21:04:14 2017 (r320021) @@ -29,6 +29,7 @@ #include "llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h" #include "llvm/DebugInfo/PDB/Native/PDBFile.h" #include "llvm/DebugInfo/PDB/Native/PDBFileBuilder.h" +#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h" #include "llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h" #include "llvm/DebugInfo/PDB/Native/PDBTypeServerHandler.h" #include "llvm/DebugInfo/PDB/Native/TpiStream.h" @@ -53,12 +54,10 @@ using llvm::object::coff_section; static ExitOnError ExitOnErr; // Returns a list of all SectionChunks. -static std::vector getInputSections(SymbolTable *Symtab) { - std::vector V; +static void addSectionContribs(SymbolTable *Symtab, pdb::DbiStreamBuilder &DbiBuilder) { for (Chunk *C : Symtab->getChunks()) if (auto *SC = dyn_cast(C)) - V.push_back(*SC->Header); - return V; + DbiBuilder.addSectionContrib(SC->File->ModuleDBI, SC->Header); } static SectionChunk *findByName(std::vector &Sections, @@ -95,10 +94,11 @@ static void addTypeInfo(pdb::TpiStreamBuilder &TpiBuil }); } -// Merge .debug$T sections into IpiData and TpiData. -static void mergeDebugT(SymbolTable *Symtab, pdb::PDBFileBuilder &Builder, - codeview::TypeTableBuilder &TypeTable, - codeview::TypeTableBuilder &IDTable) { +// Add all object files to the PDB. Merge .debug$T sections into IpiData and +// TpiData. +static void addObjectsToPDB(SymbolTable *Symtab, pdb::PDBFileBuilder &Builder, + codeview::TypeTableBuilder &TypeTable, + codeview::TypeTableBuilder &IDTable) { // Follow type servers. If the same type server is encountered more than // once for this instance of `PDBTypeServerHandler` (for example if many // object files reference the same TypeServer), the types from the @@ -107,6 +107,20 @@ static void mergeDebugT(SymbolTable *Symtab, pdb::PDBF // Visit all .debug$T sections to add them to Builder. for (ObjectFile *File : Symtab->ObjectFiles) { + // Add a module descriptor for every object file. We need to put an absolute + // path to the object into the PDB. If this is a plain object, we make its + // path absolute. If it's an object in an archive, we make the archive path + // absolute. + bool InArchive = !File->ParentName.empty(); + SmallString<128> Path = InArchive ? File->ParentName : File->getName(); + sys::fs::make_absolute(Path); + StringRef Name = InArchive ? File->getName() : StringRef(Path); + File->ModuleDBI = &ExitOnErr(Builder.getDbiBuilder().addModuleInfo(Name)); + File->ModuleDBI->setObjFileName(Path); + + // FIXME: Walk the .debug$S sections and add them. Do things like recording + // source files. + ArrayRef Data = getDebugSection(File, ".debug$T"); if (Data.empty()) continue; @@ -202,17 +216,15 @@ void coff::createPDB(StringRef Path, SymbolTable *Symt InfoBuilder.setVersion(pdb::PdbRaw_ImplVer::PdbImplVC70); // Add an empty DPI stream. - auto &DbiBuilder = Builder.getDbiBuilder(); + pdb::DbiStreamBuilder &DbiBuilder = Builder.getDbiBuilder(); DbiBuilder.setVersionHeader(pdb::PdbDbiV110); codeview::TypeTableBuilder TypeTable(BAlloc); codeview::TypeTableBuilder IDTable(BAlloc); - mergeDebugT(Symtab, Builder, TypeTable, IDTable); + addObjectsToPDB(Symtab, Builder, TypeTable, IDTable); // Add Section Contributions. - std::vector Contribs = - pdb::DbiStreamBuilder::createSectionContribs(getInputSections(Symtab)); - DbiBuilder.setSectionContribs(Contribs); + addSectionContribs(Symtab, DbiBuilder); // Add Section Map stream. ArrayRef Sections = { Added: vendor/lld/dist/ELF/Arch/AArch64.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/ELF/Arch/AArch64.cpp Fri Jun 16 21:04:14 2017 (r320021) @@ -0,0 +1,374 @@ +//===- AArch64.cpp --------------------------------------------------------===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "Error.h" +#include "Memory.h" +#include "Symbols.h" +#include "SyntheticSections.h" +#include "Target.h" +#include "Thunks.h" +#include "llvm/Object/ELF.h" +#include "llvm/Support/Endian.h" + +using namespace llvm; +using namespace llvm::support::endian; +using namespace llvm::ELF; +using namespace lld; +using namespace lld::elf; + +// Page(Expr) is the page address of the expression Expr, defined +// as (Expr & ~0xFFF). (This applies even if the machine page size +// supported by the platform has a different value.) +uint64_t elf::getAArch64Page(uint64_t Expr) { + return Expr & ~static_cast(0xFFF); +} + +namespace { +class AArch64 final : public TargetInfo { +public: + AArch64(); + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S, + const uint8_t *Loc) const override; + bool isPicRel(uint32_t Type) const override; + void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override; + void writePltHeader(uint8_t *Buf) const override; + void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr, + int32_t Index, unsigned RelOff) const override; + bool usesOnlyLowPageBits(uint32_t Type) const override; + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + RelExpr adjustRelaxExpr(uint32_t Type, const uint8_t *Data, + RelExpr Expr) const override; + void relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relaxTlsIeToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; +}; +} // namespace + +AArch64::AArch64() { + CopyRel = R_AARCH64_COPY; + RelativeRel = R_AARCH64_RELATIVE; + IRelativeRel = R_AARCH64_IRELATIVE; + GotRel = R_AARCH64_GLOB_DAT; + PltRel = R_AARCH64_JUMP_SLOT; + TlsDescRel = R_AARCH64_TLSDESC; + TlsGotRel = R_AARCH64_TLS_TPREL64; + GotEntrySize = 8; + GotPltEntrySize = 8; + PltEntrySize = 16; + PltHeaderSize = 32; + DefaultMaxPageSize = 65536; + + // It doesn't seem to be documented anywhere, but tls on aarch64 uses variant + // 1 of the tls structures and the tcb size is 16. + TcbSize = 16; +} + +RelExpr AArch64::getRelExpr(uint32_t Type, const SymbolBody &S, + const uint8_t *Loc) const { + switch (Type) { + default: + return R_ABS; + case R_AARCH64_TLSDESC_ADR_PAGE21: + return R_TLSDESC_PAGE; + case R_AARCH64_TLSDESC_LD64_LO12: + case R_AARCH64_TLSDESC_ADD_LO12: + return R_TLSDESC; + case R_AARCH64_TLSDESC_CALL: + return R_TLSDESC_CALL; + case R_AARCH64_TLSLE_ADD_TPREL_HI12: + case R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: + return R_TLS; + case R_AARCH64_CALL26: + case R_AARCH64_CONDBR19: + case R_AARCH64_JUMP26: + case R_AARCH64_TSTBR14: + return R_PLT_PC; + case R_AARCH64_PREL16: + case R_AARCH64_PREL32: + case R_AARCH64_PREL64: + case R_AARCH64_ADR_PREL_LO21: + return R_PC; + case R_AARCH64_ADR_PREL_PG_HI21: + return R_PAGE_PC; + case R_AARCH64_LD64_GOT_LO12_NC: + case R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: + return R_GOT; + case R_AARCH64_ADR_GOT_PAGE: + case R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: + return R_GOT_PAGE_PC; + case R_AARCH64_NONE: + return R_NONE; + } +} + +RelExpr AArch64::adjustRelaxExpr(uint32_t Type, const uint8_t *Data, + RelExpr Expr) const { + if (Expr == R_RELAX_TLS_GD_TO_IE) { + if (Type == R_AARCH64_TLSDESC_ADR_PAGE21) + return R_RELAX_TLS_GD_TO_IE_PAGE_PC; + return R_RELAX_TLS_GD_TO_IE_ABS; + } + return Expr; +} + +bool AArch64::usesOnlyLowPageBits(uint32_t Type) const { + switch (Type) { + default: + return false; + case R_AARCH64_ADD_ABS_LO12_NC: + case R_AARCH64_LD64_GOT_LO12_NC: + case R_AARCH64_LDST128_ABS_LO12_NC: + case R_AARCH64_LDST16_ABS_LO12_NC: + case R_AARCH64_LDST32_ABS_LO12_NC: + case R_AARCH64_LDST64_ABS_LO12_NC: + case R_AARCH64_LDST8_ABS_LO12_NC: + case R_AARCH64_TLSDESC_ADD_LO12: + case R_AARCH64_TLSDESC_LD64_LO12: + case R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: + return true; + } +} + +bool AArch64::isPicRel(uint32_t Type) const { + return Type == R_AARCH64_ABS32 || Type == R_AARCH64_ABS64; +} + +void AArch64::writeGotPlt(uint8_t *Buf, const SymbolBody &) const { + write64le(Buf, InX::Plt->getVA()); +} + +void AArch64::writePltHeader(uint8_t *Buf) const { + const uint8_t PltData[] = { + 0xf0, 0x7b, 0xbf, 0xa9, // stp x16, x30, [sp,#-16]! + 0x10, 0x00, 0x00, 0x90, // adrp x16, Page(&(.plt.got[2])) + 0x11, 0x02, 0x40, 0xf9, // ldr x17, [x16, Offset(&(.plt.got[2]))] + 0x10, 0x02, 0x00, 0x91, // add x16, x16, Offset(&(.plt.got[2])) + 0x20, 0x02, 0x1f, 0xd6, // br x17 + 0x1f, 0x20, 0x03, 0xd5, // nop + 0x1f, 0x20, 0x03, 0xd5, // nop + 0x1f, 0x20, 0x03, 0xd5 // nop + }; + memcpy(Buf, PltData, sizeof(PltData)); + + uint64_t Got = InX::GotPlt->getVA(); + uint64_t Plt = InX::Plt->getVA(); + relocateOne(Buf + 4, R_AARCH64_ADR_PREL_PG_HI21, + getAArch64Page(Got + 16) - getAArch64Page(Plt + 4)); + relocateOne(Buf + 8, R_AARCH64_LDST64_ABS_LO12_NC, Got + 16); + relocateOne(Buf + 12, R_AARCH64_ADD_ABS_LO12_NC, Got + 16); +} + +void AArch64::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, + uint64_t PltEntryAddr, int32_t Index, + unsigned RelOff) const { + const uint8_t Inst[] = { + 0x10, 0x00, 0x00, 0x90, // adrp x16, Page(&(.plt.got[n])) + 0x11, 0x02, 0x40, 0xf9, // ldr x17, [x16, Offset(&(.plt.got[n]))] + 0x10, 0x02, 0x00, 0x91, // add x16, x16, Offset(&(.plt.got[n])) + 0x20, 0x02, 0x1f, 0xd6 // br x17 + }; + memcpy(Buf, Inst, sizeof(Inst)); + + relocateOne(Buf, R_AARCH64_ADR_PREL_PG_HI21, + getAArch64Page(GotPltEntryAddr) - getAArch64Page(PltEntryAddr)); + relocateOne(Buf + 4, R_AARCH64_LDST64_ABS_LO12_NC, GotPltEntryAddr); + relocateOne(Buf + 8, R_AARCH64_ADD_ABS_LO12_NC, GotPltEntryAddr); +} + +static void write32AArch64Addr(uint8_t *L, uint64_t Imm) { + uint32_t ImmLo = (Imm & 0x3) << 29; + uint32_t ImmHi = (Imm & 0x1FFFFC) << 3; + uint64_t Mask = (0x3 << 29) | (0x1FFFFC << 3); + write32le(L, (read32le(L) & ~Mask) | ImmLo | ImmHi); +} + +// Return the bits [Start, End] from Val shifted Start bits. +// For instance, getBits(0xF0, 4, 8) returns 0xF. +static uint64_t getBits(uint64_t Val, int Start, int End) { + uint64_t Mask = ((uint64_t)1 << (End + 1 - Start)) - 1; + return (Val >> Start) & Mask; +} + +static void or32le(uint8_t *P, int32_t V) { write32le(P, read32le(P) | V); } + +// Update the immediate field in a AARCH64 ldr, str, and add instruction. +static void or32AArch64Imm(uint8_t *L, uint64_t Imm) { + or32le(L, (Imm & 0xFFF) << 10); +} + +void AArch64::relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const { + switch (Type) { + case R_AARCH64_ABS16: + case R_AARCH64_PREL16: + checkIntUInt<16>(Loc, Val, Type); + write16le(Loc, Val); + break; + case R_AARCH64_ABS32: + case R_AARCH64_PREL32: + checkIntUInt<32>(Loc, Val, Type); + write32le(Loc, Val); + break; + case R_AARCH64_ABS64: + case R_AARCH64_GLOB_DAT: + case R_AARCH64_PREL64: + write64le(Loc, Val); + break; + case R_AARCH64_ADD_ABS_LO12_NC: + or32AArch64Imm(Loc, Val); + break; + case R_AARCH64_ADR_GOT_PAGE: + case R_AARCH64_ADR_PREL_PG_HI21: + case R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: + case R_AARCH64_TLSDESC_ADR_PAGE21: + checkInt<33>(Loc, Val, Type); + write32AArch64Addr(Loc, Val >> 12); + break; + case R_AARCH64_ADR_PREL_LO21: + checkInt<21>(Loc, Val, Type); + write32AArch64Addr(Loc, Val); + break; + case R_AARCH64_CALL26: + case R_AARCH64_JUMP26: + checkInt<28>(Loc, Val, Type); + or32le(Loc, (Val & 0x0FFFFFFC) >> 2); + break; + case R_AARCH64_CONDBR19: + checkInt<21>(Loc, Val, Type); + or32le(Loc, (Val & 0x1FFFFC) << 3); + break; + case R_AARCH64_LD64_GOT_LO12_NC: + case R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: + case R_AARCH64_TLSDESC_LD64_LO12: + checkAlignment<8>(Loc, Val, Type); + or32le(Loc, (Val & 0xFF8) << 7); + break; + case R_AARCH64_LDST8_ABS_LO12_NC: + or32AArch64Imm(Loc, getBits(Val, 0, 11)); + break; + case R_AARCH64_LDST16_ABS_LO12_NC: + or32AArch64Imm(Loc, getBits(Val, 1, 11)); + break; + case R_AARCH64_LDST32_ABS_LO12_NC: + or32AArch64Imm(Loc, getBits(Val, 2, 11)); + break; + case R_AARCH64_LDST64_ABS_LO12_NC: + or32AArch64Imm(Loc, getBits(Val, 3, 11)); + break; + case R_AARCH64_LDST128_ABS_LO12_NC: + or32AArch64Imm(Loc, getBits(Val, 4, 11)); + break; + case R_AARCH64_MOVW_UABS_G0_NC: + or32le(Loc, (Val & 0xFFFF) << 5); + break; + case R_AARCH64_MOVW_UABS_G1_NC: + or32le(Loc, (Val & 0xFFFF0000) >> 11); + break; + case R_AARCH64_MOVW_UABS_G2_NC: + or32le(Loc, (Val & 0xFFFF00000000) >> 27); + break; + case R_AARCH64_MOVW_UABS_G3: + or32le(Loc, (Val & 0xFFFF000000000000) >> 43); + break; + case R_AARCH64_TSTBR14: + checkInt<16>(Loc, Val, Type); + or32le(Loc, (Val & 0xFFFC) << 3); + break; + case R_AARCH64_TLSLE_ADD_TPREL_HI12: + checkInt<24>(Loc, Val, Type); + or32AArch64Imm(Loc, Val >> 12); + break; + case R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: + case R_AARCH64_TLSDESC_ADD_LO12: + or32AArch64Imm(Loc, Val); + break; + default: + error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + } +} + +void AArch64::relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const { + // TLSDESC Global-Dynamic relocation are in the form: + // adrp x0, :tlsdesc:v [R_AARCH64_TLSDESC_ADR_PAGE21] + // ldr x1, [x0, #:tlsdesc_lo12:v [R_AARCH64_TLSDESC_LD64_LO12] + // add x0, x0, :tlsdesc_los:v [R_AARCH64_TLSDESC_ADD_LO12] + // .tlsdesccall [R_AARCH64_TLSDESC_CALL] + // blr x1 + // And it can optimized to: + // movz x0, #0x0, lsl #16 + // movk x0, #0x10 + // nop + // nop + checkUInt<32>(Loc, Val, Type); + + switch (Type) { + case R_AARCH64_TLSDESC_ADD_LO12: + case R_AARCH64_TLSDESC_CALL: + write32le(Loc, 0xd503201f); // nop + return; + case R_AARCH64_TLSDESC_ADR_PAGE21: + write32le(Loc, 0xd2a00000 | (((Val >> 16) & 0xffff) << 5)); // movz + return; + case R_AARCH64_TLSDESC_LD64_LO12: + write32le(Loc, 0xf2800000 | ((Val & 0xffff) << 5)); // movk + return; + default: + llvm_unreachable("unsupported relocation for TLS GD to LE relaxation"); + } +} + +void AArch64::relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, uint64_t Val) const { + // TLSDESC Global-Dynamic relocation are in the form: + // adrp x0, :tlsdesc:v [R_AARCH64_TLSDESC_ADR_PAGE21] + // ldr x1, [x0, #:tlsdesc_lo12:v [R_AARCH64_TLSDESC_LD64_LO12] + // add x0, x0, :tlsdesc_los:v [R_AARCH64_TLSDESC_ADD_LO12] + // .tlsdesccall [R_AARCH64_TLSDESC_CALL] + // blr x1 + // And it can optimized to: + // adrp x0, :gottprel:v + // ldr x0, [x0, :gottprel_lo12:v] + // nop + // nop + + switch (Type) { + case R_AARCH64_TLSDESC_ADD_LO12: + case R_AARCH64_TLSDESC_CALL: + write32le(Loc, 0xd503201f); // nop + break; + case R_AARCH64_TLSDESC_ADR_PAGE21: + write32le(Loc, 0x90000000); // adrp + relocateOne(Loc, R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, Val); + break; + case R_AARCH64_TLSDESC_LD64_LO12: + write32le(Loc, 0xf9400000); // ldr + relocateOne(Loc, R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, Val); + break; + default: + llvm_unreachable("unsupported relocation for TLS GD to LE relaxation"); + } +} + +void AArch64::relaxTlsIeToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const { + checkUInt<32>(Loc, Val, Type); + + if (Type == R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21) { + // Generate MOVZ. + uint32_t RegNo = read32le(Loc) & 0x1f; + write32le(Loc, (0xd2a00000 | RegNo) | (((Val >> 16) & 0xffff) << 5)); + return; + } + if (Type == R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC) { + // Generate MOVK. + uint32_t RegNo = read32le(Loc) & 0x1f; + write32le(Loc, (0xf2800000 | RegNo) | ((Val & 0xffff) << 5)); + return; + } + llvm_unreachable("invalid relocation for TLS IE to LE relaxation"); +} + +TargetInfo *elf::createAArch64TargetInfo() { return make(); } Added: vendor/lld/dist/ELF/Arch/AMDGPU.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/ELF/Arch/AMDGPU.cpp Fri Jun 16 21:04:14 2017 (r320021) @@ -0,0 +1,82 @@ +//===- AMDGPU.cpp ---------------------------------------------------------===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "Error.h" +#include "InputFiles.h" +#include "Memory.h" +#include "Symbols.h" +#include "Target.h" +#include "llvm/Object/ELF.h" +#include "llvm/Support/Endian.h" + +using namespace llvm; +using namespace llvm::object; +using namespace llvm::support::endian; +using namespace llvm::ELF; +using namespace lld; +using namespace lld::elf; + +namespace { +class AMDGPU final : public TargetInfo { +public: + AMDGPU(); + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S, + const uint8_t *Loc) const override; +}; +} // namespace + +AMDGPU::AMDGPU() { + RelativeRel = R_AMDGPU_REL64; + GotRel = R_AMDGPU_ABS64; + GotEntrySize = 8; +} + +void AMDGPU::relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const { + switch (Type) { + case R_AMDGPU_ABS32: + case R_AMDGPU_GOTPCREL: + case R_AMDGPU_GOTPCREL32_LO: + case R_AMDGPU_REL32: + case R_AMDGPU_REL32_LO: + write32le(Loc, Val); + break; + case R_AMDGPU_ABS64: + write64le(Loc, Val); + break; + case R_AMDGPU_GOTPCREL32_HI: + case R_AMDGPU_REL32_HI: + write32le(Loc, Val >> 32); + break; + default: + error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + } +} + +RelExpr AMDGPU::getRelExpr(uint32_t Type, const SymbolBody &S, + const uint8_t *Loc) const { + switch (Type) { + case R_AMDGPU_ABS32: + case R_AMDGPU_ABS64: + return R_ABS; + case R_AMDGPU_REL32: + case R_AMDGPU_REL32_LO: + case R_AMDGPU_REL32_HI: + return R_PC; + case R_AMDGPU_GOTPCREL: + case R_AMDGPU_GOTPCREL32_LO: + case R_AMDGPU_GOTPCREL32_HI: + return R_GOT_PC; + default: + error(toString(S.File) + ": unknown relocation type: " + toString(Type)); + return R_HINT; + } +} + +TargetInfo *elf::createAMDGPUTargetInfo() { return make(); } Added: vendor/lld/dist/ELF/Arch/ARM.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/ELF/Arch/ARM.cpp Fri Jun 16 21:04:14 2017 (r320021) @@ -0,0 +1,432 @@ +//===- ARM.cpp ------------------------------------------------------------===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "Error.h" +#include "InputFiles.h" +#include "Memory.h" +#include "Symbols.h" +#include "SyntheticSections.h" +#include "Target.h" +#include "Thunks.h" +#include "llvm/Object/ELF.h" +#include "llvm/Support/Endian.h" + +using namespace llvm; +using namespace llvm::support::endian; +using namespace llvm::ELF; +using namespace lld; +using namespace lld::elf; + +namespace { +class ARM final : public TargetInfo { +public: + ARM(); + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S, + const uint8_t *Loc) const override; + bool isPicRel(uint32_t Type) const override; + uint32_t getDynRel(uint32_t Type) const override; + int64_t getImplicitAddend(const uint8_t *Buf, uint32_t Type) const override; + void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override; + void writeIgotPlt(uint8_t *Buf, const SymbolBody &S) const override; + void writePltHeader(uint8_t *Buf) const override; + void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr, + int32_t Index, unsigned RelOff) const override; + void addPltSymbols(InputSectionBase *IS, uint64_t Off) const override; + void addPltHeaderSymbols(InputSectionBase *ISD) const override; + bool needsThunk(RelExpr Expr, uint32_t RelocType, const InputFile *File, + const SymbolBody &S) const override; + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; +}; +} // namespace + +ARM::ARM() { + CopyRel = R_ARM_COPY; + RelativeRel = R_ARM_RELATIVE; + IRelativeRel = R_ARM_IRELATIVE; + GotRel = R_ARM_GLOB_DAT; + PltRel = R_ARM_JUMP_SLOT; + TlsGotRel = R_ARM_TLS_TPOFF32; + TlsModuleIndexRel = R_ARM_TLS_DTPMOD32; + TlsOffsetRel = R_ARM_TLS_DTPOFF32; + GotEntrySize = 4; + GotPltEntrySize = 4; + PltEntrySize = 16; + PltHeaderSize = 20; + // ARM uses Variant 1 TLS + TcbSize = 8; + NeedsThunks = true; +} + +RelExpr ARM::getRelExpr(uint32_t Type, const SymbolBody &S, + const uint8_t *Loc) const { + switch (Type) { + default: + return R_ABS; + case R_ARM_THM_JUMP11: + return R_PC; + case R_ARM_CALL: + case R_ARM_JUMP24: + case R_ARM_PC24: + case R_ARM_PLT32: + case R_ARM_PREL31: + case R_ARM_THM_JUMP19: + case R_ARM_THM_JUMP24: + case R_ARM_THM_CALL: + return R_PLT_PC; + case R_ARM_GOTOFF32: + // (S + A) - GOT_ORG + return R_GOTREL; + case R_ARM_GOT_BREL: + // GOT(S) + A - GOT_ORG + return R_GOT_OFF; + case R_ARM_GOT_PREL: + case R_ARM_TLS_IE32: + // GOT(S) + A - P + return R_GOT_PC; + case R_ARM_SBREL32: + return R_ARM_SBREL; + case R_ARM_TARGET1: + return Config->Target1Rel ? R_PC : R_ABS; + case R_ARM_TARGET2: + if (Config->Target2 == Target2Policy::Rel) + return R_PC; + if (Config->Target2 == Target2Policy::Abs) + return R_ABS; + return R_GOT_PC; + case R_ARM_TLS_GD32: + return R_TLSGD_PC; + case R_ARM_TLS_LDM32: + return R_TLSLD_PC; + case R_ARM_BASE_PREL: + // B(S) + A - P + // FIXME: currently B(S) assumed to be .got, this may not hold for all + // platforms. + return R_GOTONLY_PC; + case R_ARM_MOVW_PREL_NC: + case R_ARM_MOVT_PREL: + case R_ARM_REL32: + case R_ARM_THM_MOVW_PREL_NC: + case R_ARM_THM_MOVT_PREL: + return R_PC; + case R_ARM_NONE: + return R_NONE; + case R_ARM_TLS_LE32: + return R_TLS; + } +} + +bool ARM::isPicRel(uint32_t Type) const { + return (Type == R_ARM_TARGET1 && !Config->Target1Rel) || + (Type == R_ARM_ABS32); +} + +uint32_t ARM::getDynRel(uint32_t Type) const { + if (Type == R_ARM_TARGET1 && !Config->Target1Rel) + return R_ARM_ABS32; + if (Type == R_ARM_ABS32) + return Type; + // Keep it going with a dummy value so that we can find more reloc errors. + return R_ARM_ABS32; +} + +void ARM::writeGotPlt(uint8_t *Buf, const SymbolBody &) const { + write32le(Buf, InX::Plt->getVA()); +} + +void ARM::writeIgotPlt(uint8_t *Buf, const SymbolBody &S) const { + // An ARM entry is the address of the ifunc resolver function. + write32le(Buf, S.getVA()); +} + +void ARM::writePltHeader(uint8_t *Buf) const { + const uint8_t PltData[] = { + 0x04, 0xe0, 0x2d, 0xe5, // str lr, [sp,#-4]! + 0x04, 0xe0, 0x9f, 0xe5, // ldr lr, L2 + 0x0e, 0xe0, 0x8f, 0xe0, // L1: add lr, pc, lr + 0x08, 0xf0, 0xbe, 0xe5, // ldr pc, [lr, #8] + 0x00, 0x00, 0x00, 0x00, // L2: .word &(.got.plt) - L1 - 8 + }; + memcpy(Buf, PltData, sizeof(PltData)); + uint64_t GotPlt = InX::GotPlt->getVA(); + uint64_t L1 = InX::Plt->getVA() + 8; + write32le(Buf + 16, GotPlt - L1 - 8); +} + +void ARM::addPltHeaderSymbols(InputSectionBase *ISD) const { + auto *IS = cast(ISD); + addSyntheticLocal("$a", STT_NOTYPE, 0, 0, IS); + addSyntheticLocal("$d", STT_NOTYPE, 16, 0, IS); +} + +void ARM::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, + uint64_t PltEntryAddr, int32_t Index, + unsigned RelOff) const { + // FIXME: Using simple code sequence with simple relocations. + // There is a more optimal sequence but it requires support for the group + // relocations. See ELF for the ARM Architecture Appendix A.3 + const uint8_t PltData[] = { + 0x04, 0xc0, 0x9f, 0xe5, // ldr ip, L2 + 0x0f, 0xc0, 0x8c, 0xe0, // L1: add ip, ip, pc + 0x00, 0xf0, 0x9c, 0xe5, // ldr pc, [ip] + 0x00, 0x00, 0x00, 0x00, // L2: .word Offset(&(.plt.got) - L1 - 8 + }; + memcpy(Buf, PltData, sizeof(PltData)); + uint64_t L1 = PltEntryAddr + 4; + write32le(Buf + 12, GotPltEntryAddr - L1 - 8); +} + +void ARM::addPltSymbols(InputSectionBase *ISD, uint64_t Off) const { + auto *IS = cast(ISD); + addSyntheticLocal("$a", STT_NOTYPE, Off, 0, IS); + addSyntheticLocal("$d", STT_NOTYPE, Off + 12, 0, IS); +} + +bool ARM::needsThunk(RelExpr Expr, uint32_t RelocType, const InputFile *File, + const SymbolBody &S) const { + // If S is an undefined weak symbol in an executable we don't need a Thunk. + // In a DSO calls to undefined symbols, including weak ones get PLT entries + // which may need a thunk. + if (S.isUndefined() && !S.isLocal() && S.symbol()->isWeak() && + !Config->Shared) + return false; + // A state change from ARM to Thumb and vice versa must go through an + // interworking thunk if the relocation type is not R_ARM_CALL or + // R_ARM_THM_CALL. + switch (RelocType) { + case R_ARM_PC24: + case R_ARM_PLT32: + case R_ARM_JUMP24: + // Source is ARM, all PLT entries are ARM so no interworking required. + // Otherwise we need to interwork if Symbol has bit 0 set (Thumb). + if (Expr == R_PC && ((S.getVA() & 1) == 1)) + return true; + break; + case R_ARM_THM_JUMP19: + case R_ARM_THM_JUMP24: + // Source is Thumb, all PLT entries are ARM so interworking is required. + // Otherwise we need to interwork if Symbol has bit 0 clear (ARM). + if (Expr == R_PLT_PC || ((S.getVA() & 1) == 0)) + return true; + break; + } + return false; +} + +void ARM::relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const { + switch (Type) { + case R_ARM_ABS32: + case R_ARM_BASE_PREL: + case R_ARM_GLOB_DAT: + case R_ARM_GOTOFF32: + case R_ARM_GOT_BREL: + case R_ARM_GOT_PREL: + case R_ARM_REL32: + case R_ARM_RELATIVE: + case R_ARM_SBREL32: + case R_ARM_TARGET1: + case R_ARM_TARGET2: + case R_ARM_TLS_GD32: + case R_ARM_TLS_IE32: + case R_ARM_TLS_LDM32: + case R_ARM_TLS_LDO32: + case R_ARM_TLS_LE32: + case R_ARM_TLS_TPOFF32: + case R_ARM_TLS_DTPOFF32: + write32le(Loc, Val); + break; + case R_ARM_TLS_DTPMOD32: + write32le(Loc, 1); + break; + case R_ARM_PREL31: + checkInt<31>(Loc, Val, Type); + write32le(Loc, (read32le(Loc) & 0x80000000) | (Val & ~0x80000000)); + break; + case R_ARM_CALL: + // R_ARM_CALL is used for BL and BLX instructions, depending on the + // value of bit 0 of Val, we must select a BL or BLX instruction + if (Val & 1) { + // If bit 0 of Val is 1 the target is Thumb, we must select a BLX. + // The BLX encoding is 0xfa:H:imm24 where Val = imm24:H:'1' + checkInt<26>(Loc, Val, Type); + write32le(Loc, 0xfa000000 | // opcode + ((Val & 2) << 23) | // H + ((Val >> 2) & 0x00ffffff)); // imm24 + break; + } + if ((read32le(Loc) & 0xfe000000) == 0xfa000000) + // BLX (always unconditional) instruction to an ARM Target, select an + // unconditional BL. + write32le(Loc, 0xeb000000 | (read32le(Loc) & 0x00ffffff)); + // fall through as BL encoding is shared with B + LLVM_FALLTHROUGH; + case R_ARM_JUMP24: + case R_ARM_PC24: + case R_ARM_PLT32: + checkInt<26>(Loc, Val, Type); + write32le(Loc, (read32le(Loc) & ~0x00ffffff) | ((Val >> 2) & 0x00ffffff)); + break; + case R_ARM_THM_JUMP11: + checkInt<12>(Loc, Val, Type); + write16le(Loc, (read32le(Loc) & 0xf800) | ((Val >> 1) & 0x07ff)); + break; + case R_ARM_THM_JUMP19: + // Encoding T3: Val = S:J2:J1:imm6:imm11:0 + checkInt<21>(Loc, Val, Type); + write16le(Loc, + (read16le(Loc) & 0xfbc0) | // opcode cond + ((Val >> 10) & 0x0400) | // S + ((Val >> 12) & 0x003f)); // imm6 + write16le(Loc + 2, + 0x8000 | // opcode + ((Val >> 8) & 0x0800) | // J2 + ((Val >> 5) & 0x2000) | // J1 + ((Val >> 1) & 0x07ff)); // imm11 + break; + case R_ARM_THM_CALL: + // R_ARM_THM_CALL is used for BL and BLX instructions, depending on the + // value of bit 0 of Val, we must select a BL or BLX instruction + if ((Val & 1) == 0) { + // Ensure BLX destination is 4-byte aligned. As BLX instruction may + // only be two byte aligned. This must be done before overflow check + Val = alignTo(Val, 4); + } + // Bit 12 is 0 for BLX, 1 for BL + write16le(Loc + 2, (read16le(Loc + 2) & ~0x1000) | (Val & 1) << 12); + // Fall through as rest of encoding is the same as B.W + LLVM_FALLTHROUGH; + case R_ARM_THM_JUMP24: + // Encoding B T4, BL T1, BLX T2: Val = S:I1:I2:imm10:imm11:0 + // FIXME: Use of I1 and I2 require v6T2ops + checkInt<25>(Loc, Val, Type); + write16le(Loc, + 0xf000 | // opcode + ((Val >> 14) & 0x0400) | // S + ((Val >> 12) & 0x03ff)); // imm10 + write16le(Loc + 2, + (read16le(Loc + 2) & 0xd000) | // opcode + (((~(Val >> 10)) ^ (Val >> 11)) & 0x2000) | // J1 + (((~(Val >> 11)) ^ (Val >> 13)) & 0x0800) | // J2 + ((Val >> 1) & 0x07ff)); // imm11 + break; + case R_ARM_MOVW_ABS_NC: + case R_ARM_MOVW_PREL_NC: + write32le(Loc, (read32le(Loc) & ~0x000f0fff) | ((Val & 0xf000) << 4) | + (Val & 0x0fff)); + break; + case R_ARM_MOVT_ABS: + case R_ARM_MOVT_PREL: + checkInt<32>(Loc, Val, Type); + write32le(Loc, (read32le(Loc) & ~0x000f0fff) | + (((Val >> 16) & 0xf000) << 4) | ((Val >> 16) & 0xfff)); + break; + case R_ARM_THM_MOVT_ABS: + case R_ARM_THM_MOVT_PREL: + // Encoding T1: A = imm4:i:imm3:imm8 + checkInt<32>(Loc, Val, Type); + write16le(Loc, + 0xf2c0 | // opcode + ((Val >> 17) & 0x0400) | // i + ((Val >> 28) & 0x000f)); // imm4 + write16le(Loc + 2, + (read16le(Loc + 2) & 0x8f00) | // opcode + ((Val >> 12) & 0x7000) | // imm3 + ((Val >> 16) & 0x00ff)); // imm8 + break; + case R_ARM_THM_MOVW_ABS_NC: + case R_ARM_THM_MOVW_PREL_NC: + // Encoding T3: A = imm4:i:imm3:imm8 + write16le(Loc, + 0xf240 | // opcode + ((Val >> 1) & 0x0400) | // i + ((Val >> 12) & 0x000f)); // imm4 + write16le(Loc + 2, + (read16le(Loc + 2) & 0x8f00) | // opcode + ((Val << 4) & 0x7000) | // imm3 + (Val & 0x00ff)); // imm8 + break; + default: + error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + } +} + +int64_t ARM::getImplicitAddend(const uint8_t *Buf, uint32_t Type) const { + switch (Type) { + default: + return 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 16 21:04:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A387D893E9; Fri, 16 Jun 2017 21:04:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EA976FA26; Fri, 16 Jun 2017 21:04:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GL4TtP063989; Fri, 16 Jun 2017 21:04:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GL4Tt2063988; Fri, 16 Jun 2017 21:04:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706162104.v5GL4Tt2063988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Jun 2017 21:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320024 - vendor/lldb/lldb-trunk-r305575 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:04:30 -0000 Author: dim Date: Fri Jun 16 21:04:29 2017 New Revision: 320024 URL: https://svnweb.freebsd.org/changeset/base/320024 Log: Tag lldb trunk r305575. Added: vendor/lldb/lldb-trunk-r305575/ - copied from r320023, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Fri Jun 16 21:37:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AE73D89EBC; Fri, 16 Jun 2017 21:37:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B67370FD1; Fri, 16 Jun 2017 21:37:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GLb5Pt076377; Fri, 16 Jun 2017 21:37:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GLb5cw076376; Fri, 16 Jun 2017 21:37:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706162137.v5GLb5cw076376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 16 Jun 2017 21:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320028 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:37:06 -0000 Author: bdrewery Date: Fri Jun 16 21:37:05 2017 New Revision: 320028 URL: https://svnweb.freebsd.org/changeset/base/320028 Log: Fix more incorrect library directories fix 'stale .depend' rebuilds. Reported by: sbruno MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Fri Jun 16 21:36:21 2017 (r320027) +++ head/share/mk/src.libnames.mk Fri Jun 16 21:37:05 2017 (r320028) @@ -420,7 +420,7 @@ LIBSMDBDIR= ${OBJTOP}/lib/libsmdb LIBSMDB?= ${LIBSMDBDIR}/libsmdb.a LIBSMUTILDIR= ${OBJTOP}/lib/libsmutil -LIBSMUTIL?= ${LIBSMDBDIR}/libsmutil.a +LIBSMUTIL?= ${LIBSMUTILDIR}/libsmutil.a LIBNETBSDDIR?= ${OBJTOP}/lib/libnetbsd LIBNETBSD?= ${LIBNETBSDDIR}/libnetbsd.a @@ -453,10 +453,10 @@ LIBPARSEDIR= ${OBJTOP}/usr.sbin/ntp/libparse LIBPARSE?= ${LIBPARSEDIR}/libparse.a LIBLPRDIR= ${OBJTOP}/usr.sbin/lpr/common_source -LIBLPR?= ${LIBOPTSDIR}/liblpr.a +LIBLPR?= ${LIBLPRDIR}/liblpr.a LIBFIFOLOGDIR= ${OBJTOP}/usr.sbin/fifolog/lib -LIBFIFOLOG?= ${LIBOPTSDIR}/libfifolog.a +LIBFIFOLOG?= ${LIBFIFOLOGDIR}/libfifolog.a LIBBSNMPTOOLSDIR= ${OBJTOP}/usr.sbin/bsnmpd/tools/libbsnmptools LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a From owner-svn-src-all@freebsd.org Fri Jun 16 21:48:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C40DD8A0DB; Fri, 16 Jun 2017 21:48:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A635714F8; Fri, 16 Jun 2017 21:48:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GLmgox080718; Fri, 16 Jun 2017 21:48:42 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GLmgH3080717; Fri, 16 Jun 2017 21:48:42 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706162148.v5GLmgH3080717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 16 Jun 2017 21:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320030 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 21:48:43 -0000 Author: bdrewery Date: Fri Jun 16 21:48:42 2017 New Revision: 320030 URL: https://svnweb.freebsd.org/changeset/base/320030 Log: WITH_META_MODE: End each ERROR_CMD CMD line with ';'. This makes it easier to debug multi-line command failures. X-MFC-With: r319862 MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/share/mk/local.sys.mk Modified: head/share/mk/local.sys.mk ============================================================================== --- head/share/mk/local.sys.mk Fri Jun 16 21:40:44 2017 (r320029) +++ head/share/mk/local.sys.mk Fri Jun 16 21:48:42 2017 (r320030) @@ -13,7 +13,7 @@ MAKE_PRINT_VAR_ON_ERROR += \ .MAKE.MODE .endif -_ERROR_CMD_EXEC= ${sed -n '/^CMD/s,^CMD ,,p' ${.ERROR_META_FILE}:L:sh} +_ERROR_CMD_EXEC= ${sed -n '/^CMD/s,^CMD \(.*\),\1;,p' ${.ERROR_META_FILE}:L:sh} _ERROR_CMD= ${!empty(.ERROR_META_FILE):?${_ERROR_CMD_EXEC}:.PHONY} MAKE_PRINT_VAR_ON_ERROR+= \ _ERROR_CMD \ From owner-svn-src-all@freebsd.org Fri Jun 16 22:32:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 377B8D8A876; Fri, 16 Jun 2017 22:32:25 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D94D7272F; Fri, 16 Jun 2017 22:32:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GMWO0t098366; Fri, 16 Jun 2017 22:32:24 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GMWNbV098362; Fri, 16 Jun 2017 22:32:23 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201706162232.v5GMWNbV098362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 16 Jun 2017 22:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320033 - head/contrib/tcp_wrappers X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 22:32:25 -0000 Author: sbruno Date: Fri Jun 16 22:32:23 2017 New Revision: 320033 URL: https://svnweb.freebsd.org/changeset/base/320033 Log: TCP Wrappers: tcpdchk (tcp wrapper configuration checker) and tcpdmatch (tcp wrapper oracle) warning fixes via edits to the C code files contrib/tcp_wrappers/fakelog.c Warnings for each of functions: openlog( ), vsyslog( ), VARARGS( ), closelog( ) warning: type specifier missing, defaults to 'int' [-Wimplicit-int] warning: control reaches end of non-void function [-Wreturn-type] Fixes: Explicitly added specification of function type to void for each function, suppressing both warnings for each function listed contrib/tcp_wrappers/inetcf.c Warnings: warning: incompativle redeclaration of library function 'malloc' note: 'malloc' is a builtin with type 'void *(unsigned long)' warning: implicit declaration of function 'check_path' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Removed redeclaration of malloc on line 21 Included library in the code which contains the malloc( ) function in it's library Included scaffold.h header file in the code that contains check-path( ) function contrib/tcp_wrappers/scaffold.c Warnings: warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Wimplicit-function-declaration] note: include the header or explicitly provide a declaration for 'exit' Fixes: Included in the code which contains the exit( ) function in it's library contrib/tcp_wrappers/tcpdchk.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included the specific function library to the code Included to the code which contains the atoi( ) function in the library contrib/tcp_wrappers/tcpdmatch.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included to the code which contains the getopt( ) function in the library Submitted by: Aaron Prieger Reviewed by: vangyzen Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D10995 Modified: head/contrib/tcp_wrappers/fakelog.c head/contrib/tcp_wrappers/inetcf.c head/contrib/tcp_wrappers/scaffold.c head/contrib/tcp_wrappers/tcpdchk.c head/contrib/tcp_wrappers/tcpdmatch.c Modified: head/contrib/tcp_wrappers/fakelog.c ============================================================================== --- head/contrib/tcp_wrappers/fakelog.c Fri Jun 16 22:07:14 2017 (r320032) +++ head/contrib/tcp_wrappers/fakelog.c Fri Jun 16 22:32:23 2017 (r320033) @@ -17,7 +17,7 @@ static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17 /* ARGSUSED */ -openlog(name, logopt, facility) +void openlog(name, logopt, facility) char *name; int logopt; int facility; @@ -27,7 +27,7 @@ int facility; /* vsyslog - format one record */ -vsyslog(severity, fmt, ap) +void vsyslog(severity, fmt, ap) int severity; char *fmt; va_list ap; @@ -43,7 +43,7 @@ va_list ap; /* VARARGS */ -VARARGS(syslog, int, severity) +void VARARGS(syslog, int, severity) { va_list ap; char *fmt; @@ -56,7 +56,7 @@ VARARGS(syslog, int, severity) /* closelog - dummy */ -closelog() +void closelog() { /* void */ } Modified: head/contrib/tcp_wrappers/inetcf.c ============================================================================== --- head/contrib/tcp_wrappers/inetcf.c Fri Jun 16 22:07:14 2017 (r320032) +++ head/contrib/tcp_wrappers/inetcf.c Fri Jun 16 22:32:23 2017 (r320033) @@ -15,13 +15,14 @@ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02: #include #include #include +#include extern int errno; extern void exit(); -extern char *malloc(); #include "tcpd.h" #include "inetcf.h" +#include "scaffold.h" /* * Network configuration files may live in unusual places. Here are some Modified: head/contrib/tcp_wrappers/scaffold.c ============================================================================== --- head/contrib/tcp_wrappers/scaffold.c Fri Jun 16 22:07:14 2017 (r320032) +++ head/contrib/tcp_wrappers/scaffold.c Fri Jun 16 22:32:23 2017 (r320033) @@ -22,6 +22,7 @@ static char sccs_id[] = "@(#) scaffold.c 1.6 97/03/21 #include #include #include +#include #ifndef INADDR_NONE #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ Modified: head/contrib/tcp_wrappers/tcpdchk.c ============================================================================== --- head/contrib/tcp_wrappers/tcpdchk.c Fri Jun 16 22:07:14 2017 (r320032) +++ head/contrib/tcp_wrappers/tcpdchk.c Fri Jun 16 22:32:23 2017 (r320033) @@ -35,6 +35,8 @@ static char sccsid[] = "@(#) tcpdchk.c 1.8 97/02/12 02 #include #include #include +#include +#include extern int errno; extern void exit(); Modified: head/contrib/tcp_wrappers/tcpdmatch.c ============================================================================== --- head/contrib/tcp_wrappers/tcpdmatch.c Fri Jun 16 22:07:14 2017 (r320032) +++ head/contrib/tcp_wrappers/tcpdmatch.c Fri Jun 16 22:32:23 2017 (r320033) @@ -31,6 +31,7 @@ static char sccsid[] = "@(#) tcpdmatch.c 1.5 96/02/11 #include #include #include +#include extern void exit(); extern int optind; From owner-svn-src-all@freebsd.org Fri Jun 16 22:45:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3CAD8AAD4 for ; Fri, 16 Jun 2017 22:45:27 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 503B172C10 for ; Fri, 16 Jun 2017 22:45:27 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x230.google.com with SMTP id u12so80515172qth.0 for ; Fri, 16 Jun 2017 15:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ezDX9XVanw+rb1b4Qd4htduacYuUrCb+CXMs3zFGg2E=; b=E8cLoODZWx142/fB8KeG4D+Tg4Hu5v03cAaGejOx5VaZ5i0FL+6PwXhsBYc9PTdMHC gUEZYrTn94rTAotBn0wlddbjqGraR7TeapN3eKdVjaQA2u4SAWebT8KdttyPl3jsOo6z eNfmRXjEDeu0/PZ4j/r3dawIAO42KiwlaSdCLrYJVFxa5klHgJ5/xPsRvViRsj6H9VK6 u817wkBWqp71m+gD8PQHhcEAAZgZrC9+u19AfnOpbC225mg8km8T4czq0YVYjNlbRMUS ZmL0V2MvQ0/hOHKhCbpmPo2vaQD4KhYk0gB/rNIMJZUAiuuuOkLSjyCgqQkbDOBVOnDZ LJSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ezDX9XVanw+rb1b4Qd4htduacYuUrCb+CXMs3zFGg2E=; b=nOfMI4Znqt2Z/paH8XrCeIfK6/8An+CoxPM8p1SSkyjgG15qb20BQQbyJlw2nGxZTd nk9a8ahO8r30FNQFLBYov404yBWLMGcWe5LVj/N9ayY6c/DnZ1LUKmtBolufAov5s0uX fK3x90dFzYU9COXkxZl3GVRrUPBSfYC18X77b9AzR7gtMk2/xXgmIyHdZnOp5FNfIQaI v28fDocpiwuIyF047N+S/QRrijPxYpljbj0ZRix0Yc8rBuwpofj7WMNyF8y5nCUrN3JZ Aop4OBaBSqS28h8KrDxgbYHTF96ZX0K6SM77hSQwle0fxEXnZT0EyJ6sT5MCQmZHQOD1 brzg== X-Gm-Message-State: AKS2vOzDA0DZgv4S2ST3wS+SCPEbgq1vO/1J3C+HOgGfwmXXa334RmZ8 5s7ZDX/X5jCft1L0 X-Received: by 10.200.49.251 with SMTP id i56mr15111955qte.113.1497653126320; Fri, 16 Jun 2017 15:45:26 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id c143sm2361068qkg.64.2017.06.16.15.45.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Jun 2017 15:45:25 -0700 (PDT) Date: Fri, 16 Jun 2017 18:45:17 -0400 From: Shawn Webb To: Jason Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc Message-ID: <20170616224517.td7yiahzv2oxcpts@mutt-hbsd> References: <201706150715.v5F7F6aT031218@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xtfgycdihvk7cebf" Content-Disposition: inline In-Reply-To: <201706150715.v5F7F6aT031218@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20170428 (1.8.2) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 22:45:27 -0000 --xtfgycdihvk7cebf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 15, 2017 at 07:15:06AM +0000, Jason Evans wrote: > Author: jasone > Date: Thu Jun 15 07:15:05 2017 > New Revision: 319971 > URL: https://svnweb.freebsd.org/changeset/base/319971 >=20 > Log: > Update jemalloc to 5.0.0. >=20 This breaks buildworld for arm64: /usr/obj/arm64.aarch64/scratch/fbsd/tmp/usr/bin/ld: error: sigsetjmp.pico:(= function sigsetjmp): relocation R_AARCH64_CONDBR19 out of range /usr/obj/arm64.aarch64/scratch/fbsd/tmp/usr/bin/ld: error: sigsetjmp.pico:(= function siglongjmp): relocation R_AARCH64_CONDBR19 out of range cc: error: linker command failed with exit code 1 (use -v to see invocation) --- libc.so.7.full --- *** [libc.so.7.full] Error code 1 make[4]: stopped in /scratch/fbsd/lib/libc Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --xtfgycdihvk7cebf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAllEX3sACgkQaoRlj1JF bu71mA//UMy8xBQac9vYNgUJzsNgGvlW/X1n0uE8sKHc2YBx3h8uFMlbMedpo6OE t7xI3aQiFCRgr0i0WO0Lrz56ykoEOPz3GZGkAjGxC3Fn5g6Tv6GvCDTXoOQYQ3R3 ugdS/a8jmoSxhLOa0UJVJJriH9oQUAvFONlE9sMbkvzFQOxZ7LaV421Kz1w36iBZ 1bGmwJIqQC5yxGLU3Fy9cU+i1AaQ0zjCCHqttjB9Kt+/quwDnM91HhQktP3Axt9/ Av31T24ZTTyZ82fRqfAw7yD3YcyyRSH0SYvZ44WW4ripj9m1NBiP6FddJ0jJOy/S k5yE962D2el/OoLV3g7FGYZl5u/qbUFK56TR/QhyFHuoLirYpucyiP5sgPmu/13/ 6GmdqmKJaEnJmo2a+7bJm0avlkdJ8pmVoplwY0iwbbsT3JAJDBX9XGNH+SDeCnSW Eh9jOLFFV8dCrSM36y0lzjfgrviSm1IPqGxqEDbdc0XKYPOUJ//GjrDALLsncppa 3vxmlvEAuLRhg4QO1+LKz14Noz/ONsuBqCTnWOytyT8L1UMbKOcIH5fTacVFKrFQ u/lcVA5cbCbwkzjryXJlqhh4Cd311ZtxKkz7qlueNAncFLdNxgQravoqI1u4pmCp jMojLzxVbMMHwVoDRGHokYzMEEtPH4zBSw42/0s8P02D4SRUh4A= =r23y -----END PGP SIGNATURE----- --xtfgycdihvk7cebf-- From owner-svn-src-all@freebsd.org Fri Jun 16 23:17:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8984D8B071; Fri, 16 Jun 2017 23:17:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C3737363E; Fri, 16 Jun 2017 23:17:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GNHVQb016956; Fri, 16 Jun 2017 23:17:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GNHVMa016955; Fri, 16 Jun 2017 23:17:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706162317.v5GNHVMa016955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Jun 2017 23:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320034 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 23:17:32 -0000 Author: kib Date: Fri Jun 16 23:17:31 2017 New Revision: 320034 URL: https://svnweb.freebsd.org/changeset/base/320034 Log: Start a new sentence on the new line. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Fri Jun 16 22:32:23 2017 (r320033) +++ head/lib/libc/sys/kqueue.2 Fri Jun 16 23:17:31 2017 (r320034) @@ -545,7 +545,8 @@ is in nanoseconds. .Pp If .Va fflags -is not set, the default is milliseconds. On return, +is not set, the default is milliseconds. +On return, .Va fflags contains the events which triggered the filter. .It Dv EVFILT_USER From owner-svn-src-all@freebsd.org Fri Jun 16 23:25:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D234DD8B294; Fri, 16 Jun 2017 23:25:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95DB673A36; Fri, 16 Jun 2017 23:25:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GNPBYZ021058; Fri, 16 Jun 2017 23:25:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GNPBcq021057; Fri, 16 Jun 2017 23:25:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706162325.v5GNPBcq021057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Jun 2017 23:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320035 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 23:25:12 -0000 Author: kib Date: Fri Jun 16 23:25:11 2017 New Revision: 320035 URL: https://svnweb.freebsd.org/changeset/base/320035 Log: Move the description of kern.kq_calloutmax sysctl into a new paragraph for better presentation. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Fri Jun 16 23:17:31 2017 (r320034) +++ head/lib/libc/sys/kqueue.2 Fri Jun 16 23:25:11 2017 (r320035) @@ -524,10 +524,6 @@ On return, contains the number of times the timeout has expired since the last call to .Fn kevent . This filter automatically sets the EV_CLEAR flag internally. -There is a system wide limit on the number of timers -which is controlled by the -.Va kern.kq_calloutmax -sysctl. .Bl -tag -width "Dv NOTE_USECONDS" .It Dv NOTE_SECONDS .Va data @@ -549,6 +545,11 @@ is not set, the default is milliseconds. On return, .Va fflags contains the events which triggered the filter. +.Pp +There is a system wide limit on the number of timers +which is controlled by the +.Va kern.kq_calloutmax +sysctl. .It Dv EVFILT_USER Establishes a user event identified by .Va ident From owner-svn-src-all@freebsd.org Fri Jun 16 23:41:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90C64D8B528; Fri, 16 Jun 2017 23:41:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 610107410E; Fri, 16 Jun 2017 23:41:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GNfDs1028199; Fri, 16 Jun 2017 23:41:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GNfDUn028198; Fri, 16 Jun 2017 23:41:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706162341.v5GNfDUn028198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Jun 2017 23:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320038 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jun 2017 23:41:14 -0000 Author: kib Date: Fri Jun 16 23:41:13 2017 New Revision: 320038 URL: https://svnweb.freebsd.org/changeset/base/320038 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D11025 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Fri Jun 16 23:29:42 2017 (r320037) +++ head/sys/kern/kern_event.c Fri Jun 16 23:41:13 2017 (r320038) @@ -601,12 +601,13 @@ knote_fork(struct knlist *list, int pid) * interval timer support code. */ -#define NOTE_TIMER_PRECMASK (NOTE_SECONDS|NOTE_MSECONDS|NOTE_USECONDS| \ - NOTE_NSECONDS) +#define NOTE_TIMER_PRECMASK \ + (NOTE_SECONDS | NOTE_MSECONDS | NOTE_USECONDS | NOTE_NSECONDS) static sbintime_t timer2sbintime(intptr_t data, int flags) { + int64_t secs; /* * Macros for converting to the fractional second portion of an @@ -625,27 +626,27 @@ timer2sbintime(intptr_t data, int flags) case NOTE_MSECONDS: /* FALLTHROUGH */ case 0: if (data >= 1000) { - int64_t secs = data / 1000; + secs = data / 1000; #ifdef __LP64__ if (secs > (SBT_MAX / SBT_1S)) return (SBT_MAX); #endif return (secs << 32 | MS_TO_SBT(data % 1000)); } - return MS_TO_SBT(data); + return (MS_TO_SBT(data)); case NOTE_USECONDS: if (data >= 1000000) { - int64_t secs = data / 1000000; + secs = data / 1000000; #ifdef __LP64__ if (secs > (SBT_MAX / SBT_1S)) return (SBT_MAX); #endif return (secs << 32 | US_TO_SBT(data % 1000000)); } - return US_TO_SBT(data); + return (US_TO_SBT(data)); case NOTE_NSECONDS: if (data >= 1000000000) { - int64_t secs = data / 1000000000; + secs = data / 1000000000; #ifdef __LP64__ if (secs > (SBT_MAX / SBT_1S)) return (SBT_MAX); From owner-svn-src-all@freebsd.org Sat Jun 17 00:15:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2712D8C39E; Sat, 17 Jun 2017 00:15:53 +0000 (UTC) (envelope-from jasone@canonware.com) Received: from canonware.com (canonware.com [204.109.63.53]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 873AB75662; Sat, 17 Jun 2017 00:15:53 +0000 (UTC) (envelope-from jasone@canonware.com) Received: from maple (unknown [208.67.62.115]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id 2F05E28A51; Fri, 16 Jun 2017 17:15:46 -0700 (PDT) Date: Fri, 16 Jun 2017 17:15:44 -0700 From: Jason Evans To: Shawn Webb Cc: Jason Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc Message-Id: <20170616171544.9b4a398cac3328f9bd6cd747@canonware.com> In-Reply-To: <20170616224517.td7yiahzv2oxcpts@mutt-hbsd> References: <201706150715.v5F7F6aT031218@repo.freebsd.org> <20170616224517.td7yiahzv2oxcpts@mutt-hbsd> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 00:15:53 -0000 On Fri, 16 Jun 2017 18:45:17 -0400 Shawn Webb wrote: > On Thu, Jun 15, 2017 at 07:15:06AM +0000, Jason Evans wrote: > > Author: jasone > > Date: Thu Jun 15 07:15:05 2017 > > New Revision: 319971 > > URL: https://svnweb.freebsd.org/changeset/base/319971 > > > > Log: > > Update jemalloc to 5.0.0. > > > > This breaks buildworld for arm64: > > /usr/obj/arm64.aarch64/scratch/fbsd/tmp/usr/bin/ld: error: sigsetjmp.pico:(function sigsetjmp): relocation R_AARCH64_CONDBR19 out of range > /usr/obj/arm64.aarch64/scratch/fbsd/tmp/usr/bin/ld: error: sigsetjmp.pico:(function siglongjmp): relocation R_AARCH64_CONDBR19 out of range > cc: error: linker command failed with exit code 1 (use -v to see invocation) > --- libc.so.7.full --- > *** [libc.so.7.full] Error code 1 > > make[4]: stopped in /scratch/fbsd/lib/libc Indeed, this happens for me too with TARGET=arm64 TARGET_ARCH=aarch64. I haven't found anything specifically about this error message, but it looks vaguely like the amd64-specific messages that happen when trying to link non-PIC object files into a shared library. In src/lib/libc/aarch64/gen/sigsetjmp.S, we have two conditional jumps b.eq C_LABEL(_setjmp) [...] b.eq C_LABEL(_longjmp) Maybe there's a simple macro change that can make these relocatable jumps. Alternatively, we could probably simplify the code by merging setjmp.S and sigsetjmp.S, so that PC-relative jumps could be used. I'm going to be AFK for the next couple days, and I do not have arm64 hardware, so I hope this is enough information for someone to work out a simple fix. Thanks, Jason From owner-svn-src-all@freebsd.org Sat Jun 17 00:57:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFA0FD8CBA2; Sat, 17 Jun 2017 00:57:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74421764CA; Sat, 17 Jun 2017 00:57:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5H0vRig057398; Sat, 17 Jun 2017 00:57:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5H0vQq5057383; Sat, 17 Jun 2017 00:57:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706170057.v5H0vQq5057383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Jun 2017 00:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320043 - in head: contrib/netbsd-tests/kernel/kqueue lib/libc/include lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/kqueue/libkqueue usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 00:57:28 -0000 Author: kib Date: Sat Jun 17 00:57:26 2017 New Revision: 320043 URL: https://svnweb.freebsd.org/changeset/base/320043 Log: Add abstime kqueue(2) timers and expand struct kevent members. This change implements NOTE_ABSTIME flag for EVFILT_TIMER, which specifies that the data field contains absolute time to fire the event. To make this useful, data member of the struct kevent must be extended to 64bit. Using the opportunity, I also added ext members. This changes struct kevent almost to Apple struct kevent64, except I did not changed type of ident and udata, the later would cause serious API incompatibilities. The type of ident was kept uintptr_t since EVFILT_AIO returns a pointer in this field, and e.g. CHERI is sensitive to the type (discussed with brooks, jhb). Unlike Apple kevent64, symbol versioning allows us to claim ABI compatibility and still name the new syscall kevent(2). Compat shims are provided for both host native and compat32. Requested by: bapt Reviewed by: bapt, brooks, ngie (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D11025 Modified: head/contrib/netbsd-tests/kernel/kqueue/t_proc1.c head/contrib/netbsd-tests/kernel/kqueue/t_sig.c head/lib/libc/include/compat.h head/lib/libc/sys/Symbol.map head/lib/libc/sys/kqueue.2 head/sys/compat/freebsd32/freebsd32.h head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/kern_event.c head/sys/kern/syscalls.master head/sys/kern/vfs_aio.c head/sys/sys/event.h head/tests/sys/kqueue/libkqueue/main.c head/tests/sys/kqueue/libkqueue/timer.c head/usr.bin/truss/syscalls.c Modified: head/contrib/netbsd-tests/kernel/kqueue/t_proc1.c ============================================================================== --- head/contrib/netbsd-tests/kernel/kqueue/t_proc1.c Sat Jun 17 00:14:54 2017 (r320042) +++ head/contrib/netbsd-tests/kernel/kqueue/t_proc1.c Sat Jun 17 00:57:26 2017 (r320043) @@ -139,11 +139,7 @@ ATF_TC_BODY(proc1, tc) printf(" NOTE_FORK"); } if (event[0].fflags & NOTE_CHILD) -#ifdef __FreeBSD__ - printf(" NOTE_CHILD, parent = %" PRIdPTR, event[0].data); -#else printf(" NOTE_CHILD, parent = %" PRId64, event[0].data); -#endif printf("\n"); } Modified: head/contrib/netbsd-tests/kernel/kqueue/t_sig.c ============================================================================== --- head/contrib/netbsd-tests/kernel/kqueue/t_sig.c Sat Jun 17 00:14:54 2017 (r320042) +++ head/contrib/netbsd-tests/kernel/kqueue/t_sig.c Sat Jun 17 00:57:26 2017 (r320043) @@ -127,11 +127,7 @@ ATF_TC_BODY(sig, tc) if (n == 0) continue; -#ifdef __FreeBSD__ - (void)printf("sig: kevent flags: 0x%x, data: %" PRIdPTR " (# " -#else (void)printf("sig: kevent flags: 0x%x, data: %" PRId64 " (# " -#endif "times signal posted)\n", event[0].flags, event[0].data); } Modified: head/lib/libc/include/compat.h ============================================================================== --- head/lib/libc/include/compat.h Sat Jun 17 00:14:54 2017 (r320042) +++ head/lib/libc/include/compat.h Sat Jun 17 00:57:26 2017 (r320043) @@ -65,6 +65,8 @@ __sym_compat(statfs, freebsd11_statfs, FBSD_1.0); __sym_compat(mknod, freebsd11_mknod, FBSD_1.0); __sym_compat(mknodat, freebsd11_mknodat, FBSD_1.1); +__sym_compat(kevent, freebsd11_kevent, FBSD_1.0); + #undef __sym_compat #define __weak_reference(sym,alias) \ Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Sat Jun 17 00:14:54 2017 (r320042) +++ head/lib/libc/sys/Symbol.map Sat Jun 17 00:57:26 2017 (r320043) @@ -121,7 +121,6 @@ FBSD_1.0 { jail; jail_attach; kenv; - kevent; kill; kldfind; kldfirstmod; @@ -393,6 +392,7 @@ FBSD_1.5 { getdents; getdirentries; getfsstat; + kevent; lstat; mknod; mknodat; Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Sat Jun 17 00:14:54 2017 (r320042) +++ head/lib/libc/sys/kqueue.2 Sat Jun 17 00:57:26 2017 (r320043) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2017 +.Dd June 17, 2017 .Dt KQUEUE 2 .Os .Sh NAME @@ -148,12 +148,13 @@ The structure is defined as: .Bd -literal struct kevent { - uintptr_t ident; /* identifier for this event */ + uintptr_t ident; /* identifier for this event */ short filter; /* filter for event */ u_short flags; /* action flags for kqueue */ u_int fflags; /* filter flag value */ - intptr_t data; /* filter data value */ + int64_t data; /* filter data value */ void *udata; /* opaque user data identifier */ + uint64_t ext[4]; /* extentions */ }; .Ed .Pp @@ -177,6 +178,20 @@ Filter-specific flags. Filter-specific data value. .It Fa udata Opaque user-defined value passed through the kernel unchanged. +.It Fa ext +Extended data passed to and from kernel. +The +.Fa ext[0] +and +.Fa ext[1] +members use is defined by the filter. +If the filter does not use them, the members are copied unchanged. +The +.Fa ext[2] +and +.Fa ext[3] +members are always passed throught the kernel as-is, +making additional context available to application. .El .Pp The @@ -515,16 +530,26 @@ Establishes an arbitrary timer identified by .Va ident . When adding a timer, .Va data -specifies the timeout period. +specifies the moment to fire the timer (for +.Dv NOTE_ABSTIME ) +or the timeout period. The timer will be periodic unless .Dv EV_ONESHOT +or +.Dv NOTE_ABSTIME is specified. On return, .Va data contains the number of times the timeout has expired since the last call to .Fn kevent . -This filter automatically sets the EV_CLEAR flag internally. -.Bl -tag -width "Dv NOTE_USECONDS" +For non-monotonic timers, this filter automatically sets the +.Dv EV_CLEAR +flag internally. +.Pp +The filter accepts the following flags in the +.Va fflags +argument: +.Bl -tag -width "Dv NOTE_MSECONDS" .It Dv NOTE_SECONDS .Va data is in seconds. @@ -537,6 +562,8 @@ is in microseconds. .It Dv NOTE_NSECONDS .Va data is in nanoseconds. +.It Dv NOTE_ABSTIME +The specified expiration time is absolute. .El .Pp If Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Sat Jun 17 00:14:54 2017 (r320042) +++ head/sys/compat/freebsd32/freebsd32.h Sat Jun 17 00:57:26 2017 (r320043) @@ -137,12 +137,13 @@ struct statfs32 { }; struct kevent32 { - u_int32_t ident; /* identifier for this event */ + uint32_t ident; /* identifier for this event */ short filter; /* filter for event */ u_short flags; u_int fflags; - int32_t data; - u_int32_t udata; /* opaque user data identifier */ + int32_t data1, data2; + uint32_t udata; /* opaque user data identifier */ + uint32_t ext64[8]; }; struct iovec32 { Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sat Jun 17 00:14:54 2017 (r320042) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sat Jun 17 00:57:26 2017 (r320043) @@ -119,7 +119,7 @@ CTASSERT(sizeof(struct statfs32) == 256); CTASSERT(sizeof(struct rusage32) == 72); #endif CTASSERT(sizeof(struct sigaltstack32) == 12); -CTASSERT(sizeof(struct kevent32) == 20); +CTASSERT(sizeof(struct kevent32) == 56); CTASSERT(sizeof(struct iovec32) == 8); CTASSERT(sizeof(struct msghdr32) == 28); #ifdef __amd64__ @@ -622,7 +622,8 @@ freebsd32_kevent_copyout(void *arg, struct kevent *kev { struct freebsd32_kevent_args *uap; struct kevent32 ks32[KQ_NEVENTS]; - int i, error = 0; + uint64_t e; + int i, j, error; KASSERT(count <= KQ_NEVENTS, ("count (%d) > KQ_NEVENTS", count)); uap = (struct freebsd32_kevent_args *)arg; @@ -632,8 +633,24 @@ freebsd32_kevent_copyout(void *arg, struct kevent *kev CP(kevp[i], ks32[i], filter); CP(kevp[i], ks32[i], flags); CP(kevp[i], ks32[i], fflags); - CP(kevp[i], ks32[i], data); +#if BYTE_ORDER == LITTLE_ENDIAN + ks32[i].data1 = kevp[i].data; + ks32[i].data2 = kevp[i].data >> 32; +#else + ks32[i].data1 = kevp[i].data >> 32; + ks32[i].data2 = kevp[i].data; +#endif PTROUT_CP(kevp[i], ks32[i], udata); + for (j = 0; j < nitems(kevp->ext); j++) { + e = kevp[i].ext[j]; +#if BYTE_ORDER == LITTLE_ENDIAN + ks32[i].ext64[2 * j] = e; + ks32[i].ext64[2 * j + 1] = e >> 32; +#else + ks32[i].ext64[2 * j] = e >> 32; + ks32[i].ext64[2 * j + 1] = e; +#endif + } } error = copyout(ks32, uap->eventlist, count * sizeof *ks32); if (error == 0) @@ -649,7 +666,8 @@ freebsd32_kevent_copyin(void *arg, struct kevent *kevp { struct freebsd32_kevent_args *uap; struct kevent32 ks32[KQ_NEVENTS]; - int i, error = 0; + uint64_t e; + int i, j, error; KASSERT(count <= KQ_NEVENTS, ("count (%d) > KQ_NEVENTS", count)); uap = (struct freebsd32_kevent_args *)arg; @@ -664,8 +682,20 @@ freebsd32_kevent_copyin(void *arg, struct kevent *kevp CP(ks32[i], kevp[i], filter); CP(ks32[i], kevp[i], flags); CP(ks32[i], kevp[i], fflags); - CP(ks32[i], kevp[i], data); + kevp[i].data = PAIR32TO64(uint64_t, ks32[i].data); PTRIN_CP(ks32[i], kevp[i], udata); + for (j = 0; j < nitems(kevp->ext); j++) { +#if BYTE_ORDER == LITTLE_ENDIAN + e = ks32[i].ext64[2 * j + 1]; + e <<= 32; + e += ks32[i].ext64[2 * j]; +#else + e = ks32[i].ext64[2 * j]; + e <<= 32; + e += ks32[i].ext64[2 * j + 1]; +#endif + kevp[i].ext[j] = e; + } } done: return (error); @@ -683,7 +713,99 @@ freebsd32_kevent(struct thread *td, struct freebsd32_k }; int error; + if (uap->timeout) { + error = copyin(uap->timeout, &ts32, sizeof(ts32)); + if (error) + return (error); + CP(ts32, ts, tv_sec); + CP(ts32, ts, tv_nsec); + tsp = &ts; + } else + tsp = NULL; + error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents, + &k_ops, tsp); + return (error); +} +#ifdef COMPAT_FREEBSD11 +struct kevent32_freebsd11 { + u_int32_t ident; /* identifier for this event */ + short filter; /* filter for event */ + u_short flags; + u_int fflags; + int32_t data; + u_int32_t udata; /* opaque user data identifier */ +}; + +static int +freebsd32_kevent11_copyout(void *arg, struct kevent *kevp, int count) +{ + struct freebsd11_freebsd32_kevent_args *uap; + struct kevent32_freebsd11 ks32[KQ_NEVENTS]; + int i, error; + + KASSERT(count <= KQ_NEVENTS, ("count (%d) > KQ_NEVENTS", count)); + uap = (struct freebsd11_freebsd32_kevent_args *)arg; + + for (i = 0; i < count; i++) { + CP(kevp[i], ks32[i], ident); + CP(kevp[i], ks32[i], filter); + CP(kevp[i], ks32[i], flags); + CP(kevp[i], ks32[i], fflags); + CP(kevp[i], ks32[i], data); + PTROUT_CP(kevp[i], ks32[i], udata); + } + error = copyout(ks32, uap->eventlist, count * sizeof *ks32); + if (error == 0) + uap->eventlist += count; + return (error); +} + +/* + * Copy 'count' items from the list pointed to by uap->changelist. + */ +static int +freebsd32_kevent11_copyin(void *arg, struct kevent *kevp, int count) +{ + struct freebsd11_freebsd32_kevent_args *uap; + struct kevent32_freebsd11 ks32[KQ_NEVENTS]; + int i, j, error; + + KASSERT(count <= KQ_NEVENTS, ("count (%d) > KQ_NEVENTS", count)); + uap = (struct freebsd11_freebsd32_kevent_args *)arg; + + error = copyin(uap->changelist, ks32, count * sizeof *ks32); + if (error) + goto done; + uap->changelist += count; + + for (i = 0; i < count; i++) { + CP(ks32[i], kevp[i], ident); + CP(ks32[i], kevp[i], filter); + CP(ks32[i], kevp[i], flags); + CP(ks32[i], kevp[i], fflags); + CP(ks32[i], kevp[i], data); + PTRIN_CP(ks32[i], kevp[i], udata); + for (j = 0; j < nitems(kevp->ext); j++) + kevp[i].ext[j] = 0; + } +done: + return (error); +} + +int +freebsd11_freebsd32_kevent(struct thread *td, + struct freebsd11_freebsd32_kevent_args *uap) +{ + struct timespec32 ts32; + struct timespec ts, *tsp; + struct kevent_copyops k_ops = { + .arg = uap, + .k_copyout = freebsd32_kevent11_copyout, + .k_copyin = freebsd32_kevent11_copyin, + }; + int error; + if (uap->timeout) { error = copyin(uap->timeout, &ts32, sizeof(ts32)); if (error) @@ -697,6 +819,7 @@ freebsd32_kevent(struct thread *td, struct freebsd32_k &k_ops, tsp); return (error); } +#endif int freebsd32_gettimeofday(struct thread *td, Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sat Jun 17 00:14:54 2017 (r320042) +++ head/sys/compat/freebsd32/syscalls.master Sat Jun 17 00:57:26 2017 (r320043) @@ -667,10 +667,12 @@ 361 AUE_GETRESGID NOPROTO { int getresgid(gid_t *rgid, gid_t *egid, \ gid_t *sgid); } 362 AUE_KQUEUE NOPROTO { int kqueue(void); } -363 AUE_KEVENT STD { int freebsd32_kevent(int fd, \ - const struct kevent32 *changelist, \ +363 AUE_KEVENT COMPAT11 { int freebsd32_kevent(int fd, \ + const struct kevent32_freebsd11 * \ + changelist, \ int nchanges, \ - struct kevent32 *eventlist, int nevents, \ + struct kevent32_freebsd11 *eventlist, \ + int nevents, \ const struct timespec32 *timeout); } 364 AUE_NULL UNIMPL __cap_get_proc 365 AUE_NULL UNIMPL __cap_set_proc @@ -1111,3 +1113,9 @@ struct statfs32 *buf); } 559 AUE_MKNODAT NOPROTO { int mknodat(int fd, char *path, mode_t mode, \ dev_t dev); } +560 AUE_KEVENT STD { int freebsd32_kevent(int fd, \ + const struct kevent32 *changelist, \ + int nchanges, \ + struct kevent32 *eventlist, \ + int nevents, \ + const struct timespec32 *timeout); } Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Jun 17 00:14:54 2017 (r320042) +++ head/sys/kern/kern_event.c Sat Jun 17 00:57:26 2017 (r320043) @@ -29,6 +29,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_ktrace.h" #include "opt_kqueue.h" @@ -111,6 +112,10 @@ static int kqueue_scan(struct kqueue *kq, int maxevent static void kqueue_wakeup(struct kqueue *kq); static struct filterops *kqueue_fo_find(int filt); static void kqueue_fo_release(int filt); +struct g_kevent_args; +static int kern_kevent_generic(struct thread *td, + struct g_kevent_args *uap, + struct kevent_copyops *k_ops); static fo_ioctl_t kqueue_ioctl; static fo_poll_t kqueue_poll; @@ -663,7 +668,7 @@ timer2sbintime(intptr_t data, int flags) struct kq_timer_cb_data { struct callout c; sbintime_t next; /* next timer event fires at */ - sbintime_t to; /* precalculated timer period */ + sbintime_t to; /* precalculated timer period, 0 for abs */ }; static void @@ -678,8 +683,9 @@ filt_timerexpire(void *knx) if ((kn->kn_flags & EV_ONESHOT) != 0) return; - kc = kn->kn_ptr.p_v; + if (kc->to == 0) + return; kc->next += kc->to; callout_reset_sbt_on(&kc->c, kc->next, 0, filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); @@ -692,7 +698,8 @@ static int filt_timerattach(struct knote *kn) { struct kq_timer_cb_data *kc; - sbintime_t to; + struct bintime bt; + sbintime_t to, sbt; unsigned int ncallouts; if (kn->kn_sdata < 0) @@ -700,10 +707,15 @@ filt_timerattach(struct knote *kn) if (kn->kn_sdata == 0 && (kn->kn_flags & EV_ONESHOT) == 0) kn->kn_sdata = 1; /* Only precision unit are supported in flags so far */ - if ((kn->kn_sfflags & ~NOTE_TIMER_PRECMASK) != 0) + if ((kn->kn_sfflags & ~(NOTE_TIMER_PRECMASK | NOTE_ABSTIME)) != 0) return (EINVAL); to = timer2sbintime(kn->kn_sdata, kn->kn_sfflags); + if ((kn->kn_sfflags & NOTE_ABSTIME) != 0) { + getboottimebin(&bt); + sbt = bttosbt(bt); + to -= sbt; + } if (to < 0) return (EINVAL); @@ -713,12 +725,18 @@ filt_timerattach(struct knote *kn) return (ENOMEM); } while (!atomic_cmpset_int(&kq_ncallouts, ncallouts, ncallouts + 1)); - kn->kn_flags |= EV_CLEAR; /* automatically set */ + if ((kn->kn_sfflags & NOTE_ABSTIME) == 0) + kn->kn_flags |= EV_CLEAR; /* automatically set */ kn->kn_status &= ~KN_DETACHED; /* knlist_add clears it */ kn->kn_ptr.p_v = kc = malloc(sizeof(*kc), M_KQUEUE, M_WAITOK); callout_init(&kc->c, 1); - kc->next = to + sbinuptime(); - kc->to = to; + if ((kn->kn_sfflags & NOTE_ABSTIME) != 0) { + kc->next = to; + kc->to = 0; + } else { + kc->next = to + sbinuptime(); + kc->to = to; + } callout_reset_sbt_on(&kc->c, kc->next, 0, filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); @@ -890,34 +908,42 @@ kern_kqueue(struct thread *td, int flags, struct filec #ifdef KTRACE static size_t -kev_iovlen(int n, u_int kgio) +kev_iovlen(int n, u_int kgio, size_t kevent_size) { - if (n < 0 || n >= kgio / sizeof(struct kevent)) + if (n < 0 || n >= kgio / kevent_size) return (kgio); - return (n * sizeof(struct kevent)); + return (n * kevent_size); } #endif -#ifndef _SYS_SYSPROTO_H_ -struct kevent_args { +struct g_kevent_args { int fd; - const struct kevent *changelist; + void *changelist; int nchanges; - struct kevent *eventlist; + void *eventlist; int nevents; const struct timespec *timeout; }; -#endif + int sys_kevent(struct thread *td, struct kevent_args *uap) { - struct timespec ts, *tsp; struct kevent_copyops k_ops = { .arg = uap, .k_copyout = kevent_copyout, .k_copyin = kevent_copyin, + .kevent_size = sizeof(struct kevent), }; + + return (kern_kevent_generic(td, (struct g_kevent_args *)uap, &k_ops)); +} + +static int +kern_kevent_generic(struct thread *td, struct g_kevent_args *uap, + struct kevent_copyops *k_ops) +{ + struct timespec ts, *tsp; int error; #ifdef KTRACE struct uio ktruio; @@ -939,26 +965,30 @@ sys_kevent(struct thread *td, struct kevent_args *uap) if (KTRPOINT(td, KTR_GENIO)) { kgio = ktr_geniosize; ktriov.iov_base = uap->changelist; - ktriov.iov_len = kev_iovlen(uap->nchanges, kgio); + ktriov.iov_len = kev_iovlen(uap->nchanges, kgio, + k_ops->kevent_size); ktruio = (struct uio){ .uio_iov = &ktriov, .uio_iovcnt = 1, .uio_segflg = UIO_USERSPACE, .uio_rw = UIO_READ, .uio_td = td }; ktruioin = cloneuio(&ktruio); ktriov.iov_base = uap->eventlist; - ktriov.iov_len = kev_iovlen(uap->nevents, kgio); - ktriov.iov_len = uap->nevents * sizeof(struct kevent); + ktriov.iov_len = kev_iovlen(uap->nevents, kgio, + k_ops->kevent_size); + ktriov.iov_len = uap->nevents * k_ops->kevent_size; ktruioout = cloneuio(&ktruio); } #endif error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents, - &k_ops, tsp); + k_ops, tsp); #ifdef KTRACE if (ktruioin != NULL) { - ktruioin->uio_resid = kev_iovlen(uap->nchanges, kgio); + ktruioin->uio_resid = kev_iovlen(uap->nchanges, kgio, + k_ops->kevent_size); ktrgenio(uap->fd, UIO_WRITE, ktruioin, 0); - ktruioout->uio_resid = kev_iovlen(td->td_retval[0], kgio); + ktruioout->uio_resid = kev_iovlen(td->td_retval[0], kgio, + k_ops->kevent_size); ktrgenio(uap->fd, UIO_READ, ktruioout, error); } #endif @@ -1001,6 +1031,86 @@ kevent_copyin(void *arg, struct kevent *kevp, int coun uap->changelist += count; return (error); } + +#ifdef COMPAT_FREEBSD11 +struct kevent_freebsd11 { + __uintptr_t ident; /* identifier for this event */ + short filter; /* filter for event */ + unsigned short flags; + unsigned int fflags; + __intptr_t data; + void *udata; /* opaque user data identifier */ +}; + +static int +kevent11_copyout(void *arg, struct kevent *kevp, int count) +{ + struct freebsd11_kevent_args *uap; + struct kevent_freebsd11 kev11; + int error, i; + + KASSERT(count <= KQ_NEVENTS, ("count (%d) > KQ_NEVENTS", count)); + uap = (struct freebsd11_kevent_args *)arg; + + for (i = 0; i < count; i++) { + kev11.ident = kevp->ident; + kev11.filter = kevp->filter; + kev11.flags = kevp->flags; + kev11.fflags = kevp->fflags; + kev11.data = kevp->data; + kev11.udata = kevp->udata; + error = copyout(&kev11, uap->eventlist, sizeof(kev11)); + if (error != 0) + break; + uap->eventlist++; + kevp++; + } + return (error); +} + +/* + * Copy 'count' items from the list pointed to by uap->changelist. + */ +static int +kevent11_copyin(void *arg, struct kevent *kevp, int count) +{ + struct freebsd11_kevent_args *uap; + struct kevent_freebsd11 kev11; + int error, i; + + KASSERT(count <= KQ_NEVENTS, ("count (%d) > KQ_NEVENTS", count)); + uap = (struct freebsd11_kevent_args *)arg; + + for (i = 0; i < count; i++) { + error = copyin(uap->changelist, &kev11, sizeof(kev11)); + if (error != 0) + break; + kevp->ident = kev11.ident; + kevp->filter = kev11.filter; + kevp->flags = kev11.flags; + kevp->fflags = kev11.fflags; + kevp->data = (uintptr_t)kev11.data; + kevp->udata = kev11.udata; + bzero(&kevp->ext, sizeof(kevp->ext)); + uap->changelist++; + kevp++; + } + return (error); +} + +int +freebsd11_kevent(struct thread *td, struct freebsd11_kevent_args *uap) +{ + struct kevent_copyops k_ops = { + .arg = uap, + .k_copyout = kevent11_copyout, + .k_copyin = kevent11_copyin, + .kevent_size = sizeof(struct kevent_freebsd11), + }; + + return (kern_kevent_generic(td, (struct g_kevent_args *)uap, &k_ops)); +} +#endif int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Sat Jun 17 00:14:54 2017 (r320042) +++ head/sys/kern/syscalls.master Sat Jun 17 00:57:26 2017 (r320043) @@ -657,9 +657,11 @@ 361 AUE_GETRESGID STD { int getresgid(gid_t *rgid, gid_t *egid, \ gid_t *sgid); } 362 AUE_KQUEUE STD { int kqueue(void); } -363 AUE_KEVENT STD { int kevent(int fd, \ - struct kevent *changelist, int nchanges, \ - struct kevent *eventlist, int nevents, \ +363 AUE_KEVENT COMPAT11 { int kevent(int fd, \ + struct kevent_freebsd11 *changelist, \ + int nchanges, \ + struct kevent_freebsd11 *eventlist, \ + int nevents, \ const struct timespec *timeout); } 364 AUE_NULL UNIMPL __cap_get_proc 365 AUE_NULL UNIMPL __cap_set_proc @@ -1017,6 +1019,10 @@ struct statfs *buf); } 559 AUE_MKNODAT STD { int mknodat(int fd, char *path, mode_t mode, \ dev_t dev); } +560 AUE_KEVENT STD { int kevent(int fd, \ + struct kevent *changelist, int nchanges, \ + struct kevent *eventlist, int nevents, \ + const struct timespec *timeout); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sat Jun 17 00:14:54 2017 (r320042) +++ head/sys/kern/vfs_aio.c Sat Jun 17 00:57:26 2017 (r320043) @@ -2491,8 +2491,10 @@ sys_aio_fsync(struct thread *td, struct aio_fsync_args static int filt_aioattach(struct knote *kn) { - struct kaiocb *job = (struct kaiocb *)kn->kn_sdata; + struct kaiocb *job; + job = (struct kaiocb *)(uintptr_t)kn->kn_sdata; + /* * The job pointer must be validated before using it, so * registration is restricted to the kernel; the user cannot @@ -2539,7 +2541,9 @@ filt_aio(struct knote *kn, long hint) static int filt_lioattach(struct knote *kn) { - struct aioliojob * lj = (struct aioliojob *)kn->kn_sdata; + struct aioliojob *lj; + + lj = (struct aioliojob *)(uintptr_t)kn->kn_sdata; /* * The aioliojob pointer must be validated before using it, so Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Sat Jun 17 00:14:54 2017 (r320042) +++ head/sys/sys/event.h Sat Jun 17 00:57:26 2017 (r320043) @@ -55,6 +55,10 @@ (kevp)->fflags = (d); \ (kevp)->data = (e); \ (kevp)->udata = (f); \ + (kevp)->ext[0] = 0; \ + (kevp)->ext[1] = 0; \ + (kevp)->ext[2] = 0; \ + (kevp)->ext[3] = 0; \ } while(0) struct kevent { @@ -62,8 +66,9 @@ struct kevent { short filter; /* filter for event */ unsigned short flags; unsigned int fflags; - __intptr_t data; + __int64_t data; void *udata; /* opaque user data identifier */ + __uint64_t ext[4]; }; /* actions */ @@ -149,6 +154,7 @@ struct kevent { #define NOTE_MSECONDS 0x00000002 /* data is milliseconds */ #define NOTE_USECONDS 0x00000004 /* data is microseconds */ #define NOTE_NSECONDS 0x00000008 /* data is nanoseconds */ +#define NOTE_ABSTIME 0x00000010 /* timeout is absolute */ struct knote; SLIST_HEAD(klist, knote); @@ -232,7 +238,7 @@ struct knote { #define KN_SCAN 0x100 /* flux set in kqueue_scan() */ int kn_influx; int kn_sfflags; /* saved filter flags */ - intptr_t kn_sdata; /* saved data field */ + int64_t kn_sdata; /* saved data field */ union { struct file *p_fp; /* file data pointer */ struct proc *p_proc; /* proc pointer */ @@ -253,6 +259,7 @@ struct kevent_copyops { void *arg; int (*k_copyout)(void *arg, struct kevent *kevp, int count); int (*k_copyin)(void *arg, struct kevent *kevp, int count); + size_t kevent_size; }; struct thread; Modified: head/tests/sys/kqueue/libkqueue/main.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/main.c Sat Jun 17 00:14:54 2017 (r320042) +++ head/tests/sys/kqueue/libkqueue/main.c Sat Jun 17 00:57:26 2017 (r320043) @@ -180,13 +180,18 @@ kevent_to_str(struct kevent *kev) char buf[512]; snprintf(&buf[0], sizeof(buf), - "[ident=%d, filter=%d, %s, %s, data=%d, udata=%p]", - (u_int) kev->ident, + "[ident=%ju, filter=%d, %s, %s, data=%jd, udata=%p, " + "ext=[%jx %jx %jx %jx]", + (uintmax_t) kev->ident, kev->filter, kevent_flags_dump(kev), kevent_fflags_dump(kev), - (int) kev->data, - kev->udata); + (uintmax_t)kev->data, + kev->udata, + (uintmax_t)kev->ext[0], + (uintmax_t)kev->ext[1], + (uintmax_t)kev->ext[2], + (uintmax_t)kev->ext[3]); return (strdup(buf)); } @@ -218,7 +223,11 @@ kevent_cmp(struct kevent *k1, struct kevent *k2) if (k1->flags & EV_ADD) k2->flags |= EV_ADD; #endif - if (memcmp(k1, k2, sizeof(*k1)) != 0) { + if (k1->ident != k2->ident || k1->filter != k2->filter || + k1->flags != k2->flags || k1->fflags != k2->fflags || + k1->data != k2->data || k1->udata != k2->udata || + k1->ext[0] != k2->ext[0] || k1->ext[1] != k2->ext[1] || + k1->ext[0] != k2->ext[2] || k1->ext[0] != k2->ext[3]) { printf("kevent_cmp: mismatch:\n %s !=\n %s\n", kevent_to_str(k1), kevent_to_str(k2)); abort(); Modified: head/tests/sys/kqueue/libkqueue/timer.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/timer.c Sat Jun 17 00:14:54 2017 (r320042) +++ head/tests/sys/kqueue/libkqueue/timer.c Sat Jun 17 00:57:26 2017 (r320043) @@ -17,6 +17,7 @@ */ #include "common.h" +#include int kqfd; @@ -164,6 +165,39 @@ disable_and_enable(void) success(); } +static void +test_abstime(void) +{ + const char *test_id = "kevent(EVFILT_TIMER, EV_ONESHOT, NOTE_ABSTIME)"; + struct kevent kev; + time_t when; + const int timeout = 3; + + test_begin(test_id); + + test_no_kevents(); + + when = time(NULL); + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_ABSTIME | NOTE_SECONDS, when + timeout, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Retrieve the event */ + kev.flags = EV_ADD | EV_ONESHOT; + kev.data = 1; + kev.fflags = 0; + kevent_cmp(&kev, kevent_get(kqfd)); + if (time(NULL) < when + timeout) + err(1, "too early %jd %jd", time(), when + timeout); + + /* Check if the event occurs again */ + sleep(3); + test_no_kevents(); + + success(); +} + void test_evfilt_timer() { @@ -173,6 +207,7 @@ test_evfilt_timer() test_kevent_timer_get(); test_oneshot(); test_periodic(); + test_abstime(); disable_and_enable(); close(kqfd); } Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sat Jun 17 00:14:54 2017 (r320042) +++ head/usr.bin/truss/syscalls.c Sat Jun 17 00:57:26 2017 (r320043) @@ -1255,7 +1255,7 @@ print_kevent(FILE *fp, struct kevent *ke, int input) default: fprintf(fp, "%#x", ke->fflags); } - fprintf(fp, ",%p,%p", (void *)ke->data, (void *)ke->udata); + fprintf(fp, ",%#jx,%p", (uintmax_t)ke->data, ke->udata); } static void From owner-svn-src-all@freebsd.org Sat Jun 17 00:58:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79923D8CC00; Sat, 17 Jun 2017 00:58:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1829E76642; Sat, 17 Jun 2017 00:58:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5H0wLwF057483; Sat, 17 Jun 2017 00:58:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5H0wKHA057472; Sat, 17 Jun 2017 00:58:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706170058.v5H0wKHA057472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Jun 2017 00:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320044 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 00:58:22 -0000 Author: kib Date: Sat Jun 17 00:58:19 2017 New Revision: 320044 URL: https://svnweb.freebsd.org/changeset/base/320044 Log: Regen. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/compat/freebsd32/freebsd32_proto.h Sat Jun 17 00:58:19 2017 (r320044) @@ -294,14 +294,6 @@ struct freebsd32_aio_waitcomplete_args { char aiocbp_l_[PADL_(struct aiocb32 **)]; struct aiocb32 ** aiocbp; char aiocbp_r_[PADR_(struct aiocb32 **)]; char timeout_l_[PADL_(struct timespec32 *)]; struct timespec32 * timeout; char timeout_r_[PADR_(struct timespec32 *)]; }; -struct freebsd32_kevent_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; - char nchanges_l_[PADL_(int)]; int nchanges; char nchanges_r_[PADR_(int)]; - char eventlist_l_[PADL_(struct kevent32 *)]; struct kevent32 * eventlist; char eventlist_r_[PADR_(struct kevent32 *)]; - char nevents_l_[PADL_(int)]; int nevents; char nevents_r_[PADR_(int)]; - char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; -}; struct freebsd32_nmount_args { char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)]; char iovcnt_l_[PADL_(unsigned int)]; unsigned int iovcnt; char iovcnt_r_[PADR_(unsigned int)]; @@ -693,6 +685,14 @@ struct freebsd32_getdirentries_args { char count_l_[PADL_(size_t)]; size_t count; char count_r_[PADR_(size_t)]; char basep_l_[PADL_(int32_t *)]; int32_t * basep; char basep_r_[PADR_(int32_t *)]; }; +struct freebsd32_kevent_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; + char nchanges_l_[PADL_(int)]; int nchanges; char nchanges_r_[PADR_(int)]; + char eventlist_l_[PADL_(struct kevent32 *)]; struct kevent32 * eventlist; char eventlist_r_[PADR_(struct kevent32 *)]; + char nevents_l_[PADL_(int)]; int nevents; char nevents_r_[PADR_(int)]; + char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; +}; #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) #define PAD64_REQUIRED #endif @@ -747,7 +747,6 @@ int freebsd32_jail(struct thread *, struct freebsd32_j int freebsd32_sigtimedwait(struct thread *, struct freebsd32_sigtimedwait_args *); int freebsd32_sigwaitinfo(struct thread *, struct freebsd32_sigwaitinfo_args *); int freebsd32_aio_waitcomplete(struct thread *, struct freebsd32_aio_waitcomplete_args *); -int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_nmount(struct thread *, struct freebsd32_nmount_args *); int freebsd32_sendfile(struct thread *, struct freebsd32_sendfile_args *); int freebsd32_ksem_init(struct thread *, struct freebsd32_ksem_init_args *); @@ -823,6 +822,7 @@ int freebsd32_fstat(struct thread *, struct freebsd32_ int freebsd32_fstatat(struct thread *, struct freebsd32_fstatat_args *); int freebsd32_fhstat(struct thread *, struct freebsd32_fhstat_args *); int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); +int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); #ifdef COMPAT_43 @@ -1165,6 +1165,14 @@ struct freebsd11_freebsd32_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct freebsd11_stat32 *)]; struct freebsd11_stat32 * sb; char sb_r_[PADR_(struct freebsd11_stat32 *)]; }; +struct freebsd11_freebsd32_kevent_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char changelist_l_[PADL_(const struct kevent32_freebsd11 *)]; const struct kevent32_freebsd11 * changelist; char changelist_r_[PADR_(const struct kevent32_freebsd11 *)]; + char nchanges_l_[PADL_(int)]; int nchanges; char nchanges_r_[PADR_(int)]; + char eventlist_l_[PADL_(struct kevent32_freebsd11 *)]; struct kevent32_freebsd11 * eventlist; char eventlist_r_[PADR_(struct kevent32_freebsd11 *)]; + char nevents_l_[PADL_(int)]; int nevents; char nevents_r_[PADR_(int)]; + char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; +}; #ifdef PAD64_REQUIRED #else #endif @@ -1196,6 +1204,7 @@ int freebsd11_freebsd32_lstat(struct thread *, struct int freebsd11_freebsd32_getdirentries(struct thread *, struct freebsd11_freebsd32_getdirentries_args *); int freebsd11_freebsd32_getdents(struct thread *, struct freebsd11_freebsd32_getdents_args *); int freebsd11_freebsd32_fhstat(struct thread *, struct freebsd11_freebsd32_fhstat_args *); +int freebsd11_freebsd32_kevent(struct thread *, struct freebsd11_freebsd32_kevent_args *); int freebsd11_freebsd32_fstatat(struct thread *, struct freebsd11_freebsd32_fstatat_args *); int freebsd11_freebsd32_mknodat(struct thread *, struct freebsd11_freebsd32_mknodat_args *); @@ -1294,7 +1303,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT #define FREEBSD32_SYS_AUE_freebsd32_sigwaitinfo AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_waitcomplete AUE_AIO_WAITCOMPLETE -#define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT +#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_nmount AUE_NMOUNT #define FREEBSD32_SYS_AUE_freebsd32_sendfile AUE_SENDFILE #define FREEBSD32_SYS_AUE_freebsd32_ksem_init AUE_SEMINIT @@ -1360,6 +1369,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_fstatat AUE_FSTATAT #define FREEBSD32_SYS_AUE_freebsd32_fhstat AUE_FHSTAT #define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES +#define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #undef PAD_ #undef PADL_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Sat Jun 17 00:58:19 2017 (r320044) @@ -299,7 +299,7 @@ #define FREEBSD32_SYS_getresuid 360 #define FREEBSD32_SYS_getresgid 361 #define FREEBSD32_SYS_kqueue 362 -#define FREEBSD32_SYS_freebsd32_kevent 363 +#define FREEBSD32_SYS_freebsd11_freebsd32_kevent 363 #define FREEBSD32_SYS_extattr_set_fd 371 #define FREEBSD32_SYS_extattr_get_fd 372 #define FREEBSD32_SYS_extattr_delete_fd 373 @@ -467,4 +467,5 @@ #define FREEBSD32_SYS_getfsstat 557 #define FREEBSD32_SYS_fhstatfs 558 #define FREEBSD32_SYS_mknodat 559 -#define FREEBSD32_SYS_MAXSYSCALL 560 +#define FREEBSD32_SYS_freebsd32_kevent 560 +#define FREEBSD32_SYS_MAXSYSCALL 561 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Sat Jun 17 00:58:19 2017 (r320044) @@ -372,7 +372,7 @@ const char *freebsd32_syscallnames[] = { "getresuid", /* 360 = getresuid */ "getresgid", /* 361 = getresgid */ "kqueue", /* 362 = kqueue */ - "freebsd32_kevent", /* 363 = freebsd32_kevent */ + "compat11.freebsd32_kevent", /* 363 = freebsd11 freebsd32_kevent */ "#364", /* 364 = __cap_get_proc */ "#365", /* 365 = __cap_set_proc */ "#366", /* 366 = __cap_get_fd */ @@ -592,4 +592,5 @@ const char *freebsd32_syscallnames[] = { "getfsstat", /* 557 = getfsstat */ "fhstatfs", /* 558 = fhstatfs */ "mknodat", /* 559 = mknodat */ + "freebsd32_kevent", /* 560 = freebsd32_kevent */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Sat Jun 17 00:58:19 2017 (r320044) @@ -421,7 +421,7 @@ struct sysent freebsd32_sysent[] = { { AS(getresuid_args), (sy_call_t *)sys_getresuid, AUE_GETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 360 = getresuid */ { AS(getresgid_args), (sy_call_t *)sys_getresgid, AUE_GETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 361 = getresgid */ { 0, (sy_call_t *)sys_kqueue, AUE_KQUEUE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 362 = kqueue */ - { AS(freebsd32_kevent_args), (sy_call_t *)freebsd32_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 363 = freebsd32_kevent */ + { compat11(AS(freebsd11_freebsd32_kevent_args),freebsd32_kevent), AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 363 = freebsd11 freebsd32_kevent */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 364 = __cap_get_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 365 = __cap_set_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 366 = __cap_get_fd */ @@ -641,4 +641,5 @@ struct sysent freebsd32_sysent[] = { { AS(getfsstat_args), (sy_call_t *)sys_getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 557 = getfsstat */ { AS(fhstatfs_args), (sy_call_t *)sys_fhstatfs, AUE_FHSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 558 = fhstatfs */ { AS(mknodat_args), (sy_call_t *)sys_mknodat, AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 559 = mknodat */ + { AS(freebsd32_kevent_args), (sy_call_t *)freebsd32_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 560 = freebsd32_kevent */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Sat Jun 17 00:58:19 2017 (r320044) @@ -1774,18 +1774,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 0; break; } - /* freebsd32_kevent */ - case 363: { - struct freebsd32_kevent_args *p = params; - iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->changelist; /* const struct kevent32 * */ - iarg[2] = p->nchanges; /* int */ - uarg[3] = (intptr_t) p->eventlist; /* struct kevent32 * */ - iarg[4] = p->nevents; /* int */ - uarg[5] = (intptr_t) p->timeout; /* const struct timespec32 * */ - *n_args = 6; - break; - } /* extattr_set_fd */ case 371: { struct extattr_set_fd_args *p = params; @@ -3266,6 +3254,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 4; break; } + /* freebsd32_kevent */ + case 560: { + struct freebsd32_kevent_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->changelist; /* const struct kevent32 * */ + iarg[2] = p->nchanges; /* int */ + uarg[3] = (intptr_t) p->eventlist; /* struct kevent32 * */ + iarg[4] = p->nevents; /* int */ + uarg[5] = (intptr_t) p->timeout; /* const struct timespec32 * */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -6088,31 +6088,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d /* kqueue */ case 362: break; - /* freebsd32_kevent */ - case 363: - switch(ndx) { - case 0: - p = "int"; - break; - case 1: - p = "userland const struct kevent32 *"; - break; - case 2: - p = "int"; - break; - case 3: - p = "userland struct kevent32 *"; - break; - case 4: - p = "int"; - break; - case 5: - p = "userland const struct timespec32 *"; - break; - default: - break; - }; - break; /* extattr_set_fd */ case 371: switch(ndx) { @@ -8768,6 +8743,31 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* freebsd32_kevent */ + case 560: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "userland const struct kevent32 *"; + break; + case 2: + p = "int"; + break; + case 3: + p = "userland struct kevent32 *"; + break; + case 4: + p = "int"; + break; + case 5: + p = "userland const struct timespec32 *"; + break; + default: + break; + }; + break; default: break; }; @@ -9805,11 +9805,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* kqueue */ case 362: - /* freebsd32_kevent */ - case 363: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* extattr_set_fd */ case 371: if (ndx == 0 || ndx == 1) @@ -10616,6 +10611,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* mknodat */ case 559: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_kevent */ + case 560: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/kern/init_sysent.c Sat Jun 17 00:58:19 2017 (r320044) @@ -414,7 +414,7 @@ struct sysent sysent[] = { { AS(getresuid_args), (sy_call_t *)sys_getresuid, AUE_GETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 360 = getresuid */ { AS(getresgid_args), (sy_call_t *)sys_getresgid, AUE_GETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 361 = getresgid */ { 0, (sy_call_t *)sys_kqueue, AUE_KQUEUE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 362 = kqueue */ - { AS(kevent_args), (sy_call_t *)sys_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 363 = kevent */ + { compat11(AS(freebsd11_kevent_args),kevent), AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 363 = freebsd11 kevent */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 364 = __cap_get_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 365 = __cap_set_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 366 = __cap_get_fd */ @@ -611,4 +611,5 @@ struct sysent sysent[] = { { AS(getfsstat_args), (sy_call_t *)sys_getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 557 = getfsstat */ { AS(fhstatfs_args), (sy_call_t *)sys_fhstatfs, AUE_FHSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 558 = fhstatfs */ { AS(mknodat_args), (sy_call_t *)sys_mknodat, AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 559 = mknodat */ + { AS(kevent_args), (sy_call_t *)sys_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 560 = kevent */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/kern/syscalls.c Sat Jun 17 00:58:19 2017 (r320044) @@ -369,7 +369,7 @@ const char *syscallnames[] = { "getresuid", /* 360 = getresuid */ "getresgid", /* 361 = getresgid */ "kqueue", /* 362 = kqueue */ - "kevent", /* 363 = kevent */ + "compat11.kevent", /* 363 = freebsd11 kevent */ "#364", /* 364 = __cap_get_proc */ "#365", /* 365 = __cap_set_proc */ "#366", /* 366 = __cap_get_fd */ @@ -566,4 +566,5 @@ const char *syscallnames[] = { "getfsstat", /* 557 = getfsstat */ "fhstatfs", /* 558 = fhstatfs */ "mknodat", /* 559 = mknodat */ + "kevent", /* 560 = kevent */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/kern/systrace_args.c Sat Jun 17 00:58:19 2017 (r320044) @@ -1819,18 +1819,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 0; break; } - /* kevent */ - case 363: { - struct kevent_args *p = params; - iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->changelist; /* struct kevent * */ - iarg[2] = p->nchanges; /* int */ - uarg[3] = (intptr_t) p->eventlist; /* struct kevent * */ - iarg[4] = p->nevents; /* int */ - uarg[5] = (intptr_t) p->timeout; /* const struct timespec * */ - *n_args = 6; - break; - } /* extattr_set_fd */ case 371: { struct extattr_set_fd_args *p = params; @@ -3276,6 +3264,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 4; break; } + /* kevent */ + case 560: { + struct kevent_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->changelist; /* struct kevent * */ + iarg[2] = p->nchanges; /* int */ + uarg[3] = (intptr_t) p->eventlist; /* struct kevent * */ + iarg[4] = p->nevents; /* int */ + uarg[5] = (intptr_t) p->timeout; /* const struct timespec * */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -6173,31 +6173,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d /* kqueue */ case 362: break; - /* kevent */ - case 363: - switch(ndx) { - case 0: - p = "int"; - break; - case 1: - p = "userland struct kevent *"; - break; - case 2: - p = "int"; - break; - case 3: - p = "userland struct kevent *"; - break; - case 4: - p = "int"; - break; - case 5: - p = "userland const struct timespec *"; - break; - default: - break; - }; - break; /* extattr_set_fd */ case 371: switch(ndx) { @@ -8728,6 +8703,31 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* kevent */ + case 560: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "userland struct kevent *"; + break; + case 2: + p = "int"; + break; + case 3: + p = "userland struct kevent *"; + break; + case 4: + p = "int"; + break; + case 5: + p = "userland const struct timespec *"; + break; + default: + break; + }; + break; default: break; }; @@ -9792,11 +9792,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* kqueue */ case 362: - /* kevent */ - case 363: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* extattr_set_fd */ case 371: if (ndx == 0 || ndx == 1) @@ -10611,6 +10606,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* mknodat */ case 559: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* kevent */ + case 560: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/sys/syscall.h Sat Jun 17 00:58:19 2017 (r320044) @@ -305,7 +305,7 @@ #define SYS_getresuid 360 #define SYS_getresgid 361 #define SYS_kqueue 362 -#define SYS_kevent 363 +#define SYS_freebsd11_kevent 363 #define SYS_extattr_set_fd 371 #define SYS_extattr_get_fd 372 #define SYS_extattr_delete_fd 373 @@ -477,4 +477,5 @@ #define SYS_getfsstat 557 #define SYS_fhstatfs 558 #define SYS_mknodat 559 -#define SYS_MAXSYSCALL 560 +#define SYS_kevent 560 +#define SYS_MAXSYSCALL 561 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/sys/syscall.mk Sat Jun 17 00:58:19 2017 (r320044) @@ -234,7 +234,7 @@ MIASM = \ getresuid.o \ getresgid.o \ kqueue.o \ - kevent.o \ + freebsd11_kevent.o \ extattr_set_fd.o \ extattr_get_fd.o \ extattr_delete_fd.o \ @@ -404,4 +404,5 @@ MIASM = \ fstatfs.o \ getfsstat.o \ fhstatfs.o \ - mknodat.o + mknodat.o \ + kevent.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Sat Jun 17 00:57:26 2017 (r320043) +++ head/sys/sys/sysproto.h Sat Jun 17 00:58:19 2017 (r320044) @@ -962,14 +962,6 @@ struct getresgid_args { struct kqueue_args { register_t dummy; }; -struct kevent_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char changelist_l_[PADL_(struct kevent *)]; struct kevent * changelist; char changelist_r_[PADR_(struct kevent *)]; - char nchanges_l_[PADL_(int)]; int nchanges; char nchanges_r_[PADR_(int)]; - char eventlist_l_[PADL_(struct kevent *)]; struct kevent * eventlist; char eventlist_r_[PADR_(struct kevent *)]; - char nevents_l_[PADL_(int)]; int nevents; char nevents_r_[PADR_(int)]; - char timeout_l_[PADL_(const struct timespec *)]; const struct timespec * timeout; char timeout_r_[PADR_(const struct timespec *)]; -}; struct extattr_set_fd_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char attrnamespace_l_[PADL_(int)]; int attrnamespace; char attrnamespace_r_[PADR_(int)]; @@ -1761,6 +1753,14 @@ struct mknodat_args { char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; char dev_l_[PADL_(dev_t)]; dev_t dev; char dev_r_[PADR_(dev_t)]; }; +struct kevent_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char changelist_l_[PADL_(struct kevent *)]; struct kevent * changelist; char changelist_r_[PADR_(struct kevent *)]; + char nchanges_l_[PADL_(int)]; int nchanges; char nchanges_r_[PADR_(int)]; + char eventlist_l_[PADL_(struct kevent *)]; struct kevent * eventlist; char eventlist_r_[PADR_(struct kevent *)]; + char nevents_l_[PADL_(int)]; int nevents; char nevents_r_[PADR_(int)]; + char timeout_l_[PADL_(const struct timespec *)]; const struct timespec * timeout; char timeout_r_[PADR_(const struct timespec *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -1976,7 +1976,6 @@ int sys_aio_waitcomplete(struct thread *, struct aio_w int sys_getresuid(struct thread *, struct getresuid_args *); int sys_getresgid(struct thread *, struct getresgid_args *); int sys_kqueue(struct thread *, struct kqueue_args *); -int sys_kevent(struct thread *, struct kevent_args *); int sys_extattr_set_fd(struct thread *, struct extattr_set_fd_args *); int sys_extattr_get_fd(struct thread *, struct extattr_get_fd_args *); int sys_extattr_delete_fd(struct thread *, struct extattr_delete_fd_args *); @@ -2141,6 +2140,7 @@ int sys_fstatfs(struct thread *, struct fstatfs_args * int sys_getfsstat(struct thread *, struct getfsstat_args *); int sys_fhstatfs(struct thread *, struct fhstatfs_args *); int sys_mknodat(struct thread *, struct mknodat_args *); +int sys_kevent(struct thread *, struct kevent_args *); #ifdef COMPAT_43 @@ -2519,6 +2519,14 @@ struct freebsd11_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * sb; char sb_r_[PADR_(struct freebsd11_stat *)]; }; +struct freebsd11_kevent_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char changelist_l_[PADL_(struct kevent_freebsd11 *)]; struct kevent_freebsd11 * changelist; char changelist_r_[PADR_(struct kevent_freebsd11 *)]; + char nchanges_l_[PADL_(int)]; int nchanges; char nchanges_r_[PADR_(int)]; + char eventlist_l_[PADL_(struct kevent_freebsd11 *)]; struct kevent_freebsd11 * eventlist; char eventlist_r_[PADR_(struct kevent_freebsd11 *)]; + char nevents_l_[PADL_(int)]; int nevents; char nevents_r_[PADR_(int)]; + char timeout_l_[PADL_(const struct timespec *)]; const struct timespec * timeout; char timeout_r_[PADR_(const struct timespec *)]; +}; struct freebsd11_getfsstat_args { char buf_l_[PADL_(struct freebsd11_statfs *)]; struct freebsd11_statfs * buf; char buf_r_[PADR_(struct freebsd11_statfs *)]; char bufsize_l_[PADL_(long)]; long bufsize; char bufsize_r_[PADR_(long)]; @@ -2558,6 +2566,7 @@ int freebsd11_nstat(struct thread *, struct freebsd11_ int freebsd11_nfstat(struct thread *, struct freebsd11_nfstat_args *); int freebsd11_nlstat(struct thread *, struct freebsd11_nlstat_args *); int freebsd11_fhstat(struct thread *, struct freebsd11_fhstat_args *); +int freebsd11_kevent(struct thread *, struct freebsd11_kevent_args *); int freebsd11_getfsstat(struct thread *, struct freebsd11_getfsstat_args *); int freebsd11_statfs(struct thread *, struct freebsd11_statfs_args *); int freebsd11_fstatfs(struct thread *, struct freebsd11_fstatfs_args *); @@ -2852,7 +2861,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_getresuid AUE_GETRESUID #define SYS_AUE_getresgid AUE_GETRESGID #define SYS_AUE_kqueue AUE_KQUEUE -#define SYS_AUE_kevent AUE_KEVENT +#define SYS_AUE_freebsd11_kevent AUE_KEVENT #define SYS_AUE_extattr_set_fd AUE_EXTATTR_SET_FD #define SYS_AUE_extattr_get_fd AUE_EXTATTR_GET_FD #define SYS_AUE_extattr_delete_fd AUE_EXTATTR_DELETE_FD @@ -3023,6 +3032,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_getfsstat AUE_GETFSSTAT #define SYS_AUE_fhstatfs AUE_FHSTATFS #define SYS_AUE_mknodat AUE_MKNODAT +#define SYS_AUE_kevent AUE_KEVENT #undef PAD_ #undef PADL_ From owner-svn-src-all@freebsd.org Sat Jun 17 01:06:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 918A6D8CEE4; Sat, 17 Jun 2017 01:06:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60ACC76B35; Sat, 17 Jun 2017 01:06:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5H16muR061525; Sat, 17 Jun 2017 01:06:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5H16msb061524; Sat, 17 Jun 2017 01:06:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706170106.v5H16msb061524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Jun 2017 01:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320045 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 01:06:49 -0000 Author: kib Date: Sat Jun 17 01:06:48 2017 New Revision: 320045 URL: https://svnweb.freebsd.org/changeset/base/320045 Log: Bump __FreeBSD_version for r320043, struct event 64-bit data. Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Jun 17 00:58:19 2017 (r320044) +++ head/sys/sys/param.h Sat Jun 17 01:06:48 2017 (r320045) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200032 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200033 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sat Jun 17 01:09:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22CA8D8CF82; Sat, 17 Jun 2017 01:09:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5DB976CD8; Sat, 17 Jun 2017 01:09:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5H19JN3061646; Sat, 17 Jun 2017 01:09:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5H19JXP061645; Sat, 17 Jun 2017 01:09:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706170109.v5H19JXP061645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Jun 2017 01:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320046 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 01:09:20 -0000 Author: kib Date: Sat Jun 17 01:09:18 2017 New Revision: 320046 URL: https://svnweb.freebsd.org/changeset/base/320046 Log: Add UPDATING note about kevent(2) ABI change. Sponsored by: The FreeBSD Foundation Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Jun 17 01:06:48 2017 (r320045) +++ head/UPDATING Sat Jun 17 01:09:18 2017 (r320046) @@ -51,6 +51,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20170617: + The ABI of struct event was changed by extending the data + member to 64bit and adding ext fields. For upgrade, same + precautions as for the entry 20170523 "ino64" must be + followed. + 20170524: The ath(4) and ath_hal(4) modules now build piecemeal to allow for smaller runtime footprint builds. This is useful for embedded systems From owner-svn-src-all@freebsd.org Sat Jun 17 01:27:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01072D8DD2E; Sat, 17 Jun 2017 01:27:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C36B6779DC; Sat, 17 Jun 2017 01:27:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5H1RFDD069781; Sat, 17 Jun 2017 01:27:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5H1RF0Z069780; Sat, 17 Jun 2017 01:27:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706170127.v5H1RF0Z069780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 17 Jun 2017 01:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320047 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 01:27:17 -0000 Author: emaste Date: Sat Jun 17 01:27:15 2017 New Revision: 320047 URL: https://svnweb.freebsd.org/changeset/base/320047 Log: UPDATING: sort 20170531 entry correctly (from r319664) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Jun 17 01:09:18 2017 (r320046) +++ head/UPDATING Sat Jun 17 01:27:15 2017 (r320047) @@ -57,6 +57,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: precautions as for the entry 20170523 "ino64" must be followed. +20170531: + The GNU roff toolchain has been removed from base. To render manpages + which are not supported by mandoc(1), man(1) can fallback on GNU roff + from ports (and recommends to install it). + To render roff(7) documents, consider using GNU roff from ports or the + heirloom doctools roff toolchain from ports via pkg install groff or + via pkg install heirloom-doctools. + 20170524: The ath(4) and ath_hal(4) modules now build piecemeal to allow for smaller runtime footprint builds. This is useful for embedded systems @@ -81,14 +89,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: bus bind type - this is where probe/attach is done. For further comments/feedback, poke adrian@ . - -20170531: - The GNU roff toolchain has been removed from base. To render manpages - which are not supported by mandoc(1), man(1) can fallback on GNU roff - from ports (and recommends to install it). - To render roff(7) documents, consider using GNU roff from ports or the - heirloom doctools roff toolchain from ports via pkg install groff or - via pkg install heirloom-doctools. 20170523: The "ino64" 64-bit inode project has been committed, which extends From owner-svn-src-all@freebsd.org Sat Jun 17 02:58:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98390B9407F; Sat, 17 Jun 2017 02:58:33 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72A657AE19; Sat, 17 Jun 2017 02:58:33 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5H2wW7D006087; Sat, 17 Jun 2017 02:58:32 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5H2wWCT006080; Sat, 17 Jun 2017 02:58:32 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201706170258.v5H2wWCT006080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 17 Jun 2017 02:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320048 - head/usr.bin/mkuzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 02:58:33 -0000 Author: sobomax Date: Sat Jun 17 02:58:31 2017 New Revision: 320048 URL: https://svnweb.freebsd.org/changeset/base/320048 Log: o Move logic that determines size of the input image into its own file. That logic has grown quite significantly now; o add a special handling for the snapshot images. Those have some extra headers at the end of the image and we don't need those in the output image really. MFC after: 6 weeks Added: head/usr.bin/mkuzip/mkuz_insize.c (contents, props changed) head/usr.bin/mkuzip/mkuz_insize.h (contents, props changed) Modified: head/usr.bin/mkuzip/Makefile head/usr.bin/mkuzip/mkuz_cfg.h head/usr.bin/mkuzip/mkuzip.c Modified: head/usr.bin/mkuzip/Makefile ============================================================================== --- head/usr.bin/mkuzip/Makefile Sat Jun 17 01:27:15 2017 (r320047) +++ head/usr.bin/mkuzip/Makefile Sat Jun 17 02:58:31 2017 (r320048) @@ -3,7 +3,7 @@ PROG= mkuzip MAN= mkuzip.8 SRCS= mkuzip.c mkuz_blockcache.c mkuz_lzma.c mkuz_zlib.c mkuz_conveyor.c \ - mkuz_blk.c mkuz_fqueue.c mkuz_time.c + mkuz_blk.c mkuz_fqueue.c mkuz_time.c mkuz_insize.c #CFLAGS+= -DMKUZ_DEBUG Modified: head/usr.bin/mkuzip/mkuz_cfg.h ============================================================================== --- head/usr.bin/mkuzip/mkuz_cfg.h Sat Jun 17 01:27:15 2017 (r320047) +++ head/usr.bin/mkuzip/mkuz_cfg.h Sat Jun 17 02:58:31 2017 (r320048) @@ -36,5 +36,7 @@ struct mkuz_cfg { int en_dedup; int nworkers; int blksz; + const char *iname; + off_t isize; const struct mkuz_format *handler; }; Added: head/usr.bin/mkuzip/mkuz_insize.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_insize.c Sat Jun 17 02:58:31 2017 (r320048) @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2004-2016 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include "mkuz_cfg.h" +#include "mkuz_insize.h" + +off_t +mkuz_get_insize(struct mkuz_cfg *cfp) +{ + int ffd; + off_t ms; + struct stat sb; + struct statfs statfsbuf; + + if (fstat(cfp->fdr, &sb) != 0) { + warn("fstat(%s)", cfp->iname); + return (-1); + } + if ((sb.st_flags & SF_SNAPSHOT) != 0) { + if (fstatfs(cfp->fdr, &statfsbuf) != 0) { + warn("fstatfs(%s)", cfp->iname); + return (-1); + } + ffd = open(statfsbuf.f_mntfromname, O_RDONLY); + if (ffd < 0) { + warn("open(%s, O_RDONLY)", statfsbuf.f_mntfromname); + return (-1); + } + if (ioctl(ffd, DIOCGMEDIASIZE, &ms) < 0) { + warn("ioctl(DIOCGMEDIASIZE)"); + return (-1); + } + sb.st_size = ms; + } else if (S_ISCHR(sb.st_mode)) { + if (ioctl(cfp->fdr, DIOCGMEDIASIZE, &ms) < 0) { + warn("ioctl(DIOCGMEDIASIZE)"); + return (-1); + } + sb.st_size = ms; + } else if (!S_ISREG(sb.st_mode)) { + warnx("%s: not a character device or regular file\n", + cfp->iname); + return (-1); + } + return (sb.st_size); +} Added: head/usr.bin/mkuzip/mkuz_insize.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_insize.h Sat Jun 17 02:58:31 2017 (r320048) @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2016 Maxim Sobolev + * 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$ + */ + +off_t mkuz_get_insize(struct mkuz_cfg *); Modified: head/usr.bin/mkuzip/mkuzip.c ============================================================================== --- head/usr.bin/mkuzip/mkuzip.c Sat Jun 17 01:27:15 2017 (r320047) +++ head/usr.bin/mkuzip/mkuzip.c Sat Jun 17 02:58:31 2017 (r320048) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -58,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include "mkuz_format.h" #include "mkuz_fqueue.h" #include "mkuz_time.h" +#include "mkuz_insize.h" #define DEFAULT_CLSTSIZE 16384 @@ -94,7 +94,7 @@ cmp_blkno(const struct mkuz_blk *bp, void *p) int main(int argc, char **argv) { struct mkuz_cfg cfs; - char *iname, *oname; + char *oname; uint64_t *toc; int i, io, opt, tmp; struct { @@ -102,7 +102,6 @@ int main(int argc, char **argv) FILE *f; } summary; struct iovec iov[2]; - struct stat sb; uint64_t offset, last_offset; struct cloop_header hdr; struct mkuz_conveyor *cvp; @@ -203,9 +202,9 @@ int main(int argc, char **argv) c_ctx = cfs.handler->f_init(cfs.blksz); - iname = argv[0]; + cfs.iname = argv[0]; if (oname == NULL) { - asprintf(&oname, "%s%s", iname, cfs.handler->default_sufx); + asprintf(&oname, "%s%s", cfs.iname, cfs.handler->default_sufx); if (oname == NULL) { err(1, "can't allocate memory"); /* Not reached */ @@ -219,30 +218,18 @@ int main(int argc, char **argv) signal(SIGXFSZ, exit); atexit(cleanup); - cfs.fdr = open(iname, O_RDONLY); + cfs.fdr = open(cfs.iname, O_RDONLY); if (cfs.fdr < 0) { - err(1, "open(%s)", iname); + err(1, "open(%s)", cfs.iname); /* Not reached */ } - if (fstat(cfs.fdr, &sb) != 0) { - err(1, "fstat(%s)", iname); + cfs.isize = mkuz_get_insize(&cfs); + if (cfs.isize < 0) { + errx(1, "can't determine input image size"); /* Not reached */ } - if (S_ISCHR(sb.st_mode)) { - off_t ms; - - if (ioctl(cfs.fdr, DIOCGMEDIASIZE, &ms) < 0) { - err(1, "ioctl(DIOCGMEDIASIZE)"); - /* Not reached */ - } - sb.st_size = ms; - } else if (!S_ISREG(sb.st_mode)) { - fprintf(stderr, "%s: not a character device or regular file\n", - iname); - exit(1); - } - hdr.nblocks = sb.st_size / cfs.blksz; - if ((sb.st_size % cfs.blksz) != 0) { + hdr.nblocks = cfs.isize / cfs.blksz; + if ((cfs.isize % cfs.blksz) != 0) { if (cfs.verbose != 0) fprintf(stderr, "file size is not multiple " "of %d, padding data\n", cfs.blksz); @@ -270,7 +257,7 @@ int main(int argc, char **argv) if (cfs.verbose != 0) { fprintf(stderr, "data size %ju bytes, number of clusters " - "%u, index length %zu bytes\n", sb.st_size, + "%u, index length %zu bytes\n", cfs.isize, hdr.nblocks, iov[1].iov_len); } @@ -353,9 +340,9 @@ drain: et = getdtime(); fprintf(summary.f, "compressed data to %ju bytes, saved %lld " "bytes, %.2f%% decrease, %.2f bytes/sec.\n", offset, - (long long)(sb.st_size - offset), - 100.0 * (long long)(sb.st_size - offset) / - (float)sb.st_size, (float)sb.st_size / (et - st)); + (long long)(cfs.isize - offset), + 100.0 * (long long)(cfs.isize - offset) / + (float)cfs.isize, (float)cfs.isize / (et - st)); } /* Convert to big endian */ From owner-svn-src-all@freebsd.org Sat Jun 17 03:05:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6711B94864; Sat, 17 Jun 2017 03:05:26 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8260B7BC87; Sat, 17 Jun 2017 03:05:26 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5H35PfK011507; Sat, 17 Jun 2017 03:05:25 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5H35P2S011506; Sat, 17 Jun 2017 03:05:25 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706170305.v5H35P2S011506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 17 Jun 2017 03:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320049 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 03:05:27 -0000 Author: alc Date: Sat Jun 17 03:05:25 2017 New Revision: 320049 URL: https://svnweb.freebsd.org/changeset/base/320049 Log: Pages that are passed to swap_pager_putpages() should already be fully dirty. Assert that they are fully dirty rather than redundantly calling vm_page_dirty() on them. Reviewed by: kib, markj MFC after: 1 week X-MFC after: r319932 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sat Jun 17 02:58:31 2017 (r320048) +++ head/sys/vm/swap_pager.c Sat Jun 17 03:05:25 2017 (r320049) @@ -1372,7 +1372,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t *m, mreq->pindex, blk + j ); - vm_page_dirty(mreq); + MPASS(mreq->dirty == VM_PAGE_BITS_ALL); mreq->oflags |= VPO_SWAPINPROG; bp->b_pages[j] = mreq; } From owner-svn-src-all@freebsd.org Sat Jun 17 07:36:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3E9BBF3942; Sat, 17 Jun 2017 07:36:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4D2D83134; Sat, 17 Jun 2017 07:36:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5H7akgV021160; Sat, 17 Jun 2017 07:36:46 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5H7ak6H021159; Sat, 17 Jun 2017 07:36:46 GMT (envelope-from br@FreeBSD.org) Message-Id: <201706170736.v5H7ak6H021159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 17 Jun 2017 07:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320050 - head/sys/riscv/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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 07:36:47 -0000 Author: br Date: Sat Jun 17 07:36:46 2017 New Revision: 320050 URL: https://svnweb.freebsd.org/changeset/base/320050 Log: Undefine temporary macro. This fixes world build. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/include/atomic.h Modified: head/sys/riscv/include/atomic.h ============================================================================== --- head/sys/riscv/include/atomic.h Sat Jun 17 03:05:25 2017 (r320049) +++ head/sys/riscv/include/atomic.h Sat Jun 17 07:36:46 2017 (r320050) @@ -512,6 +512,8 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val #define atomic_set_acq_ptr atomic_set_acq_64 #define atomic_subtract_acq_ptr atomic_subtract_acq_64 +#undef ATOMIC_ACQ_REL + static __inline void atomic_thread_fence_acq(void) { From owner-svn-src-all@freebsd.org Sat Jun 17 08:09:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B1BBF46F0; Sat, 17 Jun 2017 08:09:57 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B581A83E29; Sat, 17 Jun 2017 08:09:56 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.52.136.21]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MdnN3-1dAHDi1NXB-00PfKW; Sat, 17 Jun 2017 10:09:47 +0200 Date: Sat, 17 Jun 2017 10:09:40 +0200 From: "O. Hartmann" To: Jason Evans Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "O. Hartmann" Subject: Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc Message-ID: <20170617100940.1c925cc2@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20170615131152.4d3c7dad216234b44cc2686c@canonware.com> References: <201706150715.v5F7F6aT031218@repo.freebsd.org> <20170615103157.43bf216e@freyja.zeit4.iv.bundesimmobilien.de> <20170615080457.3c1438e957f34fb8abd241d1@canonware.com> <20170615131152.4d3c7dad216234b44cc2686c@canonware.com> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/8w8T9XE9G3wKkDwqLCWTQm5"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:utmig2Rgc9BEjKuEj1C3JbkxHakz30DsULKBpFomRc+o0SP7jyi Wh9cmOpOm4Ovsi5A04CRMJ9s6++/UsfnvztkQlrnSWH3I47yJTKtGmxkvnGoQhEvydTNVxG l+kBOO2NqRqDkPqh1QhvhxNMwTlnz6uvVFY6zsCC6wkF8BTLpu/yYFxRxdHTp3fcpwBrV1D BLWkkM6n9oW4eBt4QpIYQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:HO6yKPxMyOI=:zSkbpIxyGP3oPbBsRzVFmh gncrG+KRJCNnaERd7VY5aU37y8lmeR1DsJdQl3RhapMe1Iu28zxJjJSm2dAxzD0CEi83URx3N qDptZwXiLFaQErWxRNZpROTSzwaDhaW4Ze50N4ocSPOqcTDykzL42sHFAETv4AknM3rdEEgKI /R1cNZhQq3LjsBzDJNZQFJsHotn7dT1nytTXnH8Q55lYw9pUWkJE+OFuGUV+QQ8ofEHKGN3iL pitn2siIBwX7LrNEYYdbFpqb9kYOEZZQSEcyX1AIRYxNqTyVGOqVKuw7yn3mMFCby7oQqIoou JEoit4kK/Sl6XC28WnjFFPXW947l9pQswXr2VtMDEL/S7lFhx44VXOa9E5RavJ5oJO2DJ+V22 aWvAfaaeJJUlr7HdjMb0rDKmMGuF/NcNaE3mAa0kG43E5uwDd2wZsg9CGKjrjqJZVbdjc8bAA rcyAoYS4ajXFj2IZ3UCnjI2zp3GR0RjsEC/RpRk49coox3tyo6KZa5TVby5jMlrUlzU8g2xUN Jd1c+VJlhkMLT5FixvCjZqHXZeO3T0sIcy93RL92AYvNMYgcmpuBB8BZLPrdgAh5SCUkD1eEY aXH764ddnssbqezzTqVij+dWon/3GdJrbBJ3Esv5I9JcQdQwo4v5gSdWjlYI5thDRk5ru5nXQ 4FBs/vHHQ9GrWVCYH5uDWy2spX7w06vcLdAdWSU0rfvJIrr4k7gfzyXYkH/tB3ypG/IEgKfPf f0x1v8uz/va7wDkbyhkEWGE5anAwrXi80H0/P1NVKXB23aAAVK3hOfo3ITc= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 08:09:57 -0000 --Sig_/8w8T9XE9G3wKkDwqLCWTQm5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Thu, 15 Jun 2017 13:11:52 -0700 Jason Evans schrieb: > On Thu, 15 Jun 2017 08:04:57 -0700 > Jason Evans wrote: >=20 > > On Thu, 15 Jun 2017 10:31:57 +0200 > > "O. Hartmann" wrote: > > =20 > > > On Thu, 15 Jun 2017 07:15:06 +0000 (UTC) > > > Jason Evans wrote: > > > =20 > > > > Author: jasone > > > > Date: Thu Jun 15 07:15:05 2017 > > > > New Revision: 319971 > > > > URL: https://svnweb.freebsd.org/changeset/base/319971 > > > >=20 > > > > Log: > > > > Update jemalloc to 5.0.0. =20 > > >=20 > > > On all hosts (running CURRENT: FreeBSD 12.0-CURRENT #15 r319965: Thu= Jun 15 > > > 05:56:12 CEST 2017 amd64 AND FreeBSD 12.0-CURRENT #20 r319934: Wed Ju= n 14 > > > 06:18:46 CEST 2017 amd64) > > >=20 > > > buildworld fails on > > >=20 > > > [...] > > > Building /usr/obj/usr/src/lib/libgcc_s/_libinstall > > > --- secure/lib/libcrypto__L --- > > > --- all_subdir_secure/lib/libcrypto/engines/libaep --- > > > /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s > > > /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s > > > cc: error: linker command failed with exit code 1 (use -v to see invo= cation) > > > *** [libaep.so] Error code 1 > > >=20 > > > make[6]: stopped in /usr/src/secure/lib/libcrypto/engines/libaep > > > .ERROR_TARGET=3D'libaep.so' =20 > >=20 > > I tested this commit based on r319490. I'm in the process of updating = to r319971, > > and will see if the issue reproduces. =20 >=20 > I updated from r319490 (with jemalloc update integrated) to r319971, then= rebuilt > r319971 without issues. Is it possible that the issue you hit isn't dire= ctly related > to r319971? >=20 > Thanks, > Jason > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" Sorry for the late response. The problem vanished after removing /usr/obj and restarting the buildworld = process. I did so consequently on all systems after this incident and had no problem= s so far. And: yes, it (the initial problem reported) could probably be related to so= mething else, but it occured immediately after the update of this SVN index has been comm= itted. But I think that doesn't matter anymore. Kind regards, Oliver --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/8w8T9XE9G3wKkDwqLCWTQm5 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWUTjxAAKCRDS528fyFhY lBH5AgCfVUPdJYnVO+6s1rZtKxwko5wH82HcnRBU44/7qcWJQYoztwOKSqwVi+3E pOkHNwaUNPeo5z9dpebBcThYwuh4AgCK2/hNtuvO7Sbzj0tX53eqgWaGvGHzBQ1Q o6VOklW0wtUWnD2fcEyiZZWV0rUIbmNyKLUNfPgqNzPDJ+mOQ1rG =jXau -----END PGP SIGNATURE----- --Sig_/8w8T9XE9G3wKkDwqLCWTQm5-- From owner-svn-src-all@freebsd.org Sat Jun 17 11:25:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96E8BBF8803; Sat, 17 Jun 2017 11:25:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 550CE66239; Sat, 17 Jun 2017 11:25:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HBPV62018604; Sat, 17 Jun 2017 11:25:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HBPVIV018603; Sat, 17 Jun 2017 11:25:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706171125.v5HBPVIV018603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Jun 2017 11:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320051 - head/sys/i386/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 11:25:32 -0000 Author: kib Date: Sat Jun 17 11:25:31 2017 New Revision: 320051 URL: https://svnweb.freebsd.org/changeset/base/320051 Log: Correct translations between abridged and full x87 tags. Reported and tested by: karnajit wangkhem Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/isa/npx.c Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Sat Jun 17 07:36:46 2017 (r320050) +++ head/sys/i386/isa/npx.c Sat Jun 17 11:25:31 2017 (r320051) @@ -1108,7 +1108,7 @@ npx_fill_fpregs_xmm1(struct savexmm *sv_xmm, struct sa sv_87->sv_ac[i] = sv_xmm->sv_fp[i].fp_acc; if ((penv_xmm->en_tw & (1 << i)) != 0) /* zero and special are set as valid */ - penv_87->en_tw &= ~(3 << i); + penv_87->en_tw &= ~(3 << i * 2); } } @@ -1139,11 +1139,16 @@ npx_set_fpregs_xmm(struct save87 *sv_87, struct savexm penv_xmm->en_foo = penv_87->en_foo; penv_xmm->en_fos = penv_87->en_fos; - /* FPU registers and tags */ + /* + * FPU registers and tags. + * Abridged / Full translation (values in binary), see FXSAVE spec. + * 0 11 + * 1 00, 01, 10 + */ penv_xmm->en_tw = 0; for (i = 0; i < 8; ++i) { sv_xmm->sv_fp[i].fp_acc = sv_87->sv_ac[i]; - if ((penv_87->en_tw && (3 << i)) != (3 << i)) + if ((penv_87->en_tw & (3 << i * 2)) != (3 << i * 2)) penv_xmm->en_tw |= 1 << i; } } From owner-svn-src-all@freebsd.org Sat Jun 17 11:30:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FC93BF8892; Sat, 17 Jun 2017 11:30:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFA8866399; Sat, 17 Jun 2017 11:30:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HBU0FR018804; Sat, 17 Jun 2017 11:30:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HBU0hq018797; Sat, 17 Jun 2017 11:30:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706171130.v5HBU0hq018797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Jun 2017 11:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320052 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 11:30:01 -0000 Author: kib Date: Sat Jun 17 11:29:59 2017 New Revision: 320052 URL: https://svnweb.freebsd.org/changeset/base/320052 Log: Do not leak syslog_mutex on cancellation. Make syslog(3) resilent to cancellation occuring in supported deferred mode. Code must unlock syslog_mutex on cancel, install the cleanup handler. Diagnosed and tested by: eugen Discussed with: dchagin Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/syslog.c Modified: head/lib/libc/gen/syslog.c ============================================================================== --- head/lib/libc/gen/syslog.c Sat Jun 17 11:25:31 2017 (r320051) +++ head/lib/libc/gen/syslog.c Sat Jun 17 11:29:59 2017 (r320052) @@ -129,8 +129,8 @@ syslog(int pri, const char *fmt, ...) va_end(ap); } -void -vsyslog(int pri, const char *fmt, va_list ap) +static void +vsyslog1(int pri, const char *fmt, va_list ap) { int cnt; char ch, *p; @@ -151,13 +151,9 @@ vsyslog(int pri, const char *fmt, va_list ap) saved_errno = errno; - THREAD_LOCK(); - /* Check priority against setlogmask values. */ - if (!(LOG_MASK(LOG_PRI(pri)) & LogMask)) { - THREAD_UNLOCK(); + if (!(LOG_MASK(LOG_PRI(pri)) & LogMask)) return; - } /* Set default facility if none specified. */ if ((pri & LOG_FACMASK) == 0) @@ -167,10 +163,8 @@ vsyslog(int pri, const char *fmt, va_list ap) tbuf_cookie.base = tbuf; tbuf_cookie.left = sizeof(tbuf); fp = fwopen(&tbuf_cookie, writehook); - if (fp == NULL) { - THREAD_UNLOCK(); + if (fp == NULL) return; - } /* Build the message. */ (void)time(&now); @@ -200,7 +194,6 @@ vsyslog(int pri, const char *fmt, va_list ap) fmt_fp = fwopen(&fmt_cookie, writehook); if (fmt_fp == NULL) { fclose(fp); - THREAD_UNLOCK(); return; } @@ -285,10 +278,8 @@ vsyslog(int pri, const char *fmt, va_list ap) */ disconnectlog(); connectlog(); - if (send(LogFile, tbuf, cnt, 0) >= 0) { - THREAD_UNLOCK(); + if (send(LogFile, tbuf, cnt, 0) >= 0) return; - } /* * if the resend failed, fall through to * possible scenario 2 @@ -303,15 +294,11 @@ vsyslog(int pri, const char *fmt, va_list ap) if (status == CONNPRIV) break; _usleep(1); - if (send(LogFile, tbuf, cnt, 0) >= 0) { - THREAD_UNLOCK(); + if (send(LogFile, tbuf, cnt, 0) >= 0) return; - } } - } else { - THREAD_UNLOCK(); + } else return; - } /* * Output the message to the console; try not to block @@ -333,10 +320,25 @@ vsyslog(int pri, const char *fmt, va_list ap) (void)_writev(fd, iov, 2); (void)_close(fd); } +} +static void +syslog_cancel_cleanup(void *arg __unused) +{ + THREAD_UNLOCK(); } +void +vsyslog(int pri, const char *fmt, va_list ap) +{ + + THREAD_LOCK(); + pthread_cleanup_push(syslog_cancel_cleanup, NULL); + vsyslog1(pri, fmt, ap); + pthread_cleanup_pop(1); +} + /* Should be called with mutex acquired */ static void disconnectlog(void) @@ -423,9 +425,11 @@ openlog_unlocked(const char *ident, int logstat, int l void openlog(const char *ident, int logstat, int logfac) { + THREAD_LOCK(); + pthread_cleanup_push(syslog_cancel_cleanup, NULL); openlog_unlocked(ident, logstat, logfac); - THREAD_UNLOCK(); + pthread_cleanup_pop(1); } From owner-svn-src-all@freebsd.org Sat Jun 17 14:36:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 480EABFBB60; Sat, 17 Jun 2017 14:36:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18CB16EC2D; Sat, 17 Jun 2017 14:36:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HEaQsI097672; Sat, 17 Jun 2017 14:36:26 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HEaQAv097671; Sat, 17 Jun 2017 14:36:26 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201706171436.v5HEaQAv097671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 17 Jun 2017 14:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320054 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 14:36:27 -0000 Author: mmel Date: Sat Jun 17 14:36:25 2017 New Revision: 320054 URL: https://svnweb.freebsd.org/changeset/base/320054 Log: Manually load tunable CPU quirks. These are needed too early, far before SYSINIT is processed. Reported by: zbb Pointy hat to: mmel MFC after: 3 weeks MFC with: r319896 Modified: head/sys/arm/arm/cpuinfo.c Modified: head/sys/arm/arm/cpuinfo.c ============================================================================== --- head/sys/arm/arm/cpuinfo.c Sat Jun 17 12:48:31 2017 (r320053) +++ head/sys/arm/arm/cpuinfo.c Sat Jun 17 14:36:25 2017 (r320054) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -76,6 +77,14 @@ SYSCTL_INT(_hw_cpu_quirks, OID_AUTO, actlr_set, void cpuinfo_init(void) { + + /* + * Prematurely fetch CPU quirks. Standard fetch for tunable + * sysctls is handled using SYSINIT, thus too late for boot CPU. + * Keep names in sync with sysctls. + */ + TUNABLE_INT_FETCH("hw.cpu.quirks.actlr_mask", &cpu_quirks_actlr_mask); + TUNABLE_INT_FETCH("hw.cpu.quirks.actlr_set", &cpu_quirks_actlr_set); cpuinfo.midr = cp15_midr_get(); /* Test old version id schemes first */ From owner-svn-src-all@freebsd.org Sat Jun 17 14:39:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E59BFBC78; Sat, 17 Jun 2017 14:39:27 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 221B16EDE8; Sat, 17 Jun 2017 14:39:27 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HEdQjH097915; Sat, 17 Jun 2017 14:39:26 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HEdPF0097910; Sat, 17 Jun 2017 14:39:25 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201706171439.v5HEdPF0097910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sat, 17 Jun 2017 14:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320055 - in head/sys/dev/rtwn: rtl8188e rtl8188e/usb rtl8192c X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 14:39:27 -0000 Author: kevlo Date: Sat Jun 17 14:39:25 2017 New Revision: 320055 URL: https://svnweb.freebsd.org/changeset/base/320055 Log: - Fix incorrect values in the computation of CCK and OFDM transmit power for the rtl8188eu chipset - Rename struct r92c_rom member names: s/channel_plan/reserved5/, s/xtal_calib/channel_plan to be compliant with definitions of the efuse in vendor hal_pg.h Modified: head/sys/dev/rtwn/rtl8188e/r88e_chan.c head/sys/dev/rtwn/rtl8188e/r88e_priv.h head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/dev/rtwn/rtl8192c/r92c_rom_image.h Modified: head/sys/dev/rtwn/rtl8188e/r88e_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_chan.c Sat Jun 17 14:36:25 2017 (r320054) +++ head/sys/dev/rtwn/rtl8188e/r88e_chan.c Sat Jun 17 14:39:25 2017 (r320055) @@ -89,8 +89,7 @@ r88e_get_txpower(struct rtwn_softc *sc, int chain, { struct r92c_softc *rs = sc->sc_priv; const struct rtwn_r88e_txpwr *rt = rs->rs_txpwr; - const struct rtwn_r88e_txagc *base = rs->rs_txagc; - uint16_t cckpow, ofdmpow, bw20pow, htpow; + uint8_t cckpow, ofdmpow, bw20pow, htpow = 0; int max_mcs, ridx, group; /* Determine channel group. */ @@ -106,35 +105,24 @@ r88e_get_txpower(struct rtwn_softc *sc, int chain, KASSERT(max_mcs <= RTWN_RIDX_COUNT, ("increase ridx limit\n")); memset(power, 0, max_mcs * sizeof(power[0])); - if (rs->regulatory == 0) { - for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++) - power[ridx] = base->pwr[0][ridx]; - } - for (ridx = RTWN_RIDX_OFDM6; ridx <= max_mcs; ridx++) { - if (rs->regulatory == 3) - power[ridx] = base->pwr[0][ridx]; - else if (rs->regulatory == 1) { - if (!IEEE80211_IS_CHAN_HT40(c)) - power[ridx] = base->pwr[group][ridx]; - } else if (rs->regulatory != 2) - power[ridx] = base->pwr[0][ridx]; - } /* Compute per-CCK rate Tx power. */ cckpow = rt->cck_tx_pwr[group]; - for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++) - power[ridx] += cckpow; + for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++) { + power[ridx] = (ridx == RTWN_RIDX_CCK2) ? cckpow - 9 : cckpow; + } - htpow = rt->ht40_tx_pwr[group]; + if (group < 5) + htpow = rt->ht40_tx_pwr[group]; /* Compute per-OFDM rate Tx power. */ ofdmpow = htpow + rt->ofdm_tx_pwr_diff; for (ridx = RTWN_RIDX_OFDM6; ridx <= RTWN_RIDX_OFDM54; ridx++) - power[ridx] += ofdmpow; + power[ridx] = ofdmpow; bw20pow = htpow + rt->bw20_tx_pwr_diff; for (ridx = RTWN_RIDX_MCS(0); ridx <= max_mcs; ridx++) - power[ridx] += bw20pow; + power[ridx] = bw20pow; /* Apply max limit. */ for (ridx = RTWN_RIDX_CCK1; ridx <= max_mcs; ridx++) { Modified: head/sys/dev/rtwn/rtl8188e/r88e_priv.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_priv.h Sat Jun 17 14:36:25 2017 (r320054) +++ head/sys/dev/rtwn/rtl8188e/r88e_priv.h Sat Jun 17 14:39:25 2017 (r320055) @@ -227,47 +227,4 @@ static const struct rtwn_rf_prog rtl8188eu_rf[] = { { 0, NULL, NULL, { 0 }, NULL } }; - -struct rtwn_r88e_txagc { - uint8_t pwr[R88E_GROUP_2G][20]; /* RTWN_RIDX_MCS(7) + 1 */ -}; - -/* - * Per RF chain/group/rate Tx gain values. - */ -static const struct rtwn_r88e_txagc r88e_txagc[] = { - { { /* Chain 0. */ - { /* Group 0. */ - 0x00, 0x00, 0x00, 0x00, /* CCK1~11. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* OFDM6~54. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* MCS0~7. */ - }, - { /* Group 1. */ - 0x00, 0x00, 0x00, 0x00, /* CCK1~11. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* OFDM6~54. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* MCS0~7. */ - }, - { /* Group 2. */ - 0x00, 0x00, 0x00, 0x00, /* CCK1~11. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* OFDM6~54. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* MCS0~7. */ - }, - { /* Group 3. */ - 0x00, 0x00, 0x00, 0x00, /* CCK1~11. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* OFDM6~54. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* MCS0~7. */ - }, - { /* Group 4. */ - 0x00, 0x00, 0x00, 0x00, /* CCK1~11. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* OFDM6~54. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* MCS0~7. */ - }, - { /* Group 5. */ - 0x00, 0x00, 0x00, 0x00, /* CCK1~11. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* OFDM6~54. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* MCS0~7. */ - } - } } -}; - #endif /* R88E_PRIV_H */ Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Sat Jun 17 14:36:25 2017 (r320054) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Sat Jun 17 14:39:25 2017 (r320055) @@ -85,7 +85,7 @@ r88eu_attach_private(struct rtwn_softc *sc) rs = malloc(sizeof(struct r92c_softc), M_RTWN_PRIV, M_WAITOK | M_ZERO); rs->rs_txpwr = &r88e_txpwr; - rs->rs_txagc = &r88e_txagc; + rs->rs_txagc = NULL; rs->rs_set_bw20 = r88e_set_bw20; rs->rs_get_txpower = r88e_get_txpower; Modified: head/sys/dev/rtwn/rtl8192c/r92c_rom_image.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_rom_image.h Sat Jun 17 14:36:25 2017 (r320054) +++ head/sys/dev/rtwn/rtl8192c/r92c_rom_image.h Sat Jun 17 14:39:25 2017 (r320055) @@ -48,7 +48,7 @@ struct r92c_rom { uint8_t ofdm_tx_pwr_diff[R92C_GROUP_2G]; uint8_t ht40_max_pwr[R92C_GROUP_2G]; uint8_t ht20_max_pwr[R92C_GROUP_2G]; - uint8_t xtal_calib; + uint8_t channel_plan; uint8_t tssi[R92C_MAX_CHAINS]; uint8_t thermal_meter; #define R92C_ROM_THERMAL_METER_M 0x1f @@ -58,9 +58,7 @@ struct r92c_rom { uint8_t rf_opt2; uint8_t rf_opt3; uint8_t rf_opt4; - uint8_t channel_plan; -#define R92C_CHANNEL_PLAN_BY_HW 0x80 - + uint8_t reserved5; uint8_t version; uint8_t customer_id; } __packed; From owner-svn-src-all@freebsd.org Sat Jun 17 14:46:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E412BFC07E; Sat, 17 Jun 2017 14:46:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2F846F3C1; Sat, 17 Jun 2017 14:46:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HEkFfj002572; Sat, 17 Jun 2017 14:46:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HEkEGw002570; Sat, 17 Jun 2017 14:46:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706171446.v5HEkEGw002570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 17 Jun 2017 14:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320056 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 14:46:16 -0000 Author: emaste Date: Sat Jun 17 14:46:14 2017 New Revision: 320056 URL: https://svnweb.freebsd.org/changeset/base/320056 Log: arm: set appropriate section flags for .init_pagetable The arm kernel linker scripts place the .init_pagetable section in .bss, but .init_pagetable had no section flags set, and so did not match the expected flags for .bss. GNU ld silently ignores this case, but lld reports an error: ld: error: incompatible section flags for .bss >>> locore.o:(.init_pagetable): 0x0 >>> output section .bss: 0x3 PR: 220055 Submitted by: mmel, Rafael Espíndola MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/locore-v4.S head/sys/arm/arm/locore-v6.S Modified: head/sys/arm/arm/locore-v4.S ============================================================================== --- head/sys/arm/arm/locore-v4.S Sat Jun 17 14:39:25 2017 (r320055) +++ head/sys/arm/arm/locore-v4.S Sat Jun 17 14:46:14 2017 (r320056) @@ -365,7 +365,7 @@ svcstk: * Memory for the initial pagetable. We are unable to place this in * the bss as this will be cleared after the table is loaded. */ - .section ".init_pagetable" + .section ".init_pagetable", "aw", %nobits .align 14 /* 16KiB aligned */ pagetable: .space L1_TABLE_SIZE Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Sat Jun 17 14:39:25 2017 (r320055) +++ head/sys/arm/arm/locore-v6.S Sat Jun 17 14:46:14 2017 (r320056) @@ -436,7 +436,7 @@ svcstk: * Memory for the initial pagetable. We are unable to place this in * the bss as this will be cleared after the table is loaded. */ - .section ".init_pagetable" + .section ".init_pagetable", "aw", %nobits .align 14 /* 16KiB aligned */ .globl boot_pt1 boot_pt1: From owner-svn-src-all@freebsd.org Sat Jun 17 17:10:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA6F0BFDF4E; Sat, 17 Jun 2017 17:10:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E4D47243E; Sat, 17 Jun 2017 17:10:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HHAoGS059740; Sat, 17 Jun 2017 17:10:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HHAopr059738; Sat, 17 Jun 2017 17:10:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706171710.v5HHAopr059738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Jun 2017 17:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320057 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 17:10:51 -0000 Author: kib Date: Sat Jun 17 17:10:50 2017 New Revision: 320057 URL: https://svnweb.freebsd.org/changeset/base/320057 Log: MFC r319539: Mitigate several problems with the softdep_request_cleanup() on busy host. Approved by: re (gjb) Modified: stable/11/sys/ufs/ffs/ffs_softdep.c stable/11/sys/ufs/ffs/softdep.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_softdep.c Sat Jun 17 14:46:14 2017 (r320056) +++ stable/11/sys/ufs/ffs/ffs_softdep.c Sat Jun 17 17:10:50 2017 (r320057) @@ -901,6 +901,7 @@ static int pagedep_find(struct pagedep_hashhead *, ino struct pagedep **); static void pause_timer(void *); static int request_cleanup(struct mount *, int); +static int softdep_request_cleanup_flush(struct mount *, struct ufsmount *); static void schedule_cleanup(struct mount *); static void softdep_ast_cleanup_proc(struct thread *); static int process_worklist_item(struct mount *, int, int); @@ -13266,10 +13267,9 @@ softdep_request_cleanup(fs, vp, cred, resource) { struct ufsmount *ump; struct mount *mp; - struct vnode *lvp, *mvp; long starttime; ufs2_daddr_t needed; - int error; + int error, failed_vnode; /* * If we are being called because of a process doing a @@ -13360,41 +13360,88 @@ retry: * to the worklist that we can then process to reap addition * resources. We walk the vnodes associated with the mount point * until we get the needed worklist requests that we can reap. + * + * If there are several threads all needing to clean the same + * mount point, only one is allowed to walk the mount list. + * When several threads all try to walk the same mount list, + * they end up competing with each other and often end up in + * livelock. This approach ensures that forward progress is + * made at the cost of occational ENOSPC errors being returned + * that might otherwise have been avoided. */ + error = 1; if ((resource == FLUSH_BLOCKS_WAIT && fs->fs_cstotal.cs_nbfree <= needed) || (resource == FLUSH_INODES_WAIT && fs->fs_pendinginodes > 0 && fs->fs_cstotal.cs_nifree <= needed)) { - MNT_VNODE_FOREACH_ALL(lvp, mp, mvp) { - if (TAILQ_FIRST(&lvp->v_bufobj.bo_dirty.bv_hd) == 0) { - VI_UNLOCK(lvp); - continue; + ACQUIRE_LOCK(ump); + if ((ump->um_softdep->sd_flags & FLUSH_RC_ACTIVE) == 0) { + ump->um_softdep->sd_flags |= FLUSH_RC_ACTIVE; + FREE_LOCK(ump); + failed_vnode = softdep_request_cleanup_flush(mp, ump); + ACQUIRE_LOCK(ump); + ump->um_softdep->sd_flags &= ~FLUSH_RC_ACTIVE; + FREE_LOCK(ump); + if (ump->softdep_on_worklist > 0) { + stat_cleanup_retries += 1; + if (!failed_vnode) + goto retry; } - if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT, - curthread)) - continue; - if (lvp->v_vflag & VV_NOSYNC) { /* unlinked */ - vput(lvp); - continue; - } - (void) ffs_syncvnode(lvp, MNT_NOWAIT, 0); - vput(lvp); + } else { + FREE_LOCK(ump); + error = 0; } - lvp = ump->um_devvp; - if (vn_lock(lvp, LK_EXCLUSIVE | LK_NOWAIT) == 0) { - VOP_FSYNC(lvp, MNT_NOWAIT, curthread); - VOP_UNLOCK(lvp, 0); - } - if (ump->softdep_on_worklist > 0) { - stat_cleanup_retries += 1; - goto retry; - } stat_cleanup_failures += 1; } if (time_second - starttime > stat_cleanup_high_delay) stat_cleanup_high_delay = time_second - starttime; UFS_LOCK(ump); - return (1); + return (error); +} + +/* + * Scan the vnodes for the specified mount point flushing out any + * vnodes that can be locked without waiting. Finally, try to flush + * the device associated with the mount point if it can be locked + * without waiting. + * + * We return 0 if we were able to lock every vnode in our scan. + * If we had to skip one or more vnodes, we return 1. + */ +static int +softdep_request_cleanup_flush(mp, ump) + struct mount *mp; + struct ufsmount *ump; +{ + struct thread *td; + struct vnode *lvp, *mvp; + int failed_vnode; + + failed_vnode = 0; + td = curthread; + MNT_VNODE_FOREACH_ALL(lvp, mp, mvp) { + if (TAILQ_FIRST(&lvp->v_bufobj.bo_dirty.bv_hd) == 0) { + VI_UNLOCK(lvp); + continue; + } + if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT, + td) != 0) { + failed_vnode = 1; + continue; + } + if (lvp->v_vflag & VV_NOSYNC) { /* unlinked */ + vput(lvp); + continue; + } + (void) ffs_syncvnode(lvp, MNT_NOWAIT, 0); + vput(lvp); + } + lvp = ump->um_devvp; + if (vn_lock(lvp, LK_EXCLUSIVE | LK_NOWAIT) == 0) { + VOP_FSYNC(lvp, MNT_NOWAIT, td); + VOP_UNLOCK(lvp, 0); + } + return (failed_vnode); } static bool Modified: stable/11/sys/ufs/ffs/softdep.h ============================================================================== --- stable/11/sys/ufs/ffs/softdep.h Sat Jun 17 14:46:14 2017 (r320056) +++ stable/11/sys/ufs/ffs/softdep.h Sat Jun 17 17:10:50 2017 (r320057) @@ -1065,6 +1065,7 @@ struct mount_softdeps { #define FLUSH_EXIT 0x0001 /* time to exit */ #define FLUSH_CLEANUP 0x0002 /* need to clear out softdep structures */ #define FLUSH_STARTING 0x0004 /* flush thread not yet started */ +#define FLUSH_RC_ACTIVE 0x0008 /* a thread is flushing the mount point */ /* * Keep the old names from when these were in the ufsmount structure. From owner-svn-src-all@freebsd.org Sat Jun 17 17:32:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5E46BFE644; Sat, 17 Jun 2017 17:32:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F00B73013; Sat, 17 Jun 2017 17:32:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HHWewK071236; Sat, 17 Jun 2017 17:32:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HHWeYC071233; Sat, 17 Jun 2017 17:32:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201706171732.v5HHWeYC071233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 17 Jun 2017 17:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320058 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 17:32:41 -0000 Author: cem Date: Sat Jun 17 17:32:40 2017 New Revision: 320058 URL: https://svnweb.freebsd.org/changeset/base/320058 Log: pdwait4(2): Remove documentation of vaporware This syscall has never existed and is not at risk of existing any time soon. Remove documentation referencing it, which has been wrong since FreeBSD 9. Reported by: allanjude@ Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/pdfork.2 head/lib/libc/sys/wait.2 Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Sat Jun 17 17:10:50 2017 (r320057) +++ head/lib/libc/sys/Makefile.inc Sat Jun 17 17:32:40 2017 (r320058) @@ -421,8 +421,7 @@ MLINKS+=open.2 openat.2 MLINKS+=pathconf.2 fpathconf.2 MLINKS+=pathconf.2 lpathconf.2 MLINKS+=pdfork.2 pdgetpid.2\ - pdfork.2 pdkill.2 \ - pdfork.2 pdwait4.2 + pdfork.2 pdkill.2 MLINKS+=pipe.2 pipe2.2 MLINKS+=poll.2 ppoll.2 MLINKS+=rctl_add_rule.2 rctl_get_limits.2 \ Modified: head/lib/libc/sys/pdfork.2 ============================================================================== --- head/lib/libc/sys/pdfork.2 Sat Jun 17 17:10:50 2017 (r320057) +++ head/lib/libc/sys/pdfork.2 Sat Jun 17 17:32:40 2017 (r320058) @@ -32,14 +32,13 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2016 +.Dd June 17, 2017 .Dt PDFORK 2 .Os .Sh NAME .Nm pdfork , .Nm pdgetpid , -.Nm pdkill , -.Nm pdwait4 +.Nm pdkill .Nd System calls to manage process descriptors .Sh LIBRARY .Lb libc @@ -51,8 +50,6 @@ .Fn pdgetpid "int fd" "pid_t *pidp" .Ft int .Fn pdkill "int fd" "int signum" -.Ft int -.Fn pdwait4 "int fd" "int *status" "int options" "struct rusage *rusage" .Sh DESCRIPTION Process descriptors are special file descriptors that represent processes, and are created using @@ -96,11 +93,6 @@ except that it accepts a process descriptor, .Fa fd , rather than a PID. .Pp -.Fn pdwait4 -behaves identically to -.Xr wait4 2 , -but operates with respect to a process descriptor argument rather than a PID. -.Pp The following system calls also have effects specific to process descriptors: .Pp .Xr fstat 2 @@ -146,9 +138,6 @@ does. and .Fn pdkill return 0 on success and -1 on failure. -.Pp -.Fn pdwait4 -returns a PID on success and -1 on failure. .Sh ERRORS These functions may return the same error numbers as their PID-based equivalents (e.g. @@ -180,9 +169,8 @@ for The .Fn pdfork , .Fn pdgetpid , -.Fn pdkill and -.Fn pdwait4 +.Fn pdkill system calls first appeared in .Fx 9.0 . .Pp @@ -197,6 +185,3 @@ and .An Jonathan Anderson Aq Mt jonathan@FreeBSD.org at the University of Cambridge Computer Laboratory with support from a grant from Google, Inc. -.Sh BUGS -.Fn pdwait4 -has not yet been implemented. Modified: head/lib/libc/sys/wait.2 ============================================================================== --- head/lib/libc/sys/wait.2 Sat Jun 17 17:10:50 2017 (r320057) +++ head/lib/libc/sys/wait.2 Sat Jun 17 17:32:40 2017 (r320058) @@ -28,7 +28,7 @@ .\" @(#)wait.2 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd June 1, 2016 +.Dd June 17, 2017 .Dt WAIT 2 .Os .Sh NAME @@ -601,9 +601,7 @@ must be checked against zero to determine if a process called with -1 to wait for any child process will ignore a child that is referenced by a process descriptor (see .Xr pdfork 2 ) . -Specific processes can still be waited on by specifying the process ID -or descriptor (see -.Xr pdwait 4 ) . +Specific processes can still be waited on by specifying the process ID. .Sh ERRORS The .Fn wait From owner-svn-src-all@freebsd.org Sat Jun 17 17:42:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E393BFE8EF; Sat, 17 Jun 2017 17:42:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25155734C6; Sat, 17 Jun 2017 17:42:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HHgrjY075830; Sat, 17 Jun 2017 17:42:53 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HHgqt9075824; Sat, 17 Jun 2017 17:42:52 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201706171742.v5HHgqt9075824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 17 Jun 2017 17:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320059 - in head/sys: dev/bnxt 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 17:42:54 -0000 Author: sbruno Date: Sat Jun 17 17:42:52 2017 New Revision: 320059 URL: https://svnweb.freebsd.org/changeset/base/320059 Log: Revert r319989 "bnxt(4) Enable LRO support" This generates startup LORs and panics when adding elements to bridge devices. I will document further in https://reviews.freebsd.org/D10681 PR: 220073 Submitted by: dchagin Reported by: db Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/bnxt_hwrm.c head/sys/dev/bnxt/bnxt_txrx.c head/sys/dev/bnxt/if_bnxt.c head/sys/net/iflib.c Modified: head/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Sat Jun 17 17:32:40 2017 (r320058) +++ head/sys/dev/bnxt/bnxt.h Sat Jun 17 17:42:52 2017 (r320059) @@ -438,7 +438,6 @@ struct bnxt_ring { uint32_t ring_size; /* Must be a power of two */ uint16_t id; /* Logical ID */ uint16_t phys_id; - struct bnxt_full_tpa_start *tpa_start; }; struct bnxt_cp_ring { @@ -565,6 +564,7 @@ struct bnxt_softc { struct sysctl_ctx_list hw_stats; struct sysctl_oid *hw_stats_oid; + struct bnxt_full_tpa_start *tpa_start; struct bnxt_ver_info *ver_info; struct bnxt_nvram_info *nvm_info; bool wol; Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Sat Jun 17 17:32:40 2017 (r320058) +++ head/sys/dev/bnxt/bnxt_hwrm.c Sat Jun 17 17:42:52 2017 (r320059) @@ -935,7 +935,7 @@ bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, struc /* TODO: Calculate this based on ring size? */ req.max_agg_segs = htole16(3); /* Base this in the allocated TPA start size... */ - req.max_aggs = htole16(7); + req.max_aggs = htole16(2); /* * TODO: max_agg_timer? * req.mag_agg_timer = htole32(XXX); Modified: head/sys/dev/bnxt/bnxt_txrx.c ============================================================================== --- head/sys/dev/bnxt/bnxt_txrx.c Sat Jun 17 17:32:40 2017 (r320058) +++ head/sys/dev/bnxt/bnxt_txrx.c Sat Jun 17 17:42:52 2017 (r320059) @@ -264,7 +264,6 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru) uint8_t flid; uint64_t *paddrs; caddr_t *vaddrs; - qidx_t *frag_idxs; rxqid = iru->iru_qsidx; count = iru->iru_count; @@ -273,7 +272,6 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru) flid = iru->iru_flidx; vaddrs = iru->iru_vaddrs; paddrs = iru->iru_paddrs; - frag_idxs = iru->iru_idxs; if (flid == 0) { rx_ring = &softc->rx_rings[rxqid]; @@ -289,8 +287,8 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru) rxbd[pidx].flags_type = htole16(type); rxbd[pidx].len = htole16(len); /* No need to byte-swap the opaque value */ - rxbd[pidx].opaque = (((rxqid & 0xff) << 24) | (flid << 16) - | (frag_idxs[i])); + rxbd[pidx].opaque = ((rxqid & 0xff) << 24) | (flid << 16) + | pidx; rxbd[pidx].addr = htole64(paddrs[i]); if (++pidx == rx_ring->ring_size) pidx = 0; @@ -331,6 +329,7 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_ struct bnxt_softc *softc = (struct bnxt_softc *)sc; struct bnxt_cp_ring *cpr = &softc->rx_cp_rings[rxqid]; struct rx_pkt_cmpl *rcp; + struct rx_tpa_start_cmpl *rtpa; struct rx_tpa_end_cmpl *rtpae; struct cmpl_base *cmp = (struct cmpl_base *)cpr->ring.vaddr; int avail = 0; @@ -339,6 +338,7 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_ uint8_t ags; int i; uint16_t type; + uint8_t agg_id; for (;;) { NEXT_CP_CONS_V(&cpr->ring, cons, v_bit); @@ -388,11 +388,18 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_ avail++; break; case CMPL_BASE_TYPE_RX_TPA_START: + rtpa = (void *)&cmp[cons]; + agg_id = (rtpa->agg_id & + RX_TPA_START_CMPL_AGG_ID_MASK) >> + RX_TPA_START_CMPL_AGG_ID_SFT; + softc->tpa_start[agg_id].low = *rtpa; NEXT_CP_CONS_V(&cpr->ring, cons, v_bit); CMPL_PREFETCH_NEXT(cpr, cons); if (!CMP_VALID(&cmp[cons], v_bit)) goto cmpl_invalid; + softc->tpa_start[agg_id].high = + ((struct rx_tpa_start_cmpl_hi *)cmp)[cons]; break; case CMPL_BASE_TYPE_RX_AGG: break; @@ -542,7 +549,7 @@ bnxt_pkt_get_tpa(struct bnxt_softc *softc, if_rxd_info /* Get the agg_id */ agg_id = (agend->agg_id & RX_TPA_END_CMPL_AGG_ID_MASK) >> RX_TPA_END_CMPL_AGG_ID_SFT; - tpas = &(softc->rx_rings[ri->iri_qsidx].tpa_start[agg_id]); + tpas = &softc->tpa_start[agg_id]; /* Extract from the first 16-byte BD */ if (le16toh(tpas->low.flags_type) & RX_TPA_START_CMPL_FLAGS_RSS_VALID) { @@ -556,8 +563,8 @@ bnxt_pkt_get_tpa(struct bnxt_softc *softc, if_rxd_info RX_TPA_END_CMPL_AGG_BUFS_SFT; ri->iri_nfrags = ags + 1; /* No need to byte-swap the opaque value */ - ri->iri_frags[0].irf_flid = ((tpas->low.opaque >> 16) & 0xff); - ri->iri_frags[0].irf_idx = (tpas->low.opaque & 0xffff); + ri->iri_frags[0].irf_flid = (tpas->low.opaque >> 16) & 0xff; + ri->iri_frags[0].irf_idx = tpas->low.opaque & 0xffff; ri->iri_frags[0].irf_len = le16toh(tpas->low.len); ri->iri_len = le16toh(tpas->low.len); @@ -593,8 +600,8 @@ bnxt_pkt_get_tpa(struct bnxt_softc *softc, if_rxd_info acp = &((struct rx_abuf_cmpl *)cpr->ring.vaddr)[cpr->cons]; /* No need to byte-swap the opaque value */ - ri->iri_frags[i].irf_flid = ((acp->opaque >> 16) & 0xff); - ri->iri_frags[i].irf_idx = (acp->opaque & 0xffff); + ri->iri_frags[i].irf_flid = (acp->opaque >> 16) & 0xff; + ri->iri_frags[i].irf_idx = acp->opaque & 0xffff; ri->iri_frags[i].irf_len = le16toh(acp->len); ri->iri_len += le16toh(acp->len); } @@ -602,8 +609,8 @@ bnxt_pkt_get_tpa(struct bnxt_softc *softc, if_rxd_info /* And finally, the empty BD at the end... */ ri->iri_nfrags++; /* No need to byte-swap the opaque value */ - ri->iri_frags[i].irf_flid = ((agend->opaque >> 16) & 0xff); - ri->iri_frags[i].irf_idx = (agend->opaque & 0xffff); + ri->iri_frags[i].irf_flid = (agend->opaque >> 16) % 0xff; + ri->iri_frags[i].irf_idx = agend->opaque & 0xffff; ri->iri_frags[i].irf_len = le16toh(agend->len); ri->iri_len += le16toh(agend->len); @@ -616,12 +623,9 @@ bnxt_isc_rxd_pkt_get(void *sc, if_rxd_info_t ri) { struct bnxt_softc *softc = (struct bnxt_softc *)sc; struct bnxt_cp_ring *cpr = &softc->rx_cp_rings[ri->iri_qsidx]; - struct cmpl_base *cmp_q = (struct cmpl_base *)cpr->ring.vaddr; struct cmpl_base *cmp; - struct rx_tpa_start_cmpl *rtpa; uint16_t flags_type; uint16_t type; - uint8_t agg_id; for (;;) { NEXT_CP_CONS_V(&cpr->ring, cpr->cons, cpr->v_bit); @@ -638,18 +642,9 @@ bnxt_isc_rxd_pkt_get(void *sc, if_rxd_info_t ri) case CMPL_BASE_TYPE_RX_TPA_END: return bnxt_pkt_get_tpa(softc, ri, cpr, flags_type); case CMPL_BASE_TYPE_RX_TPA_START: - rtpa = (void *)&cmp_q[cpr->cons]; - agg_id = (rtpa->agg_id & - RX_TPA_START_CMPL_AGG_ID_MASK) >> - RX_TPA_START_CMPL_AGG_ID_SFT; - softc->rx_rings[ri->iri_qsidx].tpa_start[agg_id].low = *rtpa; - NEXT_CP_CONS_V(&cpr->ring, cpr->cons, cpr->v_bit); ri->iri_cidx = RING_NEXT(&cpr->ring, ri->iri_cidx); CMPL_PREFETCH_NEXT(cpr, cpr->cons); - - softc->rx_rings[ri->iri_qsidx].tpa_start[agg_id].high = - ((struct rx_tpa_start_cmpl_hi *)cmp_q)[cpr->cons]; break; default: device_printf(softc->dev, Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Sat Jun 17 17:32:40 2017 (r320058) +++ head/sys/dev/bnxt/if_bnxt.c Sat Jun 17 17:42:52 2017 (r320059) @@ -506,17 +506,6 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, softc->rx_rings[i].vaddr = vaddrs[i * nrxqs + 1]; softc->rx_rings[i].paddr = paddrs[i * nrxqs + 1]; - /* Allocate the TPA start buffer */ - softc->rx_rings[i].tpa_start = malloc(sizeof(struct bnxt_full_tpa_start) * - (RX_TPA_START_CMPL_AGG_ID_MASK >> RX_TPA_START_CMPL_AGG_ID_SFT), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (softc->rx_rings[i].tpa_start == NULL) { - rc = -ENOMEM; - device_printf(softc->dev, - "Unable to allocate space for TPA\n"); - goto tpa_alloc_fail; - } - /* Allocate the AG ring */ softc->ag_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; softc->ag_rings[i].softc = softc; @@ -582,10 +571,7 @@ rss_grp_alloc_fail: iflib_dma_free(&softc->vnic_info.rss_hash_key_tbl); rss_hash_alloc_fail: iflib_dma_free(&softc->vnic_info.mc_list); -tpa_alloc_fail: mc_list_alloc_fail: - for (i = i - 1; i >= 0; i--) - free(softc->rx_rings[i].tpa_start, M_DEVBUF); iflib_dma_free(&softc->rx_stats); hw_stats_alloc_fail: free(softc->grp_info, M_DEVBUF); @@ -649,6 +635,16 @@ bnxt_attach_pre(if_ctx_t ctx) if (rc) goto dma_fail; + /* Allocate the TPA start buffer */ + softc->tpa_start = malloc(sizeof(struct bnxt_full_tpa_start) * + (RX_TPA_START_CMPL_AGG_ID_MASK >> RX_TPA_START_CMPL_AGG_ID_SFT), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (softc->tpa_start == NULL) { + rc = ENOMEM; + device_printf(softc->dev, + "Unable to allocate space for TPA\n"); + goto tpa_failed; + } /* Get firmware version and compare with driver */ softc->ver_info = malloc(sizeof(struct bnxt_ver_info), @@ -818,6 +814,8 @@ nvm_alloc_fail: ver_fail: free(softc->ver_info, M_DEVBUF); ver_alloc_fail: + free(softc->tpa_start, M_DEVBUF); +tpa_failed: bnxt_free_hwrm_dma_mem(softc); dma_fail: BNXT_HWRM_LOCK_DESTROY(softc); @@ -879,8 +877,7 @@ bnxt_detach(if_ctx_t ctx) SLIST_FOREACH_SAFE(tag, &softc->vnic_info.vlan_tags, next, tmp) free(tag, M_DEVBUF); iflib_dma_free(&softc->def_cp_ring_mem); - for (i = 0; i < softc->nrxqsets; i++) - free(softc->rx_rings[i].tpa_start, M_DEVBUF); + free(softc->tpa_start, M_DEVBUF); free(softc->ver_info, M_DEVBUF); free(softc->nvm_info, M_DEVBUF); @@ -1012,17 +1009,14 @@ bnxt_init(if_ctx_t ctx) if (rc) goto fail; - /* - * Enable LRO/TPA/GRO - * TBD: - * Enable / Disable HW_LRO based on - * ifconfig lro / ifconfig -lro setting - */ +#ifdef notyet + /* Enable LRO/TPA/GRO */ rc = bnxt_hwrm_vnic_tpa_cfg(softc, &softc->vnic_info, (if_getcapenable(iflib_get_ifp(ctx)) & IFCAP_LRO) ? HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA : 0); if (rc) goto fail; +#endif for (i = 0; i < softc->ntxqsets; i++) { /* Allocate the statistics context */ Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat Jun 17 17:32:40 2017 (r320058) +++ head/sys/net/iflib.c Sat Jun 17 17:42:52 2017 (r320059) @@ -93,7 +93,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#include /* * enable accounting of every mbuf as it comes in to and goes out of * iflib's software descriptor references @@ -382,8 +381,6 @@ struct iflib_fl { #endif /* implicit pad */ - bitstr_t *ifl_rx_bitmap;; - qidx_t ifl_fragidx; /* constant */ qidx_t ifl_size; uint16_t ifl_buf_size; @@ -1800,7 +1797,7 @@ static void _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count) { struct mbuf *m; - int idx, frag_idx = fl->ifl_fragidx, pidx = fl->ifl_pidx; + int idx, pidx = fl->ifl_pidx; caddr_t cl, *sd_cl; struct mbuf **sd_m; uint8_t *sd_flags; @@ -1843,11 +1840,8 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun * * If the cluster is still set then we know a minimum sized packet was received */ - bit_ffc_at(fl->ifl_rx_bitmap, frag_idx, fl->ifl_size, &frag_idx); - if ((frag_idx < 0) || (frag_idx >= fl->ifl_size)) - bit_ffc(fl->ifl_rx_bitmap, fl->ifl_size, &frag_idx); - if ((cl = sd_cl[frag_idx]) == NULL) { - if ((cl = sd_cl[frag_idx] = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) + if ((cl = sd_cl[idx]) == NULL) { + if ((cl = sd_cl[idx] = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) break; #if MEMORY_LOGGING fl->ifl_cl_enqueued++; @@ -1873,11 +1867,10 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun cb_arg.error = 0; q = fl->ifl_rxq; MPASS(sd_map != NULL); - MPASS(sd_map[frag_idx] != NULL); - err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[frag_idx], + MPASS(sd_map[idx] != NULL); + err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[idx], cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, 0); - bus_dmamap_sync(fl->ifl_desc_tag, sd_map[frag_idx], - BUS_DMASYNC_PREREAD); + bus_dmamap_sync(fl->ifl_desc_tag, sd_map[idx], BUS_DMASYNC_PREREAD); if (err != 0 || cb_arg.error) { /* @@ -1891,13 +1884,12 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun } bus_addr = cb_arg.seg.ds_addr; } - bit_set(fl->ifl_rx_bitmap, frag_idx); - sd_flags[frag_idx] |= RX_SW_DESC_INUSE; + sd_flags[idx] |= RX_SW_DESC_INUSE; - MPASS(sd_m[frag_idx] == NULL); - sd_cl[frag_idx] = cl; - sd_m[frag_idx] = m; - fl->ifl_rxd_idxs[i] = frag_idx; + MPASS(sd_m[idx] == NULL); + sd_cl[idx] = cl; + sd_m[idx] = m; + fl->ifl_rxd_idxs[i] = idx; fl->ifl_bus_addrs[i] = bus_addr; fl->ifl_vm_addrs[i] = cl; fl->ifl_credits++; @@ -1913,8 +1905,8 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun ctx->isc_rxd_refill(ctx->ifc_softc, &iru); i = 0; pidx = idx; - fl->ifl_pidx = idx; } + fl->ifl_pidx = idx; } done: @@ -1928,7 +1920,6 @@ done: bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ctx->isc_rxd_flush(ctx->ifc_softc, fl->ifl_rxq->ifr_id, fl->ifl_id, pidx); - fl->ifl_fragidx = frag_idx; } static __inline void @@ -2008,7 +1999,6 @@ iflib_fl_setup(iflib_fl_t fl) if_ctx_t ctx = rxq->ifr_ctx; if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; - fl->ifl_rx_bitmap = bit_alloc(fl->ifl_size, M_IFLIB, M_WAITOK|M_ZERO); /* ** Free current RX buffer structs and their mbufs */ @@ -2358,7 +2348,6 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int if (map != NULL) bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - bit_clear(fl->ifl_rx_bitmap, cidx); } static struct mbuf * @@ -4254,9 +4243,8 @@ iflib_device_deregister(if_ctx_t ctx) iflib_txq_t txq; iflib_rxq_t rxq; device_t dev = ctx->ifc_dev; - int i, j; + int i; struct taskqgroup *tqg; - iflib_fl_t fl; /* Make sure VLANS are not using driver */ if (if_vlantrunkinuse(ifp)) { @@ -4291,10 +4279,6 @@ iflib_device_deregister(if_ctx_t ctx) for (i = 0, rxq = ctx->ifc_rxqs; i < NRXQSETS(ctx); i++, rxq++) { if (rxq->ifr_task.gt_uniq != NULL) taskqgroup_detach(tqg, &rxq->ifr_task); - - for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) - free(fl->ifl_rx_bitmap, M_IFLIB); - } tqg = qgroup_if_config_tqg; if (ctx->ifc_admin_task.gt_uniq != NULL) From owner-svn-src-all@freebsd.org Sat Jun 17 19:00:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6931ABFF902; Sat, 17 Jun 2017 19:00:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 423FE74EBB; Sat, 17 Jun 2017 19:00:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HJ0C8F006204; Sat, 17 Jun 2017 19:00:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HJ0CLR006202; Sat, 17 Jun 2017 19:00:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706171900.v5HJ0CLR006202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 17 Jun 2017 19:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320060 - stable/11/contrib/llvm/tools/lld/ELF X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 19:00:13 -0000 Author: emaste Date: Sat Jun 17 19:00:12 2017 New Revision: 320060 URL: https://svnweb.freebsd.org/changeset/base/320060 Log: lld: Fix weak symbols on arm and aarch64 MFC r319955: lld: sort relocations No functional change; applied to facilitate merge of later LLD commit. MFC r319956: lld: Fix weak symbols on arm and aarch64 Given .weak target .global _start _start: b target The intention is that the branch goes to the instruction after the branch, effectively turning it on a nop. The branch adds the runtime PC, but we were adding it statically too. I noticed the oddity by inspection, but llvm-objdump seems to agree, since it now prints things like: b #-4 <_start+0x4> Obtained from: LLD r298797, r305212 Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm/tools/lld/ELF/InputSection.cpp stable/11/contrib/llvm/tools/lld/ELF/Relocations.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/tools/lld/ELF/InputSection.cpp ============================================================================== --- stable/11/contrib/llvm/tools/lld/ELF/InputSection.cpp Sat Jun 17 17:42:52 2017 (r320059) +++ stable/11/contrib/llvm/tools/lld/ELF/InputSection.cpp Sat Jun 17 19:00:12 2017 (r320060) @@ -255,7 +255,7 @@ static uint32_t getARMUndefinedRelativeWeakVA(uint32_t uint32_t P) { switch (Type) { case R_ARM_THM_JUMP11: - return P + 2; + return P + 2 + A; case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_PC24: @@ -263,12 +263,12 @@ static uint32_t getARMUndefinedRelativeWeakVA(uint32_t case R_ARM_PREL31: case R_ARM_THM_JUMP19: case R_ARM_THM_JUMP24: - return P + 4; + return P + 4 + A; case R_ARM_THM_CALL: // We don't want an interworking BLX to ARM - return P + 5; + return P + 5 + A; default: - return A; + return P + A; } } @@ -279,9 +279,9 @@ static uint64_t getAArch64UndefinedRelativeWeakVA(uint case R_AARCH64_CONDBR19: case R_AARCH64_JUMP26: case R_AARCH64_TSTBR14: - return P + 4; + return P + 4 + A; default: - return A; + return P + A; } } @@ -290,82 +290,37 @@ static typename ELFT::uint getRelocTargetVA(uint32_t Type, typename ELFT::uint A, typename ELFT::uint P, const SymbolBody &Body, RelExpr Expr) { switch (Expr) { - case R_HINT: - case R_TLSDESC_CALL: - llvm_unreachable("cannot relocate hint relocs"); - case R_TLSLD: - return In::Got->getTlsIndexOff() + A - In::Got->getSize(); - case R_TLSLD_PC: - return In::Got->getTlsIndexVA() + A - P; - case R_THUNK_ABS: - return Body.getThunkVA() + A; - case R_THUNK_PC: - case R_THUNK_PLT_PC: - return Body.getThunkVA() + A - P; - case R_PPC_TOC: - return getPPC64TocBase() + A; - case R_TLSGD: - return In::Got->getGlobalDynOffset(Body) + A - - In::Got->getSize(); - case R_TLSGD_PC: - return In::Got->getGlobalDynAddr(Body) + A - P; - case R_TLSDESC: - return In::Got->getGlobalDynAddr(Body) + A; - case R_TLSDESC_PAGE: - return getAArch64Page(In::Got->getGlobalDynAddr(Body) + A) - - getAArch64Page(P); - case R_PLT: - return Body.getPltVA() + A; - case R_PLT_PC: - case R_PPC_PLT_OPD: - return Body.getPltVA() + A - P; - case R_SIZE: - return Body.getSize() + A; + case R_ABS: + case R_RELAX_GOT_PC_NOPIC: + return Body.getVA(A); + case R_GOT: + case R_RELAX_TLS_GD_TO_IE_ABS: + return Body.getGotVA() + A; + case R_GOTONLY_PC: + return In::Got->getVA() + A - P; + case R_GOTONLY_PC_FROM_END: + return In::Got->getVA() + A - P + In::Got->getSize(); case R_GOTREL: return Body.getVA(A) - In::Got->getVA(); case R_GOTREL_FROM_END: return Body.getVA(A) - In::Got->getVA() - In::Got->getSize(); - case R_RELAX_TLS_GD_TO_IE_END: case R_GOT_FROM_END: + case R_RELAX_TLS_GD_TO_IE_END: return Body.getGotOffset() + A - In::Got->getSize(); - case R_RELAX_TLS_GD_TO_IE_ABS: - case R_GOT: - return Body.getGotVA() + A; - case R_RELAX_TLS_GD_TO_IE_PAGE_PC: + case R_GOT_OFF: + return Body.getGotOffset() + A; case R_GOT_PAGE_PC: + case R_RELAX_TLS_GD_TO_IE_PAGE_PC: return getAArch64Page(Body.getGotVA() + A) - getAArch64Page(P); - case R_RELAX_TLS_GD_TO_IE: case R_GOT_PC: + case R_RELAX_TLS_GD_TO_IE: return Body.getGotVA() + A - P; - case R_GOTONLY_PC: - return In::Got->getVA() + A - P; - case R_GOTONLY_PC_FROM_END: - return In::Got->getVA() + A - P + In::Got->getSize(); - case R_RELAX_TLS_LD_TO_LE: - case R_RELAX_TLS_IE_TO_LE: - case R_RELAX_TLS_GD_TO_LE: - case R_TLS: - // A weak undefined TLS symbol resolves to the base of the TLS - // block, i.e. gets a value of zero. If we pass --gc-sections to - // lld and .tbss is not referenced, it gets reclaimed and we don't - // create a TLS program header. Therefore, we resolve this - // statically to zero. - if (Body.isTls() && (Body.isLazy() || Body.isUndefined()) && - Body.symbol()->isWeak()) - return 0; - if (Target->TcbSize) - return Body.getVA(A) + - alignTo(Target->TcbSize, Out::TlsPhdr->p_align); - return Body.getVA(A) - Out::TlsPhdr->p_memsz; - case R_RELAX_TLS_GD_TO_LE_NEG: - case R_NEG_TLS: - return Out::TlsPhdr->p_memsz - Body.getVA(A); - case R_ABS: - case R_RELAX_GOT_PC_NOPIC: - return Body.getVA(A); - case R_GOT_OFF: - return Body.getGotOffset() + A; + case R_HINT: + case R_TLSDESC_CALL: + llvm_unreachable("cannot relocate hint relocs"); + case R_MIPS_GOTREL: + return Body.getVA(A) - In::MipsGot->getGp(); case R_MIPS_GOT_LOCAL_PAGE: // If relocation against MIPS local symbol requires GOT entry, this entry // should be initialized by 'page address'. This address is high 16-bits @@ -381,8 +336,6 @@ getRelocTargetVA(uint32_t Type, typename ELFT::uint A, return In::MipsGot->getVA() + In::MipsGot->getBodyEntryOffset(Body, A) - In::MipsGot->getGp(); - case R_MIPS_GOTREL: - return Body.getVA(A) - In::MipsGot->getGp(); case R_MIPS_TLSGD: return In::MipsGot->getVA() + In::MipsGot->getTlsOffset() + In::MipsGot->getGlobalDynOffset(Body) - @@ -390,6 +343,36 @@ getRelocTargetVA(uint32_t Type, typename ELFT::uint A, case R_MIPS_TLSLD: return In::MipsGot->getVA() + In::MipsGot->getTlsOffset() + In::MipsGot->getTlsIndexOff() - In::MipsGot->getGp(); + case R_PAGE_PC: + case R_PLT_PAGE_PC: { + uint64_t Dest; + if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) + Dest = getAArch64Page(A); + else + Dest = getAArch64Page(Body.getVA(A)); + return Dest - getAArch64Page(P); + } + case R_PC: { + uint64_t Dest; + if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) { + // On ARM and AArch64 a branch to an undefined weak resolves to the + // next instruction, otherwise the place. + if (Config->EMachine == EM_ARM) + Dest = getARMUndefinedRelativeWeakVA(Type, A, P); + else if (Config->EMachine == EM_AARCH64) + Dest = getAArch64UndefinedRelativeWeakVA(Type, A, P); + else + Dest = Body.getVA(A); + } else { + Dest = Body.getVA(A); + } + return Dest - P; + } + case R_PLT: + return Body.getPltVA() + A; + case R_PLT_PC: + case R_PPC_PLT_OPD: + return Body.getPltVA() + A - P; case R_PPC_OPD: { uint64_t SymVA = Body.getVA(A); // If we have an undefined weak symbol, we might get here with a symbol @@ -408,22 +391,50 @@ getRelocTargetVA(uint32_t Type, typename ELFT::uint A, } return SymVA - P; } - case R_PC: - if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) { - // On ARM and AArch64 a branch to an undefined weak resolves to the - // next instruction, otherwise the place. - if (Config->EMachine == EM_ARM) - return getARMUndefinedRelativeWeakVA(Type, A, P); - if (Config->EMachine == EM_AARCH64) - return getAArch64UndefinedRelativeWeakVA(Type, A, P); - } + case R_PPC_TOC: + return getPPC64TocBase() + A; case R_RELAX_GOT_PC: return Body.getVA(A) - P; - case R_PLT_PAGE_PC: - case R_PAGE_PC: - if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) - return getAArch64Page(A); - return getAArch64Page(Body.getVA(A)) - getAArch64Page(P); + case R_RELAX_TLS_GD_TO_LE: + case R_RELAX_TLS_IE_TO_LE: + case R_RELAX_TLS_LD_TO_LE: + case R_TLS: + // A weak undefined TLS symbol resolves to the base of the TLS + // block, i.e. gets a value of zero. If we pass --gc-sections to + // lld and .tbss is not referenced, it gets reclaimed and we don't + // create a TLS program header. Therefore, we resolve this + // statically to zero. + if (Body.isTls() && (Body.isLazy() || Body.isUndefined()) && + Body.symbol()->isWeak()) + return 0; + if (Target->TcbSize) + return Body.getVA(A) + + alignTo(Target->TcbSize, Out::TlsPhdr->p_align); + return Body.getVA(A) - Out::TlsPhdr->p_memsz; + case R_RELAX_TLS_GD_TO_LE_NEG: + case R_NEG_TLS: + return Out::TlsPhdr->p_memsz - Body.getVA(A); + case R_SIZE: + return Body.getSize() + A; + case R_THUNK_ABS: + return Body.getThunkVA() + A; + case R_THUNK_PC: + case R_THUNK_PLT_PC: + return Body.getThunkVA() + A - P; + case R_TLSDESC: + return In::Got->getGlobalDynAddr(Body) + A; + case R_TLSDESC_PAGE: + return getAArch64Page(In::Got->getGlobalDynAddr(Body) + A) - + getAArch64Page(P); + case R_TLSGD: + return In::Got->getGlobalDynOffset(Body) + A - + In::Got->getSize(); + case R_TLSGD_PC: + return In::Got->getGlobalDynAddr(Body) + A - P; + case R_TLSLD: + return In::Got->getTlsIndexOff() + A - In::Got->getSize(); + case R_TLSLD_PC: + return In::Got->getTlsIndexVA() + A - P; } llvm_unreachable("Invalid expression"); } Modified: stable/11/contrib/llvm/tools/lld/ELF/Relocations.h ============================================================================== --- stable/11/contrib/llvm/tools/lld/ELF/Relocations.h Sat Jun 17 17:42:52 2017 (r320059) +++ stable/11/contrib/llvm/tools/lld/ELF/Relocations.h Sat Jun 17 19:00:12 2017 (r320060) @@ -34,26 +34,26 @@ enum RelExpr { R_GOT_PAGE_PC, R_GOT_PC, R_HINT, + R_MIPS_GOTREL, R_MIPS_GOT_LOCAL_PAGE, R_MIPS_GOT_OFF, R_MIPS_GOT_OFF32, - R_MIPS_GOTREL, R_MIPS_TLSGD, R_MIPS_TLSLD, R_NEG_TLS, R_PAGE_PC, R_PC, R_PLT, - R_PLT_PC, R_PLT_PAGE_PC, + R_PLT_PC, R_PPC_OPD, R_PPC_PLT_OPD, R_PPC_TOC, R_RELAX_GOT_PC, R_RELAX_GOT_PC_NOPIC, R_RELAX_TLS_GD_TO_IE, - R_RELAX_TLS_GD_TO_IE_END, R_RELAX_TLS_GD_TO_IE_ABS, + R_RELAX_TLS_GD_TO_IE_END, R_RELAX_TLS_GD_TO_IE_PAGE_PC, R_RELAX_TLS_GD_TO_LE, R_RELAX_TLS_GD_TO_LE_NEG, @@ -65,8 +65,8 @@ enum RelExpr { R_THUNK_PLT_PC, R_TLS, R_TLSDESC, - R_TLSDESC_PAGE, R_TLSDESC_CALL, + R_TLSDESC_PAGE, R_TLSGD, R_TLSGD_PC, R_TLSLD, From owner-svn-src-all@freebsd.org Sat Jun 17 20:33:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BD5EC090D2; Sat, 17 Jun 2017 20:33:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAE89774D9; Sat, 17 Jun 2017 20:33:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HKXCX6046553; Sat, 17 Jun 2017 20:33:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HKXBPF046549; Sat, 17 Jun 2017 20:33:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706172033.v5HKXBPF046549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 17 Jun 2017 20:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320061 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 20:33:13 -0000 Author: bdrewery Date: Sat Jun 17 20:33:11 2017 New Revision: 320061 URL: https://svnweb.freebsd.org/changeset/base/320061 Log: Fix Makefiles which override LIBDIR to not add incorrect dependencies into .depend. This fixes these cases which would rebuild every time: make[6]: /usr/obj/usr/src/libexec/rtld-elf/tests/libpythagoras/.depend, 1: ignoring stale .depend for /usr/obj/usr/src/tmp/usr/tests/libexec/rtld-elf/libm.a make[6]: /usr/obj/usr/src/lib/libxo/tests/encoder/.depend, 1: ignoring stale .depend for /usr/obj/usr/src/tmp/usr/tests/lib/libxo/libxo.a make[7]: /usr/obj/usr/src/lib/libthr/tests/dlopen/dso/.depend, 1: ignoring stale .depend for /usr/obj/usr/src/tmp/usr/tests/lib/libthr/dlopen/libpthread.a The problem is that some Makefiles will override LIBDIR to where they want their library to install. bsd.libnames.mk will then use ${LIBDIR} to define where *existing* libraries are. This then leads to looking for the libraries in the *target* place rather than the *expected* place. We may want to expand this (and all of the other *DIR variables in bsd.own.mk) into something like what Ports has, a PREFIX and a LOCALBASE. PREFIX being where things are being installed to and LOCALBASE being where they already are. For now store the default expected LIBDIR into LIBDIR_BASE and use that for library locations. Reported by: sbruno MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.libnames.mk head/share/mk/bsd.own.mk head/share/mk/src.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Sat Jun 17 19:00:12 2017 (r320060) +++ head/share/mk/bsd.libnames.mk Sat Jun 17 20:33:11 2017 (r320061) @@ -12,162 +12,162 @@ # Src directory locations are also defined in src.libnames.mk. -LIBCRT0?= ${DESTDIR}${LIBDIR}/crt0.o +LIBCRT0?= ${DESTDIR}${LIBDIR_BASE}/crt0.o -LIB80211?= ${DESTDIR}${LIBDIR}/lib80211.a -LIBALIAS?= ${DESTDIR}${LIBDIR}/libalias.a -LIBARCHIVE?= ${DESTDIR}${LIBDIR}/libarchive.a -LIBASN1?= ${DESTDIR}${LIBDIR}/libasn1.a -LIBATM?= ${DESTDIR}${LIBDIR}/libatm.a -LIBAUDITD?= ${DESTDIR}${LIBDIR}/libauditd.a -LIBAVL?= ${DESTDIR}${LIBDIR}/libavl.a -LIBBEGEMOT?= ${DESTDIR}${LIBDIR}/libbegemot.a -LIBBLACKLIST?= ${DESTDIR}${LIBDIR}/libblacklist.a -LIBBLUETOOTH?= ${DESTDIR}${LIBDIR}/libbluetooth.a -LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a -LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a -LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a -LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a -LIBC?= ${DESTDIR}${LIBDIR}/libc.a -LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a -LIBCAM?= ${DESTDIR}${LIBDIR}/libcam.a -LIBCAP_DNS?= ${DESTDIR}${LIBDIR}/libcap_dns.a -LIBCAP_GRP?= ${DESTDIR}${LIBDIR}/libcap_grp.a -LIBCAP_PWD?= ${DESTDIR}${LIBDIR}/libcap_pwd.a -LIBCAP_RANDOM?= ${DESTDIR}${LIBDIR}/libcap_random.a -LIBCAP_SYSCTL?= ${DESTDIR}${LIBDIR}/libcap_sysctl.a -LIBCASPER?= ${DESTDIR}${LIBDIR}/libcasper.a -LIBCOMPAT?= ${DESTDIR}${LIBDIR}/libcompat.a -LIBCOMPILER_RT?=${DESTDIR}${LIBDIR}/libcompiler_rt.a -LIBCOM_ERR?= ${DESTDIR}${LIBDIR}/libcom_err.a -LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a -LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a -LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a -LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a -LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a -LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a -LIBCXGB4?= ${DESTDIR}${LIBDIR}/libcxgb4.a -LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a -LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a -LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a -LIBDEVDCTL?= ${DESTDIR}${LIBDIR}/libdevdctl.a -LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a -LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a -LIBDIALOG?= ${DESTDIR}${LIBDIR}/libdialog.a -LIBDNS?= ${DESTDIR}${LIBDIR}/libdns.a -LIBDPV?= ${DESTDIR}${LIBDIR}/libdpv.a -LIBDTRACE?= ${DESTDIR}${LIBDIR}/libdtrace.a -LIBDWARF?= ${DESTDIR}${LIBDIR}/libdwarf.a -LIBEDIT?= ${DESTDIR}${LIBDIR}/libedit.a -LIBEFIVAR?= ${DESTDIR}${LIBDIR}/libefivar.a -LIBELF?= ${DESTDIR}${LIBDIR}/libelf.a -LIBEXECINFO?= ${DESTDIR}${LIBDIR}/libexecinfo.a -LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch.a -LIBFIGPAR?= ${DESTDIR}${LIBDIR}/libfigpar.a +LIB80211?= ${DESTDIR}${LIBDIR_BASE}/lib80211.a +LIBALIAS?= ${DESTDIR}${LIBDIR_BASE}/libalias.a +LIBARCHIVE?= ${DESTDIR}${LIBDIR_BASE}/libarchive.a +LIBASN1?= ${DESTDIR}${LIBDIR_BASE}/libasn1.a +LIBATM?= ${DESTDIR}${LIBDIR_BASE}/libatm.a +LIBAUDITD?= ${DESTDIR}${LIBDIR_BASE}/libauditd.a +LIBAVL?= ${DESTDIR}${LIBDIR_BASE}/libavl.a +LIBBEGEMOT?= ${DESTDIR}${LIBDIR_BASE}/libbegemot.a +LIBBLACKLIST?= ${DESTDIR}${LIBDIR_BASE}/libblacklist.a +LIBBLUETOOTH?= ${DESTDIR}${LIBDIR_BASE}/libbluetooth.a +LIBBSDXML?= ${DESTDIR}${LIBDIR_BASE}/libbsdxml.a +LIBBSM?= ${DESTDIR}${LIBDIR_BASE}/libbsm.a +LIBBSNMP?= ${DESTDIR}${LIBDIR_BASE}/libbsnmp.a +LIBBZ2?= ${DESTDIR}${LIBDIR_BASE}/libbz2.a +LIBC?= ${DESTDIR}${LIBDIR_BASE}/libc.a +LIBCALENDAR?= ${DESTDIR}${LIBDIR_BASE}/libcalendar.a +LIBCAM?= ${DESTDIR}${LIBDIR_BASE}/libcam.a +LIBCAP_DNS?= ${DESTDIR}${LIBDIR_BASE}/libcap_dns.a +LIBCAP_GRP?= ${DESTDIR}${LIBDIR_BASE}/libcap_grp.a +LIBCAP_PWD?= ${DESTDIR}${LIBDIR_BASE}/libcap_pwd.a +LIBCAP_RANDOM?= ${DESTDIR}${LIBDIR_BASE}/libcap_random.a +LIBCAP_SYSCTL?= ${DESTDIR}${LIBDIR_BASE}/libcap_sysctl.a +LIBCASPER?= ${DESTDIR}${LIBDIR_BASE}/libcasper.a +LIBCOMPAT?= ${DESTDIR}${LIBDIR_BASE}/libcompat.a +LIBCOMPILER_RT?=${DESTDIR}${LIBDIR_BASE}/libcompiler_rt.a +LIBCOM_ERR?= ${DESTDIR}${LIBDIR_BASE}/libcom_err.a +LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR_BASE}/libc++.a +LIBCRYPT?= ${DESTDIR}${LIBDIR_BASE}/libcrypt.a +LIBCRYPTO?= ${DESTDIR}${LIBDIR_BASE}/libcrypto.a +LIBCTF?= ${DESTDIR}${LIBDIR_BASE}/libctf.a +LIBCURSES?= ${DESTDIR}${LIBDIR_BASE}/libcurses.a +LIBCUSE?= ${DESTDIR}${LIBDIR_BASE}/libcuse.a +LIBCXGB4?= ${DESTDIR}${LIBDIR_BASE}/libcxgb4.a +LIBCXXRT?= ${DESTDIR}${LIBDIR_BASE}/libcxxrt.a +LIBC_PIC?= ${DESTDIR}${LIBDIR_BASE}/libc_pic.a +LIBDEVCTL?= ${DESTDIR}${LIBDIR_BASE}/libdevctl.a +LIBDEVDCTL?= ${DESTDIR}${LIBDIR_BASE}/libdevdctl.a +LIBDEVINFO?= ${DESTDIR}${LIBDIR_BASE}/libdevinfo.a +LIBDEVSTAT?= ${DESTDIR}${LIBDIR_BASE}/libdevstat.a +LIBDIALOG?= ${DESTDIR}${LIBDIR_BASE}/libdialog.a +LIBDNS?= ${DESTDIR}${LIBDIR_BASE}/libdns.a +LIBDPV?= ${DESTDIR}${LIBDIR_BASE}/libdpv.a +LIBDTRACE?= ${DESTDIR}${LIBDIR_BASE}/libdtrace.a +LIBDWARF?= ${DESTDIR}${LIBDIR_BASE}/libdwarf.a +LIBEDIT?= ${DESTDIR}${LIBDIR_BASE}/libedit.a +LIBEFIVAR?= ${DESTDIR}${LIBDIR_BASE}/libefivar.a +LIBELF?= ${DESTDIR}${LIBDIR_BASE}/libelf.a +LIBEXECINFO?= ${DESTDIR}${LIBDIR_BASE}/libexecinfo.a +LIBFETCH?= ${DESTDIR}${LIBDIR_BASE}/libfetch.a +LIBFIGPAR?= ${DESTDIR}${LIBDIR_BASE}/libfigpar.a LIBFL?= "don't use LIBFL, use LIBL" -LIBFORM?= ${DESTDIR}${LIBDIR}/libform.a -LIBG2C?= ${DESTDIR}${LIBDIR}/libg2c.a -LIBGEOM?= ${DESTDIR}${LIBDIR}/libgeom.a -LIBGNUREGEX?= ${DESTDIR}${LIBDIR}/libgnuregex.a -LIBGPIO?= ${DESTDIR}${LIBDIR}/libgpio.a -LIBGSSAPI?= ${DESTDIR}${LIBDIR}/libgssapi.a -LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR}/libgssapi_krb5.a -LIBHDB?= ${DESTDIR}${LIBDIR}/libhdb.a -LIBHEIMBASE?= ${DESTDIR}${LIBDIR}/libheimbase.a -LIBHEIMNTLM?= ${DESTDIR}${LIBDIR}/libheimntlm.a -LIBHEIMSQLITE?= ${DESTDIR}${LIBDIR}/libheimsqlite.a -LIBHX509?= ${DESTDIR}${LIBDIR}/libhx509.a -LIBIBCM?= ${DESTDIR}${LIBDIR}/libibcm.a -LIBIBCOMMON?= ${DESTDIR}${LIBDIR}/libibcommon.a -LIBIBMAD?= ${DESTDIR}${LIBDIR}/libibmad.a -LIBIBSDP?= ${DESTDIR}${LIBDIR}/libibsdp.a -LIBIBUMAD?= ${DESTDIR}${LIBDIR}/libibumad.a -LIBIBVERBS?= ${DESTDIR}${LIBDIR}/libibverbs.a -LIBIFCONFIG?= ${DESTDIR}${LIBDIR}/libifconfig.a -LIBIPSEC?= ${DESTDIR}${LIBDIR}/libipsec.a -LIBJAIL?= ${DESTDIR}${LIBDIR}/libjail.a -LIBKADM5CLNT?= ${DESTDIR}${LIBDIR}/libkadm5clnt.a -LIBKADM5SRV?= ${DESTDIR}${LIBDIR}/libkadm5srv.a -LIBKAFS5?= ${DESTDIR}${LIBDIR}/libkafs5.a -LIBKDC?= ${DESTDIR}${LIBDIR}/libkdc.a -LIBKEYCAP?= ${DESTDIR}${LIBDIR}/libkeycap.a -LIBKICONV?= ${DESTDIR}${LIBDIR}/libkiconv.a -LIBKRB5?= ${DESTDIR}${LIBDIR}/libkrb5.a -LIBKVM?= ${DESTDIR}${LIBDIR}/libkvm.a -LIBL?= ${DESTDIR}${LIBDIR}/libl.a +LIBFORM?= ${DESTDIR}${LIBDIR_BASE}/libform.a +LIBG2C?= ${DESTDIR}${LIBDIR_BASE}/libg2c.a +LIBGEOM?= ${DESTDIR}${LIBDIR_BASE}/libgeom.a +LIBGNUREGEX?= ${DESTDIR}${LIBDIR_BASE}/libgnuregex.a +LIBGPIO?= ${DESTDIR}${LIBDIR_BASE}/libgpio.a +LIBGSSAPI?= ${DESTDIR}${LIBDIR_BASE}/libgssapi.a +LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR_BASE}/libgssapi_krb5.a +LIBHDB?= ${DESTDIR}${LIBDIR_BASE}/libhdb.a +LIBHEIMBASE?= ${DESTDIR}${LIBDIR_BASE}/libheimbase.a +LIBHEIMNTLM?= ${DESTDIR}${LIBDIR_BASE}/libheimntlm.a +LIBHEIMSQLITE?= ${DESTDIR}${LIBDIR_BASE}/libheimsqlite.a +LIBHX509?= ${DESTDIR}${LIBDIR_BASE}/libhx509.a +LIBIBCM?= ${DESTDIR}${LIBDIR_BASE}/libibcm.a +LIBIBCOMMON?= ${DESTDIR}${LIBDIR_BASE}/libibcommon.a +LIBIBMAD?= ${DESTDIR}${LIBDIR_BASE}/libibmad.a +LIBIBSDP?= ${DESTDIR}${LIBDIR_BASE}/libibsdp.a +LIBIBUMAD?= ${DESTDIR}${LIBDIR_BASE}/libibumad.a +LIBIBVERBS?= ${DESTDIR}${LIBDIR_BASE}/libibverbs.a +LIBIFCONFIG?= ${DESTDIR}${LIBDIR_BASE}/libifconfig.a +LIBIPSEC?= ${DESTDIR}${LIBDIR_BASE}/libipsec.a +LIBJAIL?= ${DESTDIR}${LIBDIR_BASE}/libjail.a +LIBKADM5CLNT?= ${DESTDIR}${LIBDIR_BASE}/libkadm5clnt.a +LIBKADM5SRV?= ${DESTDIR}${LIBDIR_BASE}/libkadm5srv.a +LIBKAFS5?= ${DESTDIR}${LIBDIR_BASE}/libkafs5.a +LIBKDC?= ${DESTDIR}${LIBDIR_BASE}/libkdc.a +LIBKEYCAP?= ${DESTDIR}${LIBDIR_BASE}/libkeycap.a +LIBKICONV?= ${DESTDIR}${LIBDIR_BASE}/libkiconv.a +LIBKRB5?= ${DESTDIR}${LIBDIR_BASE}/libkrb5.a +LIBKVM?= ${DESTDIR}${LIBDIR_BASE}/libkvm.a +LIBL?= ${DESTDIR}${LIBDIR_BASE}/libl.a LIBLN?= "don't use LIBLN, use LIBL" -LIBLZMA?= ${DESTDIR}${LIBDIR}/liblzma.a -LIBM?= ${DESTDIR}${LIBDIR}/libm.a -LIBMAGIC?= ${DESTDIR}${LIBDIR}/libmagic.a -LIBMD?= ${DESTDIR}${LIBDIR}/libmd.a -LIBMEMSTAT?= ${DESTDIR}${LIBDIR}/libmemstat.a -LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a -LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a -LIBMLX4?= ${DESTDIR}${LIBDIR}/libmlx4.a -LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a -LIBMT?= ${DESTDIR}${LIBDIR}/libmt.a -LIBMTHCA?= ${DESTDIR}${LIBDIR}/libmthca.a -LIBNANDFS?= ${DESTDIR}${LIBDIR}/libnandfs.a -LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a -LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a -LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a -LIBNGATM?= ${DESTDIR}${LIBDIR}/libngatm.a -LIBNV?= ${DESTDIR}${LIBDIR}/libnv.a -LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a -LIBOPENSM?= ${DESTDIR}${LIBDIR}/libopensm.a -LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a -LIBOSMCOMP?= ${DESTDIR}${LIBDIR}/libosmcomp.a -LIBOSMVENDOR?= ${DESTDIR}${LIBDIR}/libosmvendor.a -LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a -LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a -LIBPANELW?= ${DESTDIR}${LIBDIR}/libpanelw.a -LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a -LIBPJDLOG?= ${DESTDIR}${LIBDIR}/libpjdlog.a -LIBPMC?= ${DESTDIR}${LIBDIR}/libpmc.a -LIBPROC?= ${DESTDIR}${LIBDIR}/libproc.a -LIBPROCSTAT?= ${DESTDIR}${LIBDIR}/libprocstat.a -LIBPTHREAD?= ${DESTDIR}${LIBDIR}/libpthread.a -LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradius.a -LIBRDMACM?= ${DESTDIR}${LIBDIR}/librdmacm.a -LIBROKEN?= ${DESTDIR}${LIBDIR}/libroken.a -LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR}/librpcsec_gss.a -LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a -LIBRT?= ${DESTDIR}${LIBDIR}/librt.a -LIBRTLD_DB?= ${DESTDIR}${LIBDIR}/librtld_db.a -LIBSBUF?= ${DESTDIR}${LIBDIR}/libsbuf.a -LIBSDP?= ${DESTDIR}${LIBDIR}/libsdp.a -LIBSMB?= ${DESTDIR}${LIBDIR}/libsmb.a -LIBSSL?= ${DESTDIR}${LIBDIR}/libssl.a -LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR}/libssp_nonshared.a -LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a -LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a -LIBSTDTHREADS?= ${DESTDIR}${LIBDIR}/libstdthreads.a -LIBSYSDECODE?= ${DESTDIR}${LIBDIR}/libsysdecode.a -LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a -LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a -LIBTERMCAPW?= ${DESTDIR}${LIBDIR}/libtermcapw.a +LIBLZMA?= ${DESTDIR}${LIBDIR_BASE}/liblzma.a +LIBM?= ${DESTDIR}${LIBDIR_BASE}/libm.a +LIBMAGIC?= ${DESTDIR}${LIBDIR_BASE}/libmagic.a +LIBMD?= ${DESTDIR}${LIBDIR_BASE}/libmd.a +LIBMEMSTAT?= ${DESTDIR}${LIBDIR_BASE}/libmemstat.a +LIBMENU?= ${DESTDIR}${LIBDIR_BASE}/libmenu.a +LIBMILTER?= ${DESTDIR}${LIBDIR_BASE}/libmilter.a +LIBMLX4?= ${DESTDIR}${LIBDIR_BASE}/libmlx4.a +LIBMP?= ${DESTDIR}${LIBDIR_BASE}/libmp.a +LIBMT?= ${DESTDIR}${LIBDIR_BASE}/libmt.a +LIBMTHCA?= ${DESTDIR}${LIBDIR_BASE}/libmthca.a +LIBNANDFS?= ${DESTDIR}${LIBDIR_BASE}/libnandfs.a +LIBNCURSES?= ${DESTDIR}${LIBDIR_BASE}/libncurses.a +LIBNCURSESW?= ${DESTDIR}${LIBDIR_BASE}/libncursesw.a +LIBNETGRAPH?= ${DESTDIR}${LIBDIR_BASE}/libnetgraph.a +LIBNGATM?= ${DESTDIR}${LIBDIR_BASE}/libngatm.a +LIBNV?= ${DESTDIR}${LIBDIR_BASE}/libnv.a +LIBNVPAIR?= ${DESTDIR}${LIBDIR_BASE}/libnvpair.a +LIBOPENSM?= ${DESTDIR}${LIBDIR_BASE}/libopensm.a +LIBOPIE?= ${DESTDIR}${LIBDIR_BASE}/libopie.a +LIBOSMCOMP?= ${DESTDIR}${LIBDIR_BASE}/libosmcomp.a +LIBOSMVENDOR?= ${DESTDIR}${LIBDIR_BASE}/libosmvendor.a +LIBPAM?= ${DESTDIR}${LIBDIR_BASE}/libpam.a +LIBPANEL?= ${DESTDIR}${LIBDIR_BASE}/libpanel.a +LIBPANELW?= ${DESTDIR}${LIBDIR_BASE}/libpanelw.a +LIBPCAP?= ${DESTDIR}${LIBDIR_BASE}/libpcap.a +LIBPJDLOG?= ${DESTDIR}${LIBDIR_BASE}/libpjdlog.a +LIBPMC?= ${DESTDIR}${LIBDIR_BASE}/libpmc.a +LIBPROC?= ${DESTDIR}${LIBDIR_BASE}/libproc.a +LIBPROCSTAT?= ${DESTDIR}${LIBDIR_BASE}/libprocstat.a +LIBPTHREAD?= ${DESTDIR}${LIBDIR_BASE}/libpthread.a +LIBRADIUS?= ${DESTDIR}${LIBDIR_BASE}/libradius.a +LIBRDMACM?= ${DESTDIR}${LIBDIR_BASE}/librdmacm.a +LIBROKEN?= ${DESTDIR}${LIBDIR_BASE}/libroken.a +LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR_BASE}/librpcsec_gss.a +LIBRPCSVC?= ${DESTDIR}${LIBDIR_BASE}/librpcsvc.a +LIBRT?= ${DESTDIR}${LIBDIR_BASE}/librt.a +LIBRTLD_DB?= ${DESTDIR}${LIBDIR_BASE}/librtld_db.a +LIBSBUF?= ${DESTDIR}${LIBDIR_BASE}/libsbuf.a +LIBSDP?= ${DESTDIR}${LIBDIR_BASE}/libsdp.a +LIBSMB?= ${DESTDIR}${LIBDIR_BASE}/libsmb.a +LIBSSL?= ${DESTDIR}${LIBDIR_BASE}/libssl.a +LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR_BASE}/libssp_nonshared.a +LIBSTAND?= ${DESTDIR}${LIBDIR_BASE}/libstand.a +LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR_BASE}/libstdc++.a +LIBSTDTHREADS?= ${DESTDIR}${LIBDIR_BASE}/libstdthreads.a +LIBSYSDECODE?= ${DESTDIR}${LIBDIR_BASE}/libsysdecode.a +LIBTACPLUS?= ${DESTDIR}${LIBDIR_BASE}/libtacplus.a +LIBTERMCAP?= ${DESTDIR}${LIBDIR_BASE}/libtermcap.a +LIBTERMCAPW?= ${DESTDIR}${LIBDIR_BASE}/libtermcapw.a LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTERMCAP" LIBTINFO?= "don't use LIBTINFO, use LIBNCURSES" -LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a -LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a -LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a -LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a -LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a -LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a -LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a -LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a -LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a -LIBVMMAPI?= ${DESTDIR}${LIBDIR}/libvmmapi.a -LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a -LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a -LIBXO?= ${DESTDIR}${LIBDIR}/libxo.a -LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a -LIBY?= ${DESTDIR}${LIBDIR}/liby.a -LIBYPCLNT?= ${DESTDIR}${LIBDIR}/libypclnt.a -LIBZ?= ${DESTDIR}${LIBDIR}/libz.a -LIBZFS?= ${DESTDIR}${LIBDIR}/libzfs.a -LIBZFS_CORE?= ${DESTDIR}${LIBDIR}/libzfs_core.a -LIBZPOOL?= ${DESTDIR}${LIBDIR}/libzpool.a +LIBUFS?= ${DESTDIR}${LIBDIR_BASE}/libufs.a +LIBUGIDFW?= ${DESTDIR}${LIBDIR_BASE}/libugidfw.a +LIBULOG?= ${DESTDIR}${LIBDIR_BASE}/libulog.a +LIBUMEM?= ${DESTDIR}${LIBDIR_BASE}/libumem.a +LIBUSB?= ${DESTDIR}${LIBDIR_BASE}/libusb.a +LIBUSBHID?= ${DESTDIR}${LIBDIR_BASE}/libusbhid.a +LIBUTIL?= ${DESTDIR}${LIBDIR_BASE}/libutil.a +LIBUUTIL?= ${DESTDIR}${LIBDIR_BASE}/libuutil.a +LIBVGL?= ${DESTDIR}${LIBDIR_BASE}/libvgl.a +LIBVMMAPI?= ${DESTDIR}${LIBDIR_BASE}/libvmmapi.a +LIBWIND?= ${DESTDIR}${LIBDIR_BASE}/libwind.a +LIBWRAP?= ${DESTDIR}${LIBDIR_BASE}/libwrap.a +LIBXO?= ${DESTDIR}${LIBDIR_BASE}/libxo.a +LIBXPG4?= ${DESTDIR}${LIBDIR_BASE}/libxpg4.a +LIBY?= ${DESTDIR}${LIBDIR_BASE}/liby.a +LIBYPCLNT?= ${DESTDIR}${LIBDIR_BASE}/libypclnt.a +LIBZ?= ${DESTDIR}${LIBDIR_BASE}/libz.a +LIBZFS?= ${DESTDIR}${LIBDIR_BASE}/libzfs.a +LIBZFS_CORE?= ${DESTDIR}${LIBDIR_BASE}/libzfs_core.a +LIBZPOOL?= ${DESTDIR}${LIBDIR_BASE}/libzpool.a # enforce the 2 -lpthread and -lc to always be the last in that exact order .if defined(LDADD) @@ -184,7 +184,7 @@ LDADD:= ${LDADD:N-lc} -lc .if defined(_LIBRARIES) && defined(LIB) && \ ${_LIBRARIES:M${LIB}} != "" .if !defined(LIB${LIB:tu}) -.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${DESTDIR}$${LIBDIR}/lib${LIB}.a +.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${DESTDIR}$${LIBDIR_BASE}/lib${LIB}.a .endif .endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat Jun 17 19:00:12 2017 (r320060) +++ head/share/mk/bsd.own.mk Sat Jun 17 20:33:11 2017 (r320061) @@ -152,7 +152,8 @@ DTBOWN?= root DTBGRP?= wheel DTBMODE?= 444 -LIBDIR?= /usr/lib +LIBDIR_BASE?= /usr/lib +LIBDIR?= ${LIBDIR_BASE} LIBCOMPATDIR?= /usr/lib/compat LIBDATADIR?= /usr/libdata LIBEXECDIR?= /usr/libexec Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sat Jun 17 19:00:12 2017 (r320060) +++ head/share/mk/src.libnames.mk Sat Jun 17 20:33:11 2017 (r320061) @@ -343,13 +343,13 @@ _DP_rdmacm= ibverbs # Define special cases LDADD_supcplusplus= -lsupc++ -LIBATF_C= ${DESTDIR}${LIBDIR}/libprivateatf-c.a -LIBATF_CXX= ${DESTDIR}${LIBDIR}/libprivateatf-c++.a +LIBATF_C= ${DESTDIR}${LIBDIR_BASE}/libprivateatf-c.a +LIBATF_CXX= ${DESTDIR}${LIBDIR_BASE}/libprivateatf-c++.a LDADD_atf_c= -lprivateatf-c LDADD_atf_cxx= -lprivateatf-c++ .for _l in ${_PRIVATELIBS} -LIB${_l:tu}?= ${DESTDIR}${LIBDIR}/libprivate${_l}.a +LIB${_l:tu}?= ${DESTDIR}${LIBDIR_BASE}/libprivate${_l}.a .endfor .for _l in ${_LIBRARIES} From owner-svn-src-all@freebsd.org Sat Jun 17 22:24:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1140C0A9B4; Sat, 17 Jun 2017 22:24:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7CBA799BD; Sat, 17 Jun 2017 22:24:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HMOJEC090863; Sat, 17 Jun 2017 22:24:19 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HMOJoV090858; Sat, 17 Jun 2017 22:24:19 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201706172224.v5HMOJoV090858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 17 Jun 2017 22:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320062 - in head/sys: fs/nfs fs/nfsclient kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 22:24:21 -0000 Author: rmacklem Date: Sat Jun 17 22:24:19 2017 New Revision: 320062 URL: https://svnweb.freebsd.org/changeset/base/320062 Log: Make MAXBCACHEBUF a tunable called vfs.maxbcachebuf. By making MAXBCACHEBUF a tunable, it can be increased to allow for larger read/write data sizes for the NFS client. The tunable is limited to MAXPHYS, which is currently 128K. Making MAXPHYS a tunable or increasing its value is being discussed, since it would be nice to support a read/write data size of 1Mbyte for the NFS client when mounting the AmazonEFS file service. Reviewed by: kib MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D10991 Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/kern/vfs_bio.c head/sys/sys/param.h Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Sat Jun 17 20:33:11 2017 (r320061) +++ head/sys/fs/nfs/nfs_commonkrpc.c Sat Jun 17 22:24:19 2017 (r320062) @@ -161,7 +161,7 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq struct ucred *cred, NFSPROC_T *p, int callback_retry_mult) { int rcvreserve, sndreserve; - int pktscale; + int pktscale, pktscalesav; struct sockaddr *saddr; struct ucred *origcred; CLIENT *client; @@ -210,6 +210,7 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq pktscale = 2; if (pktscale > 64) pktscale = 64; + pktscalesav = pktscale; /* * soreserve() can fail if sb_max is too small, so shrink pktscale * and try again if there is an error. @@ -228,8 +229,12 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq goto out; } do { - if (error != 0 && pktscale > 2) + if (error != 0 && pktscale > 2) { + if (nmp != NULL && nrp->nr_sotype == SOCK_STREAM && + pktscale == pktscalesav) + printf("Consider increasing kern.ipc.maxsockbuf\n"); pktscale--; + } if (nrp->nr_sotype == SOCK_DGRAM) { if (nmp != NULL) { sndreserve = (NFS_MAXDGRAMDATA + NFS_MAXPKTHDR) * @@ -243,15 +248,19 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq if (nrp->nr_sotype != SOCK_STREAM) panic("nfscon sotype"); if (nmp != NULL) { - sndreserve = (NFS_MAXBSIZE + NFS_MAXPKTHDR + + sndreserve = (NFS_MAXBSIZE + NFS_MAXXDR + sizeof (u_int32_t)) * pktscale; - rcvreserve = (NFS_MAXBSIZE + NFS_MAXPKTHDR + + rcvreserve = (NFS_MAXBSIZE + NFS_MAXXDR + sizeof (u_int32_t)) * pktscale; } else { sndreserve = rcvreserve = 1024 * pktscale; } } error = soreserve(so, sndreserve, rcvreserve); + if (error != 0 && nmp != NULL && nrp->nr_sotype == SOCK_STREAM && + pktscale <= 2) + printf("Must increase kern.ipc.maxsockbuf or reduce" + " rsize, wsize\n"); } while (error != 0 && pktscale > 2); soclose(so); if (error) { Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Sat Jun 17 20:33:11 2017 (r320061) +++ head/sys/fs/nfs/nfsport.h Sat Jun 17 22:24:19 2017 (r320062) @@ -1016,7 +1016,7 @@ struct nfsreq { }; #ifndef NFS_MAXBSIZE -#define NFS_MAXBSIZE MAXBCACHEBUF +#define NFS_MAXBSIZE (maxbcachebuf) #endif /* Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sat Jun 17 20:33:11 2017 (r320061) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sat Jun 17 22:24:19 2017 (r320062) @@ -4625,7 +4625,7 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsc struct nfssockreq *nrp, uint32_t sequenceid, int mds, struct ucred *cred, NFSPROC_T *p) { - uint32_t crflags, *tl; + uint32_t crflags, maxval, *tl; struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; int error, irdcnt; @@ -4643,8 +4643,8 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsc /* Fill in fore channel attributes. */ NFSM_BUILD(tl, uint32_t *, 7 * NFSX_UNSIGNED); *tl++ = 0; /* Header pad size */ - *tl++ = txdr_unsigned(100000); /* Max request size */ - *tl++ = txdr_unsigned(100000); /* Max response size */ + *tl++ = txdr_unsigned(nmp->nm_wsize + NFS_MAXXDR);/* Max request size */ + *tl++ = txdr_unsigned(nmp->nm_rsize + NFS_MAXXDR);/* Max reply size */ *tl++ = txdr_unsigned(4096); /* Max response size cached */ *tl++ = txdr_unsigned(20); /* Max operations */ *tl++ = txdr_unsigned(64); /* Max slots */ @@ -4691,7 +4691,26 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsc /* Get the fore channel slot count. */ NFSM_DISSECT(tl, uint32_t *, 7 * NFSX_UNSIGNED); - tl += 3; /* Skip the other counts. */ + tl++; /* Skip the header pad size. */ + + /* Make sure nm_wsize is small enough. */ + maxval = fxdr_unsigned(uint32_t, *tl++); + while (maxval < nmp->nm_wsize + NFS_MAXXDR) { + if (nmp->nm_wsize > 8096) + nmp->nm_wsize /= 2; + else + break; + } + + /* Make sure nm_rsize is small enough. */ + maxval = fxdr_unsigned(uint32_t, *tl++); + while (maxval < nmp->nm_rsize + NFS_MAXXDR) { + if (nmp->nm_rsize > 8096) + nmp->nm_rsize /= 2; + else + break; + } + sep->nfsess_maxcache = fxdr_unsigned(int, *tl++); tl++; sep->nfsess_foreslots = fxdr_unsigned(uint16_t, *tl++); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sat Jun 17 20:33:11 2017 (r320061) +++ head/sys/kern/vfs_bio.c Sat Jun 17 22:24:19 2017 (r320062) @@ -131,6 +131,7 @@ static void bufkva_reclaim(vmem_t *, int); static void bufkva_free(struct buf *); static int buf_import(void *, void **, int, int); static void buf_release(void *, void **, int); +static void maxbcachebuf_adjust(void); #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) @@ -245,6 +246,9 @@ SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW, SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, CTLFLAG_RD, &unmapped_buf_allowed, 0, "Permit the use of the unmapped i/o"); +int maxbcachebuf = MAXBCACHEBUF; +SYSCTL_INT(_vfs, OID_AUTO, maxbcachebuf, CTLFLAG_RDTUN, &maxbcachebuf, 0, + "Maximum size of a buffer cache block"); /* * This lock synchronizes access to bd_request. @@ -847,6 +851,29 @@ bd_wakeup(void) } /* + * Adjust the maxbcachbuf tunable. + */ +static void +maxbcachebuf_adjust(void) +{ + int i; + + /* + * maxbcachebuf must be a power of 2 >= MAXBSIZE. + */ + i = 2; + while (i * 2 <= maxbcachebuf) + i *= 2; + maxbcachebuf = i; + if (maxbcachebuf < MAXBSIZE) + maxbcachebuf = MAXBSIZE; + if (maxbcachebuf > MAXPHYS) + maxbcachebuf = MAXPHYS; + if (bootverbose != 0 && maxbcachebuf != MAXBCACHEBUF) + printf("maxbcachebuf=%d\n", maxbcachebuf); +} + +/* * bd_speedup - speedup the buffer cache flushing code */ void @@ -893,6 +920,7 @@ kern_vfs_bio_buffer_alloc(caddr_t v, long physmem_est) */ physmem_est = physmem_est * (PAGE_SIZE / 1024); + maxbcachebuf_adjust(); /* * The nominal buffer size (and minimum KVA allocation) is BKVASIZE. * For the first 64MB of ram nominally allocate sufficient buffers to @@ -1003,7 +1031,9 @@ bufinit(void) struct buf *bp; int i; - CTASSERT(MAXBCACHEBUF >= MAXBSIZE); + KASSERT(maxbcachebuf >= MAXBSIZE, + ("maxbcachebuf (%d) must be >= MAXBSIZE (%d)\n", maxbcachebuf, + MAXBSIZE)); mtx_init(&bqlocks[QUEUE_DIRTY], "bufq dirty lock", NULL, MTX_DEF); mtx_init(&bqlocks[QUEUE_EMPTY], "bufq empty lock", NULL, MTX_DEF); for (i = QUEUE_CLEAN; i < QUEUE_CLEAN + CLEAN_QUEUES; i++) @@ -1050,7 +1080,7 @@ bufinit(void) * PAGE_SIZE. */ maxbufspace = (long)nbuf * BKVASIZE; - hibufspace = lmax(3 * maxbufspace / 4, maxbufspace - MAXBCACHEBUF * 10); + hibufspace = lmax(3 * maxbufspace / 4, maxbufspace - maxbcachebuf * 10); lobufspace = (hibufspace / 20) * 19; /* 95% */ bufspacethresh = lobufspace + (hibufspace - lobufspace) / 2; @@ -1062,9 +1092,9 @@ bufinit(void) * The lower 1 MiB limit is the historical upper limit for * hirunningspace. */ - hirunningspace = lmax(lmin(roundup(hibufspace / 64, MAXBCACHEBUF), + hirunningspace = lmax(lmin(roundup(hibufspace / 64, maxbcachebuf), 16 * 1024 * 1024), 1024 * 1024); - lorunningspace = roundup((hirunningspace * 2) / 3, MAXBCACHEBUF); + lorunningspace = roundup((hirunningspace * 2) / 3, maxbcachebuf); /* * Limit the amount of malloc memory since it is wired permanently into @@ -3484,9 +3514,9 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int KASSERT((flags & (GB_UNMAPPED | GB_KVAALLOC)) != GB_KVAALLOC, ("GB_KVAALLOC only makes sense with GB_UNMAPPED")); ASSERT_VOP_LOCKED(vp, "getblk"); - if (size > MAXBCACHEBUF) - panic("getblk: size(%d) > MAXBCACHEBUF(%d)\n", size, - MAXBCACHEBUF); + if (size > maxbcachebuf) + panic("getblk: size(%d) > maxbcachebuf(%d)\n", size, + maxbcachebuf); if (!unmapped_buf_allowed) flags &= ~(GB_UNMAPPED | GB_KVAALLOC); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Jun 17 20:33:11 2017 (r320061) +++ head/sys/sys/param.h Sat Jun 17 22:24:19 2017 (r320062) @@ -244,9 +244,7 @@ * Filesystems can of course request smaller chunks. Actual * backing memory uses a chunk size of a page (PAGE_SIZE). * The default value here can be overridden on a per-architecture - * basis by defining it in . This should - * probably be done to increase its value, when MAXBCACHEBUF is - * defined as a larger value in . + * basis by defining it in . * * If you make BKVASIZE too small you risk seriously fragmenting * the buffer KVM map which may slow things down a bit. If you @@ -265,6 +263,14 @@ #define BKVASIZE 16384 /* must be power of 2 */ #endif #define BKVAMASK (BKVASIZE-1) + +/* + * This variable is tuned via vfs.maxbcachebuf and is set to the value of + * MAXBCACHEBUF by default. + */ +#ifdef _KERNEL +extern int maxbcachebuf; +#endif /* * MAXPATHLEN defines the longest permissible path length after expanding From owner-svn-src-all@freebsd.org Sat Jun 17 22:52:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8326C312BC; Sat, 17 Jun 2017 22:52:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75A577A8D2; Sat, 17 Jun 2017 22:52:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HMqNVo003411; Sat, 17 Jun 2017 22:52:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HMqN07003410; Sat, 17 Jun 2017 22:52:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706172252.v5HMqN07003410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Jun 2017 22:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320063 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 22:52:24 -0000 Author: markj Date: Sat Jun 17 22:52:23 2017 New Revision: 320063 URL: https://svnweb.freebsd.org/changeset/base/320063 Log: Remove prototypes for unimplemented LinuxKPI functions. MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Sat Jun 17 22:24:19 2017 (r320062) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Sat Jun 17 22:52:23 2017 (r320063) @@ -257,16 +257,6 @@ vm_get_page_prot(unsigned long vm_flags) return (vm_flags & VM_PROT_ALL); } -extern int vm_insert_mixed(struct vm_area_struct *, unsigned long addr, pfn_t pfn); - -extern int -vm_insert_pfn(struct vm_area_struct *, unsigned long addr, - unsigned long pfn); - -extern int -vm_insert_pfn_prot(struct vm_area_struct *, unsigned long addr, - unsigned long pfn, pgprot_t pgprot); - static inline vm_page_t vmalloc_to_page(const void *addr) { From owner-svn-src-all@freebsd.org Sat Jun 17 23:34:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAE48C31E0A; Sat, 17 Jun 2017 23:34:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B556A7BC7E; Sat, 17 Jun 2017 23:34:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5HNYrOG019634; Sat, 17 Jun 2017 23:34:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5HNYrNE019631; Sat, 17 Jun 2017 23:34:53 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201706172334.v5HNYrNE019631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 17 Jun 2017 23:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320064 - in head: share/man/man5 sys/conf sys/tools/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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2017 23:34:55 -0000 Author: manu Date: Sat Jun 17 23:34:53 2017 New Revision: 320064 URL: https://svnweb.freebsd.org/changeset/base/320064 Log: make.conf: Add the possibility to use another DTC Add a make.conf DTC variable that control which DTC (Device Tree Compiler) to use. Reviewed by: bdrewery, imp Differential Revision: https://reviews.freebsd.org/D9577 Modified: head/share/man/man5/make.conf.5 head/sys/conf/dtb.mk head/sys/tools/fdt/make_dtb.sh Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Sat Jun 17 22:52:23 2017 (r320063) +++ head/share/man/man5/make.conf.5 Sat Jun 17 23:34:53 2017 (r320064) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2016 +.Dd February 23, 2017 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -176,6 +176,11 @@ value, use .Dq Li += instead of .Dq Li = . +.It Va DTC +.Pq Vt str +Select the compiler for DTS (Device Tree Syntax) file. +.Va DTC +is initially set to the value of dtc .It Va INSTALL .Pq Vt str the default install command. Modified: head/sys/conf/dtb.mk ============================================================================== --- head/sys/conf/dtb.mk Sat Jun 17 22:52:23 2017 (r320063) +++ head/sys/conf/dtb.mk Sat Jun 17 23:34:53 2017 (r320064) @@ -4,6 +4,8 @@ # # +++ variables +++ # +# DTC The Device Tree Compiler to use +# # DTS List of the dts files to build and install. # # DTBDIR Base path for dtb modules [/boot/dtb] @@ -31,6 +33,8 @@ # do this after bsd.own.mk. .include "kern.opts.mk" +DTC?= dtc + # Search for kernel source tree in standard places. .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) @@ -50,6 +54,7 @@ DTB=${DTS:R:S/$/.dtb/} all: ${DTB} .if defined(DTS) +.export DTC .for _dts in ${DTS} ${_dts:R:S/$/.dtb/}: ${_dts} ${OP_META} @echo Generating ${.TARGET} from ${_dts} Modified: head/sys/tools/fdt/make_dtb.sh ============================================================================== --- head/sys/tools/fdt/make_dtb.sh Sat Jun 17 22:52:23 2017 (r320063) +++ head/sys/tools/fdt/make_dtb.sh Sat Jun 17 23:34:53 2017 (r320064) @@ -16,9 +16,11 @@ if [ -z "${MACHINE}" ]; then MACHINE=$(uname -m) fi +: ${DTC:=dtc} + for d in ${dts}; do dtb=${dtb_path}/`basename $d .dts`.dtb echo "converting $d -> $dtb" cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | - dtc -@ -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} + ${DTC} -@ -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} done