From owner-svn-src-head@freebsd.org Sun Jun 11 00:16:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 00:38:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 00:44:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 03:56:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 04:00:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 04:03:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 04:13:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 10:27:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 12:20:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 13:02:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 14:08:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 14:33:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 14:39:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 14:41:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 15:02:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 16:54:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 19:05:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 19:06:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 19:09:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 19:31:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 21:13:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Jun 11 21:23:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Mon Jun 12 00:21:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 01:26:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 02:12:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 02:38:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 02:42:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 05:11:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 05:45:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 06:08:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 07:36:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 07:44:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 07:48:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 09:11:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 13:49:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 14:55:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 16:31:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 16:38:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 16:43:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 16:53:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 17:22:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 18:44:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 19:13:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 19:29:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 19:31:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 19:45:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 19:51:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 19:54:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 20:14:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 20:24:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 20:30:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 20:42:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 20:42:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 20:47:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 20:53:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 20:55:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 21:03:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 21:11:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 21:15:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 21:16:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 21:33:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 22:53:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 23:41:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 23:41:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Jun 12 23:43:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Tue Jun 13 00:21:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 00:31:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 00:33:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 00:42:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 01:05:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 01:12:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 01:18:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 01:25:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 05:38:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 10:52:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 12:06:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 12:07:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 12:08:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 12:35:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 12:44:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CB60BF3684 for ; Tue, 13 Jun 2017 12:44:44 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x231.google.com (mail-yb0-x231.google.com [IPv6:2607:f8b0:4002:c09::231]) (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 3BE727A7A7 for ; Tue, 13 Jun 2017 12:44:44 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x231.google.com with SMTP id 4so35167041ybl.1 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=OPWIPFcPp7j/ls0mxZc3PyFgeb42E/N4NXYvMvHtIHk1boXSryZZCUH5GftGPXGe19 51vIxT2s0SV5/m3FM3tCLkDDTzOdeEmWFyr5X9DdE8M4wta89vbZuT8tpjOYGJFnXzQr eMw8WP4u4ge87mAV/JSh6VloLVMZ1+mJn8lLx9PwWXSfgJ0zI/pFgj13vjuppxchw465 fXBXVK2cRLvZJvZK17n1648IL8Xi1pJn3yNTIWezW3gUZRKAXTGmCYSmiOPCTtmXqjQ3 CzvTZwcXYtXK6rrgUoTDbqQu7h+r72xoSC4cAhdgXH1IdE7WSTFwGdtW3biyVLvOzbui UflQ== X-Gm-Message-State: AKS2vOxcgvs0gSaG8XO7OhxmBwb+WWOyjcEO6lsyz2e2k34WuaMFjIwQ Q6JCf1u7+UcVo2VbJKe7cH8VyaFh+GYq 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 13:26:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 13:37:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 14:07:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 14:57:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 15:37:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 15:50:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 16:19:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 16:37:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 17:49:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 18:35:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 18:46:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 18:47:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 18:48:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 18:50:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 18:51:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 18:52:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 18:53:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 18:55:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 19:02:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 19:32:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 19:38:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F02BBFCEAE for ; Tue, 13 Jun 2017 19:38:38 +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 1C53064F8D for ; Tue, 13 Jun 2017 19:38:37 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x230.google.com with SMTP id u19so187044514qta.3 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=JSILAXoWxtYkZ1OSwabBNXFozvnPA6o75eCB6fneKOc8H35b82QJFSd3hKK+H5QJIH u3piYpvlfEqD2xqhKWzBTVC28NTVaqLKlb/0OfXDYm42K7Z/FJCLnCiHRWJ+Gi6rovnS FwfTkYY0/9L15hgnpJuJVznWii5r9SRyYYRmSK50JjwcgsUZ23NRxZHm09ZJkV/CZvRR SCfuoWpcZVRWReh9ZhCN6o1TM5R0CxoLv3AuihsOvVwYo3zUizRlSSmUb8ouMBpOTqz4 5xjhH678hHBYiT9PCd0TEAJV/eFgwpIsDvlVOkZTtSUhQmU0W/UWH0hnht5tVmEw7fYr xjyg== X-Gm-Message-State: AKS2vOzR4CY79HwtqDTQHfd0gJdupi+d2h1EJJe90T17uH61BzJCNLa7 THGwzSSPA3ycXVD+ 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 21:01:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 23:16:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 23:32:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 23:49:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Jun 13 23:50:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Wed Jun 14 02:28:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 02:41:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 02:42:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 03:45:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 03:50:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 03:55:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 04:16:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 04:26:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 07:46:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 08:00:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 09:18:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 11:07:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 13:34:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 14:19:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 14:26:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 14:28:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 14:38:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 14:46:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 15:08:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 15:21:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 15:52:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 15:56:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 16:13:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 16:13:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 16:31:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 16:42:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 16:55:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 16:55:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 18:34:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 18:53:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 18:56:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 19:36:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 22:50:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Jun 14 23:14:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 651D3BF5CA3 for ; Wed, 14 Jun 2017 23:14:45 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-16.reflexion.net [208.70.210.16]) (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 0BFE37C4DA for ; Wed, 14 Jun 2017 23:14:44 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 30874 invoked from network); 14 Jun 2017 23:12:03 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 14 Jun 2017 23:12:03 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Wed, 14 Jun 2017 19:08:03 -0400 (EDT) Received: (qmail 18168 invoked from network); 14 Jun 2017 23:08:03 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 14 Jun 2017 23:08:03 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id C408CEC938A; Wed, 14 Jun 2017 16:08:02 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) 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: Date: Wed, 14 Jun 2017 16:08:02 -0700 To: andreast@FreeBSD.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2017 23:14:45 -0000 Andreas Tobler andreast at FreeBSD.org wrote on Wed Jun 14 08:00:03 UTC 2017: > 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? I'm not so sure that the specific change in question will turn out to be the cause. Below is about why I say that: similar problems back in the likes of -r317820 and before. (I'd frozen at -r317820 for weeks. That is why I've no claims about later.) TARGET=powerpc TARGET_ARCH=powerpc context. . . (Not observed anywhere else. Also only being used on a old PowerMac G5 so-called "Quad Core".) I've spent weeks trying to get evidence of crashes that include jumps to non-code (and so illegal instructions and such). This would happen if busy or if sitting idle. Usually taking hours to happen but could happen in minutes after booting. This goes back to -r317820 where I finally froze the status for a while to focus on attempted problem isolation or at least evidence. It goes back farther as well but most of my effort was on -r317820. I found that the results were very memory layout dependent. Inserting: void HACKISH_EXTRA_CODE {} into any one of a variety of source files would change the resultant behavior. (No calles to the routine but externally accessible so not eliminate by the tool chain.) Adding any code to detect a observed failure earlier also changed the type of failure seen, making the change not directly effective. In some cases the result was that I was not able to identify a problem as happening even with waiting well over 24 hours. (Longest time to observed failure: 11 hours. A couple around 8. The rest under 7). But something still might have been trashed, just with less obvious consequences. In other cases other addressing errors occurred or other out of bounds accesses occurred or locks would spin too long or . . . You probably get the idea. All my effort basically only seemed to show one thing: occasionally something stomps on register values. It almost has to be some interrupt activity that does not restore context correctly. But I never found anything that I could identify as evidence of the prior interrupt that might have happened. I was completely unable to come up with any useful identification of what specific code was doing that trashing. I recently gave up and am starting to work on taking the machines that I have access to past -r317820. That will eventually include TARGET_ARCH=powerpc . Note: I eventually modified the kernel to prevent execution of most kernel pages that are from loading the file that also have no code in the page. So this was PowerMac G5 specific but at least prevented executing most potential garbage and should catch jumping out of code areas more reliably and sooner. (Not that it got me the answer I was looking for.) === Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Thu Jun 15 00:57:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 00:59:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 02:45:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 03:09:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 04:49:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 05:00:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 05:04:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 05:12:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE4DDC09FD2 for ; Thu, 15 Jun 2017 05:12:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::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 A1B0464361 for ; Thu, 15 Jun 2017 05:12:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id l6so4314537iti.1 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=NJre5Hslp/nvamabZujocrfmT8RpRoQ6K2gVfuBQ3oOfVsFMy/EMSMRnBli3L1+KgP 8VU2DscsVTbPh2IERPsEi0fUMeZm3yfx7A+y6xWqt9Ip5dXe8I+/18YA0EDvvSyml65p BrSEzGrmf7uLVJA5/HC+Emq+oYbdac/pE+Ep8bwZCpEpfn5nrnK9NUUYuz+ISUa3jLFc kNdMP5GDpapGJwxDwJHJTOvu84Vmo4S53PQ9j0k7gmpJD7zc+xHTzWZ5mwZxrhaaFS/4 jtyo9NZUzPQGBYfUoInRBPnrZzgVgfbfPTGu7e1JeEsd9GWqubUtpOkDdQ2M0VdIAU7Z bRuQ== X-Gm-Message-State: AKS2vOxyKjkY79+J/3UWDo6Qy0Nz5bTok0Md0Lq+kibWB6ExVTDG7sOl XEZuWc675EL1tV/Y3/O9GiGLIfgQSkxL 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jun 2017 05:12:34 -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-head@freebsd.org Thu Jun 15 06:12:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 06:21:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 06:46:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 06:48:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 07:15:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 08:32:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 10:22:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 11:56:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 13:15:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 13:24:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 14:15:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 14:17:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 14:34:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 15:13:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 15:36:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 17:46:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 17:47:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 17:49:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 19:57:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 20:06:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 20:11:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 20:11:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 21:06:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 21:14:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 21:34:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Jun 15 23:08:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ECE2BF1109 for ; Thu, 15 Jun 2017 23:08:01 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-16.reflexion.net [208.70.210.16]) (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 E1A643F0E for ; Thu, 15 Jun 2017 23:08:00 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 18116 invoked from network); 15 Jun 2017 23:09:24 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 15 Jun 2017 23:09:24 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Thu, 15 Jun 2017 19:07:59 -0400 (EDT) Received: (qmail 31912 invoked from network); 15 Jun 2017 23:07:59 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 15 Jun 2017 23:07:59 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 941B8EC8B7B; Thu, 15 Jun 2017 16:07:58 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) 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: Date: Thu, 15 Jun 2017 16:07:58 -0700 To: andreast@FreeBSD.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jun 2017 23:08:01 -0000 FYI: in the current memory layout my -r317820 variant has been up for 3 days 17+ hours. (Various extra checks for panicking on some observed failures earlier but no HACKISH_EXTRA_CODE.) I think the wrong code was looked up. . . The code you reported having the failure: > 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 The trap you reported in the picture (notes added): > exception = 0x700 (program) > srr0 = 0x6064a90 (the address were execution was attempted) > srr1 = 0x89032 > lr = 0x5a500c (early inside solisten_wakeup) > curthread = 0x6c So: 0x5a4fc0 (solisten_wakeup) 0x5a500c (lr being early inside solisten_wakeup?) What about the code around 0x5a5a24 could possibly jump to 0x6064a90 ? How about around 0x5a500c that is closer to where the processor was executing? I usually have to look at what the backtrace reports and see if a call was made (bl) there and look at what was called. Powerpc backtraces can miss a layer of subroutine that is active. === Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Fri Jun 16 00:44:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 01:26:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 04:28:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 06:29:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 10:16:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 13:53:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 14:19:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 15:09:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 15:54:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 16:18:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 17:18:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 17:31:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 18:58:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 19:26:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 20:00:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 20:03:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 20:08:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 20:47:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 21:37:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 21:48:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 22:32:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 22:45:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C7C2D8AAD3 for ; Fri, 16 Jun 2017 22:45:27 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) 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 3C13172C0F for ; Fri, 16 Jun 2017 22:45:27 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x229.google.com with SMTP id w1so79876307qtg.2 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=SFPpYRAtn3zn3W9Fsfff2O6bNVJ2uZf+NeXHmRE1bK2iNT+Og0+RcZxYKXCPgVlJn5 vSNz05PLYB/B+TPIl4QCJyQ1+FAPoqTtSqpKummn9wW1YTdD3hRIwDEVDm2FttsUPsXx VHslywJ2/oDKx0lCOvY4g4Y9YkcLBgvQoPppe8dTPnC2f3lqAOfbENR9/jmzbL4sbT45 O1iLfVhCS/I+a44weey5momaCylaERkyYbBgBVTjKe5awoYpSqOjDPPnjQ0hhtDwgr9R gCLuXWwmo8NUH5OmTIafq58HfS4Ae7OCQjNGFUJRoypQNxxIO/LCmb6d4eg+ovuNOsix 2fNw== X-Gm-Message-State: AKS2vOzSQhntwjSYpHsqh9UfH4T6dykPpQzosQJMZPKka5os9q+9gN/r 8lpnBZDFdxfLDpKy2GaIug== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 23:17:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 23:25:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Jun 16 23:41:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Sat Jun 17 00:15:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 00:57:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 00:58:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 01:06:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 01:09:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 01:27:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 02:58:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 03:05:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 07:36:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 08:09:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 11:25:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 11:30:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 14:36:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 14:39:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 14:46:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 17:32:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 17:42:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 18:33:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D3D9BFF36A for ; Sat, 17 Jun 2017 18:33:02 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-16.reflexion.net [208.70.210.16]) (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 52B96746FC for ; Sat, 17 Jun 2017 18:33:01 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 2994 invoked from network); 17 Jun 2017 18:34:26 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 17 Jun 2017 18:34:26 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Sat, 17 Jun 2017 14:33:00 -0400 (EDT) Received: (qmail 8638 invoked from network); 17 Jun 2017 18:33:00 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 17 Jun 2017 18:33:00 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 9A615EC92C8; Sat, 17 Jun 2017 11:32:59 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) 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: <95670C93-9CA8-4484-B21D-83D7E73D6B47@dsl-only.net> Date: Sat, 17 Jun 2017 11:32:58 -0700 To: Shawn Webb , jasone@canonware.com, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jun 2017 18:33:02 -0000 Shawn Webb shawn.webb at hardenedbsd.org wrote on Fri Jun 16 22:45:27 UTC 2017 : > This breaks buildworld for arm64: >=20 > /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 >=20 > make[4]: stopped in /scratch/fbsd/lib/libc And Jason Evans jasone at canonware.com wrote on Sat Jun 17 00:15:53 UTC 2017 : > Indeed, this happens for me too with TARGET=3Darm64 = TARGET_ARCH=3Daarch64. But when I did my head -r319996 amd64 -> aarch64 cross build of buildworld buildkernel I got no such errors: # grep libc.so.7 = ~/sys_typescripts/typescript_make_aarch64_nodebug_clang_bootstrap-amd64-ho= st-2017-06-16:13:33:14 | more Building = /usr/obj/aarch64_clang/arm64.aarch64/usr/src/lib/libc/libc.so.7.full --- libc.so.7.full --- building shared library libc.so.7 Building = /usr/obj/aarch64_clang/arm64.aarch64/usr/src/lib/libc/libc.so.7.debug Building /usr/obj/aarch64_clang/arm64.aarch64/usr/src/lib/libc/libc.so.7 I do use: XCFLAGS+=3D -mcpu=3Dcortex-a53 XCXXFLAGS+=3D -mcpu=3Dcortex-a53 (but I've no direct clue if those make a difference). The rest of what I do is rather generic. Specifically I used: # more = ~/sys_build_scripts.amd64-host/make_aarch64_nodebug_clang_bootstrap-amd64-= host.sh=20 kldload -n filemon && \ script = ~/sys_typescripts/typescript_make_aarch64_nodebug_clang_bootstrap-amd64-ho= st-$(date +%Y-%m-%d:%H:%M:%S) \ env __MAKE_CONF=3D"/root/src.configs/make.conf" SRCCONF=3D"/dev/null" = SRC_ENV_CONF=3D"/root/src.configs/src.conf.aarch64-clang-bootstrap.amd64-h= ost" \ WITH_META_MODE=3Dyes \ MAKEOBJDIRPREFIX=3D"/usr/obj/aarch64_clang" \ make $* # more /root/src.configs/src.conf.aarch64-clang-bootstrap.amd64-host TO_TYPE=3Daarch64 TOOLS_TO_TYPE=3D${TO_TYPE} # KERNCONF=3DGENERIC-NODBG TARGET=3Darm64 .if ${.MAKE.LEVEL} =3D=3D 0 TARGET_ARCH=3D${TO_TYPE} .export TARGET_ARCH .endif # WITH_CROSS_COMPILER=3D WITHOUT_SYSTEM_COMPILER=3D # WITH_LIBCPLUSPLUS=3D WITHOUT_BINUTILS_BOOTSTRAP=3D WITH_ELFTOOLCHAIN_BOOTSTRAP=3D WITH_CLANG_BOOTSTRAP=3D WITH_CLANG=3D WITH_CLANG_IS_CC=3D WITH_CLANG_FULL=3D WITH_CLANG_EXTRAS=3D WITH_LLD_BOOTSTRAP=3D WITH_LLD=3D WITH_LLD_IS_LD=3D WITH_LLDB=3D # WITH_BOOT=3D WITHOUT_LIB32=3D # WITHOUT_GCC_BOOTSTRAP=3D WITHOUT_GCC=3D WITHOUT_GCC_IS_CC=3D WITHOUT_GNUCXX=3D # NO_WERROR=3D #WERROR=3D MALLOC_PRODUCTION=3D # WITH_REPRODUCIBLE_BUILD=3D WITH_DEBUG_FILES=3D # XCFLAGS+=3D -mcpu=3Dcortex-a53 XCXXFLAGS+=3D -mcpu=3Dcortex-a53 # There is no XCPPFLAGS but XCPP gets XCFLAGS content. # more /usr/src/sys/arm64/conf/GENERIC-NODBG # # GENERIC -- Custom configuration for the arm64/aarch64 # include "GENERIC" ident GENERIC-NODBG makeoptions DEBUG=3D-g # Build kernel with gdb(1) = debug symbols options ALT_BREAK_TO_DEBUGGER options KDB # Enable kernel debugger support # For minimum debugger support (stable branch) use: #options KDB_TRACE # Print a stack trace for a = panic options DDB # Enable the kernel debugger # Extra stuff: #options VERBOSE_SYSINIT # Enable verbose sysinit = messages #options BOOTVERBOSE=3D1 #options BOOTHOWTO=3DRB_VERBOSE #options KTR #options KTR_MASK=3DKTR_TRAP ##options KTR_CPUMASK=3D0xF #options KTR_VERBOSE # Disable any extra checking for. . . nooptions DEADLKRES # Enable the deadlock resolver nooptions INVARIANTS # Enable calls of extra sanity = checking nooptions INVARIANT_SUPPORT # Extra sanity checks of = internal structures, required by INVARIANTS nooptions WITNESS # Enable checks to detect = deadlocks and cycles nooptions WITNESS_SKIPSPIN # Don't run witness on spinlocks = for speed nooptions DIAGNOSTIC nooptions MALLOC_DEBUG_MAXZONES # Separate malloc(9) zones nooptions BUF_TRACKING nooptions FULL_BUF_TRACKING =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Sat Jun 17 20:33:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 22:24:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 22:52:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Jun 17 23:34:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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