From owner-svn-src-all@freebsd.org Sun Jan 8 02:32:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACC7CC99D3B; Sun, 8 Jan 2017 02:32:54 +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 870FD131D; Sun, 8 Jan 2017 02:32:54 +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 v082Wrpk028929; Sun, 8 Jan 2017 02:32:53 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v082WruG028927; Sun, 8 Jan 2017 02:32:53 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701080232.v082WruG028927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Jan 2017 02:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311660 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 02:32:54 -0000 Author: ian Date: Sun Jan 8 02:32:53 2017 New Revision: 311660 URL: https://svnweb.freebsd.org/changeset/base/311660 Log: Add a new sdhci interface method, get_card_present(). Many embedded SoC controllers that are (more or less) sdhci-compatible don't implement card detect, and the related values in the PRESENT_STATE register aren't useful. A bridge driver can now implement get_card_present() to read a gpio pin or whatever else is necessary for that system. The default implementation reads the CARD_PRESENT bit from the PRESENT_STATE register, so existing drivers will keep working (or keep not-fully-working, since many drivers right now can't detect card insert/remove). Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_if.m Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Jan 7 23:42:17 2017 (r311659) +++ head/sys/dev/sdhci/sdhci.c Sun Jan 8 02:32:53 2017 (r311660) @@ -164,8 +164,7 @@ sdhci_reset(struct sdhci_slot *slot, uin int timeout; if (slot->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { - if (!(RD4(slot, SDHCI_PRESENT_STATE) & - SDHCI_CARD_PRESENT)) + if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot)) return; } @@ -489,7 +488,7 @@ sdhci_card_task(void *arg, int pending) struct sdhci_slot *slot = arg; SDHCI_LOCK(slot); - if (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT) { + if (SDHCI_GET_CARD_PRESENT(slot->bus, slot)) { if (slot->dev == NULL) { /* If card is present - attach mmc bus. */ slot->dev = device_add_child(slot->bus, "mmc", -1); @@ -718,6 +717,13 @@ sdhci_generic_min_freq(device_t brdev, s return (slot->max_clk / SDHCI_200_MAX_DIVIDER); } +bool +sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot) +{ + + return (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT); +} + int sdhci_generic_update_ios(device_t brdev, device_t reqdev) { @@ -834,7 +840,7 @@ sdhci_start_command(struct sdhci_slot *s state = RD4(slot, SDHCI_PRESENT_STATE); /* Do not issue command if there is no card, clock or power. * Controller will not detect timeout without clock active. */ - if ((state & SDHCI_CARD_PRESENT) == 0 || + if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot) || slot->power == 0 || slot->clock == 0) { cmd->error = MMC_ERR_FAILED; @@ -1323,7 +1329,7 @@ sdhci_generic_intr(struct sdhci_slot *sl /* Handle card presence interrupts. */ if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) { - present = RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT; + present = SDHCI_GET_CARD_PRESENT(slot->bus, slot); slot->intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); slot->intmask |= present ? SDHCI_INT_CARD_REMOVE : Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sat Jan 7 23:42:17 2017 (r311659) +++ head/sys/dev/sdhci/sdhci.h Sun Jan 8 02:32:53 2017 (r311660) @@ -322,5 +322,6 @@ int sdhci_generic_acquire_host(device_t int sdhci_generic_release_host(device_t brdev, device_t reqdev); void sdhci_generic_intr(struct sdhci_slot *slot); uint32_t sdhci_generic_min_freq(device_t brdev, struct sdhci_slot *slot); +bool sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot); #endif /* __SDHCI_H__ */ Modified: head/sys/dev/sdhci/sdhci_if.m ============================================================================== --- head/sys/dev/sdhci/sdhci_if.m Sat Jan 7 23:42:17 2017 (r311659) +++ head/sys/dev/sdhci/sdhci_if.m Sun Jan 8 02:32:53 2017 (r311660) @@ -152,3 +152,9 @@ METHOD uint32_t min_freq { device_t brdev; struct sdhci_slot *slot; } DEFAULT sdhci_generic_min_freq; + +METHOD bool get_card_present { + device_t brdev; + struct sdhci_slot *slot; +} DEFAULT sdhci_generic_get_card_present; + From owner-svn-src-all@freebsd.org Sun Jan 8 04:23:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A88CCA5021; Sun, 8 Jan 2017 04:23:07 +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 DA1CB1F3C; Sun, 8 Jan 2017 04:23:06 +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 v084N6G4073713; Sun, 8 Jan 2017 04:23:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v084N6Sc073712; Sun, 8 Jan 2017 04:23:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701080423.v084N6Sc073712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Jan 2017 04:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311661 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 04:23:07 -0000 Author: adrian Date: Sun Jan 8 04:23:05 2017 New Revision: 311661 URL: https://svnweb.freebsd.org/changeset/base/311661 Log: [net80211] add a "is VHT available" macro. We have run out of config bits, sigh, so until I expand the ic config bits, just use this macro as a substitute. Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sun Jan 8 02:32:53 2017 (r311660) +++ head/sys/net80211/ieee80211_var.h Sun Jan 8 04:23:05 2017 (r311661) @@ -88,6 +88,14 @@ #define IEEE80211_TU_TO_TICKS(x)(((uint64_t)(x) * 1024 * hz) / (1000 * 1000)) /* + * Technically, vhtflags may be 0 /and/ 11ac is enabled. + * At some point ic should just grow a flag somewhere that + * says that VHT is supported - and then this macro can be + * changed. + */ +#define IEEE80211_CONF_VHT(ic) ((ic)->ic_vhtcaps != 0) + +/* * 802.11 control state is split into a common portion that maps * 1-1 to a physical device and one or more "Virtual AP's" (VAP) * that are bound to an ieee80211com instance and share a single From owner-svn-src-all@freebsd.org Sun Jan 8 04:25:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15647CA514B; Sun, 8 Jan 2017 04:25:43 +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 D1D711185; Sun, 8 Jan 2017 04:25:42 +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 v084Pg61073842; Sun, 8 Jan 2017 04:25:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v084Pg57073840; Sun, 8 Jan 2017 04:25:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701080425.v084Pg57073840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Jan 2017 04:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311662 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 04:25:43 -0000 Author: adrian Date: Sun Jan 8 04:25:41 2017 New Revision: 311662 URL: https://svnweb.freebsd.org/changeset/base/311662 Log: [net80211] Add initial VHT support routines. This is a skeleton set based on ieee80211_ht.c. It implements some IE parsing, some basic unfinished negotiation, and channel promotion/demotion. However, by itself it's not enough to do VHT - notably, the actual channel promotion for STA mode at least is done in ieee80211_ht.c as part of htinfo_update_chw(). I was .. quite amused when I found that out. I'm checking this in so others can see progress rather than one huge commit when VHT is "done" (which will likely be quite a while.) Added: head/sys/net80211/ieee80211_vht.c (contents, props changed) head/sys/net80211/ieee80211_vht.h (contents, props changed) Added: head/sys/net80211/ieee80211_vht.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net80211/ieee80211_vht.c Sun Jan 8 04:25:41 2017 (r311662) @@ -0,0 +1,469 @@ +/*- + * Copyright (c) 2017 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 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 +#ifdef __FreeBSD__ +__FBSDID("$FreeBSD$"); +#endif + +/* + * IEEE 802.11ac-2013 protocol support. + */ + +#include "opt_inet.h" +#include "opt_wlan.h" + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +/* define here, used throughout file */ +#define MS(_v, _f) (((_v) & _f) >> _f##_S) +#define SM(_v, _f) (((_v) << _f##_S) & _f) + +#define ADDSHORT(frm, v) do { \ + frm[0] = (v) & 0xff; \ + frm[1] = (v) >> 8; \ + frm += 2; \ +} while (0) +#define ADDWORD(frm, v) do { \ + frm[0] = (v) & 0xff; \ + frm[1] = ((v) >> 8) & 0xff; \ + frm[2] = ((v) >> 16) & 0xff; \ + frm[3] = ((v) >> 24) & 0xff; \ + frm += 4; \ +} while (0) + +/* + * XXX TODO: handle WLAN_ACTION_VHT_OPMODE_NOTIF + * + * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further details. + */ + +static void +ieee80211_vht_init(void) +{ +} + +SYSINIT(wlan_vht, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_vht_init, NULL); + +void +ieee80211_vht_attach(struct ieee80211com *ic) +{ +} + +void +ieee80211_vht_detach(struct ieee80211com *ic) +{ +} + +void +ieee80211_vht_vattach(struct ieee80211vap *vap) +{ + struct ieee80211com *ic = vap->iv_ic; + + if (! IEEE80211_CONF_VHT(ic)) + return; + + vap->iv_vhtcaps = ic->ic_vhtcaps; + vap->iv_vhtextcaps = ic->ic_vhtextcaps; + + /* XXX assume VHT80 support; should really check vhtcaps */ + vap->iv_flags_vht = + IEEE80211_FVHT_VHT + | IEEE80211_FVHT_USEVHT40 + | IEEE80211_FVHT_USEVHT80; + /* XXX TODO: enable VHT80+80, VHT160 capabilities */ + + memcpy(&vap->iv_vht_mcsinfo, &ic->ic_vht_mcsinfo, + sizeof(struct ieee80211_vht_mcs_info)); +} + +void +ieee80211_vht_vdetach(struct ieee80211vap *vap) +{ +} + +#if 0 +static void +vht_announce(struct ieee80211com *ic, enum ieee80211_phymode mode) +{ +} +#endif + +static int +vht_mcs_to_num(int m) +{ + + switch (m) { + case IEEE80211_VHT_MCS_SUPPORT_0_7: + return (7); + case IEEE80211_VHT_MCS_SUPPORT_0_8: + return (8); + case IEEE80211_VHT_MCS_SUPPORT_0_9: + return (9); + default: + return (0); + } +} + +void +ieee80211_vht_announce(struct ieee80211com *ic) +{ + int i, tx, rx; + + if (! IEEE80211_CONF_VHT(ic)) + return; + + /* Channel width */ + ic_printf(ic, "[VHT] Channel Widths: 20MHz, 40MHz, 80MHz"); + if (ic->ic_vhtcaps & IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) + printf(" 80+80MHz"); + if (ic->ic_vhtcaps & IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ) + printf(" 160MHz"); + printf("\n"); + + /* Features */ + ic_printf(ic, "[VHT] Features: %b\n", ic->ic_vhtcaps, + IEEE80211_VHTCAP_BITS); + + /* For now, just 5GHz VHT. Worry about 2GHz VHT later */ + for (i = 0; i < 7; i++) { + /* Each stream is 2 bits */ + tx = (ic->ic_vht_mcsinfo.tx_mcs_map >> (2*i)) & 0x3; + rx = (ic->ic_vht_mcsinfo.rx_mcs_map >> (2*i)) & 0x3; + if (tx == 3 && rx == 3) + continue; + ic_printf(ic, "[VHT] NSS %d: TX MCS 0..%d, RX MCS 0..%d\n", + i + 1, + vht_mcs_to_num(tx), + vht_mcs_to_num(rx)); + } +} + +void +ieee80211_vht_node_init(struct ieee80211_node *ni) +{ + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, + "%s: called", __func__); + ni->ni_flags |= IEEE80211_NODE_VHT; +} + +void +ieee80211_vht_node_cleanup(struct ieee80211_node *ni) +{ + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, + "%s: called", __func__); + ni->ni_flags &= ~IEEE80211_NODE_VHT; + ni->ni_vhtcap = 0; + bzero(&ni->ni_vht_mcsinfo, sizeof(struct ieee80211_vht_mcs_info)); +} + +/* + * Parse an 802.11ac VHT operation IE. + */ +void +ieee80211_parse_vhtopmode(struct ieee80211_node *ni, const uint8_t *ie) +{ + /* vht operation */ + ni->ni_vht_chanwidth = ie[2]; + ni->ni_vht_chan1 = ie[3]; + ni->ni_vht_chan2 = ie[4]; + ni->ni_vht_basicmcs = le16dec(ie + 5); + +#if 0 + printf("%s: chan1=%d, chan2=%d, chanwidth=%d, basicmcs=0x%04x\n", + __func__, + ni->ni_vht_chan1, + ni->ni_vht_chan2, + ni->ni_vht_chanwidth, + ni->ni_vht_basicmcs); +#endif +} + +/* + * Parse an 802.11ac VHT capability IE. + */ +void +ieee80211_parse_vhtcap(struct ieee80211_node *ni, const uint8_t *ie) +{ + + /* vht capability */ + ni->ni_vhtcap = le32dec(ie + 2); + + /* suppmcs */ + ni->ni_vht_mcsinfo.rx_mcs_map = le16dec(ie + 6); + ni->ni_vht_mcsinfo.rx_highest = le16dec(ie + 8); + ni->ni_vht_mcsinfo.tx_mcs_map = le16dec(ie + 10); + ni->ni_vht_mcsinfo.tx_highest = le16dec(ie + 12); +} + +int +ieee80211_vht_updateparams(struct ieee80211_node *ni, + const uint8_t *vhtcap_ie, + const uint8_t *vhtop_ie) +{ + + //printf("%s: called\n", __func__); + + ieee80211_parse_vhtcap(ni, vhtcap_ie); + ieee80211_parse_vhtopmode(ni, vhtop_ie); + return (0); +} + +void +ieee80211_setup_vht_rates(struct ieee80211_node *ni, + const uint8_t *vhtcap_ie, + const uint8_t *vhtop_ie) +{ + + //printf("%s: called\n", __func__); + /* XXX TODO */ +} + +void +ieee80211_vht_timeout(struct ieee80211com *ic) +{ +} + +void +ieee80211_vht_node_join(struct ieee80211_node *ni) +{ + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, + "%s: called", __func__); +} + +void +ieee80211_vht_node_leave(struct ieee80211_node *ni) +{ + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, + "%s: called", __func__); +} + +uint8_t * +ieee80211_add_vhtcap(uint8_t *frm, struct ieee80211_node *ni) +{ + uint32_t cap; + + memset(frm, '\0', sizeof(struct ieee80211_ie_vhtcap)); + + frm[0] = IEEE80211_ELEMID_VHT_CAP; + frm[1] = sizeof(struct ieee80211_ie_vhtcap) - 2; + frm += 2; + + /* + * For now, don't do any configuration. + * Just populate the node configuration. + * We can worry about making it configurable later. + */ + + cap = ni->ni_vhtcap; + + /* + * XXX TODO: any capability changes required by + * configuration. + */ + + /* 32-bit VHT capability */ + ADDWORD(frm, cap); + + /* suppmcs */ + ADDSHORT(frm, ni->ni_vht_mcsinfo.rx_mcs_map); + ADDSHORT(frm, ni->ni_vht_mcsinfo.rx_highest); + ADDSHORT(frm, ni->ni_vht_mcsinfo.tx_mcs_map); + ADDSHORT(frm, ni->ni_vht_mcsinfo.tx_highest); + + return (frm); +} + +static uint8_t +ieee80211_vht_get_chwidth_ie(struct ieee80211_channel *c) +{ + + /* + * XXX TODO: look at the node configuration as + * well? + */ + + if (IEEE80211_IS_CHAN_VHT160(c)) { + return IEEE80211_VHT_CHANWIDTH_160MHZ; + } + if (IEEE80211_IS_CHAN_VHT80_80(c)) { + return IEEE80211_VHT_CHANWIDTH_80P80MHZ; + } + if (IEEE80211_IS_CHAN_VHT80(c)) { + return IEEE80211_VHT_CHANWIDTH_80MHZ; + } + if (IEEE80211_IS_CHAN_VHT40(c)) { + return IEEE80211_VHT_CHANWIDTH_USE_HT; + } + if (IEEE80211_IS_CHAN_VHT20(c)) { + return IEEE80211_VHT_CHANWIDTH_USE_HT; + } + + /* We shouldn't get here */ + printf("%s: called on a non-VHT channel (freq=%d, flags=0x%08x\n", + __func__, + (int) c->ic_freq, + c->ic_flags); + return IEEE80211_VHT_CHANWIDTH_USE_HT; +} + +/* + * Note: this just uses the current channel information; + * it doesn't use the node info after parsing. + */ +uint8_t * +ieee80211_add_vhtinfo(uint8_t *frm, struct ieee80211_node *ni) +{ + memset(frm, '\0', sizeof(struct ieee80211_ie_vht_operation)); + + frm[0] = IEEE80211_ELEMID_VHT_OPMODE; + frm[1] = sizeof(struct ieee80211_ie_vht_operation) - 2; + frm += 2; + + /* + * XXX if it's a station, then see if we have a node + * channel or ANYC. If it's ANYC then assume we're + * scanning, and announce our capabilities. + * + * This should set the "20/40/80/160MHz wide config"; + * the 80/80 or 160MHz wide config is done in VHTCAP. + * + * Other modes - just limit it to the channel. + */ + + /* 8-bit chanwidth */ + *frm++ = ieee80211_vht_get_chwidth_ie(ni->ni_chan); + + /* 8-bit freq1 */ + *frm++ = ni->ni_chan->ic_vht_ch_freq1; + + /* 8-bit freq2 */ + *frm++ = ni->ni_chan->ic_vht_ch_freq1; + + /* 16-bit basic MCS set - just MCS0..7 for NSS=1 for now */ + ADDSHORT(frm, 0xfffc); + + return (frm); +} + +void +ieee80211_vht_update_cap(struct ieee80211_node *ni, const uint8_t *vhtcap_ie, + const uint8_t *vhtop_ie) +{ + + ieee80211_parse_vhtcap(ni, vhtcap_ie); + ieee80211_parse_vhtopmode(ni, vhtop_ie); +} + +static struct ieee80211_channel * +findvhtchan(struct ieee80211com *ic, struct ieee80211_channel *c, int vhtflags) +{ + + return (ieee80211_find_channel(ic, c->ic_freq, + (c->ic_flags & ~IEEE80211_CHAN_VHT) | vhtflags)); +} + +/* + * Handle channel promotion to VHT, similar to ieee80211_ht_adjust_channel(). + */ +struct ieee80211_channel * +ieee80211_vht_adjust_channel(struct ieee80211com *ic, + struct ieee80211_channel *chan, int flags) +{ + struct ieee80211_channel *c; + + /* First case - handle channel demotion - if VHT isn't set */ + if ((flags & IEEE80211_FVHT_VHT) == 0) { +#if 0 + printf("%s: demoting channel %d/0x%08x\n", __func__, + chan->ic_ieee, chan->ic_flags); +#endif + c = ieee80211_find_channel(ic, chan->ic_freq, + chan->ic_flags & ~IEEE80211_CHAN_VHT); + if (c == NULL) + c = chan; +#if 0 + printf("%s: .. to %d/0x%08x\n", __func__, + c->ic_ieee, c->ic_flags); +#endif + return (c); + } + + /* + * We can upgrade to VHT - attempt to do so + * + * Note: we don't clear the HT flags, these are the hints + * for HT40U/HT40D when selecting VHT40 or larger channels. + */ + /* Start with VHT80 */ + c = NULL; + if ((c == NULL) && (flags & IEEE80211_FVHT_USEVHT160)) + c = findvhtchan(ic, chan, IEEE80211_CHAN_VHT80); + + if ((c == NULL) && (flags & IEEE80211_FVHT_USEVHT80P80)) + c = findvhtchan(ic, chan, IEEE80211_CHAN_VHT80_80); + + if ((c == NULL) && (flags & IEEE80211_FVHT_USEVHT80)) + c = findvhtchan(ic, chan, IEEE80211_CHAN_VHT80); + + if ((c == NULL) && (flags & IEEE80211_FVHT_USEVHT40)) + c = findvhtchan(ic, chan, IEEE80211_CHAN_VHT40U); + if ((c == NULL) && (flags & IEEE80211_FVHT_USEVHT40)) + c = findvhtchan(ic, chan, IEEE80211_CHAN_VHT40D); + /* + * If we get here, VHT20 is always possible because we checked + * for IEEE80211_FVHT_VHT above. + */ + if (c == NULL) + c = findvhtchan(ic, chan, IEEE80211_CHAN_VHT20); + + if (c != NULL) + chan = c; + +#if 0 + printf("%s: selected %d/0x%08x\n", __func__, c->ic_ieee, c->ic_flags); +#endif + return (chan); +} Added: head/sys/net80211/ieee80211_vht.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net80211/ieee80211_vht.h Sun Jan 8 04:25:41 2017 (r311662) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2016 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _NET80211_IEEE80211_VHT_H_ +#define _NET80211_IEEE80211_VHT_H_ + +void ieee80211_vht_attach(struct ieee80211com *); +void ieee80211_vht_detach(struct ieee80211com *); +void ieee80211_vht_vattach(struct ieee80211vap *); +void ieee80211_vht_vdetach(struct ieee80211vap *); + +void ieee80211_vht_announce(struct ieee80211com *); + +void ieee80211_vht_node_init(struct ieee80211_node *); +void ieee80211_vht_node_cleanup(struct ieee80211_node *); + +void ieee80211_parse_vhtopmode(struct ieee80211_node *, const uint8_t *); +void ieee80211_parse_vhtcap(struct ieee80211_node *, const uint8_t *); + +int ieee80211_vht_updateparams(struct ieee80211_node *, + const uint8_t *, const uint8_t *); +void ieee80211_setup_vht_rates(struct ieee80211_node *, + const uint8_t *, const uint8_t *); + +void ieee80211_vht_timeout(struct ieee80211com *ic); + +void ieee80211_vht_node_join(struct ieee80211_node *ni); +void ieee80211_vht_node_leave(struct ieee80211_node *ni); + +uint8_t * ieee80211_add_vhtcap(uint8_t *frm, struct ieee80211_node *); +uint8_t * ieee80211_add_vhtinfo(uint8_t *frm, struct ieee80211_node *); + +void ieee80211_vht_update_cap(struct ieee80211_node *, + const uint8_t *, const uint8_t *); + +struct ieee80211_channel * + ieee80211_vht_adjust_channel(struct ieee80211com *, + struct ieee80211_channel *, int); + +#endif /* _NET80211_IEEE80211_VHT_H_ */ From owner-svn-src-all@freebsd.org Sun Jan 8 04:27:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53368CA51CF; Sun, 8 Jan 2017 04:27:09 +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 24FF61323; Sun, 8 Jan 2017 04:27:09 +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 v084R8W5073942; Sun, 8 Jan 2017 04:27:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v084R8dH073940; Sun, 8 Jan 2017 04:27:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701080427.v084R8dH073940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Jan 2017 04:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311663 - in head/sys: conf modules/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 04:27:09 -0000 Author: adrian Date: Sun Jan 8 04:27:08 2017 New Revision: 311663 URL: https://svnweb.freebsd.org/changeset/base/311663 Log: [net80211] include the prototype VHT code into the build. Note: it isn't called anywhere yet! Modified: head/sys/conf/files head/sys/modules/wlan/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 8 04:25:41 2017 (r311662) +++ head/sys/conf/files Sun Jan 8 04:27:08 2017 (r311663) @@ -3965,6 +3965,7 @@ net80211/ieee80211_sta.c optional wlan \ net80211/ieee80211_superg.c optional wlan ieee80211_support_superg net80211/ieee80211_scan_sw.c optional wlan net80211/ieee80211_tdma.c optional wlan ieee80211_support_tdma +net80211/ieee80211_vht.c optional wlan net80211/ieee80211_wds.c optional wlan net80211/ieee80211_xauth.c optional wlan wlan_xauth net80211/ieee80211_alq.c optional wlan ieee80211_alq Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Sun Jan 8 04:25:41 2017 (r311662) +++ head/sys/modules/wlan/Makefile Sun Jan 8 04:27:08 2017 (r311663) @@ -12,7 +12,7 @@ SRCS= ieee80211.c ieee80211_action.c iee ieee80211_ratectl_none.c ieee80211_regdomain.c \ ieee80211_ht.c ieee80211_hwmp.c ieee80211_adhoc.c ieee80211_hostap.c \ ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c \ - ieee80211_tdma.c ieee80211_superg.c + ieee80211_tdma.c ieee80211_superg.c ieee80211_vht.c SRCS+= bus_if.h device_if.h opt_ddb.h opt_inet.h opt_inet6.h \ opt_tdma.h opt_wlan.h From owner-svn-src-all@freebsd.org Sun Jan 8 06:20:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 132DBCA59AA; Sun, 8 Jan 2017 06:20:23 +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 D95221903; Sun, 8 Jan 2017 06:20:22 +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 v086KMf1018189; Sun, 8 Jan 2017 06:20:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v086KMsf018188; Sun, 8 Jan 2017 06:20:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701080620.v086KMsf018188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 8 Jan 2017 06:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311664 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 06:20:23 -0000 Author: cem Date: Sun Jan 8 06:20:21 2017 New Revision: 311664 URL: https://svnweb.freebsd.org/changeset/base/311664 Log: mmc: Accept even lower voltage for Cherryview And HP x2 210, per DragonFlyBSD 240bd9cd58f8259c12c14a8006837e698. Submitted by: Johannes Lundberg No objection: gonzo@ Obtained from: DragonFlyBSD Modified: head/sys/dev/mmc/mmcreg.h Modified: head/sys/dev/mmc/mmcreg.h ============================================================================== --- head/sys/dev/mmc/mmcreg.h Sun Jan 8 04:27:08 2017 (r311663) +++ head/sys/dev/mmc/mmcreg.h Sun Jan 8 06:20:21 2017 (r311664) @@ -355,8 +355,8 @@ struct mmc_request { */ #define MMC_OCR_VOLTAGE 0x3fffffffU /* Vdd Voltage mask */ #define MMC_OCR_LOW_VOLTAGE (1u << 7) /* Low Voltage Range -- tbd */ +#define MMC_OCR_MIN_VOLTAGE_SHIFT 7 #define MMC_OCR_200_210 (1U << 8) /* Vdd voltage 2.00 ~ 2.10 */ -#define MMC_OCR_MIN_VOLTAGE_SHIFT 8 #define MMC_OCR_210_220 (1U << 9) /* Vdd voltage 2.10 ~ 2.20 */ #define MMC_OCR_220_230 (1U << 10) /* Vdd voltage 2.20 ~ 2.30 */ #define MMC_OCR_230_240 (1U << 11) /* Vdd voltage 2.30 ~ 2.40 */ From owner-svn-src-all@freebsd.org Sun Jan 8 06:21:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81EF0CA5B1F; Sun, 8 Jan 2017 06:21:51 +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 4F9A31C6F; Sun, 8 Jan 2017 06:21:51 +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 v086LoJL019819; Sun, 8 Jan 2017 06:21:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v086LnAX019001; Sun, 8 Jan 2017 06:21:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701080621.v086LnAX019001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 8 Jan 2017 06:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311665 - head/sys/fs/cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 06:21:51 -0000 Author: cem Date: Sun Jan 8 06:21:49 2017 New Revision: 311665 URL: https://svnweb.freebsd.org/changeset/base/311665 Log: cd9660: Expand internal inum size to 64 bits Inums in cd9660 refer to byte offsets on the media. DVD and BD media can have entries above 4GB, especially with multi-session images. PR: 190655 Reported by: Thomas Schmitt Modified: head/sys/fs/cd9660/cd9660_lookup.c head/sys/fs/cd9660/cd9660_node.c head/sys/fs/cd9660/cd9660_node.h head/sys/fs/cd9660/cd9660_rrip.c head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/cd9660/iso.h head/sys/fs/cd9660/iso_rrip.h Modified: head/sys/fs/cd9660/cd9660_lookup.c ============================================================================== --- head/sys/fs/cd9660/cd9660_lookup.c Sun Jan 8 06:20:21 2017 (r311664) +++ head/sys/fs/cd9660/cd9660_lookup.c Sun Jan 8 06:21:49 2017 (r311665) @@ -51,8 +51,8 @@ __FBSDID("$FreeBSD$"); #include struct cd9660_ino_alloc_arg { - ino_t ino; - ino_t i_ino; + cd_ino_t ino; + cd_ino_t i_ino; struct iso_directory_record *ep; }; @@ -124,7 +124,7 @@ cd9660_lookup(ap) struct cd9660_ino_alloc_arg dd_arg; u_long bmask; /* block offset mask */ int error; - ino_t ino, i_ino; + cd_ino_t ino, i_ino; int ltype, reclen; u_short namelen; int isoflags; Modified: head/sys/fs/cd9660/cd9660_node.c ============================================================================== --- head/sys/fs/cd9660/cd9660_node.c Sun Jan 8 06:20:21 2017 (r311664) +++ head/sys/fs/cd9660/cd9660_node.c Sun Jan 8 06:21:49 2017 (r311665) @@ -309,12 +309,12 @@ cd9660_tstamp_conv17(pi,pu) return cd9660_tstamp_conv7(buf, pu, ISO_FTYPE_DEFAULT); } -ino_t +cd_ino_t isodirino(isodir, imp) struct iso_directory_record *isodir; struct iso_mnt *imp; { - ino_t ino; + cd_ino_t ino; ino = (isonum_733(isodir->extent) + isonum_711(isodir->ext_attr_length)) << imp->im_bshift; Modified: head/sys/fs/cd9660/cd9660_node.h ============================================================================== --- head/sys/fs/cd9660/cd9660_node.h Sun Jan 8 06:20:21 2017 (r311664) +++ head/sys/fs/cd9660/cd9660_node.h Sun Jan 8 06:21:49 2017 (r311665) @@ -58,7 +58,7 @@ typedef struct { struct iso_node { struct vnode *i_vnode; /* vnode associated with this inode */ - ino_t i_number; /* the identity of the inode */ + cd_ino_t i_number; /* the identity of the inode */ /* we use the actual starting block of the file */ struct iso_mnt *i_mnt; /* filesystem associated with this inode */ struct lockf *i_lockf; /* head of byte-level lock list */ Modified: head/sys/fs/cd9660/cd9660_rrip.c ============================================================================== --- head/sys/fs/cd9660/cd9660_rrip.c Sun Jan 8 06:20:21 2017 (r311664) +++ head/sys/fs/cd9660/cd9660_rrip.c Sun Jan 8 06:21:49 2017 (r311665) @@ -628,7 +628,7 @@ cd9660_rrip_getname(isodir,outbuf,outlen struct iso_directory_record *isodir; char *outbuf; u_short *outlen; - ino_t *inump; + cd_ino_t *inump; struct iso_mnt *imp; { ISO_RRIP_ANALYZE analyze; Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Sun Jan 8 06:20:21 2017 (r311664) +++ head/sys/fs/cd9660/cd9660_vfsops.c Sun Jan 8 06:21:49 2017 (r311665) @@ -540,7 +540,7 @@ cd9660_root(mp, flags, vpp) struct iso_mnt *imp = VFSTOISOFS(mp); struct iso_directory_record *dp = (struct iso_directory_record *)imp->root; - ino_t ino = isodirino(dp, imp); + cd_ino_t ino = isodirino(dp, imp); /* * With RRIP we must use the `.' entry of the root directory. @@ -617,6 +617,11 @@ cd9660_fhtovp(mp, fhp, flags, vpp) return (0); } +/* + * Conform to standard VFS interface; can't vget arbitrary inodes beyond 4GB + * into media with current inode scheme and 32-bit ino_t. This shouldn't be + * needed for anything other than nfsd, and who exports a mounted DVD over NFS? + */ static int cd9660_vget(mp, ino, flags, vpp) struct mount *mp; @@ -640,10 +645,22 @@ cd9660_vget(mp, ino, flags, vpp) (struct iso_directory_record *)0)); } +/* Use special comparator for full 64-bit ino comparison. */ +static int +cd9660_vfs_hash_cmp(vp, pino) + struct vnode *vp; + cd_ino_t *pino; +{ + struct iso_node *ip; + + ip = VTOI(vp); + return (ip->i_number != *pino); +} + int cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir) struct mount *mp; - ino_t ino; + cd_ino_t ino; int flags; struct vnode **vpp; int relocated; @@ -658,7 +675,8 @@ cd9660_vget_internal(mp, ino, flags, vpp struct thread *td; td = curthread; - error = vfs_hash_get(mp, ino, flags, td, vpp, NULL, NULL); + error = vfs_hash_get(mp, ino, flags, td, vpp, cd9660_vfs_hash_cmp, + &ino); if (error || *vpp != NULL) return (error); @@ -699,7 +717,8 @@ cd9660_vget_internal(mp, ino, flags, vpp *vpp = NULLVP; return (error); } - error = vfs_hash_insert(vp, ino, flags, td, vpp, NULL, NULL); + error = vfs_hash_insert(vp, ino, flags, td, vpp, cd9660_vfs_hash_cmp, + &ino); if (error || *vpp != NULL) return (error); Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Sun Jan 8 06:20:21 2017 (r311664) +++ head/sys/fs/cd9660/cd9660_vnops.c Sun Jan 8 06:21:49 2017 (r311665) @@ -481,6 +481,7 @@ cd9660_readdir(ap) u_short namelen; int ncookies = 0; u_long *cookies = NULL; + cd_ino_t ino; dp = VTOI(vdp); imp = dp->i_mnt; @@ -576,8 +577,10 @@ cd9660_readdir(ap) switch (imp->iso_ftype) { case ISO_FTYPE_RRIP: - cd9660_rrip_getname(ep,idp->current.d_name, &namelen, - &idp->current.d_fileno,imp); + ino = idp->current.d_fileno; + cd9660_rrip_getname(ep, idp->current.d_name, &namelen, + &ino, imp); + idp->current.d_fileno = ino; idp->current.d_namlen = (u_char)namelen; if (idp->current.d_namlen) error = iso_uiodir(idp,&idp->current,idp->curroff); @@ -831,8 +834,8 @@ cd9660_vptofh(ap) memcpy(ap->a_fhp, &ifh, sizeof(ifh)); #ifdef ISOFS_DBG - printf("vptofh: ino %d, start %ld\n", - ifh.ifid_ino, ifh.ifid_start); + printf("vptofh: ino %jd, start %ld\n", + (uintmax_t)ifh.ifid_ino, ifh.ifid_start); #endif return (0); Modified: head/sys/fs/cd9660/iso.h ============================================================================== --- head/sys/fs/cd9660/iso.h Sun Jan 8 06:20:21 2017 (r311664) +++ head/sys/fs/cd9660/iso.h Sun Jan 8 06:21:49 2017 (r311665) @@ -219,6 +219,11 @@ enum ISO_FTYPE { ISO_FTYPE_DEFAULT, ISO_ #define ISOFSMNT_ROOT 0 #endif +/* + * When ino_t becomes 64-bit, we can remove this definition in favor of ino_t. + */ +#define cd_ino_t uint64_t + struct iso_mnt { uint64_t im_flags; @@ -250,10 +255,10 @@ struct iso_mnt { }; struct ifid { - u_short ifid_len; - u_short ifid_pad; - int ifid_ino; - long ifid_start; + u_short ifid_len; + u_short ifid_pad; + cd_ino_t ifid_ino; + long ifid_start; }; #define VFSTOISOFS(mp) ((struct iso_mnt *)((mp)->mnt_data)) @@ -263,7 +268,7 @@ struct ifid { #define lblkno(imp, loc) ((loc) >> (imp)->im_bshift) #define blksize(imp, ip, lbn) ((imp)->logical_block_size) -int cd9660_vget_internal(struct mount *, ino_t, int, struct vnode **, int, +int cd9660_vget_internal(struct mount *, cd_ino_t, int, struct vnode **, int, struct iso_directory_record *); #define cd9660_sysctl ((int (*)(int *, u_int, void *, size_t *, void *, \ size_t, struct proc *))eopnotsupp) @@ -274,7 +279,7 @@ extern struct vop_vector cd9660_fifoops; int isochar(u_char *, u_char *, int, u_short *, int *, int, void *); int isofncmp(u_char *, int, u_char *, int, int, int, void *, void *); void isofntrans(u_char *, int, u_char *, u_short *, int, int, int, int, void *); -ino_t isodirino(struct iso_directory_record *, struct iso_mnt *); +cd_ino_t isodirino(struct iso_directory_record *, struct iso_mnt *); u_short sgetrune(const char *, size_t, char const **, int, void *); #endif /* _KERNEL */ Modified: head/sys/fs/cd9660/iso_rrip.h ============================================================================== --- head/sys/fs/cd9660/iso_rrip.h Sun Jan 8 06:20:21 2017 (r311664) +++ head/sys/fs/cd9660/iso_rrip.h Sun Jan 8 06:21:49 2017 (r311665) @@ -61,7 +61,7 @@ typedef struct { off_t iso_ce_off; /* offset of continuation area */ int iso_ce_len; /* length of continuation area */ struct iso_mnt *imp; /* mount structure */ - ino_t *inump; /* inode number pointer */ + cd_ino_t *inump; /* inode number pointer */ char *outbuf; /* name/symbolic link output area */ u_short *outlen; /* length of above */ u_short maxlen; /* maximum length of above */ @@ -74,7 +74,7 @@ int cd9660_rrip_analyze(struct iso_direc struct iso_node *inop, struct iso_mnt *imp); int cd9660_rrip_getname(struct iso_directory_record *isodir, char *outbuf, u_short *outlen, - ino_t *inump, struct iso_mnt *imp); + cd_ino_t *inump, struct iso_mnt *imp); int cd9660_rrip_getsymname(struct iso_directory_record *isodir, char *outbuf, u_short *outlen, struct iso_mnt *imp); From owner-svn-src-all@freebsd.org Sun Jan 8 06:22:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1700CA5B92; Sun, 8 Jan 2017 06:22:36 +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 7FE901E87; Sun, 8 Jan 2017 06:22:36 +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 v086MZcw022056; Sun, 8 Jan 2017 06:22:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v086MZ7o022055; Sun, 8 Jan 2017 06:22:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701080622.v086MZ7o022055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 8 Jan 2017 06:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311666 - head/sys/fs/cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 06:22:36 -0000 Author: cem Date: Sun Jan 8 06:22:35 2017 New Revision: 311666 URL: https://svnweb.freebsd.org/changeset/base/311666 Log: Do not truncate inode calculation from ISO9660 block offset PR: 190655 Reported by: Thomas Schmitt Obtained from: NetBSD sys/fs/cd9660/cd9660_node.c,r1.31 Modified: head/sys/fs/cd9660/cd9660_node.c Modified: head/sys/fs/cd9660/cd9660_node.c ============================================================================== --- head/sys/fs/cd9660/cd9660_node.c Sun Jan 8 06:21:49 2017 (r311665) +++ head/sys/fs/cd9660/cd9660_node.c Sun Jan 8 06:22:35 2017 (r311666) @@ -316,7 +316,14 @@ isodirino(isodir, imp) { cd_ino_t ino; - ino = (isonum_733(isodir->extent) + isonum_711(isodir->ext_attr_length)) - << imp->im_bshift; - return (ino); + /* + * Note there is an inverse calculation in + * cd9660_vfsops.c:cd9660_vget_internal(): + * ip->iso_start = ino >> imp->im_bshift; + * and also a calculation of the isodir pointer + * from an inode in cd9660_vnops.c:cd9660_readlink() + */ + ino = ((cd_ino_t)isonum_733(isodir->extent) + + isonum_711(isodir->ext_attr_length)) << imp->im_bshift; + return ino; } From owner-svn-src-all@freebsd.org Sun Jan 8 06:26:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B11E8CA5D5C; Sun, 8 Jan 2017 06:26:34 +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 8B555120F; Sun, 8 Jan 2017 06:26:34 +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 v086QXFv022255; Sun, 8 Jan 2017 06:26:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v086QXDx022252; Sun, 8 Jan 2017 06:26:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701080626.v086QXDx022252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 8 Jan 2017 06:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 06:26:34 -0000 Author: cem Date: Sun Jan 8 06:26:33 2017 New Revision: 311667 URL: https://svnweb.freebsd.org/changeset/base/311667 Log: Add some additional ACPI methods for DRM Add AcpiGetDataFull and AcpiGetTableWithSize. Submitted by: Matt Macy Modified: head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/include/acpixf.h Modified: head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c Sun Jan 8 06:22:35 2017 (r311666) +++ head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c Sun Jan 8 06:26:33 2017 (r311667) @@ -1022,23 +1022,25 @@ ACPI_EXPORT_SYMBOL (AcpiDetachData) /******************************************************************************* * - * FUNCTION: AcpiGetData + * FUNCTION: AcpiGetDataFull * * PARAMETERS: ObjHandle - Namespace node - * Handler - Handler used in call to AttachData + * Handle - Handler used in call to attach_data * Data - Where the data is returned + * Callback - function to execute before returning * * RETURN: Status * - * DESCRIPTION: Retrieve data that was previously attached to a namespace node. + * DESCRIPTION: Retrieve data that was previously attached to a namespace node + * and execute a callback before returning. * ******************************************************************************/ - ACPI_STATUS -AcpiGetData ( +AcpiGetDataFull ( ACPI_HANDLE ObjHandle, ACPI_OBJECT_HANDLER Handler, - void **Data) + void **Data, + void (*Callback)(void *)) { ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; @@ -1069,10 +1071,34 @@ AcpiGetData ( } Status = AcpiNsGetAttachedData (Node, Handler, Data); - + if (ACPI_SUCCESS(Status) && Callback) { + Callback(*Data); + } UnlockAndExit: (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); return (Status); } +ACPI_EXPORT_SYMBOL (AcpiGetDataFull) +/******************************************************************************* + * + * FUNCTION: AcpiGetData + * + * PARAMETERS: ObjHandle - Namespace node + * Handler - Handler used in call to AttachData + * Data - Where the data is returned + * + * RETURN: Status + * + * DESCRIPTION: Retrieve data that was previously attached to a namespace node. + * + ******************************************************************************/ +ACPI_STATUS +AcpiGetData ( + ACPI_HANDLE ObjHandle, + ACPI_OBJECT_HANDLER Handler, + void **Data) +{ + return (AcpiGetDataFull(ObjHandle, Handler, Data, NULL)); +} ACPI_EXPORT_SYMBOL (AcpiGetData) Modified: head/sys/contrib/dev/acpica/components/tables/tbxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbxface.c Sun Jan 8 06:22:35 2017 (r311666) +++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Sun Jan 8 06:26:33 2017 (r311667) @@ -314,11 +314,12 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) /******************************************************************************* * - * FUNCTION: AcpiGetTable + * FUNCTION: AcpiGetTableWithSize * * PARAMETERS: Signature - ACPI signature of needed table * Instance - Which instance (for SSDTs) * OutTable - Where the pointer to the table is returned + * TblSize - Size of the table * * RETURN: Status and pointer to the requested table * @@ -333,10 +334,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) ******************************************************************************/ ACPI_STATUS -AcpiGetTable ( +AcpiGetTableWithSize ( char *Signature, UINT32 Instance, - ACPI_TABLE_HEADER **OutTable) + ACPI_TABLE_HEADER **OutTable, + ACPI_SIZE *TblSize) { UINT32 i; UINT32 j; @@ -434,12 +436,40 @@ AcpiPutTable ( (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_VOID; } - ACPI_EXPORT_SYMBOL (AcpiPutTable) /******************************************************************************* * + * FUNCTION: AcpiGetTable + * + * PARAMETERS: Signature - ACPI signature of needed table + * Instance - Which instance (for SSDTs) + * OutTable - Where the pointer to the table is returned + * + * RETURN: Status and pointer to the requested table + * + * DESCRIPTION: Finds and verifies an ACPI table. Table must be in the + * RSDT/XSDT. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiGetTable ( + char *Signature, + UINT32 Instance, + ACPI_TABLE_HEADER **OutTable) +{ + ACPI_SIZE Size; + + return (AcpiGetTableWithSize(Signature, Instance, OutTable, &Size)); +} + +ACPI_EXPORT_SYMBOL (AcpiGetTable) + + +/******************************************************************************* + * * FUNCTION: AcpiGetTableByIndex * * PARAMETERS: TableIndex - Table index Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Sun Jan 8 06:22:35 2017 (r311666) +++ head/sys/contrib/dev/acpica/include/acpixf.h Sun Jan 8 06:26:33 2017 (r311667) @@ -586,6 +586,14 @@ AcpiGetTableHeader ( ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS +AcpiGetTableWithSize ( + ACPI_STRING Signature, + UINT32 Instance, + ACPI_TABLE_HEADER **OutTable, + ACPI_SIZE *TblSize)) + +ACPI_EXTERNAL_RETURN_STATUS ( +ACPI_STATUS AcpiGetTable ( ACPI_STRING Signature, UINT32 Instance, @@ -672,6 +680,14 @@ AcpiGetData ( ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS +AcpiGetDataFull ( + ACPI_HANDLE Object, + ACPI_OBJECT_HANDLER Handler, + void **Data, + void (*Callback)(void *))) + +ACPI_EXTERNAL_RETURN_STATUS ( +ACPI_STATUS AcpiDebugTrace ( const char *Name, UINT32 DebugLevel, From owner-svn-src-all@freebsd.org Sun Jan 8 06:50:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB681CA51EE; Sun, 8 Jan 2017 06:50:54 +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 942E31BB2; Sun, 8 Jan 2017 06:50:54 +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 v086orEc031889; Sun, 8 Jan 2017 06:50:53 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v086or32031887; Sun, 8 Jan 2017 06:50:53 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701080650.v086or32031887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 8 Jan 2017 06:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311668 - head/bin/chmod X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 06:50:55 -0000 Author: cem Date: Sun Jan 8 06:50:53 2017 New Revision: 311668 URL: https://svnweb.freebsd.org/changeset/base/311668 Log: chmod: Add SIGINFO handler PR: 191884 Submitted by: Dan McGregor Reviewed by: mjg@ (earlier version) Modified: head/bin/chmod/chmod.1 head/bin/chmod/chmod.c Modified: head/bin/chmod/chmod.1 ============================================================================== --- head/bin/chmod/chmod.1 Sun Jan 8 06:26:33 2017 (r311667) +++ head/bin/chmod/chmod.1 Sun Jan 8 06:50:53 2017 (r311668) @@ -32,7 +32,7 @@ .\" @(#)chmod.1 8.4 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd April 20, 2015 +.Dd January 7, 2017 .Dt CHMOD 1 .Os .Sh NAME @@ -106,6 +106,16 @@ option is specified. In addition, these options override each other and the command's actions are determined by the last one specified. .Pp +If +.Nm +receives a +.Dv SIGINFO +signal (see the +.Cm status +argument for +.Xr stty 1 ) , +then the current filename as well as the old and new modes are displayed. +.Pp Only the owner of a file or the super-user is permitted to change the mode of a file. .Sh EXIT STATUS Modified: head/bin/chmod/chmod.c ============================================================================== --- head/bin/chmod/chmod.c Sun Jan 8 06:26:33 2017 (r311667) +++ head/bin/chmod/chmod.c Sun Jan 8 06:50:53 2017 (r311668) @@ -49,14 +49,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +static volatile sig_atomic_t siginfo; + static void usage(void); static int may_have_nfs4acl(const FTSENT *ent, int hflag); +static void +siginfo_handler(int sig __unused) +{ + + siginfo = 1; +} + int main(int argc, char *argv[]) { @@ -125,6 +135,8 @@ done: argv += optind; if (argc < 2) usage(); + (void)signal(SIGINFO, siginfo_handler); + if (Rflag) { if (hflag) errx(1, "the -R and -h options may not be " @@ -192,10 +204,10 @@ done: argv += optind; && !fflag) { warn("%s", p->fts_path); rval = 1; - } else if (vflag) { + } else if (vflag || siginfo) { (void)printf("%s", p->fts_path); - if (vflag > 1) { + if (vflag > 1 || siginfo) { char m1[12], m2[12]; strmode(p->fts_statp->st_mode, m1); @@ -207,6 +219,7 @@ done: argv += optind; newmode, m2); } (void)printf("\n"); + siginfo = 0; } } if (errno) From owner-svn-src-all@freebsd.org Sun Jan 8 06:58:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EFAECA5410; Sun, 8 Jan 2017 06:58:44 +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 E3C1E1FEE; Sun, 8 Jan 2017 06:58:43 +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 v086whUg034286; Sun, 8 Jan 2017 06:58:43 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v086wggb034283; Sun, 8 Jan 2017 06:58:42 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701080658.v086wggb034283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 8 Jan 2017 06:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311669 - head/usr.sbin/chown X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 06:58:44 -0000 Author: cem Date: Sun Jan 8 06:58:42 2017 New Revision: 311669 URL: https://svnweb.freebsd.org/changeset/base/311669 Log: chown/chgrp: Add SIGINFO handler PR: 191884 Submitted by: Dan McGregor Reviewed by: mjg@ (earlier version) Modified: head/usr.sbin/chown/chgrp.1 head/usr.sbin/chown/chown.8 head/usr.sbin/chown/chown.c Modified: head/usr.sbin/chown/chgrp.1 ============================================================================== --- head/usr.sbin/chown/chgrp.1 Sun Jan 8 06:50:53 2017 (r311668) +++ head/usr.sbin/chown/chgrp.1 Sun Jan 8 06:58:42 2017 (r311669) @@ -31,7 +31,7 @@ .\" @(#)chgrp.1 8.3 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd April 20, 2015 +.Dd January 7, 2017 .Dt CHGRP 1 .Os .Sh NAME @@ -120,6 +120,17 @@ The user invoking .Nm must belong to the specified group and be the owner of the file, or be the super-user. +.Pp +If +.Nm +receives a +.Dv SIGINFO +signal (see the +.Cm status +argument for +.Xr stty 1 ) , +then the current filename as well as the old and new group names are +displayed. .Sh FILES .Bl -tag -width /etc/group -compact .It Pa /etc/group Modified: head/usr.sbin/chown/chown.8 ============================================================================== --- head/usr.sbin/chown/chown.8 Sun Jan 8 06:50:53 2017 (r311668) +++ head/usr.sbin/chown/chown.8 Sun Jan 8 06:58:42 2017 (r311669) @@ -28,7 +28,7 @@ .\" @(#)chown.8 8.3 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd April 20, 2015 +.Dd January 7, 2017 .Dt CHOWN 8 .Os .Sh NAME @@ -135,6 +135,17 @@ group name. .Pp The ownership of a file may only be altered by a super-user for obvious security reasons. +.Pp +If +.Nm +receives a +.Dv SIGINFO +signal (see the +.Cm status +argument for +.Xr stty 1 ) , +then the current filename as well as the old and new file owner and group +are displayed. .Sh EXIT STATUS .Ex -std .Sh COMPATIBILITY Modified: head/usr.sbin/chown/chown.c ============================================================================== --- head/usr.sbin/chown/chown.c Sun Jan 8 06:50:53 2017 (r311668) +++ head/usr.sbin/chown/chown.c Sun Jan 8 06:58:42 2017 (r311669) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,11 +64,20 @@ static void a_uid(const char *); static void chownerr(const char *); static uid_t id(const char *, const char *); static void usage(void); +static void print_info(const FTSENT *, int); static uid_t uid; static gid_t gid; static int ischown; static const char *gname; +static volatile sig_atomic_t siginfo; + +static void +siginfo_handler(int sig __unused) +{ + + siginfo = 1; +} int main(int argc, char **argv) @@ -119,6 +129,8 @@ main(int argc, char **argv) if (argc < 2) usage(); + (void)signal(SIGINFO, siginfo_handler); + if (Rflag) { if (hflag && (Hflag || Lflag)) errx(1, "the -R%c and -h options may not be " @@ -189,6 +201,10 @@ main(int argc, char **argv) default: break; } + if (siginfo) { + print_info(p, 2); + siginfo = 0; + } if ((uid == (uid_t)-1 || uid == p->fts_statp->st_uid) && (gid == (gid_t)-1 || gid == p->fts_statp->st_gid)) continue; @@ -196,35 +212,8 @@ main(int argc, char **argv) == -1 && !fflag) { chownerr(p->fts_path); rval = 1; - } else if (vflag) { - printf("%s", p->fts_path); - if (vflag > 1) { - if (ischown) { - printf(": %ju:%ju -> %ju:%ju", - (uintmax_t) - p->fts_statp->st_uid, - (uintmax_t) - p->fts_statp->st_gid, - (uid == (uid_t)-1) ? - (uintmax_t) - p->fts_statp->st_uid : - (uintmax_t)uid, - (gid == (gid_t)-1) ? - (uintmax_t) - p->fts_statp->st_gid : - (uintmax_t)gid); - } else { - printf(": %ju -> %ju", - (uintmax_t) - p->fts_statp->st_gid, - (gid == (gid_t)-1) ? - (uintmax_t) - p->fts_statp->st_gid : - (uintmax_t)gid); - } - } - printf("\n"); - } + } else if (vflag) + print_info(p, vflag); } if (errno) err(1, "fts_read"); @@ -315,3 +304,26 @@ usage(void) "usage: chgrp [-fhvx] [-R [-H | -L | -P]] group file ..."); exit(1); } + +static void +print_info(const FTSENT *p, int vflag) +{ + + printf("%s", p->fts_path); + if (vflag > 1) { + if (ischown) { + printf(": %ju:%ju -> %ju:%ju", + (uintmax_t)p->fts_statp->st_uid, + (uintmax_t)p->fts_statp->st_gid, + (uid == (uid_t)-1) ? + (uintmax_t)p->fts_statp->st_uid : (uintmax_t)uid, + (gid == (gid_t)-1) ? + (uintmax_t)p->fts_statp->st_gid : (uintmax_t)gid); + } else { + printf(": %ju -> %ju", (uintmax_t)p->fts_statp->st_gid, + (gid == (gid_t)-1) ? + (uintmax_t)p->fts_statp->st_gid : (uintmax_t)gid); + } + } + printf("\n"); +} From owner-svn-src-all@freebsd.org Sun Jan 8 07:25:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8816BCA59F5; Sun, 8 Jan 2017 07:25:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53B471CC4; Sun, 8 Jan 2017 07:25:24 +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 v087PNxr046364; Sun, 8 Jan 2017 07:25:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v087PM3H046356; Sun, 8 Jan 2017 07:25:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701080725.v087PM3H046356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 8 Jan 2017 07:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311670 - stable/11/usr.bin/netstat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 07:25:24 -0000 Author: delphij Date: Sun Jan 8 07:25:22 2017 New Revision: 311670 URL: https://svnweb.freebsd.org/changeset/base/311670 Log: MFC r311392: Use strlcpy and snprintf in netstat(1). Expand inet6name() line buffer to NI_MAXHOST and use strlcpy/snprintf in various places. Reported by: Anton Yuzhaninov Modified: stable/11/usr.bin/netstat/if.c stable/11/usr.bin/netstat/inet.c stable/11/usr.bin/netstat/inet6.c stable/11/usr.bin/netstat/mroute.c stable/11/usr.bin/netstat/netstat.h stable/11/usr.bin/netstat/route.c stable/11/usr.bin/netstat/sctp.c stable/11/usr.bin/netstat/unix.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/netstat/if.c ============================================================================== --- stable/11/usr.bin/netstat/if.c Sun Jan 8 06:58:42 2017 (r311669) +++ stable/11/usr.bin/netstat/if.c Sun Jan 8 07:25:22 2017 (r311670) @@ -393,10 +393,10 @@ intpr(void (*pfunc)(char *), int af) case AF_LINK: { struct sockaddr_dl *sdl; - char linknum[10]; + char linknum[sizeof("")]; sdl = (struct sockaddr_dl *)ifa->ifa_addr; - sprintf(linknum, "", sdl->sdl_index); + snprintf(linknum, sizeof(linknum), "", sdl->sdl_index); xo_emit("{t:network/%-*.*s} ", net_len, net_len, linknum); if (sdl->sdl_nlen == 0 && Modified: stable/11/usr.bin/netstat/inet.c ============================================================================== --- stable/11/usr.bin/netstat/inet.c Sun Jan 8 06:58:42 2017 (r311669) +++ stable/11/usr.bin/netstat/inet.c Sun Jan 8 07:25:22 2017 (r311670) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); #include "netstat.h" #include "nl_defs.h" -char *inetname(struct in_addr *); void inetprint(const char *, struct in_addr *, int, const char *, int, const int); #ifdef INET6 @@ -1407,21 +1406,26 @@ inetprint(const char *container, struct struct servent *sp = 0; char line[80], *cp; int width; + size_t alen, plen; if (container) xo_open_container(container); if (Wflag) - sprintf(line, "%s.", inetname(in)); + snprintf(line, sizeof(line), "%s.", inetname(in)); else - sprintf(line, "%.*s.", (Aflag && !num_port) ? 12 : 16, inetname(in)); - cp = strchr(line, '\0'); + snprintf(line, sizeof(line), "%.*s.", + (Aflag && !num_port) ? 12 : 16, inetname(in)); + alen = strlen(line); + cp = line + alen; if (!num_port && port) sp = getservbyport((int)port, proto); if (sp || port == 0) - sprintf(cp, "%.15s ", sp ? sp->s_name : "*"); + snprintf(cp, sizeof(line) - alen, + "%.15s ", sp ? sp->s_name : "*"); else - sprintf(cp, "%d ", ntohs((u_short)port)); + snprintf(cp, sizeof(line) - alen, + "%d ", ntohs((u_short)port)); width = (Aflag && !Wflag) ? 18 : ((!Wflag || af1 == AF_INET) ? 22 : 45); if (Wflag) @@ -1429,7 +1433,8 @@ inetprint(const char *container, struct else xo_emit("{d:target/%-*.*s} ", width, width, line); - int alen = cp - line - 1, plen = strlen(cp) - 1; + plen = strlen(cp) - 1; + alen--; xo_emit("{e:address/%*.*s}{e:port/%*.*s}", alen, alen, line, plen, plen, cp); @@ -1475,8 +1480,9 @@ inetname(struct in_addr *inp) } else { inp->s_addr = ntohl(inp->s_addr); #define C(x) ((u_int)((x) & 0xff)) - sprintf(line, "%u.%u.%u.%u", C(inp->s_addr >> 24), - C(inp->s_addr >> 16), C(inp->s_addr >> 8), C(inp->s_addr)); + snprintf(line, sizeof(line), "%u.%u.%u.%u", + C(inp->s_addr >> 24), C(inp->s_addr >> 16), + C(inp->s_addr >> 8), C(inp->s_addr)); } return (line); } Modified: stable/11/usr.bin/netstat/inet6.c ============================================================================== --- stable/11/usr.bin/netstat/inet6.c Sun Jan 8 06:58:42 2017 (r311669) +++ stable/11/usr.bin/netstat/inet6.c Sun Jan 8 07:25:22 2017 (r311670) @@ -70,8 +70,6 @@ __FBSDID("$FreeBSD$"); #include #include "netstat.h" -char *inet6name(struct in6_addr *); - static char ntop_buf[INET6_ADDRSTRLEN]; static const char *ip6nh[] = { @@ -1270,24 +1268,30 @@ inet6print(const char *container, struct struct servent *sp = 0; char line[80], *cp; int width; + size_t alen, plen; if (container) xo_open_container(container); - sprintf(line, "%.*s.", Wflag ? 39 : (Aflag && !numeric) ? 12 : 16, + snprintf(line, sizeof(line), "%.*s.", + Wflag ? 39 : (Aflag && !numeric) ? 12 : 16, inet6name(in6)); - cp = strchr(line, '\0'); + alen = strlen(line); + cp = line + alen; if (!numeric && port) GETSERVBYPORT6(port, proto, sp); if (sp || port == 0) - sprintf(cp, "%.15s", sp ? sp->s_name : "*"); + snprintf(cp, sizeof(line) - alen, + "%.15s", sp ? sp->s_name : "*"); else - sprintf(cp, "%d", ntohs((u_short)port)); + snprintf(cp, sizeof(line) - alen, + "%d", ntohs((u_short)port)); width = Wflag ? 45 : Aflag ? 18 : 22; xo_emit("{d:target/%-*.*s} ", width, width, line); - int alen = cp - line - 1, plen = strlen(cp) - 1; + plen = strlen(cp) - 1; + alen--; xo_emit("{e:address/%*.*s}{e:port/%*.*s}", alen, alen, line, plen, plen, cp); @@ -1306,7 +1310,7 @@ inet6name(struct in6_addr *in6p) { struct sockaddr_in6 sin6; char hbuf[NI_MAXHOST], *cp; - static char line[50]; + static char line[NI_MAXHOST]; static char domain[MAXHOSTNAMELEN]; static int first = 1; int flags, error; @@ -1317,9 +1321,9 @@ inet6name(struct in6_addr *in6p) } if (first && !numeric_addr) { first = 0; - if (gethostname(domain, MAXHOSTNAMELEN) == 0 && + if (gethostname(domain, sizeof(domain)) == 0 && (cp = strchr(domain, '.'))) - (void) strcpy(domain, cp + 1); + strlcpy(domain, cp + 1, sizeof(domain)); else domain[0] = 0; } @@ -1336,10 +1340,10 @@ inet6name(struct in6_addr *in6p) (cp = strchr(hbuf, '.')) && !strcmp(cp + 1, domain)) *cp = 0; - strcpy(line, hbuf); + strlcpy(line, hbuf, sizeof(line)); } else { /* XXX: this should not happen. */ - sprintf(line, "%s", + snprintf(line, sizeof(line), "%s", inet_ntop(AF_INET6, (void *)&sin6.sin6_addr, ntop_buf, sizeof(ntop_buf))); } Modified: stable/11/usr.bin/netstat/mroute.c ============================================================================== --- stable/11/usr.bin/netstat/mroute.c Sun Jan 8 06:58:42 2017 (r311669) +++ stable/11/usr.bin/netstat/mroute.c Sun Jan 8 07:25:22 2017 (r311670) @@ -100,17 +100,19 @@ print_bw_meter(struct bw_meter *bw_meter /* The measured values */ if (bw_meter->bm_flags & BW_METER_UNIT_PACKETS) { - sprintf(s1, "%ju", (uintmax_t)bw_meter->bm_measured.b_packets); + snprintf(s1, sizeof(s1), "%ju", + (uintmax_t)bw_meter->bm_measured.b_packets); xo_emit("{e:measured-packets/%ju}", (uintmax_t)bw_meter->bm_measured.b_packets); } else - sprintf(s1, "?"); + strcpy(s1, "?"); if (bw_meter->bm_flags & BW_METER_UNIT_BYTES) { - sprintf(s2, "%ju", (uintmax_t)bw_meter->bm_measured.b_bytes); + snprintf(s2, sizeof(s2), "%ju", + (uintmax_t)bw_meter->bm_measured.b_bytes); xo_emit("{e:measured-bytes/%ju}", (uintmax_t)bw_meter->bm_measured.b_bytes); } else - sprintf(s2, "?"); + strcpy(s2, "?"); xo_emit(" {[:-30}{:start-time/%lu.%06lu}|{q:measured-packets/%s}" "|{q:measured-bytes%s}{]:}", (u_long)bw_meter->bm_start_time.tv_sec, @@ -122,17 +124,19 @@ print_bw_meter(struct bw_meter *bw_meter /* The threshold values */ if (bw_meter->bm_flags & BW_METER_UNIT_PACKETS) { - sprintf(s1, "%ju", (uintmax_t)bw_meter->bm_threshold.b_packets); + snprintf(s1, sizeof(s1), "%ju", + (uintmax_t)bw_meter->bm_threshold.b_packets); xo_emit("{e:threshold-packets/%ju}", (uintmax_t)bw_meter->bm_threshold.b_packets); } else - sprintf(s1, "?"); + strcpy(s1, "?"); if (bw_meter->bm_flags & BW_METER_UNIT_BYTES) { - sprintf(s2, "%ju", (uintmax_t)bw_meter->bm_threshold.b_bytes); + snprintf(s2, sizeof(s2), "%ju", + (uintmax_t)bw_meter->bm_threshold.b_bytes); xo_emit("{e:threshold-bytes/%ju}", (uintmax_t)bw_meter->bm_threshold.b_bytes); } else - sprintf(s2, "?"); + strcpy(s2, "?"); xo_emit(" {[:-30}{:threshold-time/%lu.%06lu}|{q:threshold-packets/%s}" "|{q:threshold-bytes%s}{]:}", @@ -144,13 +148,13 @@ print_bw_meter(struct bw_meter *bw_meter &bw_meter->bm_threshold.b_time, &end); if (timercmp(&now, &end, <=)) { timersub(&end, &now, &delta); - sprintf(s3, "%lu.%06lu", + snprintf(s3, sizeof(s3), "%lu.%06lu", (u_long)delta.tv_sec, (u_long)delta.tv_usec); } else { /* Negative time */ timersub(&now, &end, &delta); - sprintf(s3, "-%lu.06%lu", + snprintf(s3, sizeof(s3), "-%lu.06%lu", (u_long)delta.tv_sec, (u_long)delta.tv_usec); } Modified: stable/11/usr.bin/netstat/netstat.h ============================================================================== --- stable/11/usr.bin/netstat/netstat.h Sun Jan 8 06:58:42 2017 (r311669) +++ stable/11/usr.bin/netstat/netstat.h Sun Jan 8 07:25:22 2017 (r311670) @@ -100,7 +100,16 @@ void ah_stats(u_long, const char *, int, void ipcomp_stats(u_long, const char *, int, int); #endif +#ifdef INET +struct in_addr; + +char *inetname(struct in_addr *); +#endif + #ifdef INET6 +struct in6_addr; + +char *inet6name(struct in6_addr *); void ip6_stats(u_long, const char *, int, int); void ip6_ifstats(char *); void icmp6_stats(u_long, const char *, int, int); Modified: stable/11/usr.bin/netstat/route.c ============================================================================== --- stable/11/usr.bin/netstat/route.c Sun Jan 8 06:58:42 2017 (r311669) +++ stable/11/usr.bin/netstat/route.c Sun Jan 8 07:25:22 2017 (r311670) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -113,7 +114,7 @@ static const char *fmt_sockaddr(struct s int flags); static void p_flags(int, const char *); static const char *fmt_flags(int f); -static void domask(char *, in_addr_t, u_long); +static void domask(char *, size_t, u_long); /* @@ -492,12 +493,16 @@ fmt_sockaddr(struct sockaddr *sa, struct cq = buf; slim = sa->sa_len + (u_char *) sa; - cqlim = cq + sizeof(buf) - 6; - cq += sprintf(cq, "(%d)", sa->sa_family); + cqlim = cq + sizeof(buf) - sizeof(" ffff"); + snprintf(cq, sizeof(cq), "(%d)", sa->sa_family); + cq += strlen(cq); while (s < slim && cq < cqlim) { - cq += sprintf(cq, " %02x", *s++); - if (s < slim) - cq += sprintf(cq, "%02x", *s++); + snprintf(cq, sizeof(" ff"), " %02x", *s++); + cq += strlen(cq); + if (s < slim) { + snprintf(cq, sizeof("ff"), "%02x", *s++); + cq += strlen(cq); + } } cp = buf; } @@ -574,7 +579,7 @@ routename(struct sockaddr *sa, int flags 0) static void -domask(char *dst, in_addr_t addr __unused, u_long mask) +domask(char *dst, size_t buflen, u_long mask) { int b, i; @@ -596,9 +601,9 @@ domask(char *dst, in_addr_t addr __unuse break; } if (i == -1) - sprintf(dst, "&0x%lx", mask); + snprintf(dst, buflen, "&0x%lx", mask); else - sprintf(dst, "/%d", 32-i); + snprintf(dst, buflen, "/%d", 32-i); } /* @@ -629,7 +634,7 @@ static const char * netname4(in_addr_t in, in_addr_t mask) { char *cp = 0; - static char line[MAXHOSTNAMELEN + sizeof("/xx")]; + static char line[MAXHOSTNAMELEN + sizeof("&0xffffffff")]; char nline[INET_ADDRSTRLEN]; struct netent *np = 0; in_addr_t i; @@ -655,7 +660,7 @@ netname4(in_addr_t in, in_addr_t mask) else { inet_ntop(AF_INET, &in, nline, sizeof(nline)); strlcpy(line, nline, sizeof(line)); - domask(line + strlen(line), i, ntohl(mask)); + domask(line + strlen(line), sizeof(line) - strlen(line), ntohl(mask)); } return (line); @@ -684,7 +689,7 @@ in6_fillscopeid(struct sockaddr_in6 *sa6 } /* Mask to length table. To check an invalid value, (length + 1) is used. */ -static int masktolen[256] = { +static const u_char masktolen[256] = { [0xff] = 8 + 1, [0xfe] = 7 + 1, [0xfc] = 6 + 1, @@ -702,17 +707,20 @@ netname6(struct sockaddr_in6 *sa6, struc static char line[NI_MAXHOST + sizeof("/xxx") - 1]; struct sockaddr_in6 addr; char nline[NI_MAXHOST]; + char maskbuf[sizeof("/xxx")]; u_char *p, *lim; - int masklen, illegal = 0, i; + u_char masklen; + int i; + bool illegal = false; if (mask) { p = (u_char *)&mask->sin6_addr; for (masklen = 0, lim = p + 16; p < lim; p++) { - if (masktolen[*p] > 0) + if (masktolen[*p] > 0) { /* -1 is required. */ - masklen += masktolen[*p] - 1; - else - illegal++; + masklen += (masktolen[*p] - 1); + } else + illegal = true; } if (illegal) xo_error("illegal prefixlen\n"); @@ -736,8 +744,10 @@ netname6(struct sockaddr_in6 *sa6, struc else getnameinfo((struct sockaddr *)sa6, sa6->sin6_len, line, sizeof(line), NULL, 0, 0); - if (numeric_addr || strcmp(line, nline) == 0) - sprintf(&line[strlen(line)], "/%d", masklen); + if (numeric_addr || strcmp(line, nline) == 0) { + snprintf(maskbuf, sizeof(maskbuf), "/%d", masklen); + strlcat(line, maskbuf, sizeof(line)); + } return (line); } Modified: stable/11/usr.bin/netstat/sctp.c ============================================================================== --- stable/11/usr.bin/netstat/sctp.c Sun Jan 8 06:58:42 2017 (r311669) +++ stable/11/usr.bin/netstat/sctp.c Sun Jan 8 07:25:22 2017 (r311670) @@ -104,16 +104,6 @@ struct xraddr_entry { LIST_ENTRY(xraddr_entry) xraddr_entries; }; -#ifdef INET -char * -inetname(struct in_addr *inp); -#endif - -#ifdef INET6 -char * -inet6name(struct in6_addr *in6p); -#endif - static void sctp_print_address(const char *container, union sctp_sockstore *address, int port, int num_port) @@ -121,6 +111,7 @@ sctp_print_address(const char *container struct servent *sp = 0; char line[80], *cp; int width; + size_t alen, plen; if (container) xo_open_container(container); @@ -128,29 +119,36 @@ sctp_print_address(const char *container switch (address->sa.sa_family) { #ifdef INET case AF_INET: - sprintf(line, "%.*s.", Wflag ? 39 : 16, inetname(&address->sin.sin_addr)); + snprintf(line, sizeof(line), "%.*s.", + Wflag ? 39 : 16, inetname(&address->sin.sin_addr)); break; #endif #ifdef INET6 case AF_INET6: - sprintf(line, "%.*s.", Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr)); + snprintf(line, sizeof(line), "%.*s.", + Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr)); break; #endif default: - sprintf(line, "%.*s.", Wflag ? 39 : 16, ""); + snprintf(line, sizeof(line), "%.*s.", + Wflag ? 39 : 16, ""); break; } - cp = strchr(line, '\0'); + alen = strlen(line); + cp = line + alen; if (!num_port && port) sp = getservbyport((int)port, "sctp"); if (sp || port == 0) - sprintf(cp, "%.15s ", sp ? sp->s_name : "*"); + snprintf(cp, sizeof(line) - alen, + "%.15s ", sp ? sp->s_name : "*"); else - sprintf(cp, "%d ", ntohs((u_short)port)); + snprintf(cp, sizeof(line) - alen, + "%d ", ntohs((u_short)port)); width = Wflag ? 45 : 22; xo_emit("{d:target/%-*.*s} ", width, width, line); - int alen = cp - line - 1, plen = strlen(cp) - 1; + plen = strlen(cp) - 1; + alen--; xo_emit("{e:address/%*.*s}{e:port/%*.*s}", alen, alen, line, plen, plen, cp); Modified: stable/11/usr.bin/netstat/unix.c ============================================================================== --- stable/11/usr.bin/netstat/unix.c Sun Jan 8 06:58:42 2017 (r311669) +++ stable/11/usr.bin/netstat/unix.c Sun Jan 8 07:25:22 2017 (r311670) @@ -75,7 +75,7 @@ pcblist_sysctl(int type, char **bufp) size_t len; char mibvar[sizeof "net.local.seqpacket.pcblist"]; - sprintf(mibvar, "net.local.%s.pcblist", socktype[type]); + snprintf(mibvar, sizeof(mibvar), "net.local.%s.pcblist", socktype[type]); len = 0; if (sysctlbyname(mibvar, 0, &len, 0, 0) < 0) { From owner-svn-src-all@freebsd.org Sun Jan 8 08:08:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E625CCA5551; Sun, 8 Jan 2017 08:08:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-yw0-x242.google.com (mail-yw0-x242.google.com [IPv6:2607:f8b0:4002:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD6CC1E46; Sun, 8 Jan 2017 08:08:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-yw0-x242.google.com with SMTP id r204so52541417ywb.3; Sun, 08 Jan 2017 00:08:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=iuemPcUJUnJ2oLDWWisa+S/q9dNxE0rmuozEtsIa/e0=; b=KJmSDlmuS9gCmKeJ/68P5OSFRt/Q1CiL+AR9brFTv/X19UANLPQbRgvPrHTte4ubSs ad0jXuqBWY60Zgx1hxxaG/hw/8sLmOKWwi27eIVDdHwHuYPFIHQmb1x9l1POh+lPFH8o 3GCJbSt7XP2eTeylCSWlAT2zBGCVvb3GvvwwaNa4I9vb+8utIyfFiL80+BKZNzfinvOH PyuRBXmi3bb+DVfrgg6PGl0aF7ksCNoEuUSYZ3vuwG6YsmCVhzWPdTiuilaVmBF5EDy9 IX4lYzje6v8GJyx0Paao0UOCfYxKrBNbVSyh1+mM1yWLx2LVnaI8UlXUYoKweS+TSbUJ CRmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=iuemPcUJUnJ2oLDWWisa+S/q9dNxE0rmuozEtsIa/e0=; b=uLDZ1w3ui0soGPea7w6nUtkcOzGCtuWijjVgF1RcU8T/+G7YxhdSReNnkB5Jw8HhaP 7Er9XQKAPfml5gsdpb4Lt4oFN8Pe0qOLmyltkiQE5kAcvCfEmTXxe8KO3k7KLEnXmBaG EpKSd9sMrqmWY8Yt4104x2AGBGZmnf7HXB5ZE3lsp3W7HARz5czoNCiy56eS+igdJDW3 zkROT/n+txmFjhIGH8RdGvxTLSUBRd6+Qp1iwo5LZdXNUb9NN1IDzroJxT/9laYjWPad 4v2cKMXgtwAsG/wkgKKLMsI7Q/H84Fb/goHlpnyLy6PRuyI4inet+7yimOcdX5yvgzpK IHWg== X-Gm-Message-State: AIkVDXLMzwc83oWoFxpHGRIrzJPorXbz7RUh3fwHpA7ml9tHmYHMKILppgyamXwk+2pV6Q== X-Received: by 10.129.13.215 with SMTP id 206mr79831452ywn.69.1483862899445; Sun, 08 Jan 2017 00:08:19 -0800 (PST) Received: from ?IPv6:2607:fb90:f4b:cf76:e161:eb39:5338:a8bd? ([2607:fb90:f4b:cf76:e161:eb39:5338:a8bd]) by smtp.gmail.com with ESMTPSA id l27sm2756827ywh.33.2017.01.08.00.08.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jan 2017 00:08:18 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r311665 - head/sys/fs/cd9660 From: Ngie Cooper X-Mailer: iPhone Mail (14C92) In-Reply-To: <201701080621.v086LnAX019001@repo.freebsd.org> Date: Sun, 8 Jan 2017 00:07:25 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1793A89F-4AC6-4922-B65A-DE0BFFCA11A1@gmail.com> References: <201701080621.v086LnAX019001@repo.freebsd.org> To: "Conrad E. Meyer" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 08:08:21 -0000 > On Jan 7, 2017, at 22:21, Conrad E. Meyer wrote: >=20 > Author: cem > Date: Sun Jan 8 06:21:49 2017 > New Revision: 311665 > URL: https://svnweb.freebsd.org/changeset/base/311665 >=20 > Log: > cd9660: Expand internal inum size to 64 bits >=20 > Inums in cd9660 refer to byte offsets on the media. DVD and BD media > can have entries above 4GB, especially with multi-session images. This change broke the build; look for the Jenkins i386 email that notes that= cd_ino_t isn't defined. Thanks, -Ngie= From owner-svn-src-all@freebsd.org Sun Jan 8 08:36:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58936CA5A05; Sun, 8 Jan 2017 08:36:38 +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 2A97F199E; Sun, 8 Jan 2017 08:36:38 +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 v088abET074376; Sun, 8 Jan 2017 08:36:37 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v088abgq074375; Sun, 8 Jan 2017 08:36:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701080836.v088abgq074375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 8 Jan 2017 08:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311671 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 08:36:38 -0000 Author: cem Date: Sun Jan 8 08:36:37 2017 New Revision: 311671 URL: https://svnweb.freebsd.org/changeset/base/311671 Log: libprocstat: Include cd9660 headers in the same order as the kernel Fix userspace build after r311665. Modified: head/lib/libprocstat/cd9660.c Modified: head/lib/libprocstat/cd9660.c ============================================================================== --- head/lib/libprocstat/cd9660.c Sun Jan 8 07:25:22 2017 (r311670) +++ head/lib/libprocstat/cd9660.c Sun Jan 8 08:36:37 2017 (r311671) @@ -53,10 +53,10 @@ __FBSDID("$FreeBSD$"); #include -#include #define _KERNEL #include #undef _KERNEL +#include #include #include From owner-svn-src-all@freebsd.org Sun Jan 8 08:52:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2451CA5DD1; Sun, 8 Jan 2017 08:52:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEFA010C6; Sun, 8 Jan 2017 08:52:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v088qGJg082467; Sun, 8 Jan 2017 08:52:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v088qGMv082466; Sun, 8 Jan 2017 08:52:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701080852.v088qGMv082466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 8 Jan 2017 08:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311672 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 08:52:18 -0000 Author: mav Date: Sun Jan 8 08:52:16 2017 New Revision: 311672 URL: https://svnweb.freebsd.org/changeset/base/311672 Log: MFC r311446: Fix bootverbose affecting code logic in r294558. Reported by: Jilles Tjoelker Modified: stable/11/sys/cam/ctl/ctl_ha.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_ha.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_ha.c Sun Jan 8 08:36:37 2017 (r311671) +++ stable/11/sys/cam/ctl/ctl_ha.c Sun Jan 8 08:52:16 2017 (r311672) @@ -443,8 +443,9 @@ ctl_ha_connect(struct ha_softc *softc) memcpy(&sa, &softc->ha_peer_in, sizeof(sa)); error = soconnect(so, (struct sockaddr *)&sa, td); - if (error != 0 && bootverbose) { - printf("%s: soconnect() error %d\n", __func__, error); + if (error != 0) { + if (bootverbose) + printf("%s: soconnect() error %d\n", __func__, error); goto out; } return (0); From owner-svn-src-all@freebsd.org Sun Jan 8 08:52:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86F8ACA5E5C; Sun, 8 Jan 2017 08:52:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3380712B1; Sun, 8 Jan 2017 08:52:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v088qrRN082654; Sun, 8 Jan 2017 08:52:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v088qrfF082653; Sun, 8 Jan 2017 08:52:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701080852.v088qrfF082653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 8 Jan 2017 08:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311673 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 08:52:54 -0000 Author: mav Date: Sun Jan 8 08:52:53 2017 New Revision: 311673 URL: https://svnweb.freebsd.org/changeset/base/311673 Log: MFC r311446: Fix bootverbose affecting code logic in r294558. Reported by: Jilles Tjoelker Modified: stable/10/sys/cam/ctl/ctl_ha.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_ha.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_ha.c Sun Jan 8 08:52:16 2017 (r311672) +++ stable/10/sys/cam/ctl/ctl_ha.c Sun Jan 8 08:52:53 2017 (r311673) @@ -443,8 +443,9 @@ ctl_ha_connect(struct ha_softc *softc) memcpy(&sa, &softc->ha_peer_in, sizeof(sa)); error = soconnect(so, (struct sockaddr *)&sa, td); - if (error != 0 && bootverbose) { - printf("%s: soconnect() error %d\n", __func__, error); + if (error != 0) { + if (bootverbose) + printf("%s: soconnect() error %d\n", __func__, error); goto out; } return (0); From owner-svn-src-all@freebsd.org Sun Jan 8 08:53:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0106CA5EDE; Sun, 8 Jan 2017 08:53:35 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F1F9151C; Sun, 8 Jan 2017 08:53:35 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v088rYwe082720; Sun, 8 Jan 2017 08:53:34 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v088rYZn082719; Sun, 8 Jan 2017 08:53:34 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201701080853.v088rYZn082719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sun, 8 Jan 2017 08:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311674 - stable/11/usr.bin/netstat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 08:53:35 -0000 Author: ume Date: Sun Jan 8 08:53:34 2017 New Revision: 311674 URL: https://svnweb.freebsd.org/changeset/base/311674 Log: MFC r311426: When displaying netstat details with libxo in JSON or XML modes, the value conversion for tcp6 and udp6 port numbers drops last digit. PR: 215682 Modified: stable/11/usr.bin/netstat/inet6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/netstat/inet6.c ============================================================================== --- stable/11/usr.bin/netstat/inet6.c Sun Jan 8 08:52:53 2017 (r311673) +++ stable/11/usr.bin/netstat/inet6.c Sun Jan 8 08:53:34 2017 (r311674) @@ -1290,7 +1290,7 @@ inet6print(const char *container, struct xo_emit("{d:target/%-*.*s} ", width, width, line); - plen = strlen(cp) - 1; + plen = strlen(cp); alen--; xo_emit("{e:address/%*.*s}{e:port/%*.*s}", alen, alen, line, plen, plen, cp); From owner-svn-src-all@freebsd.org Sun Jan 8 09:16:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 929E3CA3728; Sun, 8 Jan 2017 09:16:08 +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 648F41FE1; Sun, 8 Jan 2017 09:16:08 +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 v089G7mg091019; Sun, 8 Jan 2017 09:16:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v089G7Qu091018; Sun, 8 Jan 2017 09:16:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701080916.v089G7Qu091018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 8 Jan 2017 09:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311675 - head/sys/fs/cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 09:16:08 -0000 Author: cem Date: Sun Jan 8 09:16:07 2017 New Revision: 311675 URL: https://svnweb.freebsd.org/changeset/base/311675 Log: iso_rrip.h: Hide kernel definitions from makefs(8) Reported by: O. Hartmann Modified: head/sys/fs/cd9660/iso_rrip.h Modified: head/sys/fs/cd9660/iso_rrip.h ============================================================================== --- head/sys/fs/cd9660/iso_rrip.h Sun Jan 8 08:53:34 2017 (r311674) +++ head/sys/fs/cd9660/iso_rrip.h Sun Jan 8 09:16:07 2017 (r311675) @@ -54,6 +54,7 @@ #define ISO_SUSP_STOP 0x1000 #define ISO_SUSP_UNKNOWN 0x8000 +#ifdef _KERNEL typedef struct { struct iso_node *inop; int fields; /* interesting fields in this analysis */ @@ -80,3 +81,4 @@ int cd9660_rrip_getsymname(struct iso_di struct iso_mnt *imp); int cd9660_rrip_offset(struct iso_directory_record *isodir, struct iso_mnt *imp); +#endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Sun Jan 8 09:17:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1309CCA37EB; Sun, 8 Jan 2017 09:17:25 +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 9F2EC115C; Sun, 8 Jan 2017 09:17:24 +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 v089HEQO024013 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 8 Jan 2017 11:17:14 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v089HEQO024013 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v089HEPa024012; Sun, 8 Jan 2017 11:17:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 Jan 2017 11:17:14 +0200 From: Konstantin Belousov To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311665 - head/sys/fs/cd9660 Message-ID: <20170108091714.GF2349@kib.kiev.ua> References: <201701080621.v086LnAX019001@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701080621.v086LnAX019001@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 09:17:25 -0000 On Sun, Jan 08, 2017 at 06:21:49AM +0000, Conrad E. Meyer wrote: > +/* > + * When ino_t becomes 64-bit, we can remove this definition in favor of ino_t. > + */ > +#define cd_ino_t uint64_t > + Why the type is defined and not typedef-ed ? Also, I do not think that it is good idea to rely on specific size of the special-purpose system types, like ino_t, even if it is only an intent. Both because the types can change, and because it reduces the usefulness of the code outside the FreeBSD content (our code is often taken into weird embedded systems), where system types might be different. From owner-svn-src-all@freebsd.org Sun Jan 8 09:18:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E20A2CA386A; Sun, 8 Jan 2017 09:18: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 A29B41300; Sun, 8 Jan 2017 09:18: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 v089I8Ym091126; Sun, 8 Jan 2017 09:18:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v089I8Am091125; Sun, 8 Jan 2017 09:18:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701080918.v089I8Am091125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 Jan 2017 09:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311676 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 09:18:10 -0000 Author: kib Date: Sun Jan 8 09:18:08 2017 New Revision: 311676 URL: https://svnweb.freebsd.org/changeset/base/311676 Log: MFC r311014: Style fixes for vm_map_insert(). Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Sun Jan 8 09:16:07 2017 (r311675) +++ stable/11/sys/vm/vm_map.c Sun Jan 8 09:18:08 2017 (r311676) @@ -1180,8 +1180,8 @@ vm_map_insert(vm_map_t map, vm_object_t vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, int cow) { vm_map_entry_t new_entry, prev_entry, temp_entry; - vm_eflags_t protoeflags; struct ucred *cred; + vm_eflags_t protoeflags; vm_inherit_t inheritance; VM_MAP_ASSERT_LOCKED(map); @@ -1194,8 +1194,7 @@ vm_map_insert(vm_map_t map, vm_object_t /* * Check that the start and end points are not bogus. */ - if ((start < map->min_offset) || (end > map->max_offset) || - (start >= end)) + if (start < map->min_offset || end > map->max_offset || start >= end) return (KERN_INVALID_ADDRESS); /* @@ -1210,8 +1209,7 @@ vm_map_insert(vm_map_t map, vm_object_t /* * Assert that the next entry doesn't overlap the end point. */ - if ((prev_entry->next != &map->header) && - (prev_entry->next->start < end)) + if (prev_entry->next != &map->header && prev_entry->next->start < end) return (KERN_NO_SPACE); protoeflags = 0; @@ -1241,9 +1239,10 @@ vm_map_insert(vm_map_t map, vm_object_t ((protoeflags & MAP_ENTRY_NEEDS_COPY) || object == NULL))) { if (!(cow & MAP_ACC_CHARGED) && !swap_reserve(end - start)) return (KERN_RESOURCE_SHORTAGE); - KASSERT(object == NULL || (protoeflags & MAP_ENTRY_NEEDS_COPY) || + KASSERT(object == NULL || + (protoeflags & MAP_ENTRY_NEEDS_COPY) != 0 || object->cred == NULL, - ("OVERCOMMIT: vm_map_insert o %p", object)); + ("overcommit: vm_map_insert o %p", object)); cred = curthread->td_ucred; } @@ -1263,29 +1262,27 @@ charged: if (object->ref_count > 1 || object->shadow_count != 0) vm_object_clear_flag(object, OBJ_ONEMAPPING); VM_OBJECT_WUNLOCK(object); - } - else if ((prev_entry != &map->header) && - (prev_entry->eflags == protoeflags) && - (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && - (prev_entry->end == start) && - (prev_entry->wired_count == 0) && - (prev_entry->cred == cred || - (prev_entry->object.vm_object != NULL && - (prev_entry->object.vm_object->cred == cred))) && - vm_object_coalesce(prev_entry->object.vm_object, - prev_entry->offset, - (vm_size_t)(prev_entry->end - prev_entry->start), - (vm_size_t)(end - prev_entry->end), cred != NULL && - (protoeflags & MAP_ENTRY_NEEDS_COPY) == 0)) { + } else if (prev_entry != &map->header && + prev_entry->eflags == protoeflags && + (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && + prev_entry->end == start && prev_entry->wired_count == 0 && + (prev_entry->cred == cred || + (prev_entry->object.vm_object != NULL && + prev_entry->object.vm_object->cred == cred)) && + vm_object_coalesce(prev_entry->object.vm_object, + prev_entry->offset, + (vm_size_t)(prev_entry->end - prev_entry->start), + (vm_size_t)(end - prev_entry->end), cred != NULL && + (protoeflags & MAP_ENTRY_NEEDS_COPY) == 0)) { /* * We were able to extend the object. Determine if we * can extend the previous map entry to include the * new range as well. */ - if ((prev_entry->inheritance == inheritance) && - (prev_entry->protection == prot) && - (prev_entry->max_protection == max)) { - map->size += (end - prev_entry->end); + if (prev_entry->inheritance == inheritance && + prev_entry->protection == prot && + prev_entry->max_protection == max) { + map->size += end - prev_entry->end; prev_entry->end = end; vm_map_entry_resize_free(map, prev_entry); vm_map_simplify_entry(map, prev_entry); @@ -1300,7 +1297,7 @@ charged: */ object = prev_entry->object.vm_object; offset = prev_entry->offset + - (prev_entry->end - prev_entry->start); + (prev_entry->end - prev_entry->start); vm_object_reference(object); if (cred != NULL && object != NULL && object->cred != NULL && !(prev_entry->eflags & MAP_ENTRY_NEEDS_COPY)) { @@ -1333,7 +1330,7 @@ charged: new_entry->next_read = start; KASSERT(cred == NULL || !ENTRY_CHARGED(new_entry), - ("OVERCOMMIT: vm_map_insert leaks vm_map %p", new_entry)); + ("overcommit: vm_map_insert leaks vm_map %p", new_entry)); new_entry->cred = cred; /* @@ -1350,10 +1347,9 @@ charged: */ vm_map_simplify_entry(map, new_entry); - if (cow & (MAP_PREFAULT|MAP_PREFAULT_PARTIAL)) { - vm_map_pmap_enter(map, start, prot, - object, OFF_TO_IDX(offset), end - start, - cow & MAP_PREFAULT_PARTIAL); + if ((cow & (MAP_PREFAULT | MAP_PREFAULT_PARTIAL)) != 0) { + vm_map_pmap_enter(map, start, prot, object, OFF_TO_IDX(offset), + end - start, cow & MAP_PREFAULT_PARTIAL); } return (KERN_SUCCESS); From owner-svn-src-all@freebsd.org Sun Jan 8 10:07:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDC73CA2552; Sun, 8 Jan 2017 10:07:55 +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 834D21666; Sun, 8 Jan 2017 10:07:55 +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 v08A7sAR010958; Sun, 8 Jan 2017 10:07:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08A7sOP010957; Sun, 8 Jan 2017 10:07:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701081007.v08A7sOP010957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Jan 2017 10:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311677 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 10:07:55 -0000 Author: adrian Date: Sun Jan 8 10:07:54 2017 New Revision: 311677 URL: https://svnweb.freebsd.org/changeset/base/311677 Log: [net80211] use the correct freq2 field when populating VHT operation element. Whilst here, leave a TODO comment so I revisit this routine in the context of hostap operation probe requests for IBSS/mesh. Modified: head/sys/net80211/ieee80211_vht.c Modified: head/sys/net80211/ieee80211_vht.c ============================================================================== --- head/sys/net80211/ieee80211_vht.c Sun Jan 8 09:18:08 2017 (r311676) +++ head/sys/net80211/ieee80211_vht.c Sun Jan 8 10:07:54 2017 (r311677) @@ -352,6 +352,14 @@ ieee80211_vht_get_chwidth_ie(struct ieee /* * Note: this just uses the current channel information; * it doesn't use the node info after parsing. + * + * XXX TODO: need to make the basic MCS set configurable. + * XXX TODO: read 802.11-2013 to determine what to set + * chwidth to when scanning. I have a feeling + * it isn't involved in scanning and we shouldn't + * be sending it; and I don't yet know what to set + * it to for IBSS or hostap where the peer may be + * a completely different channel width to us. */ uint8_t * ieee80211_add_vhtinfo(uint8_t *frm, struct ieee80211_node *ni) @@ -380,7 +388,7 @@ ieee80211_add_vhtinfo(uint8_t *frm, stru *frm++ = ni->ni_chan->ic_vht_ch_freq1; /* 8-bit freq2 */ - *frm++ = ni->ni_chan->ic_vht_ch_freq1; + *frm++ = ni->ni_chan->ic_vht_ch_freq2; /* 16-bit basic MCS set - just MCS0..7 for NSS=1 for now */ ADDSHORT(frm, 0xfffc); From owner-svn-src-all@freebsd.org Sun Jan 8 10:13:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61807CA2776; Sun, 8 Jan 2017 10:13:06 +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 2DC6C1AD3; Sun, 8 Jan 2017 10:13:06 +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 v08AD5uj014991; Sun, 8 Jan 2017 10:13:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08AD5DM014990; Sun, 8 Jan 2017 10:13:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701081013.v08AD5DM014990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Jan 2017 10:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311678 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 10:13:06 -0000 Author: adrian Date: Sun Jan 8 10:13:05 2017 New Revision: 311678 URL: https://svnweb.freebsd.org/changeset/base/311678 Log: [net80211] add roaming parameters for 11ac. These are mostly placeholders for now. Modified: head/sys/net80211/ieee80211_scan.c Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Sun Jan 8 10:07:54 2017 (r311677) +++ head/sys/net80211/ieee80211_scan.c Sun Jan 8 10:13:05 2017 (r311678) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #define ROAM_RATE_HALF_DEFAULT 2*6 /* half-width 11a/g bss */ #define ROAM_RATE_QUARTER_DEFAULT 2*3 /* quarter-width 11a/g bss */ #define ROAM_MCS_11N_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11n bss */ +#define ROAM_MCS_11AC_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11ac bss; XXX not used yet */ void ieee80211_scan_attach(struct ieee80211com *ic) @@ -116,6 +117,11 @@ static const struct ieee80211_roamparam .rate = ROAM_MCS_11N_DEFAULT }, [IEEE80211_MODE_11NG] = { .rssi = ROAM_RSSI_11B_DEFAULT, .rate = ROAM_MCS_11N_DEFAULT }, + [IEEE80211_MODE_VHT_2GHZ] = { .rssi = ROAM_RSSI_11B_DEFAULT, + .rate = ROAM_MCS_11AC_DEFAULT }, + [IEEE80211_MODE_VHT_5GHZ] = { .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_MCS_11AC_DEFAULT }, + }; void From owner-svn-src-all@freebsd.org Sun Jan 8 12:40:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47063CA55AA; Sun, 8 Jan 2017 12:40:09 +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 EE5451963; Sun, 8 Jan 2017 12:40:08 +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 v08Ce8Oi071798; Sun, 8 Jan 2017 12:40:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08Ce87T071797; Sun, 8 Jan 2017 12:40:08 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201701081240.v08Ce87T071797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 8 Jan 2017 12:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311679 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 12:40:09 -0000 Author: ae Date: Sun Jan 8 12:40:07 2017 New Revision: 311679 URL: https://svnweb.freebsd.org/changeset/base/311679 Log: Add direction argument to ipsec_setspidx_inpcb() function. This function is used only by ipsec_getpolicybysock() to fill security policy index selector for locally generated packets (that have INPCB). The function incorrectly assumes that spidx is the same for both directions. Fix this by using new direction argument to specify correct INPCB security policy - sp_in or sp_out. There is no need to fill both policy indeces, because they are overwritten for each packet. This fixes security policy matching for outbound packets when user has specified TCP/UDP ports in the security policy upperspec. PR: 213869 MFC after: 1 week Modified: head/sys/netipsec/ipsec.c Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Sun Jan 8 10:13:05 2017 (r311678) +++ head/sys/netipsec/ipsec.c Sun Jan 8 12:40:07 2017 (r311679) @@ -241,7 +241,7 @@ SYSCTL_VNET_PCPUSTAT(_net_inet6_ipsec6, #endif /* INET6 */ static int ipsec_in_reject(struct secpolicy *, const struct mbuf *); -static int ipsec_setspidx_inpcb(const struct mbuf *, struct inpcb *); +static int ipsec_setspidx_inpcb(const struct mbuf *, struct inpcb *, u_int); static int ipsec_setspidx(const struct mbuf *, struct secpolicyindex *, int); static void ipsec4_get_ulp(const struct mbuf *m, struct secpolicyindex *, int); static int ipsec4_setspidx_ipaddr(const struct mbuf *, struct secpolicyindex *); @@ -343,7 +343,7 @@ ipsec_getpolicybysock(const struct mbuf } /* Set spidx in pcb. */ - *error = ipsec_setspidx_inpcb(m, inp); + *error = ipsec_setspidx_inpcb(m, inp, dir); if (*error) return (NULL); @@ -500,8 +500,9 @@ ipsec4_checkpolicy(const struct mbuf *m, } static int -ipsec_setspidx_inpcb(const struct mbuf *m, struct inpcb *inp) +ipsec_setspidx_inpcb(const struct mbuf *m, struct inpcb *inp, u_int dir) { + struct secpolicyindex *spidx; int error; IPSEC_ASSERT(inp != NULL, ("null inp")); @@ -509,11 +510,13 @@ ipsec_setspidx_inpcb(const struct mbuf * IPSEC_ASSERT(inp->inp_sp->sp_out != NULL && inp->inp_sp->sp_in != NULL, ("null sp_in || sp_out")); - error = ipsec_setspidx(m, &inp->inp_sp->sp_in->spidx, 1); + if (dir == IPSEC_DIR_INBOUND) + spidx = &inp->inp_sp->sp_in->spidx; + else + spidx = &inp->inp_sp->sp_out->spidx; + error = ipsec_setspidx(m, spidx, 1); if (error == 0) { - inp->inp_sp->sp_in->spidx.dir = IPSEC_DIR_INBOUND; - inp->inp_sp->sp_out->spidx = inp->inp_sp->sp_in->spidx; - inp->inp_sp->sp_out->spidx.dir = IPSEC_DIR_OUTBOUND; + spidx->dir = dir; } else { bzero(&inp->inp_sp->sp_in->spidx, sizeof (inp->inp_sp->sp_in->spidx)); From owner-svn-src-all@freebsd.org Sun Jan 8 13:26:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3095CA525D; Sun, 8 Jan 2017 13:26:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B52751E83; Sun, 8 Jan 2017 13:26:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v08DQYOJ091427; Sun, 8 Jan 2017 13:26:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08DQYoJ091426; Sun, 8 Jan 2017 13:26:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701081326.v08DQYoJ091426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 8 Jan 2017 13:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311680 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 13:26:36 -0000 Author: mav Date: Sun Jan 8 13:26:34 2017 New Revision: 311680 URL: https://svnweb.freebsd.org/changeset/base/311680 Log: Make CTL_GETSTATS ioctl return partial data if buffer is small. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Jan 8 12:40:07 2017 (r311679) +++ head/sys/cam/ctl/ctl.c Sun Jan 8 13:26:34 2017 (r311680) @@ -2779,32 +2779,29 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_GETSTATS: { - struct ctl_stats *stats; + struct ctl_stats *stats = (struct ctl_stats *)addr; int i; - stats = (struct ctl_stats *)addr; - - if ((sizeof(struct ctl_lun_io_stats) * softc->num_luns) > - stats->alloc_len) { - stats->status = CTL_SS_NEED_MORE_SPACE; - stats->num_luns = softc->num_luns; - break; - } /* * XXX KDM no locking here. If the LUN list changes, * things can blow up. */ i = 0; + stats->status = CTL_SS_OK; + stats->fill_len = 0; STAILQ_FOREACH(lun, &softc->lun_list, links) { + if (stats->fill_len + sizeof(lun->stats) > + stats->alloc_len) { + stats->status = CTL_SS_NEED_MORE_SPACE; + break; + } retval = copyout(&lun->stats, &stats->lun_stats[i++], sizeof(lun->stats)); if (retval != 0) break; + stats->fill_len += sizeof(lun->stats); } stats->num_luns = softc->num_luns; - stats->fill_len = sizeof(struct ctl_lun_io_stats) * - softc->num_luns; - stats->status = CTL_SS_OK; #ifdef CTL_TIME_IO stats->flags = CTL_STATS_FLAG_TIME_VALID; #else From owner-svn-src-all@freebsd.org Sun Jan 8 13:31:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 329F3CA5693; Sun, 8 Jan 2017 13:31:26 +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 0F9511180; Sun, 8 Jan 2017 13:31:25 +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 v08DVPDH091649; Sun, 8 Jan 2017 13:31:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08DVO3I091645; Sun, 8 Jan 2017 13:31:24 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201701081331.v08DVO3I091645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 8 Jan 2017 13:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311681 - in stable/11/sys: conf netinet6 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 13:31:26 -0000 Author: ae Date: Sun Jan 8 13:31:24 2017 New Revision: 311681 URL: https://svnweb.freebsd.org/changeset/base/311681 Log: MFC r309883: Add ip6_tryforward() - a run to completion forwarding implementation for IPv6. It gets performance benefits from reduced number of checks. It doesn't copy mbuf to be able send ICMPv6 error message, because it keeps mbuf unchanged until the moment, when the route decision has been made. It doesn't do IPsec checks, and when some IPsec security policies present, ip6_input() uses normal slow path. Relnotes: yes Sponsored by: Yandex LLC Added: stable/11/sys/netinet6/ip6_fastfwd.c - copied unchanged from r309883, head/sys/netinet6/ip6_fastfwd.c Modified: stable/11/sys/conf/files stable/11/sys/netinet6/in6_var.h stable/11/sys/netinet6/ip6_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Sun Jan 8 13:26:34 2017 (r311680) +++ stable/11/sys/conf/files Sun Jan 8 13:31:24 2017 (r311681) @@ -3873,6 +3873,7 @@ netinet6/in6_proto.c optional inet6 netinet6/in6_rmx.c optional inet6 netinet6/in6_rss.c optional inet6 rss netinet6/in6_src.c optional inet6 +netinet6/ip6_fastfwd.c optional inet6 netinet6/ip6_forward.c optional inet6 netinet6/ip6_gre.c optional gre inet6 netinet6/ip6_id.c optional inet6 Modified: stable/11/sys/netinet6/in6_var.h ============================================================================== --- stable/11/sys/netinet6/in6_var.h Sun Jan 8 13:26:34 2017 (r311680) +++ stable/11/sys/netinet6/in6_var.h Sun Jan 8 13:31:24 2017 (r311681) @@ -819,6 +819,7 @@ void in6_newaddrmsg(struct in6_ifaddr *, /* * Extended API for IPv6 FIB support. */ +struct mbuf *ip6_tryforward(struct mbuf *); void in6_rtredirect(struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct sockaddr *, u_int); int in6_rtrequest(int, struct sockaddr *, struct sockaddr *, Copied: stable/11/sys/netinet6/ip6_fastfwd.c (from r309883, head/sys/netinet6/ip6_fastfwd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/netinet6/ip6_fastfwd.c Sun Jan 8 13:31:24 2017 (r311681, copy of r309883, head/sys/netinet6/ip6_fastfwd.c) @@ -0,0 +1,295 @@ +/*- + * Copyright (c) 2014-2016 Andrey V. Elsukov + * 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 +__FBSDID("$FreeBSD$"); + +#include "opt_inet6.h" +#include "opt_ipstealth.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int +ip6_findroute(struct nhop6_basic *pnh, const struct sockaddr_in6 *dst, + struct mbuf *m) +{ + + if (fib6_lookup_nh_basic(M_GETFIB(m), &dst->sin6_addr, + dst->sin6_scope_id, 0, dst->sin6_flowinfo, pnh) != 0) { + IP6STAT_INC(ip6s_noroute); + IP6STAT_INC(ip6s_cantforward); + icmp6_error(m, ICMP6_DST_UNREACH, + ICMP6_DST_UNREACH_NOROUTE, 0); + return (EHOSTUNREACH); + } + if (pnh->nh_flags & NHF_BLACKHOLE) { + IP6STAT_INC(ip6s_cantforward); + m_freem(m); + return (EHOSTUNREACH); + } + + if (pnh->nh_flags & NHF_REJECT) { + IP6STAT_INC(ip6s_cantforward); + icmp6_error(m, ICMP6_DST_UNREACH, + ICMP6_DST_UNREACH_REJECT, 0); + return (EHOSTUNREACH); + } + return (0); +} + +struct mbuf* +ip6_tryforward(struct mbuf *m) +{ + struct sockaddr_in6 dst; + struct nhop6_basic nh; + struct m_tag *fwd_tag; + struct ip6_hdr *ip6; + struct ifnet *rcvif; + uint32_t plen; + int error; + + /* + * Fallback conditions to ip6_input for slow path processing. + */ + ip6 = mtod(m, struct ip6_hdr *); + if (ip6->ip6_nxt == IPPROTO_HOPOPTS || + IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || + IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_dst) || + IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src) || + IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) || + in6_localip(&ip6->ip6_dst)) + return (m); + /* + * Check that the amount of data in the buffers + * is as at least much as the IPv6 header would have us expect. + * Trim mbufs if longer than we expect. + * Drop packet if shorter than we expect. + */ + rcvif = m->m_pkthdr.rcvif; + plen = ntohs(ip6->ip6_plen); + if (plen == 0) { + /* + * Jumbograms must have hop-by-hop header and go via + * slow path. + */ + IP6STAT_INC(ip6s_badoptions); + goto dropin; + } + if (m->m_pkthdr.len - sizeof(struct ip6_hdr) < plen) { + IP6STAT_INC(ip6s_tooshort); + in6_ifstat_inc(rcvif, ifs6_in_truncated); + goto dropin; + } + if (m->m_pkthdr.len > sizeof(struct ip6_hdr) + plen) { + if (m->m_len == m->m_pkthdr.len) { + m->m_len = sizeof(struct ip6_hdr) + plen; + m->m_pkthdr.len = sizeof(struct ip6_hdr) + plen; + } else + m_adj(m, sizeof(struct ip6_hdr) + plen - + m->m_pkthdr.len); + } + + /* + * Hop limit. + */ +#ifdef IPSTEALTH + if (!V_ip6stealth) +#endif + if (ip6->ip6_hlim <= IPV6_HLIMDEC) { + icmp6_error(m, ICMP6_TIME_EXCEEDED, + ICMP6_TIME_EXCEED_TRANSIT, 0); + m = NULL; + goto dropin; + } + + bzero(&dst, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + dst.sin6_addr = ip6->ip6_dst; + + /* + * Incoming packet firewall processing. + */ + if (!PFIL_HOOKED(&V_inet6_pfil_hook)) + goto passin; + if (pfil_run_hooks(&V_inet6_pfil_hook, &m, rcvif, PFIL_IN, + NULL) != 0 || m == NULL) + goto dropin; + /* + * If packet filter sets the M_FASTFWD_OURS flag, this means + * that new destination or next hop is our local address. + * So, we can just go back to ip6_input. + * XXX: should we decrement ip6_hlim in such case? + * + * Also it can forward packet to another destination, e.g. + * M_IP6_NEXTHOP flag is set and fwd_tag is attached to mbuf. + */ + if (m->m_flags & M_FASTFWD_OURS) + return (m); + + ip6 = mtod(m, struct ip6_hdr *); + if ((m->m_flags & M_IP6_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { + /* + * Now we will find route to forwarded by pfil destination. + */ + bcopy((fwd_tag + 1), &dst, sizeof(dst)); + m->m_flags &= ~M_IP6_NEXTHOP; + m_tag_delete(m, fwd_tag); + } else { + /* Update dst since pfil could change it */ + dst.sin6_addr = ip6->ip6_dst; + } +passin: + /* + * Find route to destination. + */ + if (ip6_findroute(&nh, &dst, m) != 0) { + m = NULL; + in6_ifstat_inc(rcvif, ifs6_in_noroute); + goto dropin; + } + /* + * We used slow path processing for packets with scoped addresses. + * So, scope checks aren't needed here. + */ + if (m->m_pkthdr.len > nh.nh_mtu) { + in6_ifstat_inc(nh.nh_ifp, ifs6_in_toobig); + icmp6_error(m, ICMP6_PACKET_TOO_BIG, 0, nh.nh_mtu); + m = NULL; + goto dropout; + } + + /* + * Outgoing packet firewall processing. + */ + if (!PFIL_HOOKED(&V_inet6_pfil_hook)) + goto passout; + if (pfil_run_hooks(&V_inet6_pfil_hook, &m, nh.nh_ifp, PFIL_OUT, + NULL) != 0 || m == NULL) + goto dropout; + /* + * If packet filter sets the M_FASTFWD_OURS flag, this means + * that new destination or next hop is our local address. + * So, we can just go back to ip6_input. + * + * Also it can forward packet to another destination, e.g. + * M_IP6_NEXTHOP flag is set and fwd_tag is attached to mbuf. + */ + if (m->m_flags & M_FASTFWD_OURS) { + /* + * XXX: we did one hop and should decrement hop limit. But + * now we are the destination and just don't pay attention. + */ + return (m); + } + /* + * Again. A packet filter could change the destination address. + */ + ip6 = mtod(m, struct ip6_hdr *); + if (m->m_flags & M_IP6_NEXTHOP) + fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); + else + fwd_tag = NULL; + + if (fwd_tag != NULL || + !IN6_ARE_ADDR_EQUAL(&dst.sin6_addr, &ip6->ip6_dst)) { + if (fwd_tag != NULL) { + bcopy((fwd_tag + 1), &dst, sizeof(dst)); + m->m_flags &= ~M_IP6_NEXTHOP; + m_tag_delete(m, fwd_tag); + } else + dst.sin6_addr = ip6->ip6_dst; + /* + * Redo route lookup with new destination address + */ + if (ip6_findroute(&nh, &dst, m) != 0) { + m = NULL; + goto dropout; + } + } +passout: +#ifdef IPSTEALTH + if (!V_ip6stealth) +#endif + { + ip6->ip6_hlim -= IPV6_HLIMDEC; + } + + m_clrprotoflags(m); /* Avoid confusing lower layers. */ + IP_PROBE(send, NULL, NULL, ip6, nh.nh_ifp, NULL, ip6); + + /* + * XXX: we need to use destination address with embedded scope + * zone id, because LLTABLE uses such form of addresses for lookup. + */ + dst.sin6_addr = nh.nh_addr; + if (IN6_IS_SCOPE_LINKLOCAL(&dst.sin6_addr)) + dst.sin6_addr.s6_addr16[1] = htons(nh.nh_ifp->if_index & 0xffff); + + error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m, + (struct sockaddr *)&dst, NULL); + if (error != 0) { + in6_ifstat_inc(nh.nh_ifp, ifs6_out_discard); + IP6STAT_INC(ip6s_cantforward); + } else { + in6_ifstat_inc(nh.nh_ifp, ifs6_out_forward); + IP6STAT_INC(ip6s_forward); + } + return (NULL); +dropin: + in6_ifstat_inc(rcvif, ifs6_in_discard); + goto drop; +dropout: + in6_ifstat_inc(nh.nh_ifp, ifs6_out_discard); +drop: + if (m != NULL) + m_freem(m); + return (NULL); +} + Modified: stable/11/sys/netinet6/ip6_input.c ============================================================================== --- stable/11/sys/netinet6/ip6_input.c Sun Jan 8 13:26:34 2017 (r311680) +++ stable/11/sys/netinet6/ip6_input.c Sun Jan 8 13:31:24 2017 (r311681) @@ -119,6 +119,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef IPSEC +#include #include #include #include @@ -554,6 +555,12 @@ ip6_input(struct mbuf *m) int nxt, ours = 0; int srcrt = 0; + /* + * Drop the packet if IPv6 operation is disabled on the interface. + */ + if ((ND_IFINFO(m->m_pkthdr.rcvif)->flags & ND6_IFF_IFDISABLED)) + goto bad; + #ifdef IPSEC /* * should the inner packet be considered authentic? @@ -597,10 +604,6 @@ ip6_input(struct mbuf *m) IP6STAT_INC(ip6s_m1); } - /* drop the packet if IPv6 operation is disabled on the IF */ - if ((ND_IFINFO(m->m_pkthdr.rcvif)->flags & ND6_IFF_IFDISABLED)) - goto bad; - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_receive); IP6STAT_INC(ip6s_total); @@ -728,12 +731,21 @@ ip6_input(struct mbuf *m) goto bad; } #endif + /* Try to forward the packet, but if we fail continue */ #ifdef IPSEC + if (V_ip6_forwarding != 0 && !key_havesp(IPSEC_DIR_INBOUND) && + !key_havesp(IPSEC_DIR_OUTBOUND)) + if (ip6_tryforward(m) == NULL) + return; /* * Bypass packet filtering for packets previously handled by IPsec. */ if (ip6_ipsec_filtertunnel(m)) goto passin; +#else + if (V_ip6_forwarding != 0) + if (ip6_tryforward(m) == NULL) + return; #endif /* IPSEC */ /* From owner-svn-src-all@freebsd.org Sun Jan 8 13:35:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED4B9CA57AA; Sun, 8 Jan 2017 13:35:11 +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 BEFC7159B; Sun, 8 Jan 2017 13:35:11 +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 v08DZA3k095709; Sun, 8 Jan 2017 13:35:10 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08DZApS095707; Sun, 8 Jan 2017 13:35:10 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201701081335.v08DZApS095707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 8 Jan 2017 13:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311682 - stable/11/sys/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 13:35:12 -0000 Author: ae Date: Sun Jan 8 13:35:10 2017 New Revision: 311682 URL: https://svnweb.freebsd.org/changeset/base/311682 Log: MFC r310783: When we are sending IP fragments, update ip pointers in IP_PROBE() for each fragment. Modified: stable/11/sys/netinet/ip_fastfwd.c stable/11/sys/netinet/ip_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_fastfwd.c ============================================================================== --- stable/11/sys/netinet/ip_fastfwd.c Sun Jan 8 13:31:24 2017 (r311681) +++ stable/11/sys/netinet/ip_fastfwd.c Sun Jan 8 13:35:10 2017 (r311682) @@ -400,8 +400,9 @@ passout: */ m_clrprotoflags(m); - IP_PROBE(send, NULL, NULL, ip, nh.nh_ifp, - ip, NULL); + IP_PROBE(send, NULL, NULL, + mtod(m, struct ip *), nh.nh_ifp, + mtod(m, struct ip *), NULL); /* XXX: we can use cached route here */ error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m, (struct sockaddr *)&dst, NULL); Modified: stable/11/sys/netinet/ip_output.c ============================================================================== --- stable/11/sys/netinet/ip_output.c Sun Jan 8 13:31:24 2017 (r311681) +++ stable/11/sys/netinet/ip_output.c Sun Jan 8 13:35:10 2017 (r311682) @@ -693,7 +693,8 @@ sendit: */ m_clrprotoflags(m); - IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); + IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp, + mtod(m, struct ip *), NULL); error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); } else From owner-svn-src-all@freebsd.org Sun Jan 8 13:38:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEF4ECA5906; Sun, 8 Jan 2017 13:38:18 +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 8E0A217E7; Sun, 8 Jan 2017 13:38:18 +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 v08DcHOJ095871; Sun, 8 Jan 2017 13:38:17 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08DcHAe095870; Sun, 8 Jan 2017 13:38:17 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201701081338.v08DcHAe095870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 8 Jan 2017 13:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311683 - stable/11/cddl/lib/libdtrace X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 13:38:18 -0000 Author: ae Date: Sun Jan 8 13:38:17 2017 New Revision: 311683 URL: https://svnweb.freebsd.org/changeset/base/311683 Log: MFC r310785: Convert ipv4_flags and ipv4_offset fields into host byte order. Also save only high bits in the ipv4_flags, because it is defined as uint8_t. So now it will show DF and MF flags as 0x40 and 0x20. Modified: stable/11/cddl/lib/libdtrace/ip.d Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/lib/libdtrace/ip.d ============================================================================== --- stable/11/cddl/lib/libdtrace/ip.d Sun Jan 8 13:35:10 2017 (r311682) +++ stable/11/cddl/lib/libdtrace/ip.d Sun Jan 8 13:38:17 2017 (r311683) @@ -255,8 +255,8 @@ translator ipv4info_t < struct ip *p > { ipv4_tos = p == NULL ? 0 : p->ip_tos; ipv4_length = p == NULL ? 0 : ntohs(p->ip_len); ipv4_ident = p == NULL ? 0 : ntohs(p->ip_id); - ipv4_flags = p == NULL ? 0 : (p->ip_off & 0xe000); - ipv4_offset = p == NULL ? 0 : p->ip_off; + ipv4_flags = p == NULL ? 0 : (ntohs(p->ip_off) & 0xe000) >> 8; + ipv4_offset = p == NULL ? 0 : ntohs(p->ip_off) & 0x1fff; ipv4_ttl = p == NULL ? 0 : p->ip_ttl; ipv4_protocol = p == NULL ? 0 : p->ip_p; ipv4_protostr = p == NULL ? "" : protocols[p->ip_p]; From owner-svn-src-all@freebsd.org Sun Jan 8 16:56:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D993CA5E58; Sun, 8 Jan 2017 16:56:01 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C748612FD; Sun, 8 Jan 2017 16:56:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v08Gtxom077208; Sun, 8 Jan 2017 16:55:59 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08GtxLT077207; Sun, 8 Jan 2017 16:55:59 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201701081655.v08GtxLT077207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 8 Jan 2017 16:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311686 - stable/11/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 16:56:01 -0000 Author: dteske Date: Sun Jan 8 16:55:59 2017 New Revision: 311686 URL: https://svnweb.freebsd.org/changeset/base/311686 Log: MFC r309716: Add support for "hidden" Wi-Fi networks PR: bin/214933 Submitted by: Maxim Filimonov Reviewed by: dteske, allanjude, adrian Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Sun Jan 8 14:49:50 2017 (r311685) +++ stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Sun Jan 8 16:55:59 2017 (r311686) @@ -207,6 +207,7 @@ fi while : do + SCANSSID=0 output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" dialog --backtitle "FreeBSD Installer" --title "Scanning" \ @@ -236,7 +237,19 @@ do break ;; 1) # Cancel - exit 1 + # here we ask if the user wants to select the network manually + f_dialog_title "Network Selection" + f_dialog_yesno "Do you want to select the network manually?" || exit 1 + # and take the manual input + # first, take the ssid + f_dialog_input NETWORK "Enter SSID" || exit 1 + # then, the encryption + ENCRYPTION=$( dialog --backtitle "$DIALOG_BACKTITLE" --title \ + "$DIALOG_TITLE" --menu "Select encryption type" 0 0 0 \ + "1 WPA/WPA2 PSK" "" "2 WPA/WPA2 EAP" "" "3 WEP" "" "0 None" "" 2>&1 1>&3 ) || exit 1 + SCANSSID=1 + f_dialog_title_restore + break ;; 3) # Rescan ;; @@ -244,7 +257,7 @@ do exec 3>&- done -ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \ +[ -z "$ENCRYPTION" ] && ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \ "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"` if echo $ENCRYPTION | grep -q 'PSK'; then @@ -258,6 +271,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the exec 3>&- echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID psk=\"$PASS\" priority=5 }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf @@ -273,6 +287,7 @@ elif echo $ENCRYPTION | grep -q EAP; the exec 3>&- echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf echo "$USERPASS" | awk ' { @@ -294,6 +309,7 @@ elif echo $ENCRYPTION | grep -q WEP; the || exec $0 $@ echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=NONE wep_key0=\"$WEPKEY\" wep_tx_keyidx=0 @@ -302,6 +318,7 @@ echo "network={ else # Open echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=NONE priority=5 }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf From owner-svn-src-all@freebsd.org Sun Jan 8 16:59:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDD28CA5F45; Sun, 8 Jan 2017 16:59:08 +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 9E7951512; Sun, 8 Jan 2017 16:59:08 +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 v08Gx7eS077382; Sun, 8 Jan 2017 16:59:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08Gx7kj077381; Sun, 8 Jan 2017 16:59:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701081659.v08Gx7kj077381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 Jan 2017 16:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311687 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 16:59:09 -0000 Author: kib Date: Sun Jan 8 16:59:07 2017 New Revision: 311687 URL: https://svnweb.freebsd.org/changeset/base/311687 Log: MFC r267546 (by alc): Tidy up the early parts of vm_map_insert(). MFC r267645 (by alc): When MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the corresponding flag(s) in the new map entry. Pass MAP_STACK_GROWS_DOWN to vm_map_insert() from vm_map_growstack() when extending the stack in the downward direction. MFC r267850 (by alc): Place the check that blocks map entry coalescing on stack entries in vm_map_simplify_entry(). MFC r267917 (by alc): Delay the call to crhold() in vm_map_insert() until we know that we won't have to undo it by calling crfree(). Eliminate an unnecessary variable from vm_map_insert(). MFC r311014: Style fixes for vm_map_insert(). Tested by: pho Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Sun Jan 8 16:55:59 2017 (r311686) +++ stable/10/sys/vm/vm_map.c Sun Jan 8 16:59:07 2017 (r311687) @@ -1130,24 +1130,24 @@ vm_map_lookup_entry( */ int vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset, - vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, - int cow) + vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, int cow) { - vm_map_entry_t new_entry; - vm_map_entry_t prev_entry; - vm_map_entry_t temp_entry; - vm_eflags_t protoeflags; + vm_map_entry_t new_entry, prev_entry, temp_entry; struct ucred *cred; + vm_eflags_t protoeflags; vm_inherit_t inheritance; - boolean_t charge_prev_obj; VM_MAP_ASSERT_LOCKED(map); + KASSERT((object != kmem_object && object != kernel_object) || + (cow & MAP_COPY_ON_WRITE) == 0, + ("vm_map_insert: kmem or kernel object and COW")); + KASSERT(object == NULL || (cow & MAP_NOFAULT) == 0, + ("vm_map_insert: paradoxical MAP_NOFAULT request")); /* * Check that the start and end points are not bogus. */ - if ((start < map->min_offset) || (end > map->max_offset) || - (start >= end)) + if (start < map->min_offset || end > map->max_offset || start >= end) return (KERN_INVALID_ADDRESS); /* @@ -1162,26 +1162,22 @@ vm_map_insert(vm_map_t map, vm_object_t /* * Assert that the next entry doesn't overlap the end point. */ - if ((prev_entry->next != &map->header) && - (prev_entry->next->start < end)) + if (prev_entry->next != &map->header && prev_entry->next->start < end) return (KERN_NO_SPACE); protoeflags = 0; - charge_prev_obj = FALSE; - if (cow & MAP_COPY_ON_WRITE) - protoeflags |= MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY; - - if (cow & MAP_NOFAULT) { + protoeflags |= MAP_ENTRY_COW | MAP_ENTRY_NEEDS_COPY; + if (cow & MAP_NOFAULT) protoeflags |= MAP_ENTRY_NOFAULT; - - KASSERT(object == NULL, - ("vm_map_insert: paradoxical MAP_NOFAULT request")); - } if (cow & MAP_DISABLE_SYNCER) protoeflags |= MAP_ENTRY_NOSYNC; if (cow & MAP_DISABLE_COREDUMP) protoeflags |= MAP_ENTRY_NOCOREDUMP; + if (cow & MAP_STACK_GROWS_DOWN) + protoeflags |= MAP_ENTRY_GROWS_DOWN; + if (cow & MAP_STACK_GROWS_UP) + protoeflags |= MAP_ENTRY_GROWS_UP; if (cow & MAP_VN_WRITECOUNT) protoeflags |= MAP_ENTRY_VN_WRITECNT; if (cow & MAP_INHERIT_SHARE) @@ -1190,23 +1186,17 @@ vm_map_insert(vm_map_t map, vm_object_t inheritance = VM_INHERIT_DEFAULT; cred = NULL; - KASSERT((object != kmem_object && object != kernel_object) || - ((object == kmem_object || object == kernel_object) && - !(protoeflags & MAP_ENTRY_NEEDS_COPY)), - ("kmem or kernel object and cow")); if (cow & (MAP_ACC_NO_CHARGE | MAP_NOFAULT)) goto charged; if ((cow & MAP_ACC_CHARGED) || ((prot & VM_PROT_WRITE) && ((protoeflags & MAP_ENTRY_NEEDS_COPY) || object == NULL))) { if (!(cow & MAP_ACC_CHARGED) && !swap_reserve(end - start)) return (KERN_RESOURCE_SHORTAGE); - KASSERT(object == NULL || (protoeflags & MAP_ENTRY_NEEDS_COPY) || + KASSERT(object == NULL || + (protoeflags & MAP_ENTRY_NEEDS_COPY) != 0 || object->cred == NULL, - ("OVERCOMMIT: vm_map_insert o %p", object)); + ("overcommit: vm_map_insert o %p", object)); cred = curthread->td_ucred; - crhold(cred); - if (object == NULL && !(protoeflags & MAP_ENTRY_NEEDS_COPY)) - charge_prev_obj = TRUE; } charged: @@ -1225,33 +1215,30 @@ charged: if (object->ref_count > 1 || object->shadow_count != 0) vm_object_clear_flag(object, OBJ_ONEMAPPING); VM_OBJECT_WUNLOCK(object); - } - else if ((prev_entry != &map->header) && - (prev_entry->eflags == protoeflags) && - (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && - (prev_entry->end == start) && - (prev_entry->wired_count == 0) && - (prev_entry->cred == cred || - (prev_entry->object.vm_object != NULL && - (prev_entry->object.vm_object->cred == cred))) && - vm_object_coalesce(prev_entry->object.vm_object, - prev_entry->offset, - (vm_size_t)(prev_entry->end - prev_entry->start), - (vm_size_t)(end - prev_entry->end), charge_prev_obj)) { + } else if (prev_entry != &map->header && + prev_entry->eflags == protoeflags && + (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && + prev_entry->end == start && prev_entry->wired_count == 0 && + (prev_entry->cred == cred || + (prev_entry->object.vm_object != NULL && + prev_entry->object.vm_object->cred == cred)) && + vm_object_coalesce(prev_entry->object.vm_object, + prev_entry->offset, + (vm_size_t)(prev_entry->end - prev_entry->start), + (vm_size_t)(end - prev_entry->end), cred != NULL && + (protoeflags & MAP_ENTRY_NEEDS_COPY) == 0)) { /* * We were able to extend the object. Determine if we * can extend the previous map entry to include the * new range as well. */ - if ((prev_entry->inheritance == inheritance) && - (prev_entry->protection == prot) && - (prev_entry->max_protection == max)) { - map->size += (end - prev_entry->end); + if (prev_entry->inheritance == inheritance && + prev_entry->protection == prot && + prev_entry->max_protection == max) { + map->size += end - prev_entry->end; prev_entry->end = end; vm_map_entry_resize_free(map, prev_entry); vm_map_simplify_entry(map, prev_entry); - if (cred != NULL) - crfree(cred); return (KERN_SUCCESS); } @@ -1263,21 +1250,16 @@ charged: */ object = prev_entry->object.vm_object; offset = prev_entry->offset + - (prev_entry->end - prev_entry->start); + (prev_entry->end - prev_entry->start); vm_object_reference(object); if (cred != NULL && object != NULL && object->cred != NULL && !(prev_entry->eflags & MAP_ENTRY_NEEDS_COPY)) { /* Object already accounts for this uid. */ - crfree(cred); cred = NULL; } } - - /* - * NOTE: if conditionals fail, object can be NULL here. This occurs - * in things like the buffer map where we manage kva but do not manage - * backing objects. - */ + if (cred != NULL) + crhold(cred); /* * Create a new entry @@ -1301,7 +1283,7 @@ charged: new_entry->next_read = OFF_TO_IDX(offset); KASSERT(cred == NULL || !ENTRY_CHARGED(new_entry), - ("OVERCOMMIT: vm_map_insert leaks vm_map %p", new_entry)); + ("overcommit: vm_map_insert leaks vm_map %p", new_entry)); new_entry->cred = cred; /* @@ -1311,17 +1293,16 @@ charged: map->size += new_entry->end - new_entry->start; /* - * It may be possible to merge the new entry with the next and/or - * previous entries. However, due to MAP_STACK_* being a hack, a - * panic can result from merging such entries. - */ - if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0) - vm_map_simplify_entry(map, new_entry); - - if (cow & (MAP_PREFAULT|MAP_PREFAULT_PARTIAL)) { - vm_map_pmap_enter(map, start, prot, - object, OFF_TO_IDX(offset), end - start, - cow & MAP_PREFAULT_PARTIAL); + * Try to coalesce the new entry with both the previous and next + * entries in the list. Previously, we only attempted to coalesce + * with the previous entry when object is NULL. Here, we handle the + * other cases, which are less common. + */ + vm_map_simplify_entry(map, new_entry); + + if ((cow & (MAP_PREFAULT | MAP_PREFAULT_PARTIAL)) != 0) { + vm_map_pmap_enter(map, start, prot, object, OFF_TO_IDX(offset), + end - start, cow & MAP_PREFAULT_PARTIAL); } return (KERN_SUCCESS); @@ -1531,7 +1512,8 @@ vm_map_simplify_entry(vm_map_t map, vm_m vm_map_entry_t next, prev; vm_size_t prevsize, esize; - if (entry->eflags & (MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) + if ((entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP | + MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) != 0) return; prev = entry->prev; @@ -3527,17 +3509,17 @@ vm_map_stack_locked(vm_map_t map, vm_off /* Now set the avail_ssize amount. */ if (rv == KERN_SUCCESS) { - if (prev_entry != &map->header) - vm_map_clip_end(map, prev_entry, bot); new_entry = prev_entry->next; if (new_entry->end != top || new_entry->start != bot) panic("Bad entry start/end for new stack entry"); new_entry->avail_ssize = max_ssize - init_ssize; - if (orient & MAP_STACK_GROWS_DOWN) - new_entry->eflags |= MAP_ENTRY_GROWS_DOWN; - if (orient & MAP_STACK_GROWS_UP) - new_entry->eflags |= MAP_ENTRY_GROWS_UP; + KASSERT((orient & MAP_STACK_GROWS_DOWN) == 0 || + (new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != 0, + ("new entry lacks MAP_ENTRY_GROWS_DOWN")); + KASSERT((orient & MAP_STACK_GROWS_UP) == 0 || + (new_entry->eflags & MAP_ENTRY_GROWS_UP) != 0, + ("new entry lacks MAP_ENTRY_GROWS_UP")); } return (rv); @@ -3764,21 +3746,21 @@ Retry: } rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start, - next_entry->protection, next_entry->max_protection, 0); + next_entry->protection, next_entry->max_protection, + MAP_STACK_GROWS_DOWN); /* Adjust the available stack space by the amount we grew. */ if (rv == KERN_SUCCESS) { - if (prev_entry != &map->header) - vm_map_clip_end(map, prev_entry, addr); new_entry = prev_entry->next; KASSERT(new_entry == stack_entry->prev, ("foo")); KASSERT(new_entry->end == stack_entry->start, ("foo")); KASSERT(new_entry->start == addr, ("foo")); + KASSERT((new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != + 0, ("new entry lacks MAP_ENTRY_GROWS_DOWN")); grow_amount = new_entry->end - new_entry->start; new_entry->avail_ssize = stack_entry->avail_ssize - grow_amount; stack_entry->eflags &= ~MAP_ENTRY_GROWS_DOWN; - new_entry->eflags |= MAP_ENTRY_GROWS_DOWN; } } else { /* From owner-svn-src-all@freebsd.org Sun Jan 8 17:56:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A35CFCA561B; Sun, 8 Jan 2017 17:56:55 +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 6AD24120A; Sun, 8 Jan 2017 17:56:55 +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 v08HusQM002360; Sun, 8 Jan 2017 17:56:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08HusdO002359; Sun, 8 Jan 2017 17:56:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701081756.v08HusdO002359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 8 Jan 2017 17:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311688 - head/sys/geom/vinum X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 17:56:55 -0000 Author: dim Date: Sun Jan 8 17:56:54 2017 New Revision: 311688 URL: https://svnweb.freebsd.org/changeset/base/311688 Log: Fix logic error in gvinum's gv_set_sd_state() With clang 4.0.0, I'm getting the following warnings: sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!flags & GV_SETSTATE_FORCE) ^ ~ The logical not operator should obiously be called after masking. Reviewed by: mav, pfg MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9093 Modified: head/sys/geom/vinum/geom_vinum_state.c Modified: head/sys/geom/vinum/geom_vinum_state.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_state.c Sun Jan 8 16:59:07 2017 (r311687) +++ head/sys/geom/vinum/geom_vinum_state.c Sun Jan 8 17:56:54 2017 (r311688) @@ -183,7 +183,7 @@ gv_set_sd_state(struct gv_sd *s, int new * Only do this if we're forced, since it usually is done * internally, and then we do use the force flag. */ - if (!flags & GV_SETSTATE_FORCE) + if (!(flags & GV_SETSTATE_FORCE)) return (GV_ERR_SETSTATE); break; From owner-svn-src-all@freebsd.org Sun Jan 8 18:03:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0792CA58E9; Sun, 8 Jan 2017 18:03:53 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D3371777; Sun, 8 Jan 2017 18:03:53 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v08I3qEU006257; Sun, 8 Jan 2017 18:03:52 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08I3qnK006256; Sun, 8 Jan 2017 18:03:52 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701081803.v08I3qnK006256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 8 Jan 2017 18:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311689 - stable/11/sbin/sysctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 18:03:53 -0000 Author: avos Date: Sun Jan 8 18:03:52 2017 New Revision: 311689 URL: https://svnweb.freebsd.org/changeset/base/311689 Log: MFC r310961: sysctl(8): fix typename for uint32_t Modified: stable/11/sbin/sysctl/sysctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/sysctl/sysctl.c ============================================================================== --- stable/11/sbin/sysctl/sysctl.c Sun Jan 8 17:56:54 2017 (r311688) +++ stable/11/sbin/sysctl/sysctl.c Sun Jan 8 18:03:52 2017 (r311689) @@ -114,7 +114,7 @@ static const char *ctl_typename[CTLTYPE+ [CTLTYPE_ULONG] = "unsigned long", [CTLTYPE_U8] = "uint8_t", [CTLTYPE_U16] = "uint16_t", - [CTLTYPE_U32] = "uint16_t", + [CTLTYPE_U32] = "uint32_t", [CTLTYPE_U64] = "uint64_t", [CTLTYPE_S8] = "int8_t", [CTLTYPE_S16] = "int16_t", From owner-svn-src-all@freebsd.org Sun Jan 8 18:14:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFE78CA5035; Sun, 8 Jan 2017 18:14:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9619A102A; Sun, 8 Jan 2017 18:14:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v08IEMZD010457; Sun, 8 Jan 2017 18:14:22 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08IEMYN010456; Sun, 8 Jan 2017 18:14:22 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201701081814.v08IEMYN010456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 8 Jan 2017 18:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311690 - stable/11/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 18:14:23 -0000 Author: dteske Date: Sun Jan 8 18:14:22 2017 New Revision: 311690 URL: https://svnweb.freebsd.org/changeset/base/311690 Log: MFC improvements to bsdinstall's wlanconfig module MFC [85] revisions 309719-309720, 309901-309902, 309904-309911, 309913-309920, 309922-309924, 309926, 309928, 309930, 309932, 309934, 309937-309942, 309944-309952, 309958-309998, and 310038 (described below) r309719: Remove unnecessary trailing backslashes r309720: Functions in their own section r309901: Comments r309902: Use $( ... ) instead of `...` r309904: Change "[ ! -z ... ]" => "[ ... ]" and "[ -z ... ]" => "[ ! ... ]" r309905: Remove unnecessary local initializers r309906: Consolidate locals r309907: Replace funny block with something easy to digest r309908: Collapse tiny if statements r309909: Change "[ ! ... ] && ..." to "[ ... ] || ..." r309910: Remove unnecessary quotes around number in test r309911: Group fallbacks together r309913: Allow $BSDINSTALL_TMPETC to contain whitespace or special chars r309914: Add missing `-e' parameter to sed invocations r309915: "echo | sed | sed | awk" is silly (changed to "echo | awk") r309916: Be internally consistent (": > ..." is used elsewhere in this file) r309917: awk(1) match() takes a regex, use /.../ to remind ourselves of this r309918: Remove unnecessary `-n' parameter to head/tail r309919: Whitespace r309920: Use provided API instead of hard-coded status integers r309922: Centralize backtitle string r309923: There is zero harm in always passing --default-item to dialog r309924: Always pass --default-item parameter to dialog r309926: Change the name of a variable from $def_item_... to $default_... r309928: Use ~ instead of match() r309930: Use ternary operator r309932: Remove an unnecessary "return $?" at end of function r309934: Consolidate redirects into here documents r309937: Whitespace (dialog options separated to minimize diffs) r309938: Use provided API (change "dialog" to "$DIALOG") r309939: Fix incorrect use of provided API r309940: Reorder dialog parameters based on commonality for readability r309941: Use provided API to centralize dialog title strings r309942: Allow the script path to contain whitespace and special characters r309944: Fix invalid parameter expansion (change $@ to "$@") r309945: 1 is the default descriptor for redirects without an fd prefix r309946: Use more succinct awk syntax r309947: Remove unnecessary semi-colons r309948: Remove incomplete and unnecessary creation of fd3 r309949: Utilize provided i18n strings r309950: Whitespace r309951: Remove an unnecessary call to f_dialog_title_restore() r309952: Move the secondary condition into the action clause r309958: Quote WLAN_IFACE (pedantic) r309959: Use oft-neglected syntax "startcondition, stopcondition { ... }" r309960: Add missing backslash r309961: Stop repeating strings (centralize prompt string) r309962: More efficiently make use of the exit status r309963: Avoid non-standard options r309964: Sort the domains r309965: Whitespace alignment r309966: Sanitize dialog output for portability/compatibility requirements r309967: Use more generic f_yesno() from provided API r309968: Properly quote variable r309969: Send stderr to the same place as stdout r309970: Remove completely unnecesary parentheses r309971: Start deconstructing a conveluted hunk of code r309972: If the first ping succeeded, why on Earth should we ping it again? r309973: Why use $? when you can use the command itself r309974: These two error messages have always been backwards since inception r309975: Continued resolution of conveluted statement r309976: You don't need parentheses for awk's printf r309977: Whitespace and alignment r309978: Neither printf nor print need parens in awk r309979: This statement has too many backslashes r309980: Just use print r309981: Add missing quotes r309982: Remove unnecessary quotes r309983: Use the provided API for calculating the appropriate size of menus r309984: Whitespace alignment r309985: Comment r309986: There's an API function for displaying errors r309987: There's an API function for displaying yes/no dialogs r309988: There's an API function for displaying pauses r309989: There's an API function for catching errors r309990: Calculate proper size of menu list dialog r309991: Simplify bringup of interface after changes and catch errors r309992: Restore previous comment r309993: Why test $? when you can test the command r309994: Wordsmithing r309995: Simplify loop by moving predicate to clause r309996: Simplify single-line if statements r309997: The flags of a WLAN need to be quoted r309998: It's completely pointless to replace newlines with space r310038: Revert r309918 -- modern POSIX has deprecated -<#>/+<#> syntax PR: bin/214933 Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Sun Jan 8 18:03:52 2017 (r311689) +++ stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Sun Jan 8 18:14:22 2017 (r311690) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2015 Devin Teske +# Copyright (c) 2013-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -32,80 +32,48 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_include $BSDCFG_SHARE/dialog.subr +f_dialog_backtitle "FreeBSD Installer" -############################################################ MAIN - -echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf -chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf - -echo "ctrl_interface=/var/run/wpa_supplicant" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "eapol_version=2" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "ap_scan=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "fast_reauth=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo >> $BSDINSTALL_TMPETC/wpa_supplicant.conf - -# Try to reach wpa_supplicant. If it isn't running and we can modify the -# existing system, start it. Otherwise, fail. -(wpa_cli ping >/dev/null 2>/dev/null || ([ ! -z $BSDINSTALL_CONFIGCURRENT ] && \ - wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) || \ - (dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ - "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 - -# See if we succeeded -wpa_cli ping >/dev/null 2>/dev/null -if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCURRENT ]; then - dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ - "Wireless cannot be configured without making changes to the local system!" \ 0 0 - exit 1 -fi +############################################################ FUNCTIONS country_set() { - local error_str= - local iface_up= - local ifconfig_args= + local error_str iface_up ifconfig_args= + # # Setup what was selected - # NB: do not change order of arguments (or regdomain will be ignored) - if [ ! -z "$2" ]; then - ifconfig_args="${ifconfig_args}country $2" - fi - if [ ! -z "$1" ]; then - if [ ! -z "$2" ]; then - ifconfig_args="${ifconfig_args} " - fi - ifconfig_args="${ifconfig_args}regdomain $1" - fi - if [ -z "$ifconfig_args" ]; then - # Nothing to do (everything was skipped) - return $SUCCESS - fi + # NB: Do not change order of arguments (or regdomain will be ignored) + # + [ "$2" ] && ifconfig_args="$ifconfig_args country $2" + [ "$1" ] && ifconfig_args="$ifconfig_args regdomain $1" + [ "$ifconfig_args" ] || return $SUCCESS # Nothing to do + ifconfig_args="${ifconfig_args# }" # Regdomain/country cannot be applied while interface is running - iface_up=`ifconfig -lu | grep -w $WLAN_IFACE` - if [ ! -z "$iface_up" ]; then - ifconfig $WLAN_IFACE down - fi - error_str=`ifconfig $WLAN_IFACE $ifconfig_args 2>&1 | \ - sed 's/ifconfig: //'` - if [ ! -z "$iface_up" ]; then - # Restart wpa_supplicant(8) (should not fail). - wpa_supplicant -B -i $WLAN_IFACE -c \ - $BSDINSTALL_TMPETC/wpa_supplicant.conf - fi - if [ ! -z "$error_str" ]; then - dialog --backtitle "FreeBSD Installer" --title "Error" \ - --yes-label Change --no-label Ignore --yesno \ - "Error while applying chosen settings ($error_str)" 0 0 - if [ $? -eq $DIALOG_OK ]; then - return $FAILURE # Restart - else - return $SUCCESS # Skip - fi + iface_up=$( ifconfig -lu | grep -w "$WLAN_IFACE" ) + [ "$iface_up" ] && ifconfig "$WLAN_IFACE" down + f_eval_catch -dk error_str wlanconfig ifconfig "ifconfig %s %s" \ + "$WLAN_IFACE" "$ifconfig_args" + error_str="${error_str#ifconfig: }" + # Restart wpa_supplicant(8) (should not fail). + [ "$iface_up" ] && f_eval_catch -d wlanconfig wpa_supplicant \ + 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ + "$WLAN_IFACE" "$BSDINSTALL_TMPETC" + if [ "$error_str" ]; then + $DIALOG \ + --title "$msg_error" \ + --backtitle "$DIALOG_BACKTITLE" \ + --yes-label Change \ + --no-label Ignore \ + --yesno \ + "Error while applying chosen settings ($error_str)" \ + 0 0 || return $SUCCESS # Skip + return $FAILURE # Restart else - : > $BSDINSTALL_TMPETC/rc.conf.net.wlan - echo create_args_$WLAN_IFACE=\"$ifconfig_args\" >> \ - $BSDINSTALL_TMPETC/rc.conf.net.wlan + awk 'sub(/^\t\t/,"")||1' \ + > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + create_args_$WLAN_IFACE="$ifconfig_args" + EOF fi return $SUCCESS @@ -113,228 +81,283 @@ country_set() dialog_country_select() { - local input= - local def_item_regdomain= - local def_item_country= - local regdomains= - local countries= - local regdomain= - local country= + local input regdomains countries regdomain country prompt + local no_default="" + local default_regdomain="${1:-$no_default}" + local default_country="${2:-$no_default}" + # # Parse available countries/regdomains - input=`ifconfig $WLAN_IFACE list countries | sed 's/DEBUG//gi'` - regdomains=`echo $input | sed 's/.*domains://' | tr ' ' '\n' | \ - sort | tr '\n' ' '` - countries=`echo $input | sed 's/Country codes://' | \ - sed 's/Regulatory.*//' | awk '{ - for (i = 1; i <= NF; i++) { - printf "%s", $i - if (match($i, "[[:lower:]]")) - if (match($(i+1), "[[:lower:]]")) - printf "\\\\\\ " - else - printf "\n" - else - printf " " + # + input=$( ifconfig "$WLAN_IFACE" list countries | sed -e 's/DEBUG//gi' ) + regdomains=$( echo "$input" | awk ' + sub(/.*domains:/, ""), /[^[:alnum:][[:space:]]/ { + n = split($0, domains) + for (i = 1; i <= n; i++) + printf "'\''%s'\'' '\'\''", domains[i] } - }' | sort -k 2 | tr '\n' ' '` - - # Change default cursor position (if required). - if [ "$1" != "" ]; then - def_item_regdomain="--default-item $1" - fi - if [ "$2" != "" ]; then - def_item_country="--default-item $2" - fi + ' | sort ) + countries=$( echo "$input" | awk ' + sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { + while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { + country = substr($0, RSTART) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + code = substr(country, 1, 2) + desc = substr(country, 4) + sub(/[[:space:]]*$/, "", desc) + printf "'\''%s'\'' '\''%s'\''\n", code, desc + $0 = substr($0, RSTART + RLENGTH) + } + } + ' | sort ) - f_dialog_menu_size height width rows \"Regdomain selection\" \ - \"FreeBSD Installer\" \"Select your regdomain.\" \ - \"\" $regdomains - regdomain=`sh -c "dialog \ - --backtitle \"FreeBSD Installer\" \ - --title \"Regdomain selection\" \ - --cancel-label \"Skip\" \ - $def_item_regdomain \ - --no-items \ - --stdout \ - --menu \"Select your regdomain.\" \ - $height $width $rows $regdomains"` - - f_dialog_menu_size height width rows \"Country selection\" \ - \"FreeBSD Installer\" \"Select your country.\" \ - \"\" $countries - country=`sh -c "dialog \ - --backtitle \"FreeBSD Installer\" \ - --title \"Country selection\" \ - --cancel-label \"Skip\" \ - $def_item_country \ - --stdout \ - --menu \"Select your country.\" \ - $height $width $rows $countries"` + f_dialog_title "Regdomain selection" + prompt="Select your regdomain." + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \"\" $regdomains + regdomain=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --cancel-label \"\$msg_skip\" \ + --default-item \"\$default_regdomain\" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $regdomains \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + f_dialog_data_sanitize regdomain + + f_dialog_title "Country selection" + prompt="Select your country." + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \"\" $countries + country=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --cancel-label \"\$msg_skip\" \ + --default-item \"\$default_country\" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $countries \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + f_dialog_data_sanitize country country_set "$regdomain" "$country" - - return $? } +############################################################ MAIN + +: > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" +chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" + +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +ctrl_interface=/var/run/wpa_supplicant +eapol_version=2 +ap_scan=1 +fast_reauth=1 + +EOF + +# +# Try to reach wpa_supplicant. If it isn't running and we can modify the +# existing system, start it. Otherwise, fail. +# +if ! f_eval_catch -d wlanconfig wpa_cli "wpa_cli ping"; then + if [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then + f_show_err "Wireless cannot be configured without %s" \ + "making changes to the local system!" + exit 1 + fi + f_eval_catch wlanconfig wpa_supplicant \ + 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ + "$1" "$BSDINSTALL_TMPETC" || exit 1 + + # See if we succeeded + f_eval_catch wlanconfig wpa_cli "wpa_cli ping" || exit 1 +fi + +# # There is no way to check country/regdomain without (possible) # interface state modification -if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then +# +if [ "$BSDINSTALL_CONFIGCURRENT" ]; then # Get current country/regdomain for selected interface - WLAN_IFACE=`wpa_cli ifname | tail -n 1` - INPUT=`ifconfig $WLAN_IFACE list regdomain | head -n 1` - DEF_REGDOMAIN=`echo $INPUT | cut -w -f 2` - if [ "$DEF_REGDOMAIN" = "0" ]; then - DEF_REGDOMAIN="" - fi - DEF_COUNTRY=`echo $INPUT | cut -w -f 4` - if [ "$DEF_COUNTRY" = "0" ]; then - DEF_COUNTRY="" - fi - dialog --backtitle "FreeBSD Installer" --title "Regdomain/country" \ - --yesno "Change regdomain/country (now \ - $DEF_REGDOMAIN/$DEF_COUNTRY)?" 0 0 - if [ $? -eq 0 ]; then - while : - do - dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY" - if [ $? -eq $SUCCESS ]; then - break - fi - done + WLAN_IFACE=$( wpa_cli ifname | tail -n 1 ) + INPUT=$( ifconfig "$WLAN_IFACE" list regdomain | head -n 1 ) + DEF_REGDOMAIN=$( echo "$INPUT" | cut -w -f 2 ) + DEF_COUNTRY=$( echo "$INPUT" | cut -w -f 4 ) + [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" + [ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="" + f_dialog_title "Regdomain/country" + if f_yesno "Change regdomain/country ($DEF_REGDOMAIN/$DEF_COUNTRY)?" + then + while ! dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY" + do :; done fi fi -while : -do +while :; do SCANSSID=0 - output=$( wpa_cli scan 2>&1 ) - f_dprintf "%s" "$output" - dialog --backtitle "FreeBSD Installer" --title "Scanning" \ - --ok-label "Skip" \ - --pause "Waiting 5 seconds to scan for wireless networks..." \ - 9 40 5 || exit 1 - - SCAN_RESULTS=`wpa_cli scan_results` - NETWORKS=`echo "$SCAN_RESULTS" | awk -F '\t' \ - '/..:..:..:..:..:../ {if (length($5) > 0) \ - printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq` - - if [ -z "$NETWORKS" ]; then - dialog --backtitle "FreeBSD Installer" --title "Error" \ - --yesno "No wireless networks were found. Rescan?" 0 0 && \ - continue + f_eval_catch -d wlanconfig wpa_cli "wpa_cli scan" + f_dialog_title "Scanning" + f_dialog_pause "Waiting 5 seconds to scan for wireless networks..." 5 || + exit 1 + + f_eval_catch -dk SCAN_RESULTS wlanconfig wpa_cli "wpa_cli scan_results" + NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' ' + /..:..:..:..:..:../ && $5 { printf "\"%s\"\t\"%s\"\n", $5, $4 } + ' | sort | uniq ) + + if [ ! "$NETWORKS" ]; then + f_dialog_title "$msg_error" + f_yesno "No wireless networks were found. Rescan?" && continue exit 1 fi - exec 3>&1 - NETWORK=`sh -c "dialog --extra-button --extra-label \"Rescan\" \ - --backtitle \"FreeBSD Installer\" --title \"Network Selection\" \ - --menu \"Select a wireless network to connect to.\" 0 0 0 \ - $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3` - case $? in - 0) # OK - break - ;; - 1) # Cancel - # here we ask if the user wants to select the network manually + f_dialog_title "Network Selection" + prompt="Select a wireless network to connect to." + f_dialog_menu_size height width rows "$DIALOG_TITLE" \ + "$DIALOG_BACKTITLE" "$prompt" "" $menu_list + NETWORK=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --extra-button \ + --extra-label \"Rescan\" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $NETWORKS \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + retval=$? + f_dialog_data_sanitize NETWORK + case $retval in + $DIALOG_OK) break ;; + $DIALOG_CANCEL) + # Ask if the user wants to select network manually f_dialog_title "Network Selection" - f_dialog_yesno "Do you want to select the network manually?" || exit 1 - # and take the manual input - # first, take the ssid + f_yesno "Do you want to select the network manually?" || exit 1 f_dialog_input NETWORK "Enter SSID" || exit 1 - # then, the encryption - ENCRYPTION=$( dialog --backtitle "$DIALOG_BACKTITLE" --title \ - "$DIALOG_TITLE" --menu "Select encryption type" 0 0 0 \ - "1 WPA/WPA2 PSK" "" "2 WPA/WPA2 EAP" "" "3 WEP" "" "0 None" "" 2>&1 1>&3 ) || exit 1 + prompt="Select encryption type" + menu_list=" + '1 WPA/WPA2 PSK' '' + '2 WPA/WPA2 EAP' '' + '3 WEP' '' + '0 None' '' + " # END-QUOTE + eval f_dialog_menu_size height width rows \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \"\$prompt\" \"\" $menu_list + ENCRYPTION=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $menu_list \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) || exit 1 SCANSSID=1 - f_dialog_title_restore break ;; - 3) # Rescan + $DIALOG_EXTRA) # Rescan ;; esac - exec 3>&- done -[ -z "$ENCRYPTION" ] && ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \ - "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"` +[ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" | + awk -F '\t' "/^\"$NETWORK\"\t/ { print \$2 }" ) -if echo $ENCRYPTION | grep -q 'PSK'; then - exec 3>&1 - PASS=`dialog --insecure --backtitle "FreeBSD Installer" \ - --title "WPA Setup" --mixedform "" 0 0 0 \ +if echo "$ENCRYPTION" | grep -q PSK; then + PASS=$( $DIALOG \ + --title "WPA Setup" \ + --backtitle "$DIALOG_BACKTITLE" \ + --insecure \ + --mixedform "" \ + 0 0 0 \ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ - "Password" 2 0 "" 2 12 15 63 1 \ - 2>&1 1>&3` \ - || exec $0 $@ - exec 3>&- -echo "network={ - ssid=\"$NETWORK\" - scan_ssid=$SCANSSID - psk=\"$PASS\" - priority=5 -}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -elif echo $ENCRYPTION | grep -q EAP; then - exec 3>&1 - USERPASS=`dialog --insecure --backtitle "FreeBSD Installer" \ - --title "WPA-Enterprise Setup" --mixedform "" 0 0 0 \ + "Password" 2 0 "" 2 12 15 63 1 \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) || exec "$0" "$@" + awk 'sub(/^\t/,"")||1' \ + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + ssid="$NETWORK" + scan_ssid=$SCANSSID + psk="$PASS" + priority=5 + } + EOF +elif echo "$ENCRYPTION" | grep -q EAP; then + USERPASS=$( $DIALOG \ + --title "WPA-Enterprise Setup" \ + --backtitle "$DIALOG_BACKTITLE" \ + --insecure \ + --mixedform "" \ + 0 0 0 \ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ - "Username" 2 0 "" 2 12 25 63 0 \ - "Password" 3 0 "" 3 12 25 63 1 \ - 2>&1 1>&3` \ - || exec $0 $@ - exec 3>&- -echo "network={ - ssid=\"$NETWORK\" - scan_ssid=$SCANSSID - key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "$USERPASS" | awk ' -{ - if (NR == 1) { - printf " identity=\"%s\"\n", $1; - } else if (NR == 2) { - printf " password=\"%s\"\n", $1; + "Username" 2 0 "" 2 12 25 63 0 \ + "Password" 3 0 "" 3 12 25 63 1 \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) || exec "$0" "$@" + awk 'sub(/^\t/,"")||1' \ + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + ssid="$NETWORK" + scan_ssid=$SCANSSID + key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\t\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\t\tpassword=\"%s\"", $1 } + ' ) + priority=5 } -}' >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo " priority=5 -}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -elif echo $ENCRYPTION | grep -q WEP; then - exec 3>&1 - WEPKEY=`dialog --insecure --backtitle "FreeBSD Installer" \ - --title "WEP Setup" --mixedform "" 0 0 0 \ + EOF +elif echo "$ENCRYPTION" | grep -q WEP; then + WEPKEY=$( $DIALOG \ + --title "WEP Setup" \ + --backtitle "$DIALOG_BACKTITLE" \ + --insecure \ + --mixedform "" \ + 0 0 0 \ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ - "WEP Key 0" 2 0 "" 2 12 15 0 1 \ - 2>&1 1>&3` \ - || exec $0 $@ -echo "network={ - ssid=\"$NETWORK\" - scan_ssid=$SCANSSID - key_mgmt=NONE - wep_key0=\"$WEPKEY\" - wep_tx_keyidx=0 - priority=5 -}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -else # Open -echo "network={ - ssid=\"$NETWORK\" - scan_ssid=$SCANSSID - key_mgmt=NONE - priority=5 -}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf + "WEP Key 0" 2 0 "" 2 12 15 0 1 \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) || exec "$0" "$@" + awk 'sub(/^\t/,"")||1' \ + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + ssid="$NETWORK" + scan_ssid=$SCANSSID + key_mgmt=NONE + wep_key0="$WEPKEY" + wep_tx_keyidx=0 + priority=5 + } + EOF +else # Open + awk 'sub(/^\t/,"")||1' \ + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + ssid="$NETWORK" + scan_ssid=$SCANSSID + key_mgmt=NONE + priority=5 + } + EOF fi # Connect to any open networks policy -echo "network={ +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +network={ priority=0 key_mgmt=NONE -}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +} +EOF # Bring up new network -if [ "$BSDINSTALL_CONFIGCURRENT" ]; then - output=$( wpa_cli reconfigure 2>&1 ) - f_dprintf "%s" "$output" -fi +[ "$BSDINSTALL_CONFIGCURRENT" ] && + f_eval_catch -d wlanconfig wpa_cli "wpa_cli reconfigure" exit $SUCCESS From owner-svn-src-all@freebsd.org Sun Jan 8 18:28:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02BD9CA53B9; Sun, 8 Jan 2017 18:28:08 +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 BCEDB1B37; Sun, 8 Jan 2017 18:28:07 +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 v08IS61Z014845; Sun, 8 Jan 2017 18:28:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08IS6YR014844; Sun, 8 Jan 2017 18:28:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701081828.v08IS6YR014844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Jan 2017 18:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311693 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 18:28:08 -0000 Author: ian Date: Sun Jan 8 18:28:06 2017 New Revision: 311693 URL: https://svnweb.freebsd.org/changeset/base/311693 Log: Now that the PRESENT_STATE register is only used for the inhibit bits loop in this function, eliminate the state variable and restructure the loop to read the register just once at the top of the loop. Suggested by: skra Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Jan 8 18:17:35 2017 (r311692) +++ head/sys/dev/sdhci/sdhci.c Sun Jan 8 18:28:06 2017 (r311693) @@ -821,7 +821,7 @@ static void sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) { int flags, timeout; - uint32_t mask, state; + uint32_t mask; slot->curcmd = cmd; slot->cmd_done = 0; @@ -836,8 +836,6 @@ sdhci_start_command(struct sdhci_slot *s return; } - /* Read controller present state. */ - state = RD4(slot, SDHCI_PRESENT_STATE); /* Do not issue command if there is no card, clock or power. * Controller will not detect timeout without clock active. */ if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot) || @@ -866,7 +864,7 @@ sdhci_start_command(struct sdhci_slot *s * (It's usually more like 20-30ms in the real world.) */ timeout = 250; - while (state & mask) { + while (mask & RD4(slot, SDHCI_PRESENT_STATE)) { if (timeout == 0) { slot_printf(slot, "Controller never released " "inhibit bit(s).\n"); @@ -877,7 +875,6 @@ sdhci_start_command(struct sdhci_slot *s } timeout--; DELAY(1000); - state = RD4(slot, SDHCI_PRESENT_STATE); } /* Prepare command flags. */ From owner-svn-src-all@freebsd.org Sun Jan 8 18:33:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D84EDCA56C7; Sun, 8 Jan 2017 18:33:14 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A759D1006; Sun, 8 Jan 2017 18:33:14 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v08IXDFL018711; Sun, 8 Jan 2017 18:33:13 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08IXDAU018710; Sun, 8 Jan 2017 18:33:13 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701081833.v08IXDAU018710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 8 Jan 2017 18:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311694 - stable/11/sys/dev/usb/wlan X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 18:33:15 -0000 Author: avos Date: Sun Jan 8 18:33:13 2017 New Revision: 311694 URL: https://svnweb.freebsd.org/changeset/base/311694 Log: MFC r311105: rsu: restore 40Mhz channel support. Modified: stable/11/sys/dev/usb/wlan/if_rsu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/11/sys/dev/usb/wlan/if_rsu.c Sun Jan 8 18:28:06 2017 (r311693) +++ stable/11/sys/dev/usb/wlan/if_rsu.c Sun Jan 8 18:33:13 2017 (r311694) @@ -712,7 +712,8 @@ rsu_getradiocaps(struct ieee80211com *ic if (sc->sc_ht) setbit(bands, IEEE80211_MODE_11NG); ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rsu_chan_2ghz, nitems(rsu_chan_2ghz), bands, 0); + rsu_chan_2ghz, nitems(rsu_chan_2ghz), bands, + (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) != 0); } static void From owner-svn-src-all@freebsd.org Sun Jan 8 18:46:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A1ACCA59A7; Sun, 8 Jan 2017 18:46:02 +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 D54D815EA; Sun, 8 Jan 2017 18:46:01 +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 v08Ik10j022730; Sun, 8 Jan 2017 18:46:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08Ik1Ff022729; Sun, 8 Jan 2017 18:46:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701081846.v08Ik1Ff022729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Jan 2017 18:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311695 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 18:46:02 -0000 Author: markj Date: Sun Jan 8 18:46:00 2017 New Revision: 311695 URL: https://svnweb.freebsd.org/changeset/base/311695 Log: Release the ND6 list lock before making a prefix off-link in nd6_timer(). Reported by: Jim X-MFC With: r306829 Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Jan 8 18:33:13 2017 (r311694) +++ head/sys/netinet6/nd6.c Sun Jan 8 18:46:00 2017 (r311695) @@ -910,7 +910,7 @@ nd6_timer(void *arg) struct nd_defrouter *dr, *ndr; struct nd_prefix *pr, *npr; struct in6_ifaddr *ia6, *nia6; - bool onlink_locked; + uint64_t genid; TAILQ_INIT(&drq); LIST_INIT(&prl); @@ -1022,7 +1022,6 @@ nd6_timer(void *arg) } ND6_WLOCK(); - onlink_locked = false; restart: LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, npr) { /* @@ -1045,22 +1044,19 @@ restart: continue; } if ((pr->ndpr_stateflags & NDPRF_ONLINK) != 0) { - if (!onlink_locked) { - onlink_locked = ND6_ONLINK_TRYLOCK(); - if (!onlink_locked) { - ND6_WUNLOCK(); - ND6_ONLINK_LOCK(); - onlink_locked = true; - ND6_WLOCK(); - goto restart; - } - } + genid = V_nd6_list_genid; + nd6_prefix_ref(pr); + ND6_WUNLOCK(); + ND6_ONLINK_LOCK(); (void)nd6_prefix_offlink(pr); + ND6_ONLINK_UNLOCK(); + ND6_WLOCK(); + nd6_prefix_rele(pr); + if (genid != V_nd6_list_genid) + goto restart; } } ND6_WUNLOCK(); - if (onlink_locked) - ND6_ONLINK_UNLOCK(); while ((pr = LIST_FIRST(&prl)) != NULL) { LIST_REMOVE(pr, ndpr_entry); From owner-svn-src-all@freebsd.org Sun Jan 8 20:29:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 247E2CA66C7; Sun, 8 Jan 2017 20:29:37 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF4041F08; Sun, 8 Jan 2017 20:29:36 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v08KTaeM062823; Sun, 8 Jan 2017 20:29:36 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08KTaIK062822; Sun, 8 Jan 2017 20:29:36 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201701082029.v08KTaIK062822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sun, 8 Jan 2017 20:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311699 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 20:29:37 -0000 Author: grehan Date: Sun Jan 8 20:29:35 2017 New Revision: 311699 URL: https://svnweb.freebsd.org/changeset/base/311699 Log: Make sure the 'Always-one' bit is always set to one, in the first byte of the 3-byte mouse data report. Plan9/9front requires this. Switch over to using #defines for the data report bits. Verified no regression on Win10/Fedora-live. Reported and tested by: Trent Thompson (trentnthompson at gmail com) MFC after: 1 week Modified: head/usr.sbin/bhyve/ps2mouse.c Modified: head/usr.sbin/bhyve/ps2mouse.c ============================================================================== --- head/usr.sbin/bhyve/ps2mouse.c Sun Jan 8 19:48:13 2017 (r311698) +++ head/usr.sbin/bhyve/ps2mouse.c Sun Jan 8 20:29:35 2017 (r311699) @@ -62,6 +62,16 @@ __FBSDID("$FreeBSD$"); /* mouse device id */ #define PS2MOUSE_DEV_ID 0x0 +/* mouse data bits */ +#define PS2M_DATA_Y_OFLOW 0x80 +#define PS2M_DATA_X_OFLOW 0x40 +#define PS2M_DATA_Y_SIGN 0x20 +#define PS2M_DATA_X_SIGN 0x10 +#define PS2M_DATA_AONE 0x08 +#define PS2M_DATA_MID_BUTTON 0x04 +#define PS2M_DATA_RIGHT_BUTTON 0x02 +#define PS2M_DATA_LEFT_BUTTON 0x01 + /* mouse status bits */ #define PS2M_STS_REMOTE_MODE 0x40 #define PS2M_STS_ENABLE_DEV 0x20 @@ -169,19 +179,20 @@ movement_get(struct ps2mouse_softc *sc) assert(pthread_mutex_isowned_np(&sc->mtx)); - val0 = sc->status & (PS2M_STS_LEFT_BUTTON | - PS2M_STS_RIGHT_BUTTON | PS2M_STS_MID_BUTTON); + val0 = PS2M_DATA_AONE; + val0 |= sc->status & (PS2M_DATA_LEFT_BUTTON | + PS2M_DATA_RIGHT_BUTTON | PS2M_DATA_MID_BUTTON); if (sc->delta_x >= 0) { if (sc->delta_x > 255) { - val0 |= (1 << 6); + val0 |= PS2M_DATA_X_OFLOW; val1 = 255; } else val1 = sc->delta_x; } else { - val0 |= (1 << 4); + val0 |= PS2M_DATA_X_SIGN; if (sc->delta_x < -255) { - val0 |= (1 << 6); + val0 |= PS2M_DATA_X_OFLOW; val1 = 255; } else val1 = sc->delta_x; @@ -190,14 +201,14 @@ movement_get(struct ps2mouse_softc *sc) if (sc->delta_y >= 0) { if (sc->delta_y > 255) { - val0 |= (1 << 7); + val0 |= PS2M_DATA_Y_OFLOW; val2 = 255; } else val2 = sc->delta_y; } else { - val0 |= (1 << 5); + val0 |= PS2M_DATA_Y_SIGN; if (sc->delta_y < -255) { - val0 |= (1 << 7); + val0 |= PS2M_DATA_Y_OFLOW; val2 = 255; } else val2 = sc->delta_y; From owner-svn-src-all@freebsd.org Sun Jan 8 20:37:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96C43CA5476; Sun, 8 Jan 2017 20:37:42 +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 68A9116EB; Sun, 8 Jan 2017 20:37:42 +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 v08KbfKc067131; Sun, 8 Jan 2017 20:37:41 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08Kbf01067130; Sun, 8 Jan 2017 20:37:41 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701082037.v08Kbf01067130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 8 Jan 2017 20:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311700 - head/sys/dev/etherswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 20:37:42 -0000 Author: loos Date: Sun Jan 8 20:37:41 2017 New Revision: 311700 URL: https://svnweb.freebsd.org/changeset/base/311700 Log: Convert etherswitch to use the make_dev_s(9) KPI. This fix a possible race where si_drv1 can be accessed before it gets set. MFC after: 3 days Suggested by: kib Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/etherswitch.c Modified: head/sys/dev/etherswitch/etherswitch.c ============================================================================== --- head/sys/dev/etherswitch/etherswitch.c Sun Jan 8 20:29:35 2017 (r311699) +++ head/sys/dev/etherswitch/etherswitch.c Sun Jan 8 20:37:41 2017 (r311700) @@ -99,17 +99,24 @@ etherswitch_probe(device_t dev) static int etherswitch_attach(device_t dev) { - struct etherswitch_softc *sc = (struct etherswitch_softc *)device_get_softc(dev); + int err; + struct etherswitch_softc *sc; + struct make_dev_args devargs; + sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_devnode = make_dev(ðerswitch_cdevsw, device_get_unit(dev), - UID_ROOT, GID_WHEEL, - 0600, "etherswitch%d", device_get_unit(dev)); - if (sc->sc_devnode == NULL) { + make_dev_args_init(&devargs); + devargs.mda_devsw = ðerswitch_cdevsw; + devargs.mda_uid = UID_ROOT; + devargs.mda_gid = GID_WHEEL; + devargs.mda_mode = 0600; + devargs.mda_si_drv1 = sc; + err = make_dev_s(&devargs, &sc->sc_devnode, "etherswitch%d", + device_get_unit(dev)); + if (err != 0) { device_printf(dev, "failed to create character device\n"); return (ENXIO); } - sc->sc_devnode->si_drv1 = sc; return (0); } From owner-svn-src-all@freebsd.org Sun Jan 8 20:41:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B2C1CA56CD; Sun, 8 Jan 2017 20:41:33 +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 53EE719B6; Sun, 8 Jan 2017 20:41:33 +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 v08KfWKa069020; Sun, 8 Jan 2017 20:41:32 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08KfW1J069019; Sun, 8 Jan 2017 20:41:32 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701082041.v08KfW1J069019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 8 Jan 2017 20:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311701 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 20:41:33 -0000 Author: loos Date: Sun Jan 8 20:41:32 2017 New Revision: 311701 URL: https://svnweb.freebsd.org/changeset/base/311701 Log: Convert gpioc to use the make_dev_s(9) KPI. This fix a possible race where si_drv1 can be accessed before it gets set. This is inspired on r311700. MFC after: 3 days Modified: head/sys/dev/gpio/gpioc.c Modified: head/sys/dev/gpio/gpioc.c ============================================================================== --- head/sys/dev/gpio/gpioc.c Sun Jan 8 20:37:41 2017 (r311700) +++ head/sys/dev/gpio/gpioc.c Sun Jan 8 20:41:32 2017 (r311701) @@ -78,18 +78,25 @@ gpioc_probe(device_t dev) static int gpioc_attach(device_t dev) { - struct gpioc_softc *sc = device_get_softc(dev); + int err; + struct gpioc_softc *sc; + struct make_dev_args devargs; + sc = device_get_softc(dev); sc->sc_dev = dev; sc->sc_pdev = device_get_parent(dev); sc->sc_unit = device_get_unit(dev); - sc->sc_ctl_dev = make_dev(&gpioc_cdevsw, sc->sc_unit, - UID_ROOT, GID_WHEEL, 0600, "gpioc%d", sc->sc_unit); - if (!sc->sc_ctl_dev) { + make_dev_args_init(&devargs); + devargs.mda_devsw = &gpioc_cdevsw; + devargs.mda_uid = UID_ROOT; + devargs.mda_gid = GID_WHEEL; + devargs.mda_mode = 0600; + devargs.mda_si_drv1 = sc; + err = make_dev_s(&devargs, &sc->sc_ctl_dev, "gpioc%d", sc->sc_unit); + if (err != 0) { printf("Failed to create gpioc%d", sc->sc_unit); return (ENXIO); } - sc->sc_ctl_dev->si_drv1 = sc; return (0); } From owner-svn-src-all@freebsd.org Sun Jan 8 20:49:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96758CA5E99; Sun, 8 Jan 2017 20:49:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (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 65F1D1CB0; Sun, 8 Jan 2017 20:49:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg0-x244.google.com with SMTP id 204so2852032pge.2; Sun, 08 Jan 2017 12:49:41 -0800 (PST) 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=8SwQ1oodX8tdfSxvmS1v6ikbbRXyf00Y9UWMNDtkcUo=; b=udUN1qs9bpW2SXBDDNzq2wA/CMo0WYNLaslg7ymLKlgy1Q2io4+JCXOCAsFUxFyAAb Wf+iXlZacc+2NTIVsprYs2ALT2NHo10zW84PCtJLqDz3JQp+B4FH5FDieqVQ+PITB3hu PPYMsc9QDox7QEJw2CeuTejZH2N1ss5be8BmUxFRdwiJpTlOMT9OvSWi8vTbeZ6i6ULG BR8oIo3jNsOpMJbLLjwYBxnwOx3jXTvlna91E5SEFkmbt2HdLPAycjsbzElNVEpInrly wgQBpkgIEbfuUcLsgo0PE9nUEwqL/ajWix154ygMuPttw30EmmxHO9DX1QskrMAUmnWd xySA== 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=8SwQ1oodX8tdfSxvmS1v6ikbbRXyf00Y9UWMNDtkcUo=; b=XcbDZJttVhyCDzbb1axI3HuefPoc92DaNQnMimlxGlb2G85qfEuiNMBrqglyCeWjxG nNiuJwbStdFLJF5sdDeBPX8FLfVlernLZ9xSXxBH4MtkPbQyd3e0iyhj5MVXF/w+kCIK KUBdQrA0eqBRa+zU9XTYX/KpziBpWnxmKfopdYNm7BtDKGziw6NelYBLzgnpDdgbDFQQ jShgb11U3KKO8rk1+KoaFQqlU+NOrsGa0rAAkYOwJn6vdkK5cHbloZp2aerzZWD7NlVH hNPVEeU8EXJ32bAfux6t9/2Qb4MoOgVWeuzmNM4nR9/U1oCwALjNuM5dzKDr7T1UqEgR W9Rg== X-Gm-Message-State: AIkVDXJrftsikEQNHjmlIbiRxwpK9qo7K2mlzaAbKL0WcMyWKZJPFY6iFy0BU50hHMos7w== X-Received: by 10.84.195.1 with SMTP id i1mr186516356pld.84.1483908580798; Sun, 08 Jan 2017 12:49:40 -0800 (PST) Received: from raichu ([2604:4080:1102:0:ca60:ff:fe9d:3963]) by smtp.gmail.com with ESMTPSA id q145sm173280216pfq.22.2017.01.08.12.49.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jan 2017 12:49:40 -0800 (PST) Sender: Mark Johnston Date: Sun, 8 Jan 2017 12:49:38 -0800 From: Mark Johnston To: George Neville-Neil Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311225 - head/sys/netinet Message-ID: <20170108204938.GC34440@raichu> References: <201701040219.v042JDEk026544@repo.freebsd.org> <20170104182630.GA26522@wkstn-mjohnston.west.isilon.com> <4C01D080-64D9-4862-AFD5-42CC49B5CC0B@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 20:49:41 -0000 On Sat, Jan 07, 2017 at 02:31:28PM -0500, George Neville-Neil wrote: > > > On 7 Jan 2017, at 14:23, George Neville-Neil wrote: > > > On 4 Jan 2017, at 13:26, Mark Johnston wrote: > > > >> On Wed, Jan 04, 2017 at 02:19:13AM +0000, George V. Neville-Neil > >> wrote: > >>> Author: gnn > >>> Date: Wed Jan 4 02:19:13 2017 > >>> New Revision: 311225 > >>> URL: https://svnweb.freebsd.org/changeset/base/311225 > >>> > >>> Log: > >>> Fix DTrace TCP tracepoints to not use mtod() as it is both > >>> unnecessary and > >>> dangerous. Those wanting data from an mbuf should use DTrace > >>> itself to get > >>> the data. > >> > >> I think you also need to update the types in in_kdtrace.c, and add a > >> translator for struct mbuf * to ipinfo_t. > > > > Fair points. > > > > Actually, following up to myself, this does not need to be done just > yet. The pkt_info stuff is currently always NULL. I'm working on a > copyoutmbuf() subroutine that will make all of this much cleaner. The pkt_info stuff is unrelated to this - ipinfo_t is the third argument to the tcp probes. The translator which expects a pointer to the IP header is now getting a pointer to an mbuf, so this change effectively breaks scripts that use args[2] in a tcp:::send or tcp:::receive probe (among others). From owner-svn-src-all@freebsd.org Sun Jan 8 20:58:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFCEDCA641A; Sun, 8 Jan 2017 20:58:59 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C98E12E4; Sun, 8 Jan 2017 20:58:59 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v08KwwDR077475; Sun, 8 Jan 2017 20:58:58 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08KwwtR077474; Sun, 8 Jan 2017 20:58:58 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201701082058.v08KwwtR077474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sun, 8 Jan 2017 20:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311702 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 20:58:59 -0000 Author: grehan Date: Sun Jan 8 20:58:58 2017 New Revision: 311702 URL: https://svnweb.freebsd.org/changeset/base/311702 Log: Use correct PCI device id for virtio-rng. This prevented the device from attaching with a Windows guest (most other guests use the device type for matching) PR: 212711 Submitted by: jbeich MFC after: 3 days Modified: head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Sun Jan 8 20:41:32 2017 (r311701) +++ head/usr.sbin/bhyve/virtio.h Sun Jan 8 20:58:58 2017 (r311702) @@ -209,8 +209,8 @@ struct vring_used { #define VIRTIO_VENDOR 0x1AF4 #define VIRTIO_DEV_NET 0x1000 #define VIRTIO_DEV_BLOCK 0x1001 -#define VIRTIO_DEV_RANDOM 0x1002 #define VIRTIO_DEV_CONSOLE 0x1003 +#define VIRTIO_DEV_RANDOM 0x1005 /* * PCI config space constants. From owner-svn-src-all@freebsd.org Sun Jan 8 21:12:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE088CA5107; Sun, 8 Jan 2017 21:12:47 +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 7D59112B9; Sun, 8 Jan 2017 21:12:47 +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 v08LCk2s085402; Sun, 8 Jan 2017 21:12:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08LCk0D085401; Sun, 8 Jan 2017 21:12:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201701082112.v08LCk0D085401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 8 Jan 2017 21:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311703 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 21:12:47 -0000 Author: jhibbits Date: Sun Jan 8 21:12:46 2017 New Revision: 311703 URL: https://svnweb.freebsd.org/changeset/base/311703 Log: Knock a page off VM_MAX_KERNEL_ADDRESS There are places where checks are made against VM_MAX_KERNEL_ADDRESS, or virtual_end (set to VM_MAX_KERNEL_ADDRESS). With 32-bit checks, an address will always be less than or equal to 0xffffffff. Drop a page, so those checks can terminate loops safely. Modified: head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Sun Jan 8 20:58:58 2017 (r311702) +++ head/sys/powerpc/include/vmparam.h Sun Jan 8 21:12:46 2017 (r311703) @@ -111,7 +111,7 @@ #define KERNBASE 0xc0000000 /* start of kernel virtual */ #define VM_MIN_KERNEL_ADDRESS KERNBASE -#define VM_MAX_KERNEL_ADDRESS 0xffffffff +#define VM_MAX_KERNEL_ADDRESS 0xffffefff #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif /* AIM/E500 */ From owner-svn-src-all@freebsd.org Sun Jan 8 21:53:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6B89CA6078; Sun, 8 Jan 2017 21:53:42 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: from mail-yw0-x235.google.com (mail-yw0-x235.google.com [IPv6:2607:f8b0:4002:c05::235]) (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 94DCB1684; Sun, 8 Jan 2017 21:53:42 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: by mail-yw0-x235.google.com with SMTP id v81so309934608ywb.2; Sun, 08 Jan 2017 13:53:42 -0800 (PST) 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=45b2oIibiVWdoF//mxa7ib7C/d2fRyp6aKv8Kg6PY2Y=; b=tme82WyYRi6EDIr/kLbTaWQDbFHXivypEevg53iL6ATW2ttJjqExsPbMKHzDkOt8gi kO3Hh9AwO0hmS+jtCY0qUJGYlsnyhQSxxPJ6gwFycfu5/FnMrQwJ6BI7NKZ0a1sui3AB LKlrsJIjnLoFAerk/8HI/tDIS3X+KXjUNIXiRf+E2yRJzPhSC8taQOMePTAnA7yxMSlt iGiJtzCheH5NzXgvQTgf/o8g0U/tvhziH+N7kWZ+szplJTBWUk1znIeaV7kBJm7iQzD9 XlYDxpBAOOdOpCZqDd1rh0wZ1VTKErhziTUd/vQ28lBMMLHrIvk4z0XyTcncYdbbAuro lHRQ== 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=45b2oIibiVWdoF//mxa7ib7C/d2fRyp6aKv8Kg6PY2Y=; b=aV9cePwLlLY0AFiJye9Mi7rUoip3uec2DPMbyA7Wzet1zRxE2ZkeOTdUlhjpdbH7cg Xz4wHhwoGbOvt5hCPBxDernPdFyUbL2SdNyIV/le1v/fS23ZzzqmNwHzC6kQXK4s2+Vn iyH0DRQlJLImh6UsF+HcpMHk9CBZjZk7Vxjs/N6VJH9p8rs/qjLmZbLIQWiar8rKk2/E B3Jyq7cGKsBpX6U+n5VhWLdcrQBYSYY6LZO8KRtbDXPvwHqDJR71xGJw5np9vJ0RmCp3 XZj34zbTP8gMj6XVUdvIpPTw8Dy3cQ75dSJrXEBIAFX1QSJ85+tuJWs5FJUTOEAFllpG yc8w== X-Gm-Message-State: AIkVDXL6m8DP/kI68e+zWS+icMUPxpwX2yQIScx5ThISNM1DPwgicxioL5ae4aod4NF3G0psnXBeFK64YAFVtQ== X-Received: by 10.129.131.86 with SMTP id t83mr81516739ywf.142.1483912421551; Sun, 08 Jan 2017 13:53:41 -0800 (PST) MIME-Version: 1.0 Sender: kczekirda@gmail.com Received: by 10.37.199.199 with HTTP; Sun, 8 Jan 2017 13:53:11 -0800 (PST) In-Reply-To: <201701072342.v07NgHrk059834@repo.freebsd.org> References: <201701072342.v07NgHrk059834@repo.freebsd.org> From: Kamil Czekirda Date: Sun, 8 Jan 2017 22:53:11 +0100 X-Google-Sender-Auth: scUjmYaUOWHuj78ud-cpGTS2Gc4 Message-ID: Subject: Re: svn commit: r311659 - head/lib/libstand To: Baptiste Daroussin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 21:53:42 -0000 Thanks. 2017-01-08 0:42 GMT+01:00 Baptiste Daroussin : > Author: bapt > Date: Sat Jan 7 23:42:17 2017 > New Revision: 311659 > URL: https://svnweb.freebsd.org/changeset/base/311659 > > Log: > remove network mask calculation for Classful network > > Nowadays it's not necessary to compute network mask from the IP address > and > compare to given by DHCP. > > Submitted by: kczekirda > Reviewed by: glebius, bapt > MFC after: 3 weeks > Sponsored by: Oktawave > Differential Revision: https://reviews.freebsd.org/D8740 > > Modified: > head/lib/libstand/bootp.c > > Modified: head/lib/libstand/bootp.c > ============================================================ > ================== > --- head/lib/libstand/bootp.c Sat Jan 7 22:55:23 2017 (r311658) > +++ head/lib/libstand/bootp.c Sat Jan 7 23:42:17 2017 (r311659) > @@ -62,8 +62,6 @@ __FBSDID("$FreeBSD$"); > > struct in_addr servip; > > -static n_long nmask, smask; > - > static time_t bot; > > static char vm_rfc1048[4] = VM_RFC1048; > @@ -223,30 +221,19 @@ bootp(sock, flag) > bcopy(rbuf.rbootp.bp_file, bootfile, sizeof(bootfile)); > bootfile[sizeof(bootfile) - 1] = '\0'; > > - if (IN_CLASSA(ntohl(myip.s_addr))) > - nmask = htonl(IN_CLASSA_NET); > - else if (IN_CLASSB(ntohl(myip.s_addr))) > - nmask = htonl(IN_CLASSB_NET); > - else > - nmask = htonl(IN_CLASSC_NET); > -#ifdef BOOTP_DEBUG > - if (debug) > - printf("'native netmask' is %s\n", intoa(nmask)); > -#endif > - > - /* Check subnet mask against net mask; toss if bogus */ > - if ((nmask & smask) != nmask) { > + if (!netmask) { > + if (IN_CLASSA(ntohl(myip.s_addr))) > + netmask = htonl(IN_CLASSA_NET); > + else if (IN_CLASSB(ntohl(myip.s_addr))) > + netmask = htonl(IN_CLASSB_NET); > + else > + netmask = htonl(IN_CLASSC_NET); > #ifdef BOOTP_DEBUG > if (debug) > - printf("subnet mask (%s) bad\n", intoa(smask)); > + printf("'native netmask' is %s\n", intoa(netmask)); > #endif > - smask = 0; > } > > - /* Get subnet (or natural net) mask */ > - netmask = nmask; > - if (smask) > - netmask = smask; > #ifdef BOOTP_DEBUG > if (debug) > printf("mask: %s\n", intoa(netmask)); > @@ -385,7 +372,7 @@ vend_rfc1048(cp, len) > break; > > if (tag == TAG_SUBNET_MASK) { > - bcopy(cp, &smask, sizeof(smask)); > + bcopy(cp, &netmask, sizeof(netmask)); > } > if (tag == TAG_GATEWAY) { > bcopy(cp, &gateip.s_addr, sizeof(gateip.s_addr)); > @@ -445,7 +432,7 @@ vend_cmu(cp) > vp = (struct cmu_vend *)cp; > > if (vp->v_smask.s_addr != 0) { > - smask = vp->v_smask.s_addr; > + netmask = vp->v_smask.s_addr; > } > if (vp->v_dgate.s_addr != 0) { > gateip = vp->v_dgate; > _______________________________________________ > 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" > From owner-svn-src-all@freebsd.org Sun Jan 8 23:25:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A975CA6A0F; Sun, 8 Jan 2017 23:25:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30C8011EA; Sun, 8 Jan 2017 23:25:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v08NPkNH037825; Sun, 8 Jan 2017 23:25:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08NPkrV037824; Sun, 8 Jan 2017 23:25:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201701082325.v08NPkrV037824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 8 Jan 2017 23:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311706 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 23:25:47 -0000 Author: bapt Date: Sun Jan 8 23:25:46 2017 New Revision: 311706 URL: https://svnweb.freebsd.org/changeset/base/311706 Log: Update pciids to 2017.01.08 MFC after: 1 day Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Sun Jan 8 21:42:19 2017 (r311705) +++ head/share/misc/pci_vendors Sun Jan 8 23:25:46 2017 (r311706) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2016.11.21 -# Date: 2016-11-21 03:15:01 +# Version: 2017.01.08 +# Date: 2017-01-08 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -249,6 +249,7 @@ 0014 MegaRAID Tri-Mode SAS3516 1028 1fd4 PERC H745P MX 1d49 0602 ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter + 0015 MegaRAID Tri-Mode SAS3416 0016 MegaRAID Tri-Mode SAS3508 1028 1fc9 PERC H840 Adapter 1028 1fcb PERC H740P Adapter @@ -548,6 +549,7 @@ 1028 1f53 HBA330 Mini 1028 1fd2 HBA330 MX 1028 1fd3 HBA330 MMZ + 1bd4 0011 Inspur 12Gb 8i-3008 IT SAS HBA 00ab SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00ac SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 1d49 0201 ThinkSystem 430-16i SAS/SATA 12Gb HBA @@ -2201,6 +2203,11 @@ 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE 67c0 Ellesmere [Polaris10] + 67c4 Ellesmere [Radeon Pro WX 7100] + 67c7 Ellesmere [Radeon Pro WX 5100] + 67ca Ellesmere [Polaris10] + 67cc Ellesmere [Polaris10] + 67cf Ellesmere [Polaris10] 67df Ellesmere [Radeon RX 470/480] 1002 0b37 Radeon RX 480 1043 04a8 Radeon RX 480 @@ -2218,6 +2225,7 @@ 1787 a480 Radeon RX 480 67e0 Baffin [Polaris11] 67e1 Baffin [Polaris11] + 67e3 Baffin [Radeon Pro WX 4100] 67e8 Baffin [Polaris11] 67e9 Baffin [Polaris11] 67eb Baffin [Polaris11] @@ -2924,6 +2932,12 @@ 148c 9380 Radeon R9 380 # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 + 6980 Polaris12 + 6981 Polaris12 + 6985 Polaris12 + 6986 Polaris12 + 6987 Polaris12 + 699f Polaris12 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge 7100 R520 [Radeon X1800 XT] @@ -5095,6 +5109,7 @@ 0675 1704 ISDN Adapter (PCI Bus, D, C) 0675 1707 ISDN Adapter (PCI Bus, DV, W) 10cf 105e ISDN Adapter (PCI Bus, DV, W) + 13a0 Transformer Book T101HA-GR030R # Should be 1022:9602 9602 AMD RS780/RS880 PCI to PCI bridge (int gfx) 1043 83a2 M4A785TD Motherboard @@ -10077,6 +10092,7 @@ 10c3 GT218 [GeForce 8400 GS Rev. 3] 10c5 GT218 [GeForce 405] 10d8 GT218 [NVS 300] + 10ef GP102 HDMI Audio Controller 10f0 GP104 High Definition Audio Controller 1140 GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] 1019 0799 GeForce 820M @@ -10620,7 +10636,7 @@ 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] 13f3 GM204GL [Tesla M6] - 13f8 GM204GLM [Quadro M5000M] + 13f8 GM204GLM [Quadro M5000M / M5000 SE] 13f9 GM204GLM [Quadro M4000M] 13fa GM204GLM [Quadro M3000M] 10de 11c9 Quadro M3000 SE @@ -10634,8 +10650,9 @@ 1431 GM206GL [Tesla M4] 15f0 GP100GL 15f1 GP100GL - 15f8 GP100GL - 15f9 GP100GL + 15f7 GP100GL [Tesla P100 PCIe 12GB] + 15f8 GP100GL [Tesla P100 PCIe 16GB] + 15f9 GP100GL [Tesla P100 SMX2 16GB] 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] 1619 GM204M [GeForce GTX 965M] @@ -10659,10 +10676,12 @@ 1b81 GP104 [GeForce GTX 1070] 1b82 GP104 1b83 GP104 + 1b84 GP104 [GeForce GTX 1060 3GB] 1ba0 GP104M [GeForce GTX 1080] 1ba1 GP104M [GeForce GTX 1070] 1bb0 GP104GL [Quadro P5000] 1bb1 GP104GL + 1bb3 GP104GL [Tesla P4] 1bb4 GP104GL 1be0 GP104M [GeForce GTX 1080] 1be1 GP104M [GeForce GTX 1070] @@ -10678,6 +10697,9 @@ 1c80 GP107 1c81 GP107 [GeForce GTX 1050] 1c82 GP107 [GeForce GTX 1050 Ti] + 1c8c GP107M [GeForce GTX 1050 Ti] + 1c8d GP107M [GeForce GTX 1050] + 1c8e GP107M 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL @@ -12103,7 +12125,11 @@ 111f Precision Digital Images 4a47 Precision MX Video engine interface 5243 Frame capture bus interface -1120 EMC Corporation +# formerly EMC Corporation +1120 Dell EMC + 2306 Unity Fibre Channel Controller + 2501 Unity Ethernet Controller + 2505 Unity Fibre Channel Controller 1121 Zilog 1122 Multi-tech Systems, Inc. 1123 Excellent Design, Inc. @@ -15975,7 +16001,7 @@ 5081 T540-5081 Unified Wire Ethernet Controller 5082 T504-5082 Unified Wire Ethernet Controller 5083 T540-5083 Unified Wire Ethernet Controller - 5084 T580-5084 Unified Wire Ethernet Controller + 5084 T540-5084 Unified Wire Ethernet Controller 5085 T580-5085 Unified Wire Ethernet Controller 5086 T580-5086 Unified Wire Ethernet Controller 5087 T580-5087 Unified Wire Ethernet Controller @@ -15994,6 +16020,7 @@ 509a T520-509A Unified Wire Ethernet Controller 509b T540-509B Unified Wire Ethernet Controller 509c T520-509C Unified Wire Ethernet Controller + 509d T540-509D Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16041,6 +16068,7 @@ 549a T520-509A Unified Wire Ethernet Controller 549b T540-509B Unified Wire Ethernet Controller 549c T520-509C Unified Wire Ethernet Controller + 549d T540-509D Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16088,6 +16116,7 @@ 559a T520-509A Unified Wire Storage Controller 559b T540-509B Unified Wire Storage Controller 559c T520-509C Unified Wire Storage Controller + 559d T540-509D Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16135,6 +16164,7 @@ 569a T520-509A Unified Wire Storage Controller 569b T540-509B Unified Wire Storage Controller 569c T520-509C Unified Wire Storage Controller + 569d T540-509D Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16221,6 +16251,7 @@ 589a T520-509A Unified Wire Ethernet Controller [VF] 589b T540-509B Unified Wire Ethernet Controller [VF] 589c T520-509C Unified Wire Ethernet Controller [VF] + 589d T540-509D Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16357,7 +16388,8 @@ 144d Samsung Electronics Co Ltd 1600 Apple PCIe SSD a800 XP941 PCIe SSD - a802 NVMe SSD Controller + a802 NVMe SSD Controller SM951/PM951 + a804 NVMe SSD Controller SM961/PM961 a820 NVMe SSD Controller 171X 1028 1f95 Express Flash NVMe XS1715 SSD 400GB 1028 1f96 Express Flash NVMe XS1715 SSD 800GB @@ -17968,11 +18000,13 @@ 15b3 Mellanox Technologies 0191 MT25408 [ConnectX IB Flash Recovery] 01f6 MT27500 Family [ConnectX-3 Flash Recovery] + 01f8 MT27520 Family [ConnectX-3 Pro Flash Recovery] 01ff MT27600 Family [Connect-IB Flash Recovery] 0209 MT27700 Family [ConnectX-4 Flash Recovery] 020b MT27710 Family [ConnectX-4 Lx Flash Recovery] 020d MT28800 Family [ConnectX-5 Flash Recovery] 020f MT28908A0 Family [ConnectX-6 Flash Recovery] + 0211 MT416842 Family [BlueField SoC Flash Recovery] # reserved for RM#105916 024e MT53100 [Spectrum-2, Flash recovery mode] # Actual value to be used @@ -18732,6 +18766,7 @@ 7013 AP440-3: 32-Channel Isolated Digital Input Module 7014 AP445: 32-Channel Isolated Digital Output Module 7016 AP470 48-Channel TTL Level Digital Input/Output Module + 7017 AP323 16-bit, 20 or 40 Channel Analog Input Module 7018 AP408: 32-Channel Digital I/O Module 701a AP220-16 12-Bit, 16-Channel Analog Output Module 701b AP231-16 16-Bit, 16-Channel Analog Output Module @@ -18992,6 +19027,7 @@ 1160 ARC-1160 16-Port PCI-X to SATA RAID Controller 1170 ARC-1170 24-Port PCI-X to SATA RAID Controller 1201 ARC-1200 2-Port PCI-Express to SATA II RAID Controller + 1203 ARC-1203 2/4/8 Port PCIe 2.0 to SATA 6Gb RAID Controller 1210 ARC-1210 4-Port PCI-Express to SATA RAID Controller 1214 ARC-12x4 PCIe 2.0 to SAS/SATA 6Gb RAID Controller 17d3 1214 ARC-1214 4-Port PCIe 2.0 to SAS/SATA 6Gb RAID Controller @@ -19510,7 +19546,7 @@ 1924 5105 SFN4111T-R5 1924 5201 SFN4112F-R1 1924 5202 SFN4112F-R2 - 0803 SFC9020 [Solarstorm] + 0803 SFC9020 10G Ethernet Controller 1014 0478 2-port 10GbE Low-Latency (R7) 1014 0479 2-port 10GbE OpenOnload (R7) 1014 04a7 Solarflare 10Gb Low-latency Dual-port HBA (R7) @@ -19540,7 +19576,7 @@ 1924 7207 SFN5162F-R7 SFP+ Server Adapter 1924 7a06 SFN5152F-R6 SFP+ Server Adapter 1924 7a07 SFN5152F-R7 SFP+ Server Adapter - 0813 SFL9021 [Solarstorm] + 0813 SFL9021 10GBASE-T Ethernet Controller 1924 6100 SFN5121T-R0 10GBASE-T Server Adapter 1924 6102 SFN5121T-R2 10GBASE-T Server Adapter 1924 6103 SFN5121T-R3 10GBASE-T Server Adapter @@ -19549,7 +19585,7 @@ 1924 6904 SFN5111T-R4 10GBASE-T Server Adapter 1924 7104 SFN5161T-R4 10GBASE-T Server Adapter 1924 7904 SFN5151T-R4 10GBASE-T Server Adapter - 0903 SFC9120 + 0903 SFC9120 10G Ethernet Controller 1014 04cc SFN7122F-R2 2x10GbE SFP+ Flareon Ultra 1924 8002 SFN7122F-R1 SFP+ Server Adapter 1924 8003 SFN7x41Q-R1 Flareon Ultra 7000 Series 10/40G Adapter @@ -19561,11 +19597,11 @@ 1924 800d SFN7x02F-R3 Flareon 7000 Series 10G Adapter 1924 8010 SFA7942Q-R1 QSFP+ AOE Adapter 1924 8015 SFA7942Q-A5-0-R1 QSFP+ AOE Adapter - 0923 SFC9140 + 0923 SFC9140 10/40G Ethernet Controller 1924 800b SFN7x42Q-R1 Flareon Ultra 7000 Series 10/40G Adapter 1924 800e SFN7x42Q-R2 Flareon Ultra 7000 Series 10/40G Adapter 1924 800f SFN7xx4F-R1 Flareon Ultra 7000 Series 10G Adapter - 0a03 SFC9220 + 0a03 SFC9220 10/40G Ethernet Controller 1924 8011 SFN 8022-R1 Solarflare Flareon 8000 Series 10G Adapter 1924 8012 SFN8522-R1 Flareon Ultra 8000 Series 10G Adapter 1924 8013 SFN8042-R1 Solarflare Flareon 8000 Series 10/40G Adapter @@ -19574,10 +19610,11 @@ 1924 8017 SFN8522-R2 Flareon Ultra 8000 Series 10G Adapter 1924 8018 SFN8042-R2 Flareon 8000 Series 10/40G Adapter 1924 8019 SFN8542-R2 Flareon Ultra 8000 Series 10/40G Adapter - 1803 SFC9020 Virtual Function [Solarstorm] - 1813 SFL9021 Virtual Function [Solarstorm] - 1903 SFC9120 Virtual Function - 1923 SFC9140 Virtual Function + 1803 SFC9020 10G Ethernet Controller (Virtual Function) + 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) + 1903 SFC9120 10G Ethernet Controller (Virtual Function) + 1923 SFC9140 10/40G Ethernet Controller (Virtual Function) + 1a03 SFC9220 10/40G Ethernet Controller (Virtual Function) 6703 SFC4000 rev A iSCSI/Onload [Solarstorm] 10b8 0102 SMC10GPCIe-10BT (A2) [TigerCard] 10b8 0103 SMC10GPCIe-10BT (A3) [TigerCard] @@ -19864,6 +19901,7 @@ 5801 DDRdrive X1 5808 DDRdrive X8 dd52 DDRdrive X1-30 +19e5 Huawei Technologies Co., Ltd. 19e7 NET (Network Equipment Technologies) 1001 STIX DSP Card 1002 STIX - 1 Port T1/E1 Card @@ -20303,6 +20341,8 @@ 0303 Simulyzer-RT CompactPCI Serial PSI5-SIM-1 card 0304 Simulyzer-RT CompactPCI Serial PWR-ANA-1 card 0305 Simulyzer-RT CompactPCI Serial CAN-1 card +1cd7 Nanjing Magewell Electronics Co., Ltd. + 0010 Pro Capture Endpoint 1cdd secunet Security Networks AG 1ce4 Exablaze 0001 ExaNIC X4 @@ -20310,6 +20350,7 @@ 0003 ExaNIC X10 0004 ExaNIC X10-GM 0005 ExaNIC X40 + 0006 ExaNIC X10-HPT 1cf7 Subspace Dynamics 1d00 Pure Storage 1d1d CNEX Labs @@ -21336,6 +21377,27 @@ 0813 Moorestown SC DMA 0814 Moorestown LPE DMA 0815 Moorestown SSP0 + 0817 Medfield Serial IO I2C Controller #3 + 0818 Medfield Serial IO I2C Controller #4 + 0819 Medfield Serial IO I2C Controller #5 + 081a Medfield GPIO Controller [Core] + 081b Medfield Serial IO HSUART Controller #1 + 081c Medfield Serial IO HSUART Controller #2 + 081d Medfield Serial IO HSUART Controller #3 + 081e Medfield Serial IO HSUART DMA Controller + 081f Medfield GPIO Controller [AON] + 0820 Medfield SD Host Controller + 0821 Medfield SDIO Controller #1 + 0822 Medfield SDIO Controller #2 + 0823 Medfield eMMC Controller #0 + 0824 Medfield eMMC Controller #1 + 0827 Medfield Serial IO DMA Controller + 0828 Medfield Power Management Unit + 0829 Medfield USB Device Controller (OTG) + 082a Medfield SCU IPC + 082c Medfield Serial IO I2C Controller #0 + 082d Medfield Serial IO I2C Controller #1 + 082e Medfield Serial IO I2C Controller #2 0885 Centrino Wireless-N + WiMAX 6150 8086 1305 Centrino Wireless-N + WiMAX 6150 BGN 8086 1307 Centrino Wireless-N + WiMAX 6150 BG @@ -22445,6 +22507,18 @@ 1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller 8086 1161 82806AA PCI64 Hub APIC 1162 Xscale 80200 Big Endian Companion Chip + 1190 Merrifield SD/SDIO/eMMC Controller + 1191 Merrifield Serial IO HSUART Controller + 1192 Merrifield Serial IO HSUART DMA Controller + 1194 Merrifield Serial IO SPI Controller + 1195 Merrifield Serial IO I2C Controller + 1196 Merrifield Serial IO I2C Controller + 1199 Merrifield GPIO Controller + 119e Merrifield USB Device Controller (OTG) + 11a0 Merrifield SCU IPC + 11a1 Merrifield Power Management Unit + 11a2 Merrifield Serial IO DMA Controller + 11a5 Merrifield Serial IO PWM Controller 1200 IXP1200 Network Processor 172a 0000 AEP SSL Accelerator 1209 8255xER/82551IT Fast Ethernet Controller @@ -22917,8 +22991,8 @@ 103c 0000 HPE Ethernet 10/20Gb 2-port 660FLB Adapter 103c 22fe HPE Ethernet 10/20Gb 2-port 660FLB Adapter 1588 Ethernet Controller XL710 for 20GbE backplane - 103c 0000 HPE Ethernet 10/20Gb 2-port 660M Adapter - 103c 22ff HPE Ethernet 10/20Gb 2-port 660M Adapter + 103c 0000 Ethernet 10/20Gb 2-port 660M Adapter + 103c 22ff Ethernet 10/20Gb 2-port 660M Adapter 1589 Ethernet Controller X710/X557-AT 10GBASE-T 108e 0000 Quad Port 10GBase-T Adapter 108e 7b1c Quad Port 10GBase-T Adapter @@ -22951,12 +23025,17 @@ 15ac Ethernet Connection X552 10 GbE SFP+ 15ad Ethernet Connection X552/X557-AT 10GBASE-T 15ae Ethernet Connection X552 1000BASE-T + 15b0 Ethernet Connection X552 Backplane 15b4 X553 Virtual Function 15b5 DSL6340 USB 3.1 Controller [Alpine Ridge] 15b6 DSL6540 USB 3.1 Controller [Alpine Ridge] 15b7 Ethernet Connection (2) I219-LM 15b8 Ethernet Connection (2) I219-V 15b9 Ethernet Connection (3) I219-LM + 15bb Ethernet Connection (7) I219-LM + 15bc Ethernet Connection (7) I219-V + 15bd Ethernet Connection (6) I219-LM + 15be Ethernet Connection (6) I219-V 15bf JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] 15c0 JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] 15c5 X553 Virtual Function @@ -24258,6 +24337,9 @@ 24f4 Wireless 8260 # Snow Field Peak AC 8086 0030 Dual Band Wireless-AC 8260 + 24fd Wireless 8265 / 8275 +# Windstorm Peak + 8086 0010 Dual Band Wireless-AC 8265 2500 82820 820 (Camino) Chipset Host Bridge (MCH) 1028 0095 Precision Workstation 220 Chipset 1043 801c P3C-2000 system chipset @@ -25145,12 +25227,12 @@ 1028 01da OptiPlex 745 1462 7235 P965 Neo MS-7235 mainboard 2826 C600/X79 series chipset SATA RAID Controller - 1d49 0100 ThinkSystem RAID 331 - 1d49 0101 ThinkSystem RAID 331 - 1d49 0102 ThinkSystem RAID 331 - 1d49 0103 ThinkSystem RAID 331 - 1d49 0104 ThinkSystem RAID 331 - 1d49 0105 ThinkSystem RAID 331 + 1d49 0100 Intel RSTe SATA Software RAID + 1d49 0101 Intel RSTe SATA Software RAID + 1d49 0102 Intel RSTe SATA Software RAID + 1d49 0103 Intel RSTe SATA Software RAID + 1d49 0104 Intel RSTe SATA Software RAID + 1d49 0105 Intel RSTe SATA Software RAID 2827 C610/X99 series chipset sSATA Controller [RAID mode] 2828 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [IDE mode] 1028 01f3 Inspiron 1420 @@ -26950,41 +27032,41 @@ 530d 80310 (IOP) IO Processor 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine - 5a84 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Integrated Graphics Controller - 5a88 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Imaging Unit - 5a98 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Audio Cluster - 5a9a Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Trusted Execution Engine - 5aa2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Integrated Sensor Hub - 5aa8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series USB xHCI - 5aac Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #1 - 5aae Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #2 - 5ab0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #3 - 5ab2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #4 - 5ab4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #5 - 5ab6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #6 - 5ab8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #7 - 5aba Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #8 - 5abc Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #1 - 5abe Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #2 - 5ac0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #3 - 5ac2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #1 - 5ac4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #2 - 5ac6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #3 - 5ac8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PWM Pin Controller - 5aca Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SDXC/MMC Host Controller - 5acc Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series eMMC Controller - 5ad0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SDIO Controller - 5ad4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SMBus Controller - 5ad6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port B #1 - 5ad7 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port B #2 - 5ad8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #1 - 5ad9 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #2 - 5ada Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #3 - 5adb Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #4 - 5ae3 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SATA AHCI Controller - 5ae8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Low Pin Count Interface - 5aee Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #4 - 5af0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Host Bridge + 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller + 5a88 Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit + 5a98 Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster + 5a9a Celeron N3350/Pentium N4200/Atom E3900 Series Trusted Execution Engine + 5aa2 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Sensor Hub + 5aa8 Celeron N3350/Pentium N4200/Atom E3900 Series USB xHCI + 5aac Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #1 + 5aae Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #2 + 5ab0 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #3 + 5ab2 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #4 + 5ab4 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #5 + 5ab6 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #6 + 5ab8 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #7 + 5aba Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #8 + 5abc Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #1 + 5abe Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #2 + 5ac0 Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #3 + 5ac2 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #1 + 5ac4 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #2 + 5ac6 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #3 + 5ac8 Celeron N3350/Pentium N4200/Atom E3900 Series PWM Pin Controller + 5aca Celeron N3350/Pentium N4200/Atom E3900 Series SDXC/MMC Host Controller + 5acc Celeron N3350/Pentium N4200/Atom E3900 Series eMMC Controller + 5ad0 Celeron N3350/Pentium N4200/Atom E3900 Series SDIO Controller + 5ad4 Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller + 5ad6 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #1 + 5ad7 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #2 + 5ad8 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #1 + 5ad9 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #2 + 5ada Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #3 + 5adb Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #4 + 5ae3 Celeron N3350/Pentium N4200/Atom E3900 Series SATA AHCI Controller + 5ae8 Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface + 5aee Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #4 + 5af0 Celeron N3350/Pentium N4200/Atom E3900 Series Host Bridge 65c0 5100 Chipset Memory Controller Hub 65e2 5100 Chipset PCI Express x4 Port 2 65e3 5100 Chipset PCI Express x4 Port 3 @@ -27826,6 +27908,25 @@ a243 Lewisburg LPC or eSPI Controller a252 Lewisburg SSATA Controller [AHCI mode] a256 Lewisburg SSATA Controller [RAID mode] + a282 200 Series PCH SATA controller [AHCI mode] + a294 200 Series PCH PCI Express Root Port #1 + a2a1 200 Series PCH PMC + a2a3 200 Series PCH SMBus Controller + a2a7 200 Series PCH Serial IO UART Controller #0 + a2a8 200 Series PCH Serial IO UART Controller #1 + a2a9 200 Series PCH Serial IO SPI Controller #0 + a2aa 200 Series PCH Serial IO SPI Controller #1 + a2af 200 Series PCH USB 3.0 xHCI Controller + a2b1 200 Series PCH Thermal Subsystem + a2ba 200 Series PCH CSME HECI #1 + a2bb 200 Series PCH CSME HECI #2 + a2c6 200 Series PCH LPC Controller + a2e0 200 Series PCH Serial IO I2C Controller #0 + a2e1 200 Series PCH Serial IO I2C Controller #1 + a2e2 200 Series PCH Serial IO I2C Controller #2 + a2e3 200 Series PCH Serial IO I2C Controller #3 + a2e6 200 Series PCH Serial IO UART Controller #2 + a2f0 200 Series PCH HD Audio a620 6400/6402 Advanced Memory Buffer (AMB) abc0 Omni-Path Fabric Switch Silicon 100 Series b152 21152 PCI-to-PCI Bridge @@ -28605,6 +28706,7 @@ f1d0 AJA Video cafe Kona SD cfee Xena LS/SD-22-DA/SD-DA daff KONA LHi + db09 Corvid 24 dcaf Kona HD dfee Xena HD-DA efac Xena SD-MM/SD-22-MM From owner-svn-src-all@freebsd.org Sun Jan 8 23:41:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08C0CCA65D3; Sun, 8 Jan 2017 23:41:19 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE98C1BF2; Sun, 8 Jan 2017 23:41:18 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v08NfHp4046814; Sun, 8 Jan 2017 23:41:17 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08NfH4O046808; Sun, 8 Jan 2017 23:41:17 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701082341.v08NfH4O046808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 8 Jan 2017 23:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311707 - in head/sys/dev/rtwn: . usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 23:41:19 -0000 Author: avos Date: Sun Jan 8 23:41:17 2017 New Revision: 311707 URL: https://svnweb.freebsd.org/changeset/base/311707 Log: rtwn_usb(4): fix Rx buffer size calculation. Use device-specific Rx buffer size to ensure that data will not be truncated + add a warning if truncation was detected (the driver cannot handle this case correctly yet). Tested with: - RTL8188CUS, RTL8188EU and RTL8821AU, STA / AP modes. Modified: head/sys/dev/rtwn/if_rtwnvar.h head/sys/dev/rtwn/usb/rtwn_usb_attach.c head/sys/dev/rtwn/usb/rtwn_usb_ep.c head/sys/dev/rtwn/usb/rtwn_usb_rx.c Modified: head/sys/dev/rtwn/if_rtwnvar.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnvar.h Sun Jan 8 23:25:46 2017 (r311706) +++ head/sys/dev/rtwn/if_rtwnvar.h Sun Jan 8 23:41:17 2017 (r311707) @@ -25,7 +25,6 @@ #define RTWN_TX_DESC_SIZE 64 -#define RTWN_RXBUFSZ (8 * 1024) #define RTWN_TXBUFSZ (16 * 1024) #define RTWN_BCN_MAX_SIZE 512 Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.c Sun Jan 8 23:25:46 2017 (r311706) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.c Sun Jan 8 23:41:17 2017 (r311707) @@ -133,8 +133,9 @@ rtwn_usb_alloc_rx_list(struct rtwn_softc struct rtwn_usb_softc *uc = RTWN_USB_SOFTC(sc); int error, i; + /* XXX recheck */ error = rtwn_usb_alloc_list(sc, uc->uc_rx, RTWN_USB_RX_LIST_COUNT, - RTWN_RXBUFSZ); + sc->rx_dma_size + 1024); if (error != 0) return (error); Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan 8 23:25:46 2017 (r311706) +++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan 8 23:41:17 2017 (r311707) @@ -63,7 +63,6 @@ static struct usb_config rtwn_config[RTW .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .bufsize = RTWN_RXBUFSZ, .flags = { .pipe_bof = 1, .short_xfer_ok = 1 @@ -222,6 +221,7 @@ rtwn_usb_setup_endpoints(struct rtwn_usb break; } + rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024; error = usbd_transfer_setup(uc->uc_udev, &iface_index, uc->uc_xfer, rtwn_config, RTWN_N_TRANSFER, uc, &sc->sc_mtx); if (error) { Modified: head/sys/dev/rtwn/usb/rtwn_usb_rx.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_rx.c Sun Jan 8 23:25:46 2017 (r311706) +++ head/sys/dev/rtwn/usb/rtwn_usb_rx.c Sun Jan 8 23:41:17 2017 (r311707) @@ -158,8 +158,12 @@ rtwn_rxeof(struct rtwn_softc *sc, uint8_ /* Make sure everything fits in xfer. */ totlen = sizeof(*stat) + infosz + pktlen; - if (totlen > len) + if (totlen > len) { + device_printf(sc->sc_dev, + "%s: totlen (%d) > len (%d)!\n", + __func__, totlen, len); break; + } if (m0 == NULL) m0 = m = rtwn_rx_copy_to_mbuf(sc, stat, totlen); From owner-svn-src-all@freebsd.org Mon Jan 9 00:09:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63B32CA68A7; Mon, 9 Jan 2017 00:09:21 +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 1887E1A44; Mon, 9 Jan 2017 00:09:21 +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 v0909K2c058813; Mon, 9 Jan 2017 00:09:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0909K4k058809; Mon, 9 Jan 2017 00:09:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701090009.v0909K4k058809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 Jan 2017 00:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311708 - in stable: 10/sys/sys 10/usr.bin/kdump 11/sys/sys 11/usr.bin/kdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:09:21 -0000 Author: jhb Date: Mon Jan 9 00:09:19 2017 New Revision: 311708 URL: https://svnweb.freebsd.org/changeset/base/311708 Log: MFC 306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined. The kernel uses a few negative errno values for internal conditions such as requesting a system call restart. Normally these errno values are not exposed to userland. However, kdump needs access to these values as some of then can be present in a ktrace system call return record. Previously kdump was defining _KERNEL to gain access to ehse values, but was then having to manually declare 'errno' (and doing it incorrectly). Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL and uses the system-provided declaration of errno. Modified: stable/10/sys/sys/errno.h stable/10/usr.bin/kdump/kdump.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/sys/errno.h stable/11/usr.bin/kdump/kdump.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/sys/errno.h ============================================================================== --- stable/10/sys/sys/errno.h Sun Jan 8 23:41:17 2017 (r311707) +++ stable/10/sys/sys/errno.h Mon Jan 9 00:09:19 2017 (r311708) @@ -184,7 +184,7 @@ __END_DECLS #define ELAST 96 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) /* pseudo-errors returned inside kernel to modify return to process */ #define ERESTART (-1) /* restart syscall */ #define EJUSTRETURN (-2) /* don't modify regs, just return */ Modified: stable/10/usr.bin/kdump/kdump.c ============================================================================== --- stable/10/usr.bin/kdump/kdump.c Sun Jan 8 23:41:17 2017 (r311707) +++ stable/10/usr.bin/kdump/kdump.c Mon Jan 9 00:09:19 2017 (r311708) @@ -41,10 +41,7 @@ static char sccsid[] = "@(#)kdump.c 8.1 #include __FBSDID("$FreeBSD$"); -#define _KERNEL -extern int errno; -#include -#undef _KERNEL +#define _WANT_KERNEL_ERRNO #include #include #include From owner-svn-src-all@freebsd.org Mon Jan 9 00:09:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A43E9CA68AB; Mon, 9 Jan 2017 00:09:21 +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 5D1BC1A45; Mon, 9 Jan 2017 00:09:21 +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 v0909KCZ058820; Mon, 9 Jan 2017 00:09:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0909KPk058818; Mon, 9 Jan 2017 00:09:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701090009.v0909KPk058818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 Jan 2017 00:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311708 - in stable: 10/sys/sys 10/usr.bin/kdump 11/sys/sys 11/usr.bin/kdump X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:09:21 -0000 Author: jhb Date: Mon Jan 9 00:09:19 2017 New Revision: 311708 URL: https://svnweb.freebsd.org/changeset/base/311708 Log: MFC 306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined. The kernel uses a few negative errno values for internal conditions such as requesting a system call restart. Normally these errno values are not exposed to userland. However, kdump needs access to these values as some of then can be present in a ktrace system call return record. Previously kdump was defining _KERNEL to gain access to ehse values, but was then having to manually declare 'errno' (and doing it incorrectly). Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL and uses the system-provided declaration of errno. Modified: stable/11/sys/sys/errno.h stable/11/usr.bin/kdump/kdump.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/sys/errno.h stable/10/usr.bin/kdump/kdump.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/sys/errno.h ============================================================================== --- stable/11/sys/sys/errno.h Sun Jan 8 23:41:17 2017 (r311707) +++ stable/11/sys/sys/errno.h Mon Jan 9 00:09:19 2017 (r311708) @@ -184,7 +184,7 @@ __END_DECLS #define ELAST 96 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) /* pseudo-errors returned inside kernel to modify return to process */ #define ERESTART (-1) /* restart syscall */ #define EJUSTRETURN (-2) /* don't modify regs, just return */ Modified: stable/11/usr.bin/kdump/kdump.c ============================================================================== --- stable/11/usr.bin/kdump/kdump.c Sun Jan 8 23:41:17 2017 (r311707) +++ stable/11/usr.bin/kdump/kdump.c Mon Jan 9 00:09:19 2017 (r311708) @@ -41,10 +41,7 @@ static char sccsid[] = "@(#)kdump.c 8.1 #include __FBSDID("$FreeBSD$"); -#define _KERNEL -extern int errno; -#include -#undef _KERNEL +#define _WANT_KERNEL_ERRNO #include #include #include From owner-svn-src-all@freebsd.org Mon Jan 9 00:25:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA516CA2063; Mon, 9 Jan 2017 00:25:34 +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 AAC691F5D; Mon, 9 Jan 2017 00:25:34 +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 v090PXZX068657; Mon, 9 Jan 2017 00:25:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v090PXHV068656; Mon, 9 Jan 2017 00:25:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090025.v090PXHV068656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 00:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311709 - head/usr.sbin/rwhod X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:25:35 -0000 Author: ngie Date: Mon Jan 9 00:25:33 2017 New Revision: 311709 URL: https://svnweb.freebsd.org/changeset/base/311709 Log: Style(9) fixes - Sort sys/ #includes - Use nitems instead of hardcoding the length of `mib` MFC after: 3 days Modified: head/usr.sbin/rwhod/rwhod.c Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Mon Jan 9 00:09:19 2017 (r311708) +++ head/usr.sbin/rwhod/rwhod.c Mon Jan 9 00:25:33 2017 (r311709) @@ -43,14 +43,14 @@ static char sccsid[] = "@(#)rwhod.c 8.1 #include __FBSDID("$FreeBSD$"); -#include #include +#include +#include +#include #include #include #include -#include #include -#include #include #include @@ -548,7 +548,7 @@ getboottime(int signo __unused) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(tm); - if (sysctl(mib, 2, &tm, &size, NULL, 0) == -1) { + if (sysctl(mib, nitems(mib), &tm, &size, NULL, 0) == -1) { syslog(LOG_ERR, "cannot get boottime: %m"); exit(1); } @@ -629,11 +629,11 @@ configure(int so) mib[3] = AF_INET; mib[4] = NET_RT_IFLIST; mib[5] = 0; - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) quit("route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) quit("malloc"); - if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), buf, &needed, NULL, 0) < 0) quit("actual retrieval of interface table"); lim = buf + needed; From owner-svn-src-all@freebsd.org Mon Jan 9 00:29:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C12D3CA220B; Mon, 9 Jan 2017 00:29: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 9371C117B; Mon, 9 Jan 2017 00:29:24 +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 v090TNAP068861; Mon, 9 Jan 2017 00:29:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v090TNOf068860; Mon, 9 Jan 2017 00:29:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090029.v090TNOf068860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 00:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311710 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:29:24 -0000 Author: ngie Date: Mon Jan 9 00:29:23 2017 New Revision: 311710 URL: https://svnweb.freebsd.org/changeset/base/311710 Log: Style fixes - Delete trailing whitespace - Use nitems(mib) instead of hardcoding the mib length MFC after: 3 days Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Jan 9 00:25:33 2017 (r311709) +++ head/usr.bin/top/machine.c Mon Jan 9 00:29:23 2017 (r311710) @@ -413,7 +413,7 @@ format_header(char *uname_field) { static char Header[128]; const char *prehead; - + if (ps.jail) jidlength = TOP_JID_LEN + 1; /* +1 for extra left space. */ else @@ -559,7 +559,7 @@ get_system_info(struct system_info *si) arc_stats[5] = arc_stat >> 10; si->arc = arc_stats; } - + /* set arrays and strings */ if (pcpu_stats) { si->cpustates = pcpu_cpu_states; @@ -585,7 +585,7 @@ get_system_info(struct system_info *si) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(boottime); - if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && + if (sysctl(mib, nitems(mib), &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) { si->boottime = boottime; } else { @@ -1072,7 +1072,7 @@ format_next_process(caddr_t handle, char } } - if (ps.jail == 0) + if (ps.jail == 0) jid_buf[0] = '\0'; else snprintf(jid_buf, sizeof(jid_buf), "%*d", From owner-svn-src-all@freebsd.org Mon Jan 9 00:33:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86E30CA24AF; Mon, 9 Jan 2017 00:33:28 +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 5E6DB1632; Mon, 9 Jan 2017 00:33:28 +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 v090XRPO072738; Mon, 9 Jan 2017 00:33:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v090XREB072737; Mon, 9 Jan 2017 00:33:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090033.v090XREB072737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 00:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311711 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:33:28 -0000 Author: ngie Date: Mon Jan 9 00:33:27 2017 New Revision: 311711 URL: https://svnweb.freebsd.org/changeset/base/311711 Log: Clean up trailing whitespace MFC after: 3 days Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Mon Jan 9 00:29:23 2017 (r311710) +++ head/usr.sbin/route6d/route6d.c Mon Jan 9 00:33:27 2017 (r311711) @@ -4,7 +4,7 @@ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,7 +16,7 @@ * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 @@ -106,7 +106,7 @@ struct ifc { /* Configuration of an in }; TAILQ_HEAD(, ifc) ifc_head = TAILQ_HEAD_INITIALIZER(ifc_head); -struct ifac { /* Adddress associated to an interface */ +struct ifac { /* Adddress associated to an interface */ TAILQ_ENTRY(ifac) ifac_next; struct ifc *ifac_ifc; /* back pointer */ @@ -673,7 +673,7 @@ init(void) fatal("rip IPV6_PKTINFO"); /*NOTREACHED*/ } -#endif +#endif #ifdef IPV6_RECVPKTINFO if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, @@ -819,8 +819,8 @@ ripsend(struct ifc *ifcp, struct sockadd * Request from non-link local address is not * a regular route6d update. */ - maxrte = (IFMINMTU - sizeof(struct ip6_hdr) - - sizeof(struct udphdr) - + maxrte = (IFMINMTU - sizeof(struct ip6_hdr) - + sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); nh = NULL; @@ -868,8 +868,8 @@ ripsend(struct ifc *ifcp, struct sockadd return; } - maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) - - sizeof(struct udphdr) - + maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) - + sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); @@ -953,13 +953,13 @@ out_filter(struct riprt *rrt, struct ifc /* * -A: filter out less specific routes, if we have aggregated * route configured. - */ + */ TAILQ_FOREACH(iffp, &ifcp->ifc_iff_head, iff_next) { if (iffp->iff_type != 'A') continue; if (rrt->rrt_info.rip6_plen <= iffp->iff_plen) continue; - ia = rrt->rrt_info.rip6_dest; + ia = rrt->rrt_info.rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) return 0; @@ -995,7 +995,7 @@ out_filter(struct riprt *rrt, struct ifc continue; if (rrt->rrt_info.rip6_plen < iffp->iff_plen) continue; - ia = rrt->rrt_info.rip6_dest; + ia = rrt->rrt_info.rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) { ok = 1; @@ -1195,8 +1195,8 @@ riprecv(void) } else { riprequest(NULL, np, nn, &fsock); } - return; - } + return; + } if (!IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr)) { trace(1, "Response from non-ll addr: %s\n", @@ -1223,7 +1223,7 @@ riprecv(void) * source address to be forwarded to a different link. * So we also check whether the destination address is a link-local * address or the hop limit is 255. Note that RFC2080 does not require - * the specific hop limit for a unicast response, so we cannot assume + * the specific hop limit for a unicast response, so we cannot assume * the limitation. */ if (!IN6_IS_ADDR_LINKLOCAL(&pi->ipi6_addr) && *hlimp != 255) { @@ -1245,7 +1245,7 @@ riprecv(void) return; /* The packet is from me; ignore */ if (rp->rip6_cmd != RIP6_RESPONSE) { trace(1, "Invalid command %d\n", rp->rip6_cmd); - return; + return; } /* -N: no use */ @@ -1323,7 +1323,7 @@ riprecv(void) /* special rule: ::/0 means default, not "in /0" */ if (iffp->iff_plen == 0 && np->rip6_plen > 0) continue; - ia = np->rip6_dest; + ia = np->rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) { ok = 1; @@ -1374,7 +1374,7 @@ riprecv(void) } else if (nq->rip6_metric == np->rip6_metric && np->rip6_metric < HOPCNT_INFINITY6) { if (rrt->rrt_index == ifcp->ifc_index && - IN6_ARE_ADDR_EQUAL(&nh, &rrt->rrt_gw)) { + IN6_ARE_ADDR_EQUAL(&nh, &rrt->rrt_gw)) { /* same metric, same route from same gw */ rrt->rrt_t = t; } else if (rrt->rrt_t < t_half_lifetime) { @@ -1389,7 +1389,7 @@ riprecv(void) rrt->rrt_t = t; } } - /* + /* * if nq->rip6_metric == HOPCNT_INFINITY6 then * do not update age value. Do nothing. */ @@ -1667,7 +1667,7 @@ ifremove(int ifindex) break; } if (ifcp == NULL) - return; + return; tracet(1, "ifremove: %s is departed.\n", ifcp->ifc_name); TAILQ_REMOVE(&ifc_head, ifcp, ifc_next); @@ -1824,7 +1824,7 @@ rtrecv(void) #if 0 if (rta[RTAX_DST] == NULL) { trace(1, "\tno destination, ignored\n"); - continue; + continue; } if (rta[RTAX_DST]->sin6_family != AF_INET6) { trace(1, "\taf mismatch, ignored\n"); @@ -3238,7 +3238,7 @@ ifonly: #if 0 /* * When the address has already been registered in the - * kernel routing table, it should be removed + * kernel routing table, it should be removed */ delroute(&rrt->rrt_info, &gw); #else @@ -3319,7 +3319,7 @@ mask2len(const struct in6_addr *addr, in { int i = 0, j; const u_char *p = (const u_char *)addr; - + for (j = 0; j < lenlim; j++, p++) { if (*p != 0xff) break; @@ -3446,7 +3446,7 @@ ripsuptrig(void) time_t t; double r = rand(); - t = (int)(RIP_TRIG_INT6_MIN + + t = (int)(RIP_TRIG_INT6_MIN + (RIP_TRIG_INT6_MAX - RIP_TRIG_INT6_MIN) * (r / RAND_MAX)); sup_trig_update = time(NULL) + t; return t; From owner-svn-src-all@freebsd.org Mon Jan 9 00:37:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12C7FCA2713; Mon, 9 Jan 2017 00:37: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 D8EAC1A08; Mon, 9 Jan 2017 00:37:10 +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 v090bAZZ072901; Mon, 9 Jan 2017 00:37:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v090bAkD072899; Mon, 9 Jan 2017 00:37:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090037.v090bAkD072899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 00:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311712 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:37:11 -0000 Author: ngie Date: Mon Jan 9 00:37:09 2017 New Revision: 311712 URL: https://svnweb.freebsd.org/changeset/base/311712 Log: Sort #includes MFC after: 3 days Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Mon Jan 9 00:33:27 2017 (r311711) +++ head/usr.sbin/route6d/route6d.c Mon Jan 9 00:37:09 2017 (r311712) @@ -34,44 +34,40 @@ static const char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itojun Exp $"; #endif -#include - -#include -#include -#include -#include -#include -#include -#ifdef __STDC__ -#include -#else -#include -#endif -#include -#include -#include -#include -#ifdef HAVE_POLL_H -#include -#endif - -#include #include #include -#include #include +#include #include #include +#include #include #include #include #include #include #include -#include +#include +#include +#include #include - -#include +#include +#ifdef HAVE_POLL_H +#include +#endif +#include +#include +#ifdef __STDC__ +#include +#else +#include +#endif +#include +#include +#include +#include +#include +#include #include "route6d.h" From owner-svn-src-all@freebsd.org Mon Jan 9 00:38:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12F0CCA2826; Mon, 9 Jan 2017 00:38:21 +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 D95241C58; Mon, 9 Jan 2017 00:38:20 +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 v090cK9e072986; Mon, 9 Jan 2017 00:38:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v090cKqq072985; Mon, 9 Jan 2017 00:38:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090038.v090cKqq072985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 00:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311713 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:38:21 -0000 Author: ngie Date: Mon Jan 9 00:38:19 2017 New Revision: 311713 URL: https://svnweb.freebsd.org/changeset/base/311713 Log: Use nitems(mib) instead of hardcoding mib's length MFC after: 3 days Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Mon Jan 9 00:37:09 2017 (r311712) +++ head/usr.sbin/route6d/route6d.c Mon Jan 9 00:38:19 2017 (r311713) @@ -2418,7 +2418,7 @@ getifmtu(int ifindex) mib[3] = AF_INET6; mib[4] = NET_RT_IFLIST; mib[5] = ifindex; - if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &msize, NULL, 0) < 0) { fatal("sysctl estimate NET_RT_IFLIST"); /*NOTREACHED*/ } @@ -2426,7 +2426,7 @@ getifmtu(int ifindex) fatal("malloc"); /*NOTREACHED*/ } - if (sysctl(mib, 6, buf, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &msize, NULL, 0) < 0) { fatal("sysctl NET_RT_IFLIST"); /*NOTREACHED*/ } @@ -2598,7 +2598,7 @@ krtread(int again) free(buf); buf = NULL; } - if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &msize, NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; } @@ -2606,7 +2606,7 @@ krtread(int again) errmsg = "malloc"; continue; } - if (sysctl(mib, 6, buf, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &msize, NULL, 0) < 0) { errmsg = "sysctl NET_RT_DUMP"; continue; } From owner-svn-src-all@freebsd.org Mon Jan 9 00:47:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62C5DCA2B37; Mon, 9 Jan 2017 00:47:25 +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 3AC8B1166; Mon, 9 Jan 2017 00:47:25 +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 v090lOBb077140; Mon, 9 Jan 2017 00:47:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v090lOlF077136; Mon, 9 Jan 2017 00:47:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090047.v090lOlF077136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 00:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311714 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:47:25 -0000 Author: ngie Date: Mon Jan 9 00:47:23 2017 New Revision: 311714 URL: https://svnweb.freebsd.org/changeset/base/311714 Log: lib/libutil/kinfo_*: style cleanup - Use nitems(mib) instead of hardcoding mib's length - Sort sys/ #includes MFC after: 3 days Modified: head/lib/libutil/kinfo_getallproc.c head/lib/libutil/kinfo_getfile.c head/lib/libutil/kinfo_getproc.c head/lib/libutil/kinfo_getvmmap.c Modified: head/lib/libutil/kinfo_getallproc.c ============================================================================== --- head/lib/libutil/kinfo_getallproc.c Mon Jan 9 00:38:19 2017 (r311713) +++ head/lib/libutil/kinfo_getallproc.c Mon Jan 9 00:47:23 2017 (r311714) @@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -75,14 +75,14 @@ kinfo_getallproc(int *cntp) mib[2] = KERN_PROC_PROC; len = 0; - if (sysctl(mib, 3, NULL, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) return (NULL); kipp = malloc(len); if (kipp == NULL) return (NULL); - if (sysctl(mib, 3, kipp, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), kipp, &len, NULL, 0) < 0) goto bad; if (len % sizeof(*kipp) != 0) goto bad; Modified: head/lib/libutil/kinfo_getfile.c ============================================================================== --- head/lib/libutil/kinfo_getfile.c Mon Jan 9 00:38:19 2017 (r311713) +++ head/lib/libutil/kinfo_getfile.c Mon Jan 9 00:47:23 2017 (r311714) @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -26,14 +26,14 @@ kinfo_getfile(pid_t pid, int *cntp) mib[2] = KERN_PROC_FILEDESC; mib[3] = pid; - error = sysctl(mib, 4, NULL, &len, NULL, 0); + error = sysctl(mib, nitems(mib), NULL, &len, NULL, 0); if (error) return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) return (NULL); - error = sysctl(mib, 4, buf, &len, NULL, 0); + error = sysctl(mib, nitems(mib), buf, &len, NULL, 0); if (error) { free(buf); return (NULL); Modified: head/lib/libutil/kinfo_getproc.c ============================================================================== --- head/lib/libutil/kinfo_getproc.c Mon Jan 9 00:38:19 2017 (r311713) +++ head/lib/libutil/kinfo_getproc.c Mon Jan 9 00:47:23 2017 (r311714) @@ -30,8 +30,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -49,14 +49,14 @@ kinfo_getproc(pid_t pid) mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID; mib[3] = pid; - if (sysctl(mib, 4, NULL, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) return (NULL); kipp = malloc(len); if (kipp == NULL) return (NULL); - if (sysctl(mib, 4, kipp, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), kipp, &len, NULL, 0) < 0) goto bad; if (len != sizeof(*kipp)) goto bad; Modified: head/lib/libutil/kinfo_getvmmap.c ============================================================================== --- head/lib/libutil/kinfo_getvmmap.c Mon Jan 9 00:38:19 2017 (r311713) +++ head/lib/libutil/kinfo_getvmmap.c Mon Jan 9 00:47:23 2017 (r311714) @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -26,14 +26,14 @@ kinfo_getvmmap(pid_t pid, int *cntp) mib[2] = KERN_PROC_VMMAP; mib[3] = pid; - error = sysctl(mib, 4, NULL, &len, NULL, 0); + error = sysctl(mib, nitems(mib), NULL, &len, NULL, 0); if (error) return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) return (NULL); - error = sysctl(mib, 4, buf, &len, NULL, 0); + error = sysctl(mib, nitems(mib), buf, &len, NULL, 0); if (error) { free(buf); return (NULL); From owner-svn-src-all@freebsd.org Mon Jan 9 00:54:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEB47CA2E09; Mon, 9 Jan 2017 00:54:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A80817C9; Mon, 9 Jan 2017 00:54:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v090sIEO080894; Mon, 9 Jan 2017 00:54:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v090sIQV080893; Mon, 9 Jan 2017 00:54:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090054.v090sIQV080893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 00:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311715 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:54:19 -0000 Author: ngie Date: Mon Jan 9 00:54:18 2017 New Revision: 311715 URL: https://svnweb.freebsd.org/changeset/base/311715 Log: Use nitems({mib,name}) instead of hardcoding their value MFC after: 3 days Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Mon Jan 9 00:47:23 2017 (r311714) +++ head/lib/libprocstat/libprocstat.c Mon Jan 9 00:54:18 2017 (r311715) @@ -282,7 +282,7 @@ procstat_getprocs(struct procstat *procs name[1] = KERN_PROC; name[2] = what; name[3] = arg; - error = sysctl(name, 4, NULL, &len, NULL, 0); + error = sysctl(name, nitems(name), NULL, &len, NULL, 0); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); goto fail; @@ -299,7 +299,7 @@ procstat_getprocs(struct procstat *procs goto fail; } olen = len; - error = sysctl(name, 4, p, &len, NULL, 0); + error = sysctl(name, nitems(name), p, &len, NULL, 0); } while (error < 0 && errno == ENOMEM && olen == len); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); @@ -1760,7 +1760,7 @@ getargv(struct procstat *procstat, struc name[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; name[3] = kp->ki_pid; len = nchr; - error = sysctl(name, 4, av->buf, &len, NULL, 0); + error = sysctl(name, nitems(name), av->buf, &len, NULL, 0); if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl(kern.proc.%s)", env ? "env" : "args"); if (error != 0 || len == 0) @@ -1983,7 +1983,7 @@ procstat_getgroups_sysctl(pid_t pid, uns warn("malloc(%zu)", len); return (NULL); } - if (sysctl(mib, 4, groups, &len, NULL, 0) == -1) { + if (sysctl(mib, nitems(mib), groups, &len, NULL, 0) == -1) { warn("sysctl: kern.proc.groups: %d", pid); free(groups); return (NULL); @@ -2059,7 +2059,7 @@ procstat_getumask_sysctl(pid_t pid, unsi mib[2] = KERN_PROC_UMASK; mib[3] = pid; len = sizeof(*maskp); - error = sysctl(mib, 4, maskp, &len, NULL, 0); + error = sysctl(mib, nitems(mib), maskp, &len, NULL, 0); if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.umask: %d", pid); return (error); @@ -2139,7 +2139,7 @@ procstat_getrlimit_sysctl(pid_t pid, int name[3] = pid; name[4] = which; len = sizeof(struct rlimit); - error = sysctl(name, 5, rlimit, &len, NULL, 0); + error = sysctl(name, nitems(name), rlimit, &len, NULL, 0); if (error < 0 && errno != ESRCH) { warn("sysctl: kern.proc.rlimit: %d", pid); return (-1); @@ -2201,7 +2201,7 @@ procstat_getpathname_sysctl(pid_t pid, c name[2] = KERN_PROC_PATHNAME; name[3] = pid; len = maxlen; - error = sysctl(name, 4, pathname, &len, NULL, 0); + error = sysctl(name, nitems(name), pathname, &len, NULL, 0); if (error != 0 && errno != ESRCH) warn("sysctl: kern.proc.pathname: %d", pid); if (len == 0) @@ -2281,7 +2281,7 @@ procstat_getosrel_sysctl(pid_t pid, int name[2] = KERN_PROC_OSREL; name[3] = pid; len = sizeof(*osrelp); - error = sysctl(name, 4, osrelp, &len, NULL, 0); + error = sysctl(name, nitems(name), osrelp, &len, NULL, 0); if (error != 0 && errno != ESRCH) warn("sysctl: kern.proc.osrel: %d", pid); return (error); @@ -2341,7 +2341,7 @@ is_elf32_sysctl(pid_t pid) name[2] = KERN_PROC_SV_NAME; name[3] = pid; len = sizeof(sv_name); - error = sysctl(name, 4, sv_name, &len, NULL, 0); + error = sysctl(name, nitems(name), sv_name, &len, NULL, 0); if (error != 0 || len == 0) return (0); for (i = 0; i < sizeof(elf32_sv_names) / sizeof(*elf32_sv_names); i++) { @@ -2372,7 +2372,7 @@ procstat_getauxv32_sysctl(pid_t pid, uns warn("malloc(%zu)", len); goto out; } - if (sysctl(name, 4, auxv32, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), auxv32, &len, NULL, 0) == -1) { if (errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); goto out; @@ -2421,7 +2421,7 @@ procstat_getauxv_sysctl(pid_t pid, unsig warn("malloc(%zu)", len); return (NULL); } - if (sysctl(name, 4, auxv, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), auxv, &len, NULL, 0) == -1) { if (errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); free(auxv); @@ -2482,7 +2482,7 @@ procstat_getkstack_sysctl(pid_t pid, int name[3] = pid; len = 0; - error = sysctl(name, 4, NULL, &len, NULL, 0); + error = sysctl(name, nitems(name), NULL, &len, NULL, 0); if (error < 0 && errno != ESRCH && errno != EPERM && errno != ENOENT) { warn("sysctl: kern.proc.kstack: %d", pid); return (NULL); @@ -2499,7 +2499,7 @@ procstat_getkstack_sysctl(pid_t pid, int warn("malloc(%zu)", len); return (NULL); } - if (sysctl(name, 4, kkstp, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), kkstp, &len, NULL, 0) == -1) { warn("sysctl: kern.proc.pid: %d", pid); free(kkstp); return (NULL); From owner-svn-src-all@freebsd.org Mon Jan 9 00:55:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01E91CA2E8E; Mon, 9 Jan 2017 00:55:12 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (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 C39FF1976; Mon, 9 Jan 2017 00:55:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 204so3225617pge.2; Sun, 08 Jan 2017 16:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=UCvEM8p/an/UFcmw4sPGffZ7/Bjf+7pCm5gdIHhe4rQ=; b=R8GS75GW0FYNrpBSqfdrvukQvuEJW2moduYxgvb7ldrpQ0A40WL2js6CgwSrQeiW5t 3rJpb9zfR/YgHwmk2zc0iLk64GfYJ/J6C/Qoz+kH2lzWrYGQ3QaP+ekG4t/XN6xWEWwJ 4VIHmqkxXYxBZBc2efLMtk5f3cdfXZE9xSVZK/Db4qebqX7GRpfFFDhi1BiWF6uNKlES 7B421pc+cYQjXpUfOitRw5ksqvitMxY+Bw+fyn6WxDFRgmQuTVMmwrZxzolqLIYAfS8c DULcy5ABgqMPcY4AH1evQMcKqec3PGvrPv+Xntb85p7nJrvywAd2Ixg15k975my7hYEL N0Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=UCvEM8p/an/UFcmw4sPGffZ7/Bjf+7pCm5gdIHhe4rQ=; b=eBj2M4f4P/FOVpin1C9YDURMB/OSJJ8zJ055VEun2mJXBVN3VTkZWyBdlL6rhiT6hc Av5nmwUgvb1pcvhvapHlJRK5mP1b/e7d7MRl2qsX8zScyOo53EVGw6Edm0CeK14sspWX XG8XMRVSZ/ArbJ2ulTanSoApfvdNGoVXjA1KQRMgtJQUeF57k/d3ND1gJ6gsXXjeHBvc FLmicstNoXo07+qOws3/HmX0ItsVdg+/EvcbMLBIU7/K+hqlq2Xx7LvXYi7eCWT++wGV IOnJbVc0IZEh29elaEp7k77BQCcOWyRitly4SYQFu6OHxqV10tsqbPz5d9SGY3CKyD+m FwJQ== X-Gm-Message-State: AIkVDXLhycA6FnCQU8sI5ciAq8l6t9bCyGuawqeQHHgOfUP9jwbk56vGg9KT/AMVUWBO6w== X-Received: by 10.99.152.10 with SMTP id q10mr158462766pgd.106.1483923311132; Sun, 08 Jan 2017 16:55:11 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id o1sm175408399pgf.35.2017.01.08.16.55.10 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Jan 2017 16:55:10 -0800 (PST) Subject: Re: svn commit: r311715 - head/lib/libprocstat Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_D5226151-598D-4ACB-890C-557BE980343F"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701090054.v090sIQV080893@repo.freebsd.org> Date: Sun, 8 Jan 2017 16:55:06 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <6FCB0545-5369-48E7-959B-9A4FB29FA4D7@gmail.com> References: <201701090054.v090sIQV080893@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:55:12 -0000 --Apple-Mail=_D5226151-598D-4ACB-890C-557BE980343F Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jan 8, 2017, at 16:54, Ngie Cooper wrote: > > Author: ngie > Date: Mon Jan 9 00:54:18 2017 > New Revision: 311715 > URL: https://svnweb.freebsd.org/changeset/base/311715 > > Log: > Use nitems({mib,name}) instead of hardcoding their value *value -> length --Apple-Mail=_D5226151-598D-4ACB-890C-557BE980343F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYct9tAAoJEPWDqSZpMIYVszkP/16mkGO3jif2uVcTyjxFqpep 64i94OMveM9Cs0gKS7DXRmAN3mCCb7up/R9eITtDwbZxjei0AdpwoWe4L6JJIdnP ogs2oLomgN7a8j7E83O81+a1MsXwlpEDiw1LmsdEGB9SbcQjzYTh3zq9LdjZKDUV uBpZt6f9Hf3A60EW+TfxNhIsSBprxpy5ms7WynLkuWg33aXkY65zYy4FtzuVndP6 Ll0z1qxtyiIy2w8R2HL371XaeztAGrG/FjQrIYh/VP/EASHgNksiCXV8i5nYVADo biFtS+Q9zdbAsakf+OJYQfIPDinqaGI9zHJARtMkupC2nPR+VevK6NXkzaqpQOR9 7yxoo79ag0Bze99r6AV6l1c/ew6AI8LJyNzKhgg+ugbEayb6PhT7A7yz2RRRJFH0 DS3Vs9b8hTUsv/pC+pWTuj47X//ql1IWeqPThLlO53Mumh09pd/xK//UmHl6WFrO 94odOtDcsA+oi+1T2lZ/H/YwfTG4lEfWFZLml+0VLDUmRCPMhD7YGV6s2ju7yabO zD0FcT1VUAYBnZzf2R/R5Uy7aQNXgrrK3fOlLexF4nVThSr+4tfAnNfq8gSxSR7q 4Fg04jA8vrW/t95bo94cIA7iN7VJEeXV+jD69Lj4oXRjo6oqal0TYzLkjK7+vuQ/ sIJEijJzM0lVbwr0fHK2 =zs3Y -----END PGP SIGNATURE----- --Apple-Mail=_D5226151-598D-4ACB-890C-557BE980343F-- From owner-svn-src-all@freebsd.org Mon Jan 9 01:02:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5EB7CA5144; Mon, 9 Jan 2017 01:02:17 +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 5D9331EE3; Mon, 9 Jan 2017 01:02:17 +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 v0912GsB084894; Mon, 9 Jan 2017 01:02:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0912Gjt084893; Mon, 9 Jan 2017 01:02:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090102.v0912Gjt084893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311717 - stable/11/lib/libc/net X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:02:17 -0000 Author: ngie Date: Mon Jan 9 01:02:16 2017 New Revision: 311717 URL: https://svnweb.freebsd.org/changeset/base/311717 Log: MFC r310984,r311102: r310984: Use calloc instead of malloc + memset(.., 0, ..) r311102 (by pfg): Cleanup inelegant calloc(3) introduced in r310984. Modified: stable/11/lib/libc/net/getaddrinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/11/lib/libc/net/getaddrinfo.c Mon Jan 9 01:00:20 2017 (r311716) +++ stable/11/lib/libc/net/getaddrinfo.c Mon Jan 9 01:02:16 2017 (r311717) @@ -691,9 +691,8 @@ reorder(struct addrinfo *sentinel) return(n); /* allocate a temporary array for sort and initialization of it. */ - if ((aio = malloc(sizeof(*aio) * n)) == NULL) + if ((aio = calloc(n, sizeof(*aio))) == NULL) return(n); /* give up reordering */ - memset(aio, 0, sizeof(*aio) * n); /* retrieve address selection policy from the kernel */ TAILQ_INIT(&policyhead); @@ -1449,9 +1448,8 @@ copy_ai(const struct addrinfo *pai) size_t l; l = sizeof(*ai) + pai->ai_addrlen; - if ((ai = (struct addrinfo *)malloc(l)) == NULL) + if ((ai = calloc(1, l)) == NULL) return NULL; - memset(ai, 0, l); memcpy(ai, pai, sizeof(*ai)); ai->ai_addr = (struct sockaddr *)(void *)(ai + 1); memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen); @@ -1874,8 +1872,7 @@ addrinfo_unmarshal_func(char *buffer, si size = new_ai.ai_addrlen + sizeof(struct addrinfo) + _ALIGNBYTES; - sentinel = (struct addrinfo *)malloc(size); - memset(sentinel, 0, size); + sentinel = calloc(1, size); memcpy(sentinel, &new_ai, sizeof(struct addrinfo)); sentinel->ai_addr = (struct sockaddr *)_ALIGN((char *)sentinel + @@ -1888,8 +1885,7 @@ addrinfo_unmarshal_func(char *buffer, si memcpy(&size, p, sizeof(size_t)); p += sizeof(size_t); - sentinel->ai_canonname = (char *)malloc(size + 1); - memset(sentinel->ai_canonname, 0, size + 1); + sentinel->ai_canonname = calloc(1, size + 1); memcpy(sentinel->ai_canonname, p, size); p += size; From owner-svn-src-all@freebsd.org Mon Jan 9 01:05:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3C26CA51D9; Mon, 9 Jan 2017 01:05:03 +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 50FD71094; Mon, 9 Jan 2017 01:05:03 +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 v09152Ea085086; Mon, 9 Jan 2017 01:05:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09152hO085085; Mon, 9 Jan 2017 01:05:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090105.v09152hO085085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311718 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:05:03 -0000 Author: ngie Date: Mon Jan 9 01:05:02 2017 New Revision: 311718 URL: https://svnweb.freebsd.org/changeset/base/311718 Log: MFC r310984,r311102: r310984: Use calloc instead of malloc + memset(.., 0, ..) r311102 (by pfg): Cleanup inelegant calloc(3) introduced in r310984. Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Mon Jan 9 01:02:16 2017 (r311717) +++ stable/10/lib/libc/net/getaddrinfo.c Mon Jan 9 01:05:02 2017 (r311718) @@ -673,9 +673,8 @@ reorder(struct addrinfo *sentinel) return(n); /* allocate a temporary array for sort and initialization of it. */ - if ((aio = malloc(sizeof(*aio) * n)) == NULL) + if ((aio = calloc(n, sizeof(*aio))) == NULL) return(n); /* give up reordering */ - memset(aio, 0, sizeof(*aio) * n); /* retrieve address selection policy from the kernel */ TAILQ_INIT(&policyhead); @@ -1454,9 +1453,8 @@ copy_ai(const struct addrinfo *pai) size_t l; l = sizeof(*ai) + pai->ai_addrlen; - if ((ai = (struct addrinfo *)malloc(l)) == NULL) + if ((ai = calloc(1, l)) == NULL) return NULL; - memset(ai, 0, l); memcpy(ai, pai, sizeof(*ai)); ai->ai_addr = (struct sockaddr *)(void *)(ai + 1); memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen); @@ -1876,8 +1874,7 @@ addrinfo_unmarshal_func(char *buffer, si size = new_ai.ai_addrlen + sizeof(struct addrinfo) + _ALIGNBYTES; - sentinel = (struct addrinfo *)malloc(size); - memset(sentinel, 0, size); + sentinel = calloc(1, size); memcpy(sentinel, &new_ai, sizeof(struct addrinfo)); sentinel->ai_addr = (struct sockaddr *)_ALIGN((char *)sentinel + @@ -1890,8 +1887,7 @@ addrinfo_unmarshal_func(char *buffer, si memcpy(&size, p, sizeof(size_t)); p += sizeof(size_t); - sentinel->ai_canonname = (char *)malloc(size + 1); - memset(sentinel->ai_canonname, 0, size + 1); + sentinel->ai_canonname = calloc(1, size + 1); memcpy(sentinel->ai_canonname, p, size); p += size; From owner-svn-src-all@freebsd.org Mon Jan 9 01:05:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1448CA5262; Mon, 9 Jan 2017 01:05: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 C03421207; Mon, 9 Jan 2017 01:05:45 +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 v0915ikn085171; Mon, 9 Jan 2017 01:05:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0915i4d085170; Mon, 9 Jan 2017 01:05:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090105.v0915i4d085170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311719 - stable/11/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:05:46 -0000 Author: ngie Date: Mon Jan 9 01:05:44 2017 New Revision: 311719 URL: https://svnweb.freebsd.org/changeset/base/311719 Log: MFC r311393: OS_getSystemUptime: use nitems for calculating the number of elements in a sysctl mib instead of hardcoding the number 2 Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Mon Jan 9 01:05:02 2017 (r311718) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Mon Jan 9 01:05:44 2017 (r311719) @@ -33,7 +33,7 @@ * Host Resources MIB scalars implementation for SNMPd. */ -#include +#include #include #include @@ -85,7 +85,7 @@ OS_getSystemUptime(uint32_t *ut) int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t len = sizeof(kernel_boot_timestamp); - if (sysctl(mib, 2, &kernel_boot_timestamp, + if (sysctl(mib, nitems(mib), &kernel_boot_timestamp, &len, NULL, 0) == -1) { syslog(LOG_ERR, "sysctl KERN_BOOTTIME failed: %m"); return (SNMP_ERR_GENERR); From owner-svn-src-all@freebsd.org Mon Jan 9 01:07:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8154CA52EF; Mon, 9 Jan 2017 01:07:17 +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 B7E201383; Mon, 9 Jan 2017 01:07:17 +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 v0917G3K085266; Mon, 9 Jan 2017 01:07:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0917GwG085265; Mon, 9 Jan 2017 01:07:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090107.v0917GwG085265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311720 - stable/10/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:07:18 -0000 Author: ngie Date: Mon Jan 9 01:07:16 2017 New Revision: 311720 URL: https://svnweb.freebsd.org/changeset/base/311720 Log: MFC r311393: OS_getSystemUptime: use nitems for calculating the number of elements in a sysctl mib instead of hardcoding the number 2 Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Mon Jan 9 01:05:44 2017 (r311719) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Mon Jan 9 01:07:16 2017 (r311720) @@ -33,7 +33,7 @@ * Host Resources MIB scalars implementation for SNMPd. */ -#include +#include #include #include @@ -85,7 +85,7 @@ OS_getSystemUptime(uint32_t *ut) int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t len = sizeof(kernel_boot_timestamp); - if (sysctl(mib, 2, &kernel_boot_timestamp, + if (sysctl(mib, nitems(mib), &kernel_boot_timestamp, &len, NULL, 0) == -1) { syslog(LOG_ERR, "sysctl KERN_BOOTTIME failed: %m"); return (SNMP_ERR_GENERR); From owner-svn-src-all@freebsd.org Mon Jan 9 01:08:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0F4BCA53AE; Mon, 9 Jan 2017 01:08:44 +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 9D69C1568; Mon, 9 Jan 2017 01:08: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 v0918hYw085395; Mon, 9 Jan 2017 01:08:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0918hb4085394; Mon, 9 Jan 2017 01:08:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090108.v0918hb4085394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311721 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:08:44 -0000 Author: ngie Date: Mon Jan 9 01:08:43 2017 New Revision: 311721 URL: https://svnweb.freebsd.org/changeset/base/311721 Log: MFC r311382: Use calloc instead of malloc + memset(.., 0, ..) Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 9 01:07:16 2017 (r311720) +++ stable/10/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 9 01:08:43 2017 (r311721) @@ -143,16 +143,14 @@ lsock_open_port(u_char *name, size_t nam return (SNMP_ERR_BADVALUE); } - if ((port = malloc(sizeof(*port))) == NULL) + if ((port = calloc(1, sizeof(*port))) == NULL) return (SNMP_ERR_GENERR); - memset(port, 0, sizeof(*port)); if (!is_stream) { - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { free(port); return (SNMP_ERR_GENERR); } - memset(peer, 0, sizeof(*peer)); } if ((port->name = malloc(namelen + 1)) == NULL) { free(port); @@ -258,12 +256,11 @@ lsock_listen_input(int fd, void *udata) struct lsock_port *p = udata; struct lsock_peer *peer; - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { syslog(LOG_WARNING, "%s: peer malloc failed", p->name); (void)close(accept(fd, NULL, NULL)); return; } - memset(peer, 0, sizeof(*peer)); peer->port = p; From owner-svn-src-all@freebsd.org Mon Jan 9 01:09:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0B50CA541E; Mon, 9 Jan 2017 01:09:01 +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 A020F1688; Mon, 9 Jan 2017 01:09:01 +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 v09190uI085452; Mon, 9 Jan 2017 01:09:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09190nv085451; Mon, 9 Jan 2017 01:09:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090109.v09190nv085451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311722 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:09:01 -0000 Author: ngie Date: Mon Jan 9 01:09:00 2017 New Revision: 311722 URL: https://svnweb.freebsd.org/changeset/base/311722 Log: MFC r311382: Use calloc instead of malloc + memset(.., 0, ..) Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 9 01:08:43 2017 (r311721) +++ stable/11/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 9 01:09:00 2017 (r311722) @@ -143,16 +143,14 @@ lsock_open_port(u_char *name, size_t nam return (SNMP_ERR_BADVALUE); } - if ((port = malloc(sizeof(*port))) == NULL) + if ((port = calloc(1, sizeof(*port))) == NULL) return (SNMP_ERR_GENERR); - memset(port, 0, sizeof(*port)); if (!is_stream) { - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { free(port); return (SNMP_ERR_GENERR); } - memset(peer, 0, sizeof(*peer)); } if ((port->name = malloc(namelen + 1)) == NULL) { free(port); @@ -258,12 +256,11 @@ lsock_listen_input(int fd, void *udata) struct lsock_port *p = udata; struct lsock_peer *peer; - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { syslog(LOG_WARNING, "%s: peer malloc failed", p->name); (void)close(accept(fd, NULL, NULL)); return; } - memset(peer, 0, sizeof(*peer)); peer->port = p; From owner-svn-src-all@freebsd.org Mon Jan 9 01:11:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA141CA5853; Mon, 9 Jan 2017 01:11:39 +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 7BD271B09; Mon, 9 Jan 2017 01:11:39 +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 v091Bcd1089331; Mon, 9 Jan 2017 01:11:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091Bc5n089330; Mon, 9 Jan 2017 01:11:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090111.v091Bc5n089330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311723 - stable/10/contrib/bsnmp/snmp_usm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:11:39 -0000 Author: ngie Date: Mon Jan 9 01:11:38 2017 New Revision: 311723 URL: https://svnweb.freebsd.org/changeset/base/311723 Log: MFC r311384: op_usm_users: fix indentation in SNMP_OP_SET block Modified: stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Mon Jan 9 01:09:00 2017 (r311722) +++ stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Mon Jan 9 01:11:38 2017 (r311723) @@ -167,7 +167,7 @@ op_usm_users(struct snmp_context *ctx, s if ((uuser = usm_get_user(&val->var, sub)) == NULL && val->var.subs[sub - 1] != LEAF_usmUserStatus && val->var.subs[sub - 1] != LEAF_usmUserCloneFrom) - return (SNMP_ERR_NOSUCHNAME); + return (SNMP_ERR_NOSUCHNAME); if (community != COMM_INITIALIZE && uuser->type == StorageType_readOnly) From owner-svn-src-all@freebsd.org Mon Jan 9 01:11:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9ABCCA588F; Mon, 9 Jan 2017 01:11:46 +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 968781B2A; Mon, 9 Jan 2017 01:11: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 v091BgJF089378; Mon, 9 Jan 2017 01:11:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091Bgnq089377; Mon, 9 Jan 2017 01:11:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090111.v091Bgnq089377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311724 - stable/11/contrib/bsnmp/snmp_usm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:11:47 -0000 Author: ngie Date: Mon Jan 9 01:11:42 2017 New Revision: 311724 URL: https://svnweb.freebsd.org/changeset/base/311724 Log: MFC r311384: op_usm_users: fix indentation in SNMP_OP_SET block Modified: stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c Mon Jan 9 01:11:38 2017 (r311723) +++ stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c Mon Jan 9 01:11:42 2017 (r311724) @@ -167,7 +167,7 @@ op_usm_users(struct snmp_context *ctx, s if ((uuser = usm_get_user(&val->var, sub)) == NULL && val->var.subs[sub - 1] != LEAF_usmUserStatus && val->var.subs[sub - 1] != LEAF_usmUserCloneFrom) - return (SNMP_ERR_NOSUCHNAME); + return (SNMP_ERR_NOSUCHNAME); if (community != COMM_INITIALIZE && uuser->type == StorageType_readOnly) From owner-svn-src-all@freebsd.org Mon Jan 9 01:12:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18ED1CA5953; Mon, 9 Jan 2017 01:12:34 +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 CBAC91E8F; Mon, 9 Jan 2017 01:12: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 v091CW46089492; Mon, 9 Jan 2017 01:12:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091CWnQ089491; Mon, 9 Jan 2017 01:12:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090112.v091CWnQ089491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311725 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:12:34 -0000 Author: ngie Date: Mon Jan 9 01:12:32 2017 New Revision: 311725 URL: https://svnweb.freebsd.org/changeset/base/311725 Log: MFC r311505: Remove unnecessary __unused attribute attached to `ctx` in op_begemot_mibII(..) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Mon Jan 9 01:11:42 2017 (r311724) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Mon Jan 9 01:12:32 2017 (r311725) @@ -37,7 +37,7 @@ * Scalars */ int -op_begemot_mibII(struct snmp_context *ctx __unused, struct snmp_value *value, +op_begemot_mibII(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int idx __unused, enum snmp_op op) { switch (op) { From owner-svn-src-all@freebsd.org Mon Jan 9 01:12:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E877ACA596E; Mon, 9 Jan 2017 01:12:35 +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 B856B1E94; Mon, 9 Jan 2017 01:12:35 +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 v091CYXw089539; Mon, 9 Jan 2017 01:12:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091CYpv089538; Mon, 9 Jan 2017 01:12:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090112.v091CYpv089538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311726 - stable/11/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:12:36 -0000 Author: ngie Date: Mon Jan 9 01:12:34 2017 New Revision: 311726 URL: https://svnweb.freebsd.org/changeset/base/311726 Log: MFC r311505: Remove unnecessary __unused attribute attached to `ctx` in op_begemot_mibII(..) Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c Mon Jan 9 01:12:32 2017 (r311725) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c Mon Jan 9 01:12:34 2017 (r311726) @@ -37,7 +37,7 @@ * Scalars */ int -op_begemot_mibII(struct snmp_context *ctx __unused, struct snmp_value *value, +op_begemot_mibII(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int idx __unused, enum snmp_op op) { switch (op) { From owner-svn-src-all@freebsd.org Mon Jan 9 01:15:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDA72CA5AA7; Mon, 9 Jan 2017 01:15:19 +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 9817D118A; Mon, 9 Jan 2017 01:15:19 +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 v091FI7j089712; Mon, 9 Jan 2017 01:15:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091FIcu089710; Mon, 9 Jan 2017 01:15:18 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701090115.v091FIcu089710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Jan 2017 01:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311727 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:15:19 -0000 Author: ian Date: Mon Jan 9 01:15:18 2017 New Revision: 311727 URL: https://svnweb.freebsd.org/changeset/base/311727 Log: Add support for non-removable media, and a quirk to use polling to detect card insert/remove events on controllers that don't implement the insert and remove interrupts. Bridge drivers can set a new slot option, SDHCI_NON_REMOVABLE, to indicate non-removable media (such as eMMC). The sdhci driver will not enable insert/remove interrupts, and sdhci_generic_get_card_present() will always return true. Bridge drivers can set a new quirk, SDHCI_QUIRK_POLL_CARD_PRESENT, and the sdhci driver will not enable insert/remove interrupts, and instead will use a callout to poll the card-present status at 5 Hz. For bridge drivers that get notified of card insert/remove via gpio interrupts, there is a new sdhci_handle_card_present() function they can call from the gpio interrupt handler to inform the sdhci code of the event. In addition to adding these new features, the existing code to debounce card insertions was updated to use taskqueue_enqueue_timeout() instead of scheduling a callout to do the taskqueue_enqueue(). There is also now a comment explaining that insertion-debounce is what's going on -- it took me a long time to realize that's what the old sdhci_card_delay() routine was really doing. There is no functional difference between the old and new debounce code (I hope!). Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Jan 9 01:12:34 2017 (r311726) +++ head/sys/dev/sdhci/sdhci.c Mon Jan 9 01:15:18 2017 (r311727) @@ -73,6 +73,7 @@ static void sdhci_set_clock(struct sdhci static void sdhci_start(struct sdhci_slot *slot); static void sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data); +static void sdhci_card_poll(void *); static void sdhci_card_task(void *, int); /* helper routines */ @@ -89,6 +90,9 @@ static void sdhci_card_task(void *, int) #define SDHCI_200_MAX_DIVIDER 256 #define SDHCI_300_MAX_DIVIDER 2046 +#define SDHCI_CARD_PRESENT_TICKS (hz / 5) +#define SDHCI_INSERT_DELAY_TICKS (hz / 2) + /* * Broadcom BCM577xx Controller Constants */ @@ -229,10 +233,15 @@ sdhci_init(struct sdhci_slot *slot) slot->intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX | SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT | - SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT | SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE | SDHCI_INT_ACMD12ERR; + + if (!(slot->quirks & SDHCI_QUIRK_POLL_CARD_PRESENT) && + !(slot->opt & SDHCI_NON_REMOVABLE)) { + slot->intmask |= SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT; + } + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -474,14 +483,6 @@ sdhci_transfer_pio(struct sdhci_slot *sl } } -static void -sdhci_card_delay(void *arg) -{ - struct sdhci_slot *slot = arg; - - taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); -} - static void sdhci_card_task(void *arg, int pending) { @@ -491,6 +492,8 @@ sdhci_card_task(void *arg, int pending) if (SDHCI_GET_CARD_PRESENT(slot->bus, slot)) { if (slot->dev == NULL) { /* If card is present - attach mmc bus. */ + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card inserted\n"); slot->dev = device_add_child(slot->bus, "mmc", -1); device_set_ivars(slot->dev, slot); SDHCI_UNLOCK(slot); @@ -500,6 +503,8 @@ sdhci_card_task(void *arg, int pending) } else { if (slot->dev != NULL) { /* If no card present - detach mmc bus. */ + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card removed\n"); device_t d = slot->dev; slot->dev = NULL; SDHCI_UNLOCK(slot); @@ -509,6 +514,44 @@ sdhci_card_task(void *arg, int pending) } } +void +sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present) +{ + bool was_present; + + /* + * If there was no card and now there is one, schedule the task to + * create the child device after a short delay. The delay is to + * debounce the card insert (sometimes the card detect pin stabilizes + * before the other pins have made good contact). + * + * If there was a card present and now it's gone, immediately schedule + * the task to delete the child device. No debouncing -- gone is gone, + * because once power is removed, a full card re-init is needed, and + * that happens by deleting and recreating the child device. + */ + SDHCI_LOCK(slot); + was_present = slot->dev != NULL; + if (!was_present && is_present) { + taskqueue_enqueue_timeout(taskqueue_swi_giant, + &slot->card_delayed_task, -SDHCI_INSERT_DELAY_TICKS); + } else if (was_present && !is_present) { + taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); + } + SDHCI_UNLOCK(slot); +} + +static void +sdhci_card_poll(void *arg) +{ + struct sdhci_slot *slot = arg; + + sdhci_handle_card_present(slot, + SDHCI_GET_CARD_PRESENT(slot->bus, slot)); + callout_reset(&slot->card_poll_callout, SDHCI_CARD_PRESENT_TICKS, + sdhci_card_poll, slot); +} + int sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) { @@ -652,9 +695,17 @@ sdhci_init_slot(device_t dev, struct sdh "timeout", CTLFLAG_RW, &slot->timeout, 0, "Maximum timeout for SDHCI transfers (in secs)"); TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); - callout_init(&slot->card_callout, 1); + TIMEOUT_TASK_INIT(taskqueue_swi_giant, &slot->card_delayed_task, 0, + sdhci_card_task, slot); + callout_init(&slot->card_poll_callout, 1); callout_init_mtx(&slot->timeout_callout, &slot->mtx, 0); + if ((slot->quirks & SDHCI_QUIRK_POLL_CARD_PRESENT) && + !(slot->opt & SDHCI_NON_REMOVABLE)) { + callout_reset(&slot->card_poll_callout, + SDHCI_CARD_PRESENT_TICKS, sdhci_card_poll, slot); + } + return (0); } @@ -670,8 +721,9 @@ sdhci_cleanup_slot(struct sdhci_slot *sl device_t d; callout_drain(&slot->timeout_callout); - callout_drain(&slot->card_callout); + callout_drain(&slot->card_poll_callout); taskqueue_drain(taskqueue_swi_giant, &slot->card_task); + taskqueue_drain_timeout(taskqueue_swi_giant, &slot->card_delayed_task); SDHCI_LOCK(slot); d = slot->dev; @@ -721,6 +773,9 @@ bool sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot) { + if (slot->opt & SDHCI_NON_REMOVABLE) + return true; + return (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT); } @@ -1326,7 +1381,7 @@ sdhci_generic_intr(struct sdhci_slot *sl /* Handle card presence interrupts. */ if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) { - present = SDHCI_GET_CARD_PRESENT(slot->bus, slot); + present = (intmask & SDHCI_INT_CARD_INSERT) != 0; slot->intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); slot->intmask |= present ? SDHCI_INT_CARD_REMOVE : @@ -1335,20 +1390,7 @@ sdhci_generic_intr(struct sdhci_slot *sl WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); WR4(slot, SDHCI_INT_STATUS, intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)); - - if (intmask & SDHCI_INT_CARD_REMOVE) { - if (bootverbose || sdhci_debug) - slot_printf(slot, "Card removed\n"); - callout_stop(&slot->card_callout); - taskqueue_enqueue(taskqueue_swi_giant, - &slot->card_task); - } - if (intmask & SDHCI_INT_CARD_INSERT) { - if (bootverbose || sdhci_debug) - slot_printf(slot, "Card inserted\n"); - callout_reset(&slot->card_callout, hz / 2, - sdhci_card_delay, slot); - } + sdhci_handle_card_present(slot, present); intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); } /* Handle command interrupts. */ Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Mon Jan 9 01:12:34 2017 (r311726) +++ head/sys/dev/sdhci/sdhci.h Mon Jan 9 01:15:18 2017 (r311727) @@ -65,6 +65,8 @@ #define SDHCI_QUIRK_DONT_SET_HISPD_BIT (1<<15) /* Alternate clock source is required when supplying a 400 KHz clock. */ #define SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC (1<<16) +/* Card insert/remove interrupts don't work, polling required. */ +#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) /* * Controller registers @@ -273,8 +275,9 @@ struct sdhci_slot { device_t dev; /* Slot device */ u_char num; /* Slot number */ u_char opt; /* Slot options */ -#define SDHCI_HAVE_DMA 1 -#define SDHCI_PLATFORM_TRANSFER 2 +#define SDHCI_HAVE_DMA 0x01 +#define SDHCI_PLATFORM_TRANSFER 0x02 +#define SDHCI_NON_REMOVABLE 0x04 u_char version; int timeout; /* Transfer timeout */ uint32_t max_clk; /* Max possible freq */ @@ -284,7 +287,9 @@ struct sdhci_slot { u_char *dmamem; bus_addr_t paddr; /* DMA buffer address */ struct task card_task; /* Card presence check task */ - struct callout card_callout; /* Card insert delay callout */ + struct timeout_task + card_delayed_task;/* Card insert delayed task */ + struct callout card_poll_callout;/* Card present polling callout */ struct callout timeout_callout;/* Card command/data response timeout */ struct mmc_host host; /* Host parameters */ struct mmc_request *req; /* Current request */ @@ -323,5 +328,6 @@ int sdhci_generic_release_host(device_t void sdhci_generic_intr(struct sdhci_slot *slot); uint32_t sdhci_generic_min_freq(device_t brdev, struct sdhci_slot *slot); bool sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot); +void sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present); #endif /* __SDHCI_H__ */ From owner-svn-src-all@freebsd.org Mon Jan 9 01:22:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E08CBCA5CC2; Mon, 9 Jan 2017 01:22:47 +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 8B677166E; Mon, 9 Jan 2017 01:22:47 +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 v091Mk8I093866; Mon, 9 Jan 2017 01:22:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091MkPq093864; Mon, 9 Jan 2017 01:22:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090122.v091MkPq093864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311728 - in stable/11/kerberos5: . lib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:22:48 -0000 Author: ngie Date: Mon Jan 9 01:22:46 2017 New Revision: 311728 URL: https://svnweb.freebsd.org/changeset/base/311728 Log: MFC r311112,r311115: r311112: libgssapi_{krb5,ntlm,spnego} requires MK_GSSAPI != no; conditionalize their building on the knob r311115: Conditionalize adding ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et to ETSRCS if MK_GSSAPI != "no" Modified: stable/11/kerberos5/Makefile.inc stable/11/kerberos5/lib/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/kerberos5/Makefile.inc ============================================================================== --- stable/11/kerberos5/Makefile.inc Mon Jan 9 01:15:18 2017 (r311727) +++ stable/11/kerberos5/Makefile.inc Mon Jan 9 01:22:46 2017 (r311728) @@ -26,11 +26,14 @@ ETSRCS= \ ${KRB5DIR}/lib/krb5/k524_err.et \ ${KRB5DIR}/lib/krb5/krb5_err.et \ ${KRB5DIR}/lib/krb5/krb_err.et \ - ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et \ ${KRB5DIR}/lib/hx509/hx509_err.et \ ${KRB5DIR}/lib/wind/wind_err.et \ ${KRB5DIR}/lib/ntlm/ntlm_err.et +.if ${MK_GSSAPI} != "no" +ETSRCS+= ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et +.endif + .for ET in ${ETSRCS} .for _ET in ${ET:T:R} .if ${SRCS:M${_ET}.[ch]} != "" Modified: stable/11/kerberos5/lib/Makefile ============================================================================== --- stable/11/kerberos5/lib/Makefile Mon Jan 9 01:15:18 2017 (r311727) +++ stable/11/kerberos5/lib/Makefile Mon Jan 9 01:22:46 2017 (r311728) @@ -1,11 +1,18 @@ - # $FreeBSD$ -SUBDIR= libasn1 libgssapi_krb5 libgssapi_ntlm libgssapi_spnego libhdb \ +.include + +SUBDIR= libasn1 libhdb \ libheimntlm libhx509 libkadm5clnt libkadm5srv libkrb5 \ libroken libsl libvers libkdc libwind libheimbase libheimipcc libheimipcs SUBDIR+= libkafs5 # requires krb_err.h from libkrb5 SUBDIR_DEPEND_libkafs5= libkrb5 +.if ${MK_GSSAPI} != "no" +SUBDIR+= libgssapi_krb5 +SUBDIR+= libgssapi_ntlm +SUBDIR+= libgssapi_spnego +.endif + .include From owner-svn-src-all@freebsd.org Mon Jan 9 01:29:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3014CA5ED4; Mon, 9 Jan 2017 01:29:21 +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 7FEC9190B; Mon, 9 Jan 2017 01:29:21 +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 v091TKuC094136; Mon, 9 Jan 2017 01:29:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091TK8V094134; Mon, 9 Jan 2017 01:29:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090129.v091TK8V094134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311729 - in stable/10/kerberos5: . lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:29:21 -0000 Author: ngie Date: Mon Jan 9 01:29:20 2017 New Revision: 311729 URL: https://svnweb.freebsd.org/changeset/base/311729 Log: MFC r311112,r311115: r311112: libgssapi_{krb5,ntlm,spnego} requires MK_GSSAPI != no; conditionalize their building on the knob r311115: Conditionalize adding ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et to ETSRCS if MK_GSSAPI != "no" Modified: stable/10/kerberos5/Makefile.inc stable/10/kerberos5/lib/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/kerberos5/Makefile.inc ============================================================================== --- stable/10/kerberos5/Makefile.inc Mon Jan 9 01:22:46 2017 (r311728) +++ stable/10/kerberos5/Makefile.inc Mon Jan 9 01:29:20 2017 (r311729) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + NO_LINT= KRB5DIR= ${.CURDIR}/../../../crypto/heimdal @@ -27,11 +29,14 @@ ETSRCS= \ ${KRB5DIR}/lib/krb5/k524_err.et \ ${KRB5DIR}/lib/krb5/krb5_err.et \ ${KRB5DIR}/lib/krb5/krb_err.et \ - ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et \ ${KRB5DIR}/lib/hx509/hx509_err.et \ ${KRB5DIR}/lib/wind/wind_err.et \ ${KRB5DIR}/lib/ntlm/ntlm_err.et +.if ${MK_GSSAPI} != "no" +ETSRCS+= ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et +.endif + .for ET in ${ETSRCS} .for _ET in ${ET:T:R} .if ${SRCS:M${_ET}.[ch]} != "" Modified: stable/10/kerberos5/lib/Makefile ============================================================================== --- stable/10/kerberos5/lib/Makefile Mon Jan 9 01:22:46 2017 (r311728) +++ stable/10/kerberos5/lib/Makefile Mon Jan 9 01:29:20 2017 (r311729) @@ -1,10 +1,17 @@ - # $FreeBSD$ -SUBDIR= libasn1 libgssapi_krb5 libgssapi_ntlm libgssapi_spnego libhdb \ +.include + +SUBDIR= libasn1 libhdb \ libheimntlm libhx509 libkadm5clnt libkadm5srv libkafs5 libkrb5 \ libroken libsl libvers libkdc libwind libheimsqlite libheimbase libheimipcc libheimipcs SUBDIR_DEPEND_libkafs5= libkrb5 +.if ${MK_GSSAPI} != "no" +SUBDIR+= libgssapi_krb5 +SUBDIR+= libgssapi_ntlm +SUBDIR+= libgssapi_spnego +.endif + .include From owner-svn-src-all@freebsd.org Mon Jan 9 01:31:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07FF2CA5F67; Mon, 9 Jan 2017 01:31: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 CDD931B02; Mon, 9 Jan 2017 01:31: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 v091VDkK094306; Mon, 9 Jan 2017 01:31:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091VD3q094305; Mon, 9 Jan 2017 01:31:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090131.v091VD3q094305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311730 - stable/10/kerberos5/libexec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:31:14 -0000 Author: ngie Date: Mon Jan 9 01:31:12 2017 New Revision: 311730 URL: https://svnweb.freebsd.org/changeset/base/311730 Log: MFC r311114: Build libexec/kadmind when MK_GSSAPI != no because it requires gssapi Modified: stable/10/kerberos5/libexec/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/kerberos5/libexec/Makefile ============================================================================== --- stable/10/kerberos5/libexec/Makefile Mon Jan 9 01:29:20 2017 (r311729) +++ stable/10/kerberos5/libexec/Makefile Mon Jan 9 01:31:12 2017 (r311730) @@ -1,7 +1,13 @@ # $FreeBSD$ -SUBDIR= digest-service ipropd-master ipropd-slave hprop hpropd kadmind kdc \ +.include + +SUBDIR= digest-service ipropd-master ipropd-slave hprop hpropd kdc \ kdigest kfd kimpersonate kpasswdd kcm SUBDIR_PARALLEL= +.if ${MK_GSSAPI} != "no" +SUBDIR+= kadmind +.endif + .include From owner-svn-src-all@freebsd.org Mon Jan 9 01:31:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D11F9CA5FAA; Mon, 9 Jan 2017 01:31:17 +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 A20B31B1A; Mon, 9 Jan 2017 01:31:17 +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 v091VGl6094354; Mon, 9 Jan 2017 01:31:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091VGaF094353; Mon, 9 Jan 2017 01:31:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090131.v091VGaF094353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311731 - stable/11/kerberos5/libexec X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:31:17 -0000 Author: ngie Date: Mon Jan 9 01:31:16 2017 New Revision: 311731 URL: https://svnweb.freebsd.org/changeset/base/311731 Log: MFC r311114: Build libexec/kadmind when MK_GSSAPI != no because it requires gssapi Modified: stable/11/kerberos5/libexec/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/kerberos5/libexec/Makefile ============================================================================== --- stable/11/kerberos5/libexec/Makefile Mon Jan 9 01:31:12 2017 (r311730) +++ stable/11/kerberos5/libexec/Makefile Mon Jan 9 01:31:16 2017 (r311731) @@ -1,7 +1,13 @@ # $FreeBSD$ -SUBDIR= digest-service ipropd-master ipropd-slave hprop hpropd kadmind kdc \ +.include + +SUBDIR= digest-service ipropd-master ipropd-slave hprop hpropd kdc \ kdigest kfd kimpersonate kpasswdd kcm SUBDIR_PARALLEL= +.if ${MK_GSSAPI} != "no" +SUBDIR+= kadmind +.endif + .include From owner-svn-src-all@freebsd.org Mon Jan 9 01:47:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67E90CA5525; Mon, 9 Jan 2017 01:47:01 +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 1DABF14F1; Mon, 9 Jan 2017 01:47:01 +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 v091l0a8002346; Mon, 9 Jan 2017 01:47:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091l0fi002345; Mon, 9 Jan 2017 01:47:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090147.v091l0fi002345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311733 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:47:01 -0000 Author: ngie Date: Mon Jan 9 01:47:00 2017 New Revision: 311733 URL: https://svnweb.freebsd.org/changeset/base/311733 Log: Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3) MFC after: 3 days Modified: head/contrib/bsnmp/snmp_mibII/mibII.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Mon Jan 9 01:35:33 2017 (r311732) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Mon Jan 9 01:47:00 2017 (r311733) @@ -319,7 +319,7 @@ fetch_generic_mib(struct mibif *ifp, con name[5] = IFDATA_GENERAL; len = sizeof(ifp->mib); - if (sysctl(name, 6, &ifp->mib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), &ifp->mib, &len, NULL, 0) == -1) { if (errno != ENOENT) syslog(LOG_WARNING, "sysctl(ifmib, %s) failed %m", ifp->name); @@ -480,7 +480,7 @@ mib_fetch_ifmib(struct mibif *ifp) name[3] = IFMIB_IFDATA; name[4] = ifp->sysindex; name[5] = IFDATA_LINKSPECIFIC; - if (sysctl(name, 6, NULL, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), NULL, &len, NULL, 0) == -1) { syslog(LOG_WARNING, "sysctl linkmib estimate (%s): %m", ifp->name); if (ifp->specmib != NULL) { @@ -506,7 +506,7 @@ mib_fetch_ifmib(struct mibif *ifp) ifp->specmib = newmib; ifp->specmiblen = len; } - if (sysctl(name, 6, ifp->specmib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), ifp->specmib, &len, NULL, 0) == -1) { syslog(LOG_WARNING, "sysctl linkmib (%s): %m", ifp->name); if (ifp->specmib != NULL) { ifp->specmib = NULL; @@ -902,7 +902,7 @@ mib_refresh_iflist(void) for (idx = 1; idx <= count; idx++) { name[4] = idx; len = sizeof(mib); - if (sysctl(name, 6, &mib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), &mib, &len, NULL, 0) == -1) { if (errno == ENOENT) continue; syslog(LOG_ERR, "ifmib(%u): %m", idx); @@ -1213,7 +1213,7 @@ mib_fetch_rtab(int af, int info, int arg *lenp = 0; /* initial estimate */ - if (sysctl(name, 6, NULL, lenp, NULL, 0) == -1) { + if (sysctl(name, nitems(name), NULL, lenp, NULL, 0) == -1) { syslog(LOG_ERR, "sysctl estimate (%d,%d,%d,%d,%d,%d): %m", name[0], name[1], name[2], name[3], name[4], name[5]); return (NULL); @@ -1230,7 +1230,7 @@ mib_fetch_rtab(int af, int info, int arg } buf = newbuf; - if (sysctl(name, 6, buf, lenp, NULL, 0) == 0) + if (sysctl(name, nitems(name), buf, lenp, NULL, 0) == 0) break; if (errno != ENOMEM) { From owner-svn-src-all@freebsd.org Mon Jan 9 01:54:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5DC2CA5868; Mon, 9 Jan 2017 01:54:37 +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 AF73A1B03; Mon, 9 Jan 2017 01:54:37 +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 v091sa8o006234; Mon, 9 Jan 2017 01:54:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091saIa006231; Mon, 9 Jan 2017 01:54:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701090154.v091saIa006231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Jan 2017 01:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311734 - in head/sys: conf dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:54:37 -0000 Author: ian Date: Mon Jan 9 01:54:36 2017 New Revision: 311734 URL: https://svnweb.freebsd.org/changeset/base/311734 Log: Add new helper routines for sdhci bridge drivers that use gpio pins for card presence and write protect switch detection. A bridge driver just needs to call the setup routine in its attach(), the teardown in its detach(), and write a couple tiny glue functions to connect the sdhci interface functions to the new helper functions. This is not extensively documented, but multiple examples will exist real soon. Added: head/sys/dev/sdhci/sdhci_fdt_gpio.c (contents, props changed) head/sys/dev/sdhci/sdhci_fdt_gpio.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jan 9 01:47:00 2017 (r311733) +++ head/sys/conf/files Mon Jan 9 01:54:36 2017 (r311734) @@ -2824,6 +2824,7 @@ dev/scc/scc_dev_quicc.c optional scc qu dev/scc/scc_dev_sab82532.c optional scc dev/scc/scc_dev_z8530.c optional scc dev/sdhci/sdhci.c optional sdhci +dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_pci.c optional sdhci pci dev/sf/if_sf.c optional sf pci Added: head/sys/dev/sdhci/sdhci_fdt_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdhci/sdhci_fdt_gpio.c Mon Jan 9 01:54:36 2017 (r311734) @@ -0,0 +1,256 @@ +/*- + * Copyright (c) 2017 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Support routines usable by any SoC sdhci bridge driver that uses gpio pins + * for card detect and write protect, and uses FDT data to describe those pins. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +struct sdhci_fdt_gpio { + device_t dev; + struct sdhci_slot * slot; + gpio_pin_t wp_pin; + gpio_pin_t cd_pin; + void * cd_ihandler; + struct resource * cd_ires; + int cd_irid; + bool wp_disabled; + bool wp_inverted; + bool cd_disabled; + bool cd_inverted; +}; + +/* + * Card detect interrupt handler. + */ +static void +cd_intr(void *arg) +{ + struct sdhci_fdt_gpio *gpio = arg; + + sdhci_handle_card_present(gpio->slot, sdhci_fdt_gpio_get_present(gpio)); +} + +/* + * Card detect setup. + */ +static void +cd_setup(struct sdhci_fdt_gpio *gpio, phandle_t node) +{ + int pincaps; + device_t dev; + const char *cd_mode_str; + + dev = gpio->dev; + + /* + * If the device is flagged as non-removable, set that slot option, and + * set a flag to make sdhci_fdt_gpio_get_present() always return true. + */ + if (OF_hasprop(node, "non-removable")) { + gpio->slot->opt |= SDHCI_NON_REMOVABLE; + gpio->cd_disabled = true; + if (bootverbose) + device_printf(dev, "Non-removable media"); + return; + } + + /* + * If there is no cd-gpios property, then presumably the hardware + * PRESENT_STATE register and interrupts will reflect card state + * properly, and there's nothing more for us to do. Our get_present() + * will return sdhci_generic_get_card_present() because cd_pin is NULL. + * + * If there is a property, make sure we can read the pin. + */ + if (gpio_pin_get_by_ofw_property(dev, node, "cd-gpios", &gpio->cd_pin)) + return; + + if (gpio_pin_getcaps(gpio->cd_pin, &pincaps) != 0 || + !(pincaps & GPIO_PIN_INPUT)) { + device_printf(dev, "Cannot read card-detect gpio pin; " + "setting card-always-present flag.\n"); + gpio->cd_disabled = true; + return; + } + + if (OF_hasprop(node, "cd-inverted")) + gpio->cd_inverted = true; + + /* + * If the pin can trigger an interrupt on both rising and falling edges, + * we can use it to detect card presence changes. If not, we'll request + * card presence polling instead of using interrupts. + */ + if (!(pincaps & GPIO_INTR_EDGE_BOTH)) { + if (bootverbose) + device_printf(dev, "Cannot configure " + "GPIO_INTR_EDGE_BOTH for card detect\n"); + goto without_interrupts; + } + + /* + * Create an interrupt resource from the pin and set up the interrupt. + */ + if ((gpio->cd_ires = gpio_alloc_intr_resource(dev, &gpio->cd_irid, + RF_ACTIVE, gpio->cd_pin, GPIO_INTR_EDGE_BOTH)) == NULL) { + if (bootverbose) + device_printf(dev, "Cannot allocate an IRQ for card " + "detect GPIO\n"); + goto without_interrupts; + } + + if (bus_setup_intr(dev, gpio->cd_ires, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, cd_intr, gpio, &gpio->cd_ihandler) != 0) { + device_printf(dev, "Unable to setup card-detect irq handler\n"); + gpio->cd_ihandler = NULL; + goto without_interrupts; + } + +without_interrupts: + + /* + * If we have a readable gpio pin, but didn't successfully configure + * gpio interrupts, ask the sdhci driver to poll from a callout. + */ + if (gpio->cd_ihandler == NULL) { + cd_mode_str = "polling"; + gpio->slot->quirks |= SDHCI_QUIRK_POLL_CARD_PRESENT; + } else { + cd_mode_str = "interrupts"; + } + + if (bootverbose) { + device_printf(dev, "Card presence detect on %s pin %u, " + "configured for %s.\n", + device_get_nameunit(gpio->cd_pin->dev), gpio->cd_pin->pin, + cd_mode_str); + } +} + +/* + * Write protect setup. + */ +static void +wp_setup(struct sdhci_fdt_gpio *gpio, phandle_t node) +{ + device_t dev; + + dev = gpio->dev; + + if (OF_hasprop(node, "wp-disable")) + return; + + if (gpio_pin_get_by_ofw_property(dev, node, "wp-gpios", &gpio->wp_pin)) + return; + + if (OF_hasprop(node, "wp-inverted")) + gpio->wp_inverted = true; + + if (bootverbose) + device_printf(dev, "Write protect switch on %s pin %u\n", + device_get_nameunit(gpio->cd_pin->dev), gpio->cd_pin->pin); +} + +struct sdhci_fdt_gpio * +sdhci_fdt_gpio_setup(device_t dev, struct sdhci_slot *slot) +{ + phandle_t node; + struct sdhci_fdt_gpio *gpio; + + gpio = malloc(sizeof(*gpio), M_DEVBUF, M_ZERO | M_WAITOK); + gpio->dev = dev; + gpio->slot = slot; + + node = ofw_bus_get_node(dev); + + wp_setup(gpio, node); + cd_setup(gpio, node); + + return (gpio); +} + +void +sdhci_fdt_gpio_teardown(struct sdhci_fdt_gpio *gpio) +{ + + if (gpio == NULL) + return; + + if (gpio->cd_ihandler != NULL) { + bus_teardown_intr(gpio->dev, gpio->cd_ires, gpio->cd_ihandler); + } + + free(gpio, M_DEVBUF); +} + +bool +sdhci_fdt_gpio_get_present(struct sdhci_fdt_gpio *gpio) +{ + bool pinstate; + + if (gpio->cd_disabled) + return (true); + + if (gpio->cd_pin == NULL) + return (sdhci_generic_get_card_present(gpio->slot->bus, + gpio->slot)); + + gpio_pin_is_active(gpio->cd_pin, &pinstate); + + return (pinstate ^ gpio->cd_inverted); +} + +int +sdhci_fdt_gpio_get_readonly(struct sdhci_fdt_gpio *gpio) +{ + bool pinstate; + + if (gpio->wp_disabled) + return (false); + + if (gpio->wp_pin == NULL) + return (sdhci_generic_get_ro(gpio->slot->bus, gpio->slot->dev)); + + gpio_pin_is_active(gpio->wp_pin, &pinstate); + + return (pinstate ^ gpio->wp_inverted); +} Added: head/sys/dev/sdhci/sdhci_fdt_gpio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdhci/sdhci_fdt_gpio.h Mon Jan 9 01:54:36 2017 (r311734) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2017 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Support routines usable by any SoC sdhci bridge driver that uses gpio pins + * for card detect and/or write protect, and uses FDT data to describe those + * pins. A bridge driver need only supply a couple 2-line forwarding functions + * to connect the get_present and get_readonly accessors to the corresponding + * driver interface functions, and add setup/teardown calls to its attach and + * detach functions. + */ + +#ifndef _SDHCI_FDT_GPIO_H_ +#define _SDHCI_FDT_GPIO_H_ + +struct sdhci_slot; +struct sdhci_fdt_gpio; + +/* + * sdhci_fdt_gpio_setup() + * sdhci_fdt_gpio_teardown() + * + * Process FDT properties that use gpio pins and set up interrupt handling (if + * supported by hardware) and accessor functions to read the pins. + * + * Setup cannot fail. If the properties are not present, the accessors will + * return the values from standard sdhci registers. If the gpio controller + * can't trigger interrupts on both edges, it configures the slot to use polling + * for card presence detection. If it can't access the gpio pin at all it sets + * up the get_present() accessor to always return true. Likewise the + * get_readonly() accessor always returns false if its pin can't be accessed. + */ +struct sdhci_fdt_gpio *sdhci_fdt_gpio_setup(device_t dev, struct sdhci_slot *slot); +void sdhci_fdt_gpio_teardown(struct sdhci_fdt_gpio *gpio); + +/* + * sdhci_fdt_gpio_get_present() + * sdhci_fdt_gpio_get_readonly() + * + * Gpio pin state accessor functions. + */ +bool sdhci_fdt_gpio_get_present(struct sdhci_fdt_gpio *gpio); +int sdhci_fdt_gpio_get_readonly(struct sdhci_fdt_gpio *gpio); + +#endif From owner-svn-src-all@freebsd.org Mon Jan 9 01:57:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6005CA59CB; Mon, 9 Jan 2017 01:57:52 +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 A6C621CC2; Mon, 9 Jan 2017 01:57:52 +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 v091vpVe006409; Mon, 9 Jan 2017 01:57:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091vpV0006408; Mon, 9 Jan 2017 01:57:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701090157.v091vpV0006408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Jan 2017 01:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311735 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:57:53 -0000 Author: ian Date: Mon Jan 9 01:57:51 2017 New Revision: 311735 URL: https://svnweb.freebsd.org/changeset/base/311735 Log: Use the new sdhci_fdt_gpio helper functions to add full support for FDT gpio pins for detecting card insert/remove and write protect. Modified: head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Mon Jan 9 01:54:36 2017 (r311734) +++ head/sys/arm/ti/ti_sdhci.c Mon Jan 9 01:57:51 2017 (r311735) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "sdhci_if.h" #include @@ -61,7 +62,7 @@ __FBSDID("$FreeBSD$"); struct ti_sdhci_softc { device_t dev; - device_t gpio_dev; + struct sdhci_fdt_gpio * gpio; struct resource * mem_res; struct resource * irq_res; void * intr_cookie; @@ -362,20 +363,24 @@ static int ti_sdhci_get_ro(device_t brdev, device_t reqdev) { struct ti_sdhci_softc *sc = device_get_softc(brdev); - unsigned int readonly = 0; - /* If a gpio pin is configured, read it. */ - if (sc->gpio_dev != NULL) { - GPIO_PIN_GET(sc->gpio_dev, sc->wp_gpio_pin, &readonly); - } + return (sdhci_fdt_gpio_get_readonly(sc->gpio)); +} - return (readonly); +static bool +ti_sdhci_get_card_present(device_t dev, struct sdhci_slot *slot) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + + return (sdhci_fdt_gpio_get_present(sc->gpio)); } static int ti_sdhci_detach(device_t dev) { + /* sdhci_fdt_gpio_teardown(sc->gpio); */ + return (EBUSY); } @@ -502,25 +507,6 @@ ti_sdhci_attach(device_t dev) } /* - * See if we've got a GPIO-based write detect pin. This is not the - * standard documented property for this, we added it in freebsd. - */ - if ((OF_getencprop(node, "mmchs-wp-gpio-pin", &prop, sizeof(prop))) <= 0) - sc->wp_gpio_pin = 0xffffffff; - else - sc->wp_gpio_pin = prop; - - if (sc->wp_gpio_pin != 0xffffffff) { - sc->gpio_dev = devclass_get_device(devclass_find("gpio"), 0); - if (sc->gpio_dev == NULL) - device_printf(dev, "Error: No GPIO device, " - "Write Protect pin will not function\n"); - else - GPIO_PIN_SETFLAGS(sc->gpio_dev, sc->wp_gpio_pin, - GPIO_PIN_INPUT); - } - - /* * Set the offset from the device's memory start to the MMCHS registers. * Also for OMAP4 disable high speed mode due to erratum ID i626. */ @@ -572,6 +558,8 @@ ti_sdhci_attach(device_t dev) goto fail; } + sc->gpio = sdhci_fdt_gpio_setup(sc->dev, &sc->slot); + /* Initialise the MMCHS hardware. */ ti_sdhci_hw_init(dev); @@ -706,6 +694,7 @@ static device_method_t ti_sdhci_methods[ DEVMETHOD(sdhci_write_2, ti_sdhci_write_2), DEVMETHOD(sdhci_write_4, ti_sdhci_write_4), DEVMETHOD(sdhci_write_multi_4, ti_sdhci_write_multi_4), + DEVMETHOD(sdhci_get_card_present, ti_sdhci_get_card_present), DEVMETHOD_END }; From owner-svn-src-all@freebsd.org Mon Jan 9 02:04:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB1D0CA5C82; Mon, 9 Jan 2017 02:04:55 +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 97A6A1101; Mon, 9 Jan 2017 02:04:55 +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 v0924s6J010382; Mon, 9 Jan 2017 02:04:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0924sAV010381; Mon, 9 Jan 2017 02:04:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701090204.v0924sAV010381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Jan 2017 02:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311736 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 02:04:55 -0000 Author: ian Date: Mon Jan 9 02:04:54 2017 New Revision: 311736 URL: https://svnweb.freebsd.org/changeset/base/311736 Log: Use the new sdhci_fdt_gpio helper functions to add full support for FDT gpio pins for detecting card insert/remove and write protect. Modified: head/sys/dev/sdhci/fsl_sdhci.c Modified: head/sys/dev/sdhci/fsl_sdhci.c ============================================================================== --- head/sys/dev/sdhci/fsl_sdhci.c Mon Jan 9 01:57:51 2017 (r311735) +++ head/sys/dev/sdhci/fsl_sdhci.c Mon Jan 9 02:04:54 2017 (r311736) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include #include #include @@ -67,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "sdhci_if.h" struct fsl_sdhci_softc { @@ -77,10 +79,10 @@ struct fsl_sdhci_softc { struct sdhci_slot slot; struct callout r1bfix_callout; sbintime_t r1bfix_timeout_at; + struct sdhci_fdt_gpio * gpio; uint32_t baseclk_hz; uint32_t cmd_and_mode; uint32_t r1bfix_intmask; - boolean_t force_card_present; uint16_t sdclockreg_freq_bits; uint8_t r1bfix_type; uint8_t hwtype; @@ -345,8 +347,6 @@ fsl_sdhci_read_4(device_t dev, struct sd val32 &= 0x000F0F07; val32 |= (wrk32 >> 4) & SDHCI_STATE_DAT_MASK; val32 |= (wrk32 >> 9) & SDHCI_RETUNE_REQUEST; - if (sc->force_card_present) - val32 |= SDHCI_CARD_PRESENT; return (val32); } @@ -752,9 +752,15 @@ fsl_sdhci_get_ro(device_t bus, device_t { struct fsl_sdhci_softc *sc = device_get_softc(bus); - if (RD4(sc, SDHCI_PRESENT_STATE) & SDHC_PRES_WPSPL) - return (false); - return (true); + return (sdhci_fdt_gpio_get_readonly(sc->gpio)); +} + +static bool +fsl_sdhci_get_card_present(device_t dev, struct sdhci_slot *slot) +{ + struct fsl_sdhci_softc *sc = device_get_softc(dev); + + return (sdhci_fdt_gpio_get_present(sc->gpio)); } #ifdef __powerpc__ @@ -802,6 +808,7 @@ static int fsl_sdhci_detach(device_t dev) { + /* sdhci_fdt_gpio_teardown(sc->gpio); */ return (EBUSY); } @@ -810,8 +817,8 @@ fsl_sdhci_attach(device_t dev) { struct fsl_sdhci_softc *sc = device_get_softc(dev); int rid, err; - phandle_t node; #ifdef __powerpc__ + phandle_t node; uint32_t protctl; #endif @@ -887,24 +894,13 @@ fsl_sdhci_attach(device_t dev) sc->slot.max_clk = sc->baseclk_hz; /* - * If the slot is flagged with the non-removable property, set our flag - * to always force the SDHCI_CARD_PRESENT bit on. - * - * XXX Workaround for gpio-based card detect... - * - * We don't have gpio support yet. If there's a cd-gpios property just - * force the SDHCI_CARD_PRESENT bit on for now. If there isn't really a - * card there it will fail to probe at the mmc layer and nothing bad - * happens except instantiating an mmcN device for an empty slot. + * Set up any gpio pin handling described in the FDT data. This cannot + * fail; see comments in sdhci_fdt_gpio.h for details. */ - node = ofw_bus_get_node(dev); - if (OF_hasprop(node, "non-removable")) - sc->force_card_present = true; - else if (OF_hasprop(node, "cd-gpios")) { - /* XXX put real gpio hookup here. */ - sc->force_card_present = true; - } + sc->gpio = sdhci_fdt_gpio_setup(dev, &sc->slot); + #ifdef __powerpc__ + node = ofw_bus_get_node(dev); /* Default to big-endian on powerpc */ protctl = RD4(sc, SDHC_PROT_CTRL); protctl &= ~SDHC_PROT_EMODE_MASK; @@ -974,7 +970,7 @@ static device_method_t fsl_sdhci_methods DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), - /* SDHCI registers accessors */ + /* SDHCI accessors */ DEVMETHOD(sdhci_read_1, fsl_sdhci_read_1), DEVMETHOD(sdhci_read_2, fsl_sdhci_read_2), DEVMETHOD(sdhci_read_4, fsl_sdhci_read_4), @@ -983,6 +979,7 @@ static device_method_t fsl_sdhci_methods DEVMETHOD(sdhci_write_2, fsl_sdhci_write_2), DEVMETHOD(sdhci_write_4, fsl_sdhci_write_4), DEVMETHOD(sdhci_write_multi_4, fsl_sdhci_write_multi_4), + DEVMETHOD(sdhci_get_card_present,fsl_sdhci_get_card_present), { 0, 0 } }; From owner-svn-src-all@freebsd.org Mon Jan 9 02:24:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96712CA0466; Mon, 9 Jan 2017 02:24:01 +0000 (UTC) (envelope-from jbeich@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 7B9F41A90; Mon, 9 Jan 2017 02:24:01 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id D7E72487A; Mon, 9 Jan 2017 02:24:00 +0000 (UTC) To: cem@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include In-Reply-To: <201701080626.v086QXDx022252@repo.freebsd.org> Message-Id: <20170109022400.D7E72487A@freefall.freebsd.org> Date: Mon, 9 Jan 2017 02:24:00 +0000 (UTC) From: jbeich@freebsd.org (Jan Beich) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 02:24:01 -0000 "Conrad E. Meyer" writes: > +++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Sun Jan 8 06:26:33 2017 (r311667) > @@ -314,11 +314,12 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) > > /******************************************************************************* > * > - * FUNCTION: AcpiGetTable > + * FUNCTION: AcpiGetTableWithSize > * > * PARAMETERS: Signature - ACPI signature of needed table > * Instance - Which instance (for SSDTs) > * OutTable - Where the pointer to the table is returned > + * TblSize - Size of the table > * > * RETURN: Status and pointer to the requested table > * > @@ -333,10 +334,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) > ******************************************************************************/ > > ACPI_STATUS > -AcpiGetTable ( > +AcpiGetTableWithSize ( Can you adjust ACPI_EXPORT_SYMBOL() as well? It doesn't make sense to export AcpiGetTable() twice but compiler won't complain if you do. From owner-svn-src-all@freebsd.org Mon Jan 9 02:25:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF1E7CA0502; Mon, 9 Jan 2017 02:25:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (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 9BBA11C31; Mon, 9 Jan 2017 02:25:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id f144so4517400pfa.2; Sun, 08 Jan 2017 18:25:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=15WxPo2dFa02BLg/iHtPHYChOXVKFb6fa5djohrPJVc=; b=MXJX8Ctg/6elx27c1IkGG2cpTDqUk/hAT7s2mJG2JKBcjn1BlApblICSem9jLVndIY hR8Q4KYbDr75ewIy5h7UYDWMdCV1dWd8p+Eb8KyPSNmw0BwSVFj7k5THhrFQ1cc3DzLL DHLbbosMliZdaXGRCYTx93kfJTXlk8K/omPoH527Y5eNrgnkbED1TGFdLrTpxOuhTqOb 2AqsQgZjQZ9NenpIWjiHbhIM7goIP1sGObIxulQleLKfH/bqEUaonz2LS+ZrXdgA6iln L9xSxsRzrhfoQvrfz1OLThYaQHvX59pO6sLCC1DpnPyQKXgc2k1bxjse+Zr8Kl7CEaAU l5OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=15WxPo2dFa02BLg/iHtPHYChOXVKFb6fa5djohrPJVc=; b=n1hTHzW5i39uAS7i6GrBixUC/u/2MXT1qTQ21HM280r/Vo8iA/M7pjCxcxPce9TROH HSgzhcGf1zUpcJ5eZTrRYGXQ3C/Qu9V8s3ozKbAnTTRkv+105UywxtsI2KI3qm3REBQS PZkf+vu5HA1l7B9v34/vLGlFpps6Ekdab8zL/UMFYcgZaB9UoCE+l8vsnBdcGUsKjIKy tooE7gceZJevQXsv38pEPgu6sDuXuROhWvFIgbymI+5/4Ctpf2ph0TxQ1GDoxBhYNRht nJXAoQzjRwRo0G2YjiuUqCSErhrslg14tg7qaGpFguaVmcYCJ35GkBFzFz+YHOy9sJGZ d80g== X-Gm-Message-State: AIkVDXLJWAPCktPsi1tMuJggTGnMneGCb0ivDydLxhH/ZhT5suQTUkEiWh/alN6cnKfLSg== X-Received: by 10.84.216.91 with SMTP id f27mr29815428plj.92.1483928720052; Sun, 08 Jan 2017 18:25:20 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id a24sm174345495pfh.57.2017.01.08.18.25.19 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Jan 2017 18:25:19 -0800 (PST) Subject: Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_FEFBCA4B-3EC2-4CAE-B15E-D892D007ED4B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20170109022400.D7E72487A@freefall.freebsd.org> Date: Sun, 8 Jan 2017 18:25:18 -0800 Cc: "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <31477079-EE88-4D42-B006-BB8C1B061DCB@gmail.com> References: <20170109022400.D7E72487A@freefall.freebsd.org> To: Jan Beich X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 02:25:20 -0000 --Apple-Mail=_FEFBCA4B-3EC2-4CAE-B15E-D892D007ED4B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 8, 2017, at 18:24, Jan Beich wrote: >=20 > "Conrad E. Meyer" writes: >=20 >> +++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Sun Jan = 8 06:26:33 2017 (r311667) >> @@ -314,11 +314,12 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) >>=20 >> = /*************************************************************************= ****** >> * >> - * FUNCTION: AcpiGetTable >> + * FUNCTION: AcpiGetTableWithSize >> * >> * PARAMETERS: Signature - ACPI signature of needed table >> * Instance - Which instance (for SSDTs) >> * OutTable - Where the pointer to the table = is returned >> + * TblSize - Size of the table >> * >> * RETURN: Status and pointer to the requested table >> * >> @@ -333,10 +334,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) >> = **************************************************************************= ****/ >>=20 >> ACPI_STATUS >> -AcpiGetTable ( >> +AcpiGetTableWithSize ( >=20 > Can you adjust ACPI_EXPORT_SYMBOL() as well? It doesn't make sense to > export AcpiGetTable() twice but compiler won't complain if you do. Depends on the compiler and the version. IIRC clang won=E2=80=99t, but = gcc will (depending on the version). Cheers, -Ngie --Apple-Mail=_FEFBCA4B-3EC2-4CAE-B15E-D892D007ED4B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYcvSOAAoJEPWDqSZpMIYVEtwP/1cFjNtjU2Fp5oQrp0TGcdUg p34EM859JhAuhFdAqv7LEU66u6c0PMBqZb1nXVvs3O6MGwDig/xvAseUOJChmVkr VOZ6SGKSlkRvv4tDgypRuDYKqej2o7XGKCZW2HFQPqyOOyFfZvPbvgJusVKbvOJB vX8+jKbqt2jB3Kn8RUWJl7a2RRymDhcNHZcv3RVhHin2jNs79883Ek143dT37yxD NmMkldDI9DILxPAWxDyfVopSjgdC8HL08HO8RRH4zeqfd7eSdnrYvaD/aDOEmWZt h2z/cNTPSd8qJ83TTe3VMhCUWbYGr/z0GfWYyPRyR2wKgN79C9NoPVD+OI342uXD cjq5Xo0BEYZLOZOqG1mhV9Cvmi8WWrbMlRgMd7yBDbCiIFH4s0bRDRGEjcefglS9 Ti+Wh3R5M51RRgjJOLxs0qMSbdtXM+7qaYtOz49lQeRfrZdnlDrDu3nqjCMOUGap EyU4cihxqKLFqGS/Wj/ifq7Onx2RmHnhTzuex9godyzPdttwXRRzquukr7HFGy20 9lskFBeEgLicWjLq+wu+TmRgLt9HCYnJKp60hGunuwMZHUqJNbFKPU/fl6l1IBja U9JLBOJojteSs1zlsWltKxc6aVIYfv98dZKCIvaFydxGg0sPd2pOJSj7eKVBhW8b VwnomwcNNROiqKXsLjeD =btMk -----END PGP SIGNATURE----- --Apple-Mail=_FEFBCA4B-3EC2-4CAE-B15E-D892D007ED4B-- From owner-svn-src-all@freebsd.org Mon Jan 9 03:08:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3E0FCA633C; Mon, 9 Jan 2017 03:08:22 +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 A0ECA1486; Mon, 9 Jan 2017 03:08:22 +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 v0938Ltm035373; Mon, 9 Jan 2017 03:08:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0938L66035365; Mon, 9 Jan 2017 03:08:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090308.v0938L66035365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 03:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311739 - in head/usr.sbin/bsnmpd/modules: snmp_atm snmp_hast snmp_hostres snmp_mibII snmp_target snmp_usm snmp_vacm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 03:08:22 -0000 Author: ngie Date: Mon Jan 9 03:08:21 2017 New Revision: 311739 URL: https://svnweb.freebsd.org/changeset/base/311739 Log: Use SRCTOP instead of spelling out the full path with .CURDIR This helps condense the output for CFLAGS and .PATH MFC after: 3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_atm/Makefile head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile head/usr.sbin/bsnmpd/modules/snmp_target/Makefile head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Modified: head/usr.sbin/bsnmpd/modules/snmp_atm/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_atm/Makefile Mon Jan 9 02:48:08 2017 (r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_atm/Makefile Mon Jan 9 03:08:21 2017 (r311739) @@ -2,7 +2,7 @@ # # Author: Harti Brandt -CONTRIB= ${.CURDIR}/../../../../contrib/ngatm +CONTRIB= ${SRCTOP}/contrib/ngatm .PATH: ${CONTRIB}/snmp_atm MOD= atm Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Mon Jan 9 02:48:08 2017 (r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Mon Jan 9 03:08:21 2017 (r311739) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../../../sbin/hastd +.PATH: ${SRCTOP}/sbin/hastd MOD= hast SRCS= ebuf.c @@ -18,7 +18,7 @@ MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= NO_WMISSING_VARIABLE_DECLARATIONS= -CFLAGS+=-I${.CURDIR}/../../../../sbin/hastd +CFLAGS+=-I${SRCTOP}/sbin/hastd CFLAGS+=-DHAVE_CAPSICUM CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 9 02:48:08 2017 (r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 9 03:08:21 2017 (r311739) @@ -28,7 +28,7 @@ # $FreeBSD$ # -LPRSRC= ${.CURDIR}/../../../lpr/common_source +LPRSRC= ${SRCTOP}/usr.sbin/lpr/common_source .PATH: ${LPRSRC} MOD= hostres Modified: head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Mon Jan 9 02:48:08 2017 (r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Mon Jan 9 03:08:21 2017 (r311739) @@ -2,7 +2,7 @@ # # Author: Harti Brandt -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_mibII MOD= mibII Modified: head/usr.sbin/bsnmpd/modules/snmp_target/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_target/Makefile Mon Jan 9 02:48:08 2017 (r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_target/Makefile Mon Jan 9 03:08:21 2017 (r311739) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_target MOD= target Modified: head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile Mon Jan 9 02:48:08 2017 (r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile Mon Jan 9 03:08:21 2017 (r311739) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_usm MOD= usm Modified: head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Mon Jan 9 02:48:08 2017 (r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Mon Jan 9 03:08:21 2017 (r311739) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_vacm MOD= vacm From owner-svn-src-all@freebsd.org Mon Jan 9 03:14:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 138E8CA65D1; Mon, 9 Jan 2017 03:14:06 +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 D41381AFD; Mon, 9 Jan 2017 03:14:05 +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 v093E4Dq039248; Mon, 9 Jan 2017 03:14:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v093E49A039246; Mon, 9 Jan 2017 03:14:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090314.v093E49A039246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 03:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311740 - in head/usr.sbin/bsnmpd/modules: snmp_hostres snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 03:14:06 -0000 Author: ngie Date: Mon Jan 9 03:14:04 2017 New Revision: 311740 URL: https://svnweb.freebsd.org/changeset/base/311740 Log: Improve the smilint target in the hostres and mibII modules - Mark the smilint target .PHONY so it's always executed when requested - Leverage .PATH for BMIBS instead of spelling the path out longhand for them MFC after: 1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 9 03:08:21 2017 (r311739) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 9 03:14:04 2017 (r311740) @@ -76,6 +76,7 @@ LIBADD= kvm devinfo m geom memstat printcap.pico: printcap.c ${CC} ${PICFLAG} -DPIC ${CFLAGS:C/^-W.*//} -c ${.IMPSRC} -o ${.TARGET} -smilint: +smilint: .PHONY +smilint: ${BMIBS} env SMIPATH=.:/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership BEGEMOT-HOSTRES-MIB + smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} Modified: head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Mon Jan 9 03:08:21 2017 (r311739) +++ head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Mon Jan 9 03:14:04 2017 (r311740) @@ -22,6 +22,7 @@ BMIBS= BEGEMOT-IP-MIB.txt BEGEMOT-MIB2-M .include -smilint: +smilint: .PHONY +smilint: ${BMIBS} env SMIPATH=/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership ${BMIBS:C/^/${CONTRIB}\/snmp_mibII\//} + smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} From owner-svn-src-all@freebsd.org Mon Jan 9 03:18:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F234CA6674; Mon, 9 Jan 2017 03:18:20 +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 6127B1D4B; Mon, 9 Jan 2017 03:18:20 +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 v093IJu4039434; Mon, 9 Jan 2017 03:18:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v093IJ5a039433; Mon, 9 Jan 2017 03:18:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090318.v093IJ5a039433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 03:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311741 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 03:18:20 -0000 Author: ngie Date: Mon Jan 9 03:18:19 2017 New Revision: 311741 URL: https://svnweb.freebsd.org/changeset/base/311741 Log: Add a REVISION section to track changes for the hostres module There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after: 1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Mon Jan 9 03:14:04 2017 (r311740) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Mon Jan 9 03:18:19 2017 (r311741) @@ -54,6 +54,9 @@ begemotHostres MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for additional HOST-RESOURCES data." + REVISION "200601030000Z" + DESCRIPTION + "Initial revision." ::= { begemot 202 } begemotHostresObjects OBJECT IDENTIFIER ::= { begemotHostres 1 } From owner-svn-src-all@freebsd.org Mon Jan 9 03:21:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 722FFCA6809; Mon, 9 Jan 2017 03:21:22 +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 41EA210C6; Mon, 9 Jan 2017 03:21:22 +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 v093LLjb039590; Mon, 9 Jan 2017 03:21:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v093LLrH039589; Mon, 9 Jan 2017 03:21:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090321.v093LLrH039589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 03:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311742 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 03:21:22 -0000 Author: ngie Date: Mon Jan 9 03:21:21 2017 New Revision: 311742 URL: https://svnweb.freebsd.org/changeset/base/311742 Log: Add a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after: 1 week Modified: head/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Modified: head/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt ============================================================================== --- head/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Mon Jan 9 03:18:19 2017 (r311741) +++ head/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Mon Jan 9 03:21:21 2017 (r311742) @@ -54,6 +54,9 @@ begemotIp MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for IP stuff that is not in the official IP MIBs." + REVISION "200602130000Z" + DESCRIPTION + "Initial revision." ::= { begemot 3 } begemotIpObjects OBJECT IDENTIFIER ::= { begemotIp 1 } From owner-svn-src-all@freebsd.org Mon Jan 9 03:38:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57F93CA6A7A; Mon, 9 Jan 2017 03:38:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FDC518F2; Mon, 9 Jan 2017 03:38:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v093cgHJ047604; Mon, 9 Jan 2017 03:38:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v093cf9t047600; Mon, 9 Jan 2017 03:38:41 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201701090338.v093cf9t047600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 9 Jan 2017 03:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311743 - in head/sys/dev/hyperv: include utilities vmbus vmbus/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 03:38:43 -0000 Author: sephe Date: Mon Jan 9 03:38:41 2017 New Revision: 311743 URL: https://svnweb.freebsd.org/changeset/base/311743 Log: hyperv: Add method to read 64bit Hyper-V specific time value. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9057 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/utilities/vmbus_timesync.c head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c head/sys/dev/hyperv/vmbus/hyperv.c head/sys/dev/hyperv/vmbus/vmbus_et.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Mon Jan 9 03:21:21 2017 (r311742) +++ head/sys/dev/hyperv/include/hyperv.h Mon Jan 9 03:38:41 2017 (r311743) @@ -79,9 +79,17 @@ struct hyperv_guid { #define HYPERV_GUID_STRLEN 40 -int hyperv_guid2str(const struct hyperv_guid *, char *, size_t); +typedef uint64_t (*hyperv_tc64_t)(void); -extern u_int hyperv_features; /* CPUID_HV_MSR_ */ +int hyperv_guid2str(const struct hyperv_guid *, char *, + size_t); + +/* + * hyperv_tc64 could be NULL, if there were no suitable Hyper-V + * specific timecounter. + */ +extern hyperv_tc64_t hyperv_tc64; +extern u_int hyperv_features; /* CPUID_HV_MSR_ */ #endif /* _KERNEL */ Modified: head/sys/dev/hyperv/utilities/vmbus_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/vmbus_timesync.c Mon Jan 9 03:21:21 2017 (r311742) +++ head/sys/dev/hyperv/utilities/vmbus_timesync.c Mon Jan 9 03:38:41 2017 (r311743) @@ -52,8 +52,7 @@ __FBSDID("$FreeBSD$"); VMBUS_ICVER_LE(VMBUS_IC_VERSION(4, 0), (sc)->ic_msgver) #define VMBUS_TIMESYNC_DORTT(sc) \ - (VMBUS_TIMESYNC_MSGVER4((sc)) &&\ - (hyperv_features & CPUID_HV_MSR_TIME_REFCNT)) + (VMBUS_TIMESYNC_MSGVER4((sc)) && hyperv_tc64 != NULL) static int vmbus_timesync_probe(device_t); static int vmbus_timesync_attach(device_t); @@ -117,7 +116,7 @@ vmbus_timesync(struct vmbus_ic_softc *sc uint64_t hv_ns, vm_ns, rtt = 0; if (VMBUS_TIMESYNC_DORTT(sc)) - rtt = rdmsr(MSR_HV_TIME_REF_COUNT) - sent_tc; + rtt = hyperv_tc64() - sent_tc; hv_ns = (hvtime - VMBUS_ICMSG_TS_BASE + rtt) * HYPERV_TIMER_NS_FACTOR; nanotime(&vm_ts); Modified: head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c ============================================================================== --- head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Mon Jan 9 03:21:21 2017 (r311742) +++ head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Mon Jan 9 03:38:41 2017 (r311743) @@ -133,8 +133,8 @@ hyperv_tsc_vdso_timehands(struct vdso_ti } #define HYPERV_TSC_TIMECOUNT(fence) \ -static u_int \ -hyperv_tsc_timecount_##fence(struct timecounter *tc) \ +static uint64_t \ +hyperv_tc64_tsc_##fence(void) \ { \ struct hyperv_reftsc *tsc_ref = hyperv_ref_tsc.tsc_ref; \ uint32_t seq; \ @@ -162,6 +162,13 @@ hyperv_tsc_timecount_##fence(struct time /* Fallback to the generic timecounter, i.e. rdmsr. */ \ return (rdmsr(MSR_HV_TIME_REF_COUNT)); \ } \ + \ +static u_int \ +hyperv_tsc_timecount_##fence(struct timecounter *tc __unused) \ +{ \ + \ + return (hyperv_tc64_tsc_##fence()); \ +} \ struct __hack HYPERV_TSC_TIMECOUNT(lfence); @@ -170,6 +177,7 @@ HYPERV_TSC_TIMECOUNT(mfence); static void hyperv_tsc_tcinit(void *dummy __unused) { + hyperv_tc64_t tc64 = NULL; uint64_t val, orig; if ((hyperv_features & @@ -182,11 +190,13 @@ hyperv_tsc_tcinit(void *dummy __unused) case CPU_VENDOR_AMD: hyperv_tsc_timecounter.tc_get_timecount = hyperv_tsc_timecount_mfence; + tc64 = hyperv_tc64_tsc_mfence; break; case CPU_VENDOR_INTEL: hyperv_tsc_timecounter.tc_get_timecount = hyperv_tsc_timecount_lfence; + tc64 = hyperv_tc64_tsc_lfence; break; default: @@ -211,6 +221,10 @@ hyperv_tsc_tcinit(void *dummy __unused) /* Register "enlightened" timecounter. */ tc_init(&hyperv_tsc_timecounter); + /* Install 64 bits timecounter method for other modules to use. */ + KASSERT(tc64 != NULL, ("tc64 is not set")); + hyperv_tc64 = tc64; + /* Add device for mmap(2). */ make_dev(&hyperv_tsc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0444, HYPERV_REFTSC_DEVNAME); Modified: head/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv.c Mon Jan 9 03:21:21 2017 (r311742) +++ head/sys/dev/hyperv/vmbus/hyperv.c Mon Jan 9 03:38:41 2017 (r311743) @@ -77,6 +77,8 @@ u_int hyperv_recommends; static u_int hyperv_pm_features; static u_int hyperv_features3; +hyperv_tc64_t hyperv_tc64; + static struct timecounter hyperv_timecounter = { .tc_get_timecount = hyperv_get_timecount, .tc_poll_pps = NULL, @@ -96,6 +98,13 @@ hyperv_get_timecount(struct timecounter return rdmsr(MSR_HV_TIME_REF_COUNT); } +static uint64_t +hyperv_tc64_rdmsr(void) +{ + + return (rdmsr(MSR_HV_TIME_REF_COUNT)); +} + uint64_t hypercall_post_message(bus_addr_t msg_paddr) { @@ -232,6 +241,12 @@ hyperv_init(void *dummy __unused) if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) { /* Register Hyper-V timecounter */ tc_init(&hyperv_timecounter); + + /* + * Install 64 bits timecounter method for other modules + * to use. + */ + hyperv_tc64 = hyperv_tc64_rdmsr; } } SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, Modified: head/sys/dev/hyperv/vmbus/vmbus_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_et.c Mon Jan 9 03:21:21 2017 (r311742) +++ head/sys/dev/hyperv/vmbus/vmbus_et.c Mon Jan 9 03:38:41 2017 (r311743) @@ -48,13 +48,10 @@ __FBSDID("$FreeBSD$"); MSR_HV_STIMER_CFG_SINT_MASK) /* - * Two additionally required features: + * Additionally required feature: * - SynIC is needed for interrupt generation. - * - Time reference counter is needed to set ABS reference count to - * STIMER0_COUNT. */ -#define CPUID_HV_ET_MASK (CPUID_HV_MSR_TIME_REFCNT | \ - CPUID_HV_MSR_SYNIC | \ +#define CPUID_HV_ET_MASK (CPUID_HV_MSR_SYNIC | \ CPUID_HV_MSR_SYNTIMER) static void vmbus_et_identify(driver_t *, device_t); @@ -102,7 +99,7 @@ vmbus_et_start(struct eventtimer *et __u { uint64_t current; - current = rdmsr(MSR_HV_TIME_REF_COUNT); + current = hyperv_tc64(); current += hyperv_sbintime2count(first); wrmsr(MSR_HV_STIMER0_COUNT, current); @@ -131,7 +128,8 @@ vmbus_et_identify(driver_t *driver, devi { if (device_get_unit(parent) != 0 || device_find_child(parent, VMBUS_ET_NAME, -1) != NULL || - (hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK) + (hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK || + hyperv_tc64 == NULL) return; device_add_child(parent, VMBUS_ET_NAME, -1); @@ -187,9 +185,8 @@ vmbus_et_attach(device_t dev) vmbus_et.et_start = vmbus_et_start; /* - * Delay a bit to make sure that MSR_HV_TIME_REF_COUNT will - * not return 0, since writing 0 to STIMER0_COUNT will disable - * STIMER0. + * Delay a bit to make sure that hyperv_tc64 will not return 0, + * since writing 0 to STIMER0_COUNT will disable STIMER0. */ DELAY(100); smp_rendezvous(NULL, vmbus_et_config, NULL, NULL); From owner-svn-src-all@freebsd.org Mon Jan 9 04:35:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAFD8CA6561; Mon, 9 Jan 2017 04:35: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 7DB831FC8; Mon, 9 Jan 2017 04:35: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 v094ZtPH071460; Mon, 9 Jan 2017 04:35:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v094ZtGS071459; Mon, 9 Jan 2017 04:35:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090435.v094ZtGS071459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 04:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311744 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 04:35:56 -0000 Author: ngie Date: Mon Jan 9 04:35:55 2017 New Revision: 311744 URL: https://svnweb.freebsd.org/changeset/base/311744 Log: Document bsd.snmpmod.mk from a high-level MFC after: 2 weeks Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Mon Jan 9 03:38:41 2017 (r311743) +++ head/share/mk/bsd.README Mon Jan 9 04:35:55 2017 (r311744) @@ -410,6 +410,63 @@ If foo has multiple source files, add th =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +The include file, , handles building MIB modules for bsnmpd +from one or more source files, along with their manual pages. It has a +limited number of suffixes, consistent with the current needs of the BSD +tree. + +bsd.snmpmod.mk leverages bsd.lib.mk for building MIB modules and +bsd.files.mk for installing MIB description and definition files. + +It has no additional targets. + +It sets/uses the following variables: + +BMIBS The MIB definitions to install. + +BMIBSDIR The directory where the MIB definitions are installed. + This defaults to `${SHAREDIR}/snmp/mibs`. + +DEFS The MIB description files to install. + +DEFSDIR The directory where MIB description files are installed. + This defaults to `${SHAREDIR}/snmp/defs`. + +EXTRAMIBDEFS Extra MIB description files to use as input when + generating ${MOD}_oid.h and ${MOD}_tree.[ch]. + +EXTRAMIBSYMS Extra MIB definition files used only for extracting + symbols. + + EXTRAMIBSYMS are useful when resolving inter-module + dependencies and are useful with files containing only + enum-definitions. + + See ${MOD}_oid.h for more details. + +MOD The bsnmpd module name. + +XSYM MIB names to extract symbols for. See ${MOD}_oid.h for + more details. + +It generates the following files: + +${MOD}_tree.c A source file and header which programmatically describes +${MOD}_tree.h the MIB (type, OID name, ACCESS attributes, etc). + + The files are generated via "gensnmptree -p". + + See gensnmptree(1) for more details. + +${MOD}_oid.h A header which programmatically describes the MIB root and + MIB tables. + + The files are generated via "gensnmptree -e". + + See gensnmptree(1) for more details. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + The include file contains the default targets for building subdirectories. It has the same seven targets as : all, clean, cleandir, depend, install, lint, and tags. For all of the directories From owner-svn-src-all@freebsd.org Mon Jan 9 05:41:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A465BCA5419; Mon, 9 Jan 2017 05:41:48 +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 7615318F9; Mon, 9 Jan 2017 05:41:48 +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 v095flx1098647; Mon, 9 Jan 2017 05:41:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095fltn098646; Mon, 9 Jan 2017 05:41:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090541.v095fltn098646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 05:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311746 - stable/11/libexec/talkd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:41:48 -0000 Author: delphij Date: Mon Jan 9 05:41:47 2017 New Revision: 311746 URL: https://svnweb.freebsd.org/changeset/base/311746 Log: MFC r310608: Avoid use after free. Modified: stable/11/libexec/talkd/table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/talkd/table.c ============================================================================== --- stable/11/libexec/talkd/table.c Mon Jan 9 05:26:00 2017 (r311745) +++ stable/11/libexec/talkd/table.c Mon Jan 9 05:41:47 2017 (r311746) @@ -82,14 +82,15 @@ static TABLE_ENTRY *table = NIL; CTL_MSG * find_match(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(&tp, NULL); current_time = tp.tv_sec; if (debug) print_request("find_match", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) @@ -115,7 +116,7 @@ find_match(CTL_MSG *request) CTL_MSG * find_request(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(&tp, NULL); @@ -126,7 +127,8 @@ find_request(CTL_MSG *request) */ if (debug) print_request("find_request", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) From owner-svn-src-all@freebsd.org Mon Jan 9 05:44:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8821ACA5561; Mon, 9 Jan 2017 05:44:20 +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 573DA1C37; Mon, 9 Jan 2017 05:44:20 +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 v095iJDf099583; Mon, 9 Jan 2017 05:44:19 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095iJKF099582; Mon, 9 Jan 2017 05:44:19 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090544.v095iJKF099582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 05:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311747 - stable/10/libexec/talkd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:44:20 -0000 Author: delphij Date: Mon Jan 9 05:44:19 2017 New Revision: 311747 URL: https://svnweb.freebsd.org/changeset/base/311747 Log: MFC r310608: Avoid use after free. Modified: stable/10/libexec/talkd/table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/talkd/table.c ============================================================================== --- stable/10/libexec/talkd/table.c Mon Jan 9 05:41:47 2017 (r311746) +++ stable/10/libexec/talkd/table.c Mon Jan 9 05:44:19 2017 (r311747) @@ -82,14 +82,15 @@ static TABLE_ENTRY *table = NIL; CTL_MSG * find_match(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(&tp, NULL); current_time = tp.tv_sec; if (debug) print_request("find_match", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) @@ -115,7 +116,7 @@ find_match(CTL_MSG *request) CTL_MSG * find_request(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(&tp, NULL); @@ -126,7 +127,8 @@ find_request(CTL_MSG *request) */ if (debug) print_request("find_request", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) From owner-svn-src-all@freebsd.org Mon Jan 9 05:46:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93B94CA5603; Mon, 9 Jan 2017 05:46:42 +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 5A3F11DF3; Mon, 9 Jan 2017 05:46:42 +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 v095kfuC099721; Mon, 9 Jan 2017 05:46:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095kfTE099720; Mon, 9 Jan 2017 05:46:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090546.v095kfTE099720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 05:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311748 - head/tools/tools/gensnmpdef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:46:42 -0000 Author: ngie Date: Mon Jan 9 05:46:41 2017 New Revision: 311748 URL: https://svnweb.freebsd.org/changeset/base/311748 Log: Bump WARNS up from 0 to 6 MFC after: 5 days Modified: head/tools/tools/gensnmpdef/Makefile Modified: head/tools/tools/gensnmpdef/Makefile ============================================================================== --- head/tools/tools/gensnmpdef/Makefile Mon Jan 9 05:44:19 2017 (r311747) +++ head/tools/tools/gensnmpdef/Makefile Mon Jan 9 05:46:41 2017 (r311748) @@ -19,4 +19,6 @@ LDFLAGS+= -L${LOCALBASE}/lib LDADD+= -lsmi +WARNS?= 6 + .include From owner-svn-src-all@freebsd.org Mon Jan 9 05:50:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FC9CA56A2; Mon, 9 Jan 2017 05:50:54 +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 D91861FE8; Mon, 9 Jan 2017 05:50:53 +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 v095or41099962; Mon, 9 Jan 2017 05:50:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095orle099958; Mon, 9 Jan 2017 05:50:53 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090550.v095orle099958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 05:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311749 - stable/11/libexec/talkd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:50:54 -0000 Author: delphij Date: Mon Jan 9 05:50:52 2017 New Revision: 311749 URL: https://svnweb.freebsd.org/changeset/base/311749 Log: MFC r310609: Don't use high precision clock for expiration as only second portion is used. Modified: stable/11/libexec/talkd/table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/talkd/table.c ============================================================================== --- stable/11/libexec/talkd/table.c Mon Jan 9 05:46:41 2017 (r311748) +++ stable/11/libexec/talkd/table.c Mon Jan 9 05:50:52 2017 (r311749) @@ -60,7 +60,7 @@ static const char rcsid[] = #define NIL ((TABLE_ENTRY *)0) -static struct timeval tp; +static struct timespec ts; typedef struct table_entry TABLE_ENTRY; @@ -85,8 +85,8 @@ find_match(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; if (debug) print_request("find_match", request); for (ptr = table; ptr != NIL; ptr = next) { @@ -119,8 +119,8 @@ find_request(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; /* * See if this is a repeated message, and check for * out of date entries in the table while we are it. @@ -157,8 +157,8 @@ insert_table(CTL_MSG *request, CTL_RESPO TABLE_ENTRY *ptr; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; request->id_num = new_id(); response->id_num = htonl(request->id_num); /* insert a new entry into the top of the list */ From owner-svn-src-all@freebsd.org Mon Jan 9 05:51:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD23CA5833; Mon, 9 Jan 2017 05:51:39 +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 1F64A11CE; Mon, 9 Jan 2017 05:51:39 +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 v095pcA4002222; Mon, 9 Jan 2017 05:51:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095pcOl002221; Mon, 9 Jan 2017 05:51:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090551.v095pcOl002221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 05:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311750 - head/contrib/bsnmp/gensnmpdef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:51:39 -0000 Author: ngie Date: Mon Jan 9 05:51:38 2017 New Revision: 311750 URL: https://svnweb.freebsd.org/changeset/base/311750 Log: Check result from smiGetFirstNode and smiGetNodeByOID This avoids a segfault with malformed or unanticipated files, like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS). MFC after: 5 days Found with: gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c ============================================================================== --- head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 05:50:52 2017 (r311749) +++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 05:51:38 2017 (r311750) @@ -126,9 +126,11 @@ open_node(const SmiNode *n, u_int level, while (level < n->oidlen - 1) { if (level >= cut) { + n1 = smiGetNodeByOID(level + 1, n->oid); + if (n1 == NULL) + continue; pindent(level); printf("(%u", n->oid[level]); - n1 = smiGetNodeByOID(level + 1, n->oid); printf(" "); print_name(n1); printf("\n"); @@ -560,6 +562,8 @@ main(int argc, char *argv[]) last = NULL; for (opt = 0; opt < argc; opt++) { n = smiGetFirstNode(mods[opt], SMI_NODEKIND_ANY); + if (n == NULL) + continue; for (;;) { if (do_typedef == 0) { level = open_node(n, level, &last); From owner-svn-src-all@freebsd.org Mon Jan 9 05:52:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6953CA58AA; Mon, 9 Jan 2017 05:52:31 +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 75C4C1579; Mon, 9 Jan 2017 05:52:31 +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 v095qUjv003892; Mon, 9 Jan 2017 05:52:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095qUUA003891; Mon, 9 Jan 2017 05:52:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090552.v095qUUA003891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 05:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311751 - stable/10/libexec/talkd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:52:31 -0000 Author: delphij Date: Mon Jan 9 05:52:30 2017 New Revision: 311751 URL: https://svnweb.freebsd.org/changeset/base/311751 Log: MFC r310609: Don't use high precision clock for expiration as only second portion is used. Modified: stable/10/libexec/talkd/table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/talkd/table.c ============================================================================== --- stable/10/libexec/talkd/table.c Mon Jan 9 05:51:38 2017 (r311750) +++ stable/10/libexec/talkd/table.c Mon Jan 9 05:52:30 2017 (r311751) @@ -60,7 +60,7 @@ static const char rcsid[] = #define NIL ((TABLE_ENTRY *)0) -static struct timeval tp; +static struct timespec ts; typedef struct table_entry TABLE_ENTRY; @@ -85,8 +85,8 @@ find_match(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; if (debug) print_request("find_match", request); for (ptr = table; ptr != NIL; ptr = next) { @@ -119,8 +119,8 @@ find_request(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; /* * See if this is a repeated message, and check for * out of date entries in the table while we are it. @@ -157,8 +157,8 @@ insert_table(CTL_MSG *request, CTL_RESPO TABLE_ENTRY *ptr; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; request->id_num = new_id(); response->id_num = htonl(request->id_num); /* insert a new entry into the top of the list */ From owner-svn-src-all@freebsd.org Mon Jan 9 05:57:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68AE1CA59E6; Mon, 9 Jan 2017 05:57:32 +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 387861802; Mon, 9 Jan 2017 05:57: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 v095vVAH004237; Mon, 9 Jan 2017 05:57:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095vVFW004236; Mon, 9 Jan 2017 05:57:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090557.v095vVFW004236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 05:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311752 - stable/11/usr.sbin/pstat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:57:32 -0000 Author: delphij Date: Mon Jan 9 05:57:31 2017 New Revision: 311752 URL: https://svnweb.freebsd.org/changeset/base/311752 Log: MFC r310611: - pstat(8) does not accept any arguments other than getopt() args, so don't bother to adjust argc/argv after getopt() loop. - Make a string pointer constant. Modified: stable/11/usr.sbin/pstat/pstat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/pstat/pstat.c ============================================================================== --- stable/11/usr.sbin/pstat/pstat.c Mon Jan 9 05:52:30 2017 (r311751) +++ stable/11/usr.sbin/pstat/pstat.c Mon Jan 9 05:57:31 2017 (r311752) @@ -174,8 +174,6 @@ main(int argc, char *argv[]) default: usage(); } - argc -= optind; - argv += optind; /* * Initialize symbol names list. @@ -339,7 +337,7 @@ static void ttyprt(struct xtty *xt) { int i, j; - char *name; + const char *name; if (xt->xt_size != sizeof *xt) errx(1, "struct xtty size mismatch"); From owner-svn-src-all@freebsd.org Mon Jan 9 05:58:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8D5ECA5A82; Mon, 9 Jan 2017 05:58:49 +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 B78091971; Mon, 9 Jan 2017 05:58:49 +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 v095wm0p004330; Mon, 9 Jan 2017 05:58:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095wmEg004329; Mon, 9 Jan 2017 05:58:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090558.v095wmEg004329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 05:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311753 - stable/10/usr.sbin/pstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:58:50 -0000 Author: delphij Date: Mon Jan 9 05:58:48 2017 New Revision: 311753 URL: https://svnweb.freebsd.org/changeset/base/311753 Log: MFC r310611: - pstat(8) does not accept any arguments other than getopt() args, so don't bother to adjust argc/argv after getopt() loop. - Make a string pointer constant. Modified: stable/10/usr.sbin/pstat/pstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pstat/pstat.c ============================================================================== --- stable/10/usr.sbin/pstat/pstat.c Mon Jan 9 05:57:31 2017 (r311752) +++ stable/10/usr.sbin/pstat/pstat.c Mon Jan 9 05:58:48 2017 (r311753) @@ -174,8 +174,6 @@ main(int argc, char *argv[]) default: usage(); } - argc -= optind; - argv += optind; /* * Initialize symbol names list. @@ -339,7 +337,7 @@ static void ttyprt(struct xtty *xt) { int i, j; - char *name; + const char *name; if (xt->xt_size != sizeof *xt) errx(1, "struct xtty size mismatch"); From owner-svn-src-all@freebsd.org Mon Jan 9 06:03:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF2BBCA5D19; Mon, 9 Jan 2017 06:03:50 +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 A152E1E9F; Mon, 9 Jan 2017 06:03:50 +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 v0963nIB008436; Mon, 9 Jan 2017 06:03:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0963nCc008435; Mon, 9 Jan 2017 06:03:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090603.v0963nCc008435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 06:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311754 - head/contrib/bsnmp/gensnmpdef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:03:50 -0000 Author: ngie Date: Mon Jan 9 06:03:49 2017 New Revision: 311754 URL: https://svnweb.freebsd.org/changeset/base/311754 Log: Use calloc instead of malloc + memset(.., 0, ..) MFC after: 5 days Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c ============================================================================== --- head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 05:58:48 2017 (r311753) +++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 06:03:49 2017 (r311754) @@ -399,12 +399,11 @@ static void save_typdef(char *name) { struct tdef *t; - t = malloc(sizeof(struct tdef)); + t = calloc(1, sizeof(struct tdef)); if (t == NULL) err(1, NULL); - memset(t, 0 , sizeof(struct tdef)); t->name = name; SLIST_INSERT_HEAD(&tdefs, t, link); } From owner-svn-src-all@freebsd.org Mon Jan 9 06:05:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF10CA5DD7; Mon, 9 Jan 2017 06:05:58 +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 A90211066; Mon, 9 Jan 2017 06:05:58 +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 v0965vAa008561; Mon, 9 Jan 2017 06:05:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0965vBk008560; Mon, 9 Jan 2017 06:05:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090605.v0965vBk008560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 06:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311755 - stable/11/usr.sbin/jail X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:05:59 -0000 Author: delphij Date: Mon Jan 9 06:05:57 2017 New Revision: 311755 URL: https://svnweb.freebsd.org/changeset/base/311755 Log: MFC r310614: Don't assign rtjp twice. Modified: stable/11/usr.sbin/jail/jail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/jail/jail.c ============================================================================== --- stable/11/usr.sbin/jail/jail.c Mon Jan 9 06:03:49 2017 (r311754) +++ stable/11/usr.sbin/jail/jail.c Mon Jan 9 06:05:57 2017 (r311755) @@ -806,8 +806,7 @@ rdtun_params(struct cfjail *j, int dofai if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { rtjp = rtparams + 1; - for (jp = j->jp, rtjp = rtparams + 1; rtjp < rtparams + nrt; - jp++) { + for (jp = j->jp; rtjp < rtparams + nrt; jp++) { if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { if (!((jp->jp_flags & (JP_BOOL | JP_NOBOOL)) && jp->jp_valuelen == 0 && From owner-svn-src-all@freebsd.org Mon Jan 9 06:07:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E89BDCA5EB8; Mon, 9 Jan 2017 06:07:45 +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 BA2CF1244; Mon, 9 Jan 2017 06:07:45 +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 v0967i2L008668; Mon, 9 Jan 2017 06:07:44 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0967iZD008667; Mon, 9 Jan 2017 06:07:44 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090607.v0967iZD008667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 06:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311756 - stable/10/usr.sbin/jail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:07:46 -0000 Author: delphij Date: Mon Jan 9 06:07:44 2017 New Revision: 311756 URL: https://svnweb.freebsd.org/changeset/base/311756 Log: MFC r310614: Don't assign rtjp twice. Modified: stable/10/usr.sbin/jail/jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/jail.c ============================================================================== --- stable/10/usr.sbin/jail/jail.c Mon Jan 9 06:05:57 2017 (r311755) +++ stable/10/usr.sbin/jail/jail.c Mon Jan 9 06:07:44 2017 (r311756) @@ -806,8 +806,7 @@ rdtun_params(struct cfjail *j, int dofai if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { rtjp = rtparams + 1; - for (jp = j->jp, rtjp = rtparams + 1; rtjp < rtparams + nrt; - jp++) { + for (jp = j->jp; rtjp < rtparams + nrt; jp++) { if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { if (!((jp->jp_flags & (JP_BOOL | JP_NOBOOL)) && jp->jp_valuelen == 0 && From owner-svn-src-all@freebsd.org Mon Jan 9 06:13:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24E60CA6158; Mon, 9 Jan 2017 06:13:29 +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 E5769170F; Mon, 9 Jan 2017 06:13:28 +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 v096DSWq012401; Mon, 9 Jan 2017 06:13:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v096DSp3012400; Mon, 9 Jan 2017 06:13:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090613.v096DSp3012400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 06:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311757 - head/contrib/bsnmp/gensnmpdef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:13:29 -0000 Author: ngie Date: Mon Jan 9 06:13:27 2017 New Revision: 311757 URL: https://svnweb.freebsd.org/changeset/base/311757 Log: Similar to r311750, check for the result from smiGetModule to avoid a segfault when dereferencing a NULL pointer later on. Choose to just check for the NULL pointer in the next for-loop for now to fix the issue with a minimal amount of code churn sys/queue.h use here would make more sense than using a static table MFC after: 5 days Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c ============================================================================== --- head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 06:07:44 2017 (r311756) +++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 06:13:27 2017 (r311757) @@ -560,6 +560,8 @@ main(int argc, char *argv[]) level = 0; last = NULL; for (opt = 0; opt < argc; opt++) { + if (mods[opt] == NULL) /* smiGetModule failed above */ + continue; n = smiGetFirstNode(mods[opt], SMI_NODEKIND_ANY); if (n == NULL) continue; From owner-svn-src-all@freebsd.org Mon Jan 9 06:19:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAA4DCA61E1; Mon, 9 Jan 2017 06:19:21 +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 A8D8818D5; Mon, 9 Jan 2017 06:19:21 +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 v096JK3x012626; Mon, 9 Jan 2017 06:19:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v096JKYW012625; Mon, 9 Jan 2017 06:19:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090619.v096JKYW012625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 06:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311758 - head/usr.sbin/bsnmpd/modules/snmp_atm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:19:22 -0000 Author: ngie Date: Mon Jan 9 06:19:20 2017 New Revision: 311758 URL: https://svnweb.freebsd.org/changeset/base/311758 Log: Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after: 1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Modified: head/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Mon Jan 9 06:13:27 2017 (r311757) +++ head/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Mon Jan 9 06:19:20 2017 (r311758) @@ -56,7 +56,9 @@ begemotAtmFreeBSDGroup MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The FreeBSD specific Begemot MIB for ATM interfaces." - + REVISION "200408060000Z" + DESCRIPTION + "Initial revision." ::= { begemotAtmSysGroup 1 } -- Netgraph From owner-svn-src-all@freebsd.org Mon Jan 9 06:24:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 726C8CA637D; Mon, 9 Jan 2017 06:24:29 +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 447EF1D0D; Mon, 9 Jan 2017 06:24:29 +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 v096OS1S016596; Mon, 9 Jan 2017 06:24:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v096OSV8016595; Mon, 9 Jan 2017 06:24:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090624.v096OSV8016595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 06:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311759 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:24:29 -0000 Author: ngie Date: Mon Jan 9 06:24:28 2017 New Revision: 311759 URL: https://svnweb.freebsd.org/changeset/base/311759 Log: Add a REVISION section to track changes for the FOKUS-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after: 1 week Modified: head/contrib/bsnmp/snmpd/FOKUS-MIB.txt Modified: head/contrib/bsnmp/snmpd/FOKUS-MIB.txt ============================================================================== --- head/contrib/bsnmp/snmpd/FOKUS-MIB.txt Mon Jan 9 06:19:20 2017 (r311758) +++ head/contrib/bsnmp/snmpd/FOKUS-MIB.txt Mon Jan 9 06:24:28 2017 (r311759) @@ -52,6 +52,9 @@ fokus MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The root of the Fokus enterprises tree." + REVISION "200202050000Z" + DESCRIPTION + "Initial revision." ::= { enterprises 12325 } END From owner-svn-src-all@freebsd.org Mon Jan 9 06:27:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6818CA6407; Mon, 9 Jan 2017 06:27: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 6DED11EBB; Mon, 9 Jan 2017 06:27: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 v096RUF8016740; Mon, 9 Jan 2017 06:27:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v096RUXs016739; Mon, 9 Jan 2017 06:27:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090627.v096RUXs016739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 06:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311760 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:27:31 -0000 Author: ngie Date: Mon Jan 9 06:27:30 2017 New Revision: 311760 URL: https://svnweb.freebsd.org/changeset/base/311760 Log: Add a REVISION section to track changes for the BEGEMOT-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after: 1 week Modified: head/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt Modified: head/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt ============================================================================== --- head/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt Mon Jan 9 06:24:28 2017 (r311759) +++ head/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt Mon Jan 9 06:27:30 2017 (r311760) @@ -54,6 +54,9 @@ begemot MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The root of the Begemot subtree of the fokus tree." + REVISION "200201300000Z" + DESCRIPTION + "Initial revision." ::= { fokus 1 } END From owner-svn-src-all@freebsd.org Mon Jan 9 06:36:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D2FDCA66D9; Mon, 9 Jan 2017 06:36:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E05FF14A0; Mon, 9 Jan 2017 06:36:18 +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 v096aITN020797; Mon, 9 Jan 2017 06:36:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v096aIpm020796; Mon, 9 Jan 2017 06:36:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090636.v096aIpm020796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 06:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311761 - head/usr.sbin/bsnmpd/modules/snmp_netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:36:19 -0000 Author: ngie Date: Mon Jan 9 06:36:17 2017 New Revision: 311761 URL: https://svnweb.freebsd.org/changeset/base/311761 Log: Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file This change also documents the modification harti made to a handful of objects in r122758 (the max OCTET STRING width was increased from 15 to 31 octets) MFC after: 1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Modified: head/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Mon Jan 9 06:27:30 2017 (r311760) +++ head/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Mon Jan 9 06:36:17 2017 (r311761) @@ -59,6 +59,19 @@ begemotNg MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for the NetGraph access module for SNMP." + REVISION "200311140000Z" + DESCRIPTION + "The maximum width of the following OCTET STRINGs was increased + from 15 to 31: + + - NgTypeName + - NgNodeName + - NgNodeNameOrEmpty + - NgHookName + " + REVISION "200201310000Z" + DESCRIPTION + "Initial revision." ::= { begemot 2 } begemotNgObjects OBJECT IDENTIFIER ::= { begemotNg 1 } From owner-svn-src-all@freebsd.org Mon Jan 9 07:36:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1CE1CA64AA; Mon, 9 Jan 2017 07:36:32 +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 8156C1FBB; Mon, 9 Jan 2017 07:36: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 v097aV40045022; Mon, 9 Jan 2017 07:36:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v097aVFG045021; Mon, 9 Jan 2017 07:36:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090736.v097aVFG045021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 07:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311762 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 07:36:32 -0000 Author: delphij Date: Mon Jan 9 07:36:31 2017 New Revision: 311762 URL: https://svnweb.freebsd.org/changeset/base/311762 Log: Fix typo. MFC after: 3 days Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Mon Jan 9 06:36:17 2017 (r311761) +++ head/usr.bin/netstat/route.c Mon Jan 9 07:36:31 2017 (r311762) @@ -496,7 +496,7 @@ fmt_sockaddr(struct sockaddr *sa, struct cq = buf; slim = sa->sa_len + (u_char *) sa; cqlim = cq + sizeof(buf) - sizeof(" ffff"); - snprintf(cq, sizeof(cq), "(%d)", sa->sa_family); + snprintf(cq, sizeof(buf), "(%d)", sa->sa_family); cq += strlen(cq); while (s < slim && cq < cqlim) { snprintf(cq, sizeof(" ff"), " %02x", *s++); From owner-svn-src-all@freebsd.org Mon Jan 9 08:05:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C1BDCA636B; Mon, 9 Jan 2017 08:05:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE19411DA; Mon, 9 Jan 2017 08:05:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0985Fkt057395; Mon, 9 Jan 2017 08:05:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0985Fag057394; Mon, 9 Jan 2017 08:05:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701090805.v0985Fag057394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 Jan 2017 08:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311763 - stable/11/sys/dev/sfxge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 08:05:16 -0000 Author: arybchik Date: Mon Jan 9 08:05:14 2017 New Revision: 311763 URL: https://svnweb.freebsd.org/changeset/base/311763 Log: MFC r311638 sfxge(4): use SFXGE_LINK_UP() to report link up state Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_port.c Mon Jan 9 07:36:31 2017 (r311762) +++ stable/11/sys/dev/sfxge/sfxge_port.c Mon Jan 9 08:05:14 2017 (r311763) @@ -311,8 +311,7 @@ sfxge_mac_link_update(struct sfxge_softc port->link_mode = mode; /* Push link state update to the OS */ - link_state = (port->link_mode != EFX_LINK_DOWN ? - LINK_STATE_UP : LINK_STATE_DOWN); + link_state = (SFXGE_LINK_UP(sc) ? LINK_STATE_UP : LINK_STATE_DOWN); sc->ifnet->if_baudrate = sfxge_link_baudrate[port->link_mode]; if_link_state_change(sc->ifnet, link_state); } From owner-svn-src-all@freebsd.org Mon Jan 9 08:06:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 729B8CA63E2; Mon, 9 Jan 2017 08:06:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 408B41352; Mon, 9 Jan 2017 08:06:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09861HU057484; Mon, 9 Jan 2017 08:06:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09861Pm057483; Mon, 9 Jan 2017 08:06:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701090806.v09861Pm057483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 Jan 2017 08:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311764 - stable/11/sys/dev/sfxge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 08:06:02 -0000 Author: arybchik Date: Mon Jan 9 08:06:01 2017 New Revision: 311764 URL: https://svnweb.freebsd.org/changeset/base/311764 Log: MFC r311639 sfxge(4): treat EFX_LINK_UNKOWN as link down It is safer to consider EFX_LINK_UNKNOWN as link down. link_mode is set to EFX_LINK_UNKNOWN on port stop and fini. Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/sfxge.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/11/sys/dev/sfxge/sfxge.h Mon Jan 9 08:05:14 2017 (r311763) +++ stable/11/sys/dev/sfxge/sfxge.h Mon Jan 9 08:06:01 2017 (r311764) @@ -326,7 +326,9 @@ struct sfxge_softc { #endif }; -#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) +#define SFXGE_LINK_UP(sc) \ + ((sc)->port.link_mode != EFX_LINK_DOWN && \ + (sc)->port.link_mode != EFX_LINK_UNKNOWN) #define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING) #define SFXGE_PARAM(_name) "hw.sfxge." #_name From owner-svn-src-all@freebsd.org Mon Jan 9 08:07:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 947DFCA6457; Mon, 9 Jan 2017 08:07:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 717031528; Mon, 9 Jan 2017 08:07:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0987Jox057591; Mon, 9 Jan 2017 08:07:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0987Jls057583; Mon, 9 Jan 2017 08:07:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701090807.v0987Jls057583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 Jan 2017 08:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311765 - in stable/11/sys/dev/sfxge: . common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 08:07:20 -0000 Author: arybchik Date: Mon Jan 9 08:07:18 2017 New Revision: 311765 URL: https://svnweb.freebsd.org/changeset/base/311765 Log: MFC r311640 sfxge(4): allow DMA descs to cross 4k boundary on EF10 Siena has limitation on maximum byte count and 4k boundary crosssing (which is stricter than maximum byte count). EF10 has limitation on maximum byte count only. Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_tx.c stable/11/sys/dev/sfxge/common/efx.h stable/11/sys/dev/sfxge/common/efx_tx.c stable/11/sys/dev/sfxge/common/hunt_nic.c stable/11/sys/dev/sfxge/common/medford_nic.c stable/11/sys/dev/sfxge/common/siena_nic.c stable/11/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_tx.c Mon Jan 9 08:06:01 2017 (r311764) +++ stable/11/sys/dev/sfxge/common/ef10_tx.c Mon Jan 9 08:07:18 2017 (r311765) @@ -438,8 +438,9 @@ ef10_tx_qpost( size_t offset; efx_qword_t qword; - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= (addr + size)); + /* No limitations on boundary crossing */ + EFSYS_ASSERT(size <= + etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max); id = added++ & etp->et_mask; offset = id * sizeof (efx_qword_t); @@ -584,8 +585,8 @@ ef10_tx_qdesc_dma_create( __in boolean_t eop, __out efx_desc_t *edp) { - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size); + /* No limitations on boundary crossing */ + EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max); EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index, efsys_dma_addr_t, addr, Modified: stable/11/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx.h Mon Jan 9 08:06:01 2017 (r311764) +++ stable/11/sys/dev/sfxge/common/efx.h Mon Jan 9 08:07:18 2017 (r311765) @@ -1154,6 +1154,13 @@ typedef struct efx_nic_cfg_s { uint32_t enc_rx_batch_max; /* Number of rx descriptors the hardware requires for a push. */ uint32_t enc_rx_push_align; + /* Maximum amount of data in DMA descriptor */ + uint32_t enc_tx_dma_desc_size_max; + /* + * Boundary which DMA descriptor data must not cross or 0 if no + * limitation. + */ + uint32_t enc_tx_dma_desc_boundary; /* * Maximum number of bytes into the packet the TCP header can start for * the hardware to apply TSO packet edits. Modified: stable/11/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_tx.c Mon Jan 9 08:06:01 2017 (r311764) +++ stable/11/sys/dev/sfxge/common/efx_tx.c Mon Jan 9 08:07:18 2017 (r311765) @@ -748,8 +748,12 @@ siena_tx_qpost( size_t size = ebp->eb_size; efsys_dma_addr_t end = start + size; - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(start + 1, 4096) >= end); + /* + * Fragments must not span 4k boundaries. + * Here it is a stricter requirement than the maximum length. + */ + EFSYS_ASSERT(P2ROUNDUP(start + 1, + etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= end); EFX_TX_DESC(etp, start, size, ebp->eb_eop, added); } @@ -1009,8 +1013,12 @@ siena_tx_qdesc_dma_create( __in boolean_t eop, __out efx_desc_t *edp) { - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size); + /* + * Fragments must not span 4k boundaries. + * Here it is a stricter requirement than the maximum length. + */ + EFSYS_ASSERT(P2ROUNDUP(addr + 1, + etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= addr + size); EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index, efsys_dma_addr_t, addr, Modified: stable/11/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/hunt_nic.c Mon Jan 9 08:06:01 2017 (r311764) +++ stable/11/sys/dev/sfxge/common/hunt_nic.c Mon Jan 9 08:07:18 2017 (r311765) @@ -304,6 +304,10 @@ hunt_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); + /* No boundary crossing limits */ + encp->enc_tx_dma_desc_boundary = 0; + /* * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available Modified: stable/11/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/medford_nic.c Mon Jan 9 08:06:01 2017 (r311764) +++ stable/11/sys/dev/sfxge/common/medford_nic.c Mon Jan 9 08:07:18 2017 (r311765) @@ -301,6 +301,10 @@ medford_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); + /* No boundary crossing limits */ + encp->enc_tx_dma_desc_boundary = 0; + /* * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available Modified: stable/11/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/siena_nic.c Mon Jan 9 08:06:01 2017 (r311764) +++ stable/11/sys/dev/sfxge/common/siena_nic.c Mon Jan 9 08:07:18 2017 (r311765) @@ -138,6 +138,10 @@ siena_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = 1; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(FSF_AZ_TX_KER_BYTE_COUNT); + /* Fragments must not span 4k boundaries. */ + encp->enc_tx_dma_desc_boundary = 4096; + /* Resource limits */ rc = efx_mcdi_get_resource_limits(enp, &nevq, &nrxq, &ntxq); if (rc != 0) { Modified: stable/11/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_tx.c Mon Jan 9 08:06:01 2017 (r311764) +++ stable/11/sys/dev/sfxge/sfxge_tx.c Mon Jan 9 08:07:18 2017 (r311765) @@ -1720,6 +1720,7 @@ static int sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, enum sfxge_txq_type type, unsigned int evq_index) { + const efx_nic_cfg_t *encp = efx_nic_cfg_get(sc->enp); char name[16]; struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev); struct sysctl_oid *txq_node; @@ -1750,9 +1751,11 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u &txq->buf_base_id); /* Create a DMA tag for packet mappings. */ - if (bus_dma_tag_create(sc->parent_dma_tag, 1, 0x1000, + if (bus_dma_tag_create(sc->parent_dma_tag, 1, + encp->enc_tx_dma_desc_boundary, MIN(0x3FFFFFFFFFFFUL, BUS_SPACE_MAXADDR), BUS_SPACE_MAXADDR, NULL, - NULL, 0x11000, SFXGE_TX_MAPPING_MAX_SEG, 0x1000, 0, NULL, NULL, + NULL, 0x11000, SFXGE_TX_MAPPING_MAX_SEG, + encp->enc_tx_dma_desc_size_max, 0, NULL, NULL, &txq->packet_dma_tag) != 0) { device_printf(sc->dev, "Couldn't allocate txq DMA tag\n"); rc = ENOMEM; From owner-svn-src-all@freebsd.org Mon Jan 9 08:08:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FD8CCA6514; Mon, 9 Jan 2017 08:08:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF5C61799; Mon, 9 Jan 2017 08:08:52 +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 328841FE1B5; Mon, 9 Jan 2017 09:08:25 +0100 (CET) Subject: Re: svn commit: r311707 - in head/sys/dev/rtwn: . usb To: Andriy Voskoboinyk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201701082341.v08NfH4O046808@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <83881095-b47e-facb-6bbe-a79f8e54209d@selasky.org> Date: Mon, 9 Jan 2017 09:08:13 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201701082341.v08NfH4O046808@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 08:08:54 -0000 On 01/09/17 00:41, Andriy Voskoboinyk wrote: > Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c > ============================================================================== > --- head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan 8 23:25:46 2017 (r311706) > +++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan 8 23:41:17 2017 (r311707) > @@ -63,7 +63,6 @@ static struct usb_config rtwn_config[RTW > .type = UE_BULK, > .endpoint = UE_ADDR_ANY, > .direction = UE_DIR_IN, > - .bufsize = RTWN_RXBUFSZ, > .flags = { > .pipe_bof = 1, > .short_xfer_ok = 1 > @@ -222,6 +221,7 @@ rtwn_usb_setup_endpoints(struct rtwn_usb > break; > } > > + rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024; Hi, You should copy the rtwn_config to the stack/softc, and not write to the static struct, which should be made "static const" after this change! This might lead to a race when multiple adapters are connecting at the same time! Remember USB enumeration is multithreaded. Else your change looks good. --HPS From owner-svn-src-all@freebsd.org Mon Jan 9 08:10:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 025C0CA65AB; Mon, 9 Jan 2017 08:10:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8175196E; Mon, 9 Jan 2017 08:10:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v098ADOQ057894; Mon, 9 Jan 2017 08:10:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v098ADoT057893; Mon, 9 Jan 2017 08:10:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701090810.v098ADoT057893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 Jan 2017 08:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311766 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 08:10:14 -0000 Author: arybchik Date: Mon Jan 9 08:10:12 2017 New Revision: 311766 URL: https://svnweb.freebsd.org/changeset/base/311766 Log: MFC r311638 sfxge(4): use SFXGE_LINK_UP() to report link up state Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Mon Jan 9 08:07:18 2017 (r311765) +++ stable/10/sys/dev/sfxge/sfxge_port.c Mon Jan 9 08:10:12 2017 (r311766) @@ -284,8 +284,7 @@ sfxge_mac_link_update(struct sfxge_softc port->link_mode = mode; /* Push link state update to the OS */ - link_state = (port->link_mode != EFX_LINK_DOWN ? - LINK_STATE_UP : LINK_STATE_DOWN); + link_state = (SFXGE_LINK_UP(sc) ? LINK_STATE_UP : LINK_STATE_DOWN); if_initbaudrate(sc->ifnet, sfxge_link_baudrate[port->link_mode]); if_link_state_change(sc->ifnet, link_state); } From owner-svn-src-all@freebsd.org Mon Jan 9 08:11:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14BA4CA6762; Mon, 9 Jan 2017 08:11:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D50311B6F; Mon, 9 Jan 2017 08:11:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v098BG63060820; Mon, 9 Jan 2017 08:11:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v098BGA7060819; Mon, 9 Jan 2017 08:11:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701090811.v098BGA7060819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 Jan 2017 08:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311767 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 08:11:18 -0000 Author: arybchik Date: Mon Jan 9 08:11:16 2017 New Revision: 311767 URL: https://svnweb.freebsd.org/changeset/base/311767 Log: MFC r311639 sfxge(4): treat EFX_LINK_UNKOWN as link down It is safer to consider EFX_LINK_UNKNOWN as link down. link_mode is set to EFX_LINK_UNKNOWN on port stop and fini. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Mon Jan 9 08:10:12 2017 (r311766) +++ stable/10/sys/dev/sfxge/sfxge.h Mon Jan 9 08:11:16 2017 (r311767) @@ -329,7 +329,9 @@ struct sfxge_softc { #endif }; -#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) +#define SFXGE_LINK_UP(sc) \ + ((sc)->port.link_mode != EFX_LINK_DOWN && \ + (sc)->port.link_mode != EFX_LINK_UNKNOWN) #define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING) #define SFXGE_PARAM(_name) "hw.sfxge." #_name From owner-svn-src-all@freebsd.org Mon Jan 9 08:12:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36EA8CA67ED; Mon, 9 Jan 2017 08:12:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 141641EBC; Mon, 9 Jan 2017 08:12:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v098CNkl061792; Mon, 9 Jan 2017 08:12:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v098CMgk061785; Mon, 9 Jan 2017 08:12:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701090812.v098CMgk061785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 Jan 2017 08:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311768 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 08:12:24 -0000 Author: arybchik Date: Mon Jan 9 08:12:22 2017 New Revision: 311768 URL: https://svnweb.freebsd.org/changeset/base/311768 Log: MFC r311640 sfxge(4): allow DMA descs to cross 4k boundary on EF10 Siena has limitation on maximum byte count and 4k boundary crosssing (which is stricter than maximum byte count). EF10 has limitation on maximum byte count only. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_tx.c stable/10/sys/dev/sfxge/common/hunt_nic.c stable/10/sys/dev/sfxge/common/medford_nic.c stable/10/sys/dev/sfxge/common/siena_nic.c stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_tx.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/ef10_tx.c Mon Jan 9 08:12:22 2017 (r311768) @@ -438,8 +438,9 @@ ef10_tx_qpost( size_t offset; efx_qword_t qword; - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= (addr + size)); + /* No limitations on boundary crossing */ + EFSYS_ASSERT(size <= + etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max); id = added++ & etp->et_mask; offset = id * sizeof (efx_qword_t); @@ -584,8 +585,8 @@ ef10_tx_qdesc_dma_create( __in boolean_t eop, __out efx_desc_t *edp) { - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size); + /* No limitations on boundary crossing */ + EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max); EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index, efsys_dma_addr_t, addr, Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/efx.h Mon Jan 9 08:12:22 2017 (r311768) @@ -1154,6 +1154,13 @@ typedef struct efx_nic_cfg_s { uint32_t enc_rx_batch_max; /* Number of rx descriptors the hardware requires for a push. */ uint32_t enc_rx_push_align; + /* Maximum amount of data in DMA descriptor */ + uint32_t enc_tx_dma_desc_size_max; + /* + * Boundary which DMA descriptor data must not cross or 0 if no + * limitation. + */ + uint32_t enc_tx_dma_desc_boundary; /* * Maximum number of bytes into the packet the TCP header can start for * the hardware to apply TSO packet edits. Modified: stable/10/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_tx.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/efx_tx.c Mon Jan 9 08:12:22 2017 (r311768) @@ -748,8 +748,12 @@ siena_tx_qpost( size_t size = ebp->eb_size; efsys_dma_addr_t end = start + size; - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(start + 1, 4096) >= end); + /* + * Fragments must not span 4k boundaries. + * Here it is a stricter requirement than the maximum length. + */ + EFSYS_ASSERT(P2ROUNDUP(start + 1, + etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= end); EFX_TX_DESC(etp, start, size, ebp->eb_eop, added); } @@ -1009,8 +1013,12 @@ siena_tx_qdesc_dma_create( __in boolean_t eop, __out efx_desc_t *edp) { - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size); + /* + * Fragments must not span 4k boundaries. + * Here it is a stricter requirement than the maximum length. + */ + EFSYS_ASSERT(P2ROUNDUP(addr + 1, + etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= addr + size); EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index, efsys_dma_addr_t, addr, Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Mon Jan 9 08:12:22 2017 (r311768) @@ -304,6 +304,10 @@ hunt_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); + /* No boundary crossing limits */ + encp->enc_tx_dma_desc_boundary = 0; + /* * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available Modified: stable/10/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/medford_nic.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/medford_nic.c Mon Jan 9 08:12:22 2017 (r311768) @@ -301,6 +301,10 @@ medford_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); + /* No boundary crossing limits */ + encp->enc_tx_dma_desc_boundary = 0; + /* * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Mon Jan 9 08:12:22 2017 (r311768) @@ -138,6 +138,10 @@ siena_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = 1; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(FSF_AZ_TX_KER_BYTE_COUNT); + /* Fragments must not span 4k boundaries. */ + encp->enc_tx_dma_desc_boundary = 4096; + /* Resource limits */ rc = efx_mcdi_get_resource_limits(enp, &nevq, &nrxq, &ntxq); if (rc != 0) { Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Mon Jan 9 08:12:22 2017 (r311768) @@ -1701,6 +1701,7 @@ static int sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, enum sfxge_txq_type type, unsigned int evq_index) { + const efx_nic_cfg_t *encp = efx_nic_cfg_get(sc->enp); char name[16]; struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev); struct sysctl_oid *txq_node; @@ -1731,9 +1732,11 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u &txq->buf_base_id); /* Create a DMA tag for packet mappings. */ - if (bus_dma_tag_create(sc->parent_dma_tag, 1, 0x1000, + if (bus_dma_tag_create(sc->parent_dma_tag, 1, + encp->enc_tx_dma_desc_boundary, MIN(0x3FFFFFFFFFFFUL, BUS_SPACE_MAXADDR), BUS_SPACE_MAXADDR, NULL, - NULL, 0x11000, SFXGE_TX_MAPPING_MAX_SEG, 0x1000, 0, NULL, NULL, + NULL, 0x11000, SFXGE_TX_MAPPING_MAX_SEG, + encp->enc_tx_dma_desc_size_max, 0, NULL, NULL, &txq->packet_dma_tag) != 0) { device_printf(sc->dev, "Couldn't allocate txq DMA tag\n"); rc = ENOMEM; From owner-svn-src-all@freebsd.org Mon Jan 9 09:28:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7343FCA5017; Mon, 9 Jan 2017 09:28:04 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4564E111E; Mon, 9 Jan 2017 09:28:04 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v099S3Bk090432; Mon, 9 Jan 2017 09:28:03 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v099S3fM090431; Mon, 9 Jan 2017 09:28:03 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201701090928.v099S3fM090431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 9 Jan 2017 09:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311769 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 09:28:04 -0000 Author: smh Date: Mon Jan 9 09:28:03 2017 New Revision: 311769 URL: https://svnweb.freebsd.org/changeset/base/311769 Log: Fix rstat: symbol not in namelist from netstat Load kvm symbols earlier to prevent rstat: symbol not in namelist error when running netstat -rs. Submitted by: Sebastian Huber MFC after: 1 week Sponsored by: Multiplay Modified: head/usr.bin/netstat/main.c Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Mon Jan 9 08:12:22 2017 (r311768) +++ head/usr.bin/netstat/main.c Mon Jan 9 09:28:03 2017 (r311769) @@ -427,6 +427,9 @@ main(int argc, char *argv[]) if (xflag && Tflag) xo_errx(1, "-x and -T are incompatible, pick one."); + /* Load all necessary kvm symbols */ + kresolve_list(nl); + if (Bflag) { if (!live) usage(); @@ -507,9 +510,6 @@ main(int argc, char *argv[]) exit(0); } - /* Load all necessary kvm symbols */ - kresolve_list(nl); - if (tp) { xo_open_container("statistics"); printproto(tp, tp->pr_name, &first); From owner-svn-src-all@freebsd.org Mon Jan 9 09:53:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B215CA5A0D; Mon, 9 Jan 2017 09:53: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 E0CEC156A; Mon, 9 Jan 2017 09:53:08 +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 v099r8A6002786; Mon, 9 Jan 2017 09:53:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v099r8mc002785; Mon, 9 Jan 2017 09:53:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701090953.v099r8mc002785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 09:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311770 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 09:53:09 -0000 Author: kib Date: Mon Jan 9 09:53:07 2017 New Revision: 311770 URL: https://svnweb.freebsd.org/changeset/base/311770 Log: MFC r311055: Remove unneeded externs keywords. Reindent long lines. Modified: stable/11/sys/sys/event.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/event.h ============================================================================== --- stable/11/sys/sys/event.h Mon Jan 9 09:28:03 2017 (r311769) +++ stable/11/sys/sys/event.h Mon Jan 9 09:53:07 2017 (r311770) @@ -257,30 +257,30 @@ struct knlist; struct mtx; struct rwlock; -extern void knote(struct knlist *list, long hint, int lockflags); -extern void knote_fork(struct knlist *list, int pid); -extern struct knlist *knlist_alloc(struct mtx *lock); -extern void knlist_detach(struct knlist *knl); -extern void knlist_add(struct knlist *knl, struct knote *kn, int islocked); -extern void knlist_remove(struct knlist *knl, struct knote *kn, int islocked); -extern int knlist_empty(struct knlist *knl); -extern void knlist_init(struct knlist *knl, void *lock, - void (*kl_lock)(void *), void (*kl_unlock)(void *), - void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *)); -extern void knlist_init_mtx(struct knlist *knl, struct mtx *lock); -extern void knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock); -extern void knlist_destroy(struct knlist *knl); -extern void knlist_cleardel(struct knlist *knl, struct thread *td, - int islocked, int killkn); +void knote(struct knlist *list, long hint, int lockflags); +void knote_fork(struct knlist *list, int pid); +struct knlist *knlist_alloc(struct mtx *lock); +void knlist_detach(struct knlist *knl); +void knlist_add(struct knlist *knl, struct knote *kn, int islocked); +void knlist_remove(struct knlist *knl, struct knote *kn, int islocked); +int knlist_empty(struct knlist *knl); +void knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *), + void (*kl_unlock)(void *), void (*kl_assert_locked)(void *), + void (*kl_assert_unlocked)(void *)); +void knlist_init_mtx(struct knlist *knl, struct mtx *lock); +void knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock); +void knlist_destroy(struct knlist *knl); +void knlist_cleardel(struct knlist *knl, struct thread *td, + int islocked, int killkn); #define knlist_clear(knl, islocked) \ - knlist_cleardel((knl), NULL, (islocked), 0) + knlist_cleardel((knl), NULL, (islocked), 0) #define knlist_delete(knl, td, islocked) \ - knlist_cleardel((knl), (td), (islocked), 1) -extern void knote_fdclose(struct thread *p, int fd); -extern int kqfd_register(int fd, struct kevent *kev, struct thread *p, - int waitok); -extern int kqueue_add_filteropts(int filt, struct filterops *filtops); -extern int kqueue_del_filteropts(int filt); + knlist_cleardel((knl), (td), (islocked), 1) +void knote_fdclose(struct thread *p, int fd); +int kqfd_register(int fd, struct kevent *kev, struct thread *p, + int waitok); +int kqueue_add_filteropts(int filt, struct filterops *filtops); +int kqueue_del_filteropts(int filt); #else /* !_KERNEL */ From owner-svn-src-all@freebsd.org Mon Jan 9 09:57:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F5CBCA5BA1; Mon, 9 Jan 2017 09:57:35 +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 5F8A21937; Mon, 9 Jan 2017 09:57:35 +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 v099vYDS003195; Mon, 9 Jan 2017 09:57:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v099vYNY003194; Mon, 9 Jan 2017 09:57:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701090957.v099vYNY003194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 09:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311771 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 09:57:35 -0000 Author: kib Date: Mon Jan 9 09:57:34 2017 New Revision: 311771 URL: https://svnweb.freebsd.org/changeset/base/311771 Log: MFC r310615: Change knlist_destroy() to assertion. Modified: stable/11/sys/kern/kern_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_event.c ============================================================================== --- stable/11/sys/kern/kern_event.c Mon Jan 9 09:53:07 2017 (r311770) +++ stable/11/sys/kern/kern_event.c Mon Jan 9 09:57:34 2017 (r311771) @@ -2249,17 +2249,8 @@ void knlist_destroy(struct knlist *knl) { -#ifdef INVARIANTS - /* - * if we run across this error, we need to find the offending - * driver and have it call knlist_clear or knlist_delete. - */ - if (!SLIST_EMPTY(&knl->kl_list)) - printf("WARNING: destroying knlist w/ knotes on it!\n"); -#endif - - knl->kl_lockarg = knl->kl_lock = knl->kl_unlock = NULL; - SLIST_INIT(&knl->kl_list); + KASSERT(KNLIST_EMPTY(knl), + ("destroying knlist %p with knotes on it", knl)); } void From owner-svn-src-all@freebsd.org Mon Jan 9 10:13:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4935CA63A0; Mon, 9 Jan 2017 10:13:54 +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 8267C1A24; Mon, 9 Jan 2017 10:13:54 +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 v09ADrUR011713; Mon, 9 Jan 2017 10:13:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09ADrsT011712; Mon, 9 Jan 2017 10:13:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091013.v09ADrsT011712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311772 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:13:54 -0000 Author: kib Date: Mon Jan 9 10:13:53 2017 New Revision: 311772 URL: https://svnweb.freebsd.org/changeset/base/311772 Log: MFC r311055: Remove unneeded externs keywords. Reindent long lines. Modified: stable/10/sys/sys/event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/event.h ============================================================================== --- stable/10/sys/sys/event.h Mon Jan 9 09:57:34 2017 (r311771) +++ stable/10/sys/sys/event.h Mon Jan 9 10:13:53 2017 (r311772) @@ -253,29 +253,29 @@ struct knlist; struct mtx; struct rwlock; -extern void knote(struct knlist *list, long hint, int lockflags); -extern void knote_fork(struct knlist *list, int pid); -extern void knlist_add(struct knlist *knl, struct knote *kn, int islocked); -extern void knlist_remove(struct knlist *knl, struct knote *kn, int islocked); -extern void knlist_remove_inevent(struct knlist *knl, struct knote *kn); -extern int knlist_empty(struct knlist *knl); -extern void knlist_init(struct knlist *knl, void *lock, - void (*kl_lock)(void *), void (*kl_unlock)(void *), - void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *)); -extern void knlist_init_mtx(struct knlist *knl, struct mtx *lock); -extern void knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock); -extern void knlist_destroy(struct knlist *knl); -extern void knlist_cleardel(struct knlist *knl, struct thread *td, +void knote(struct knlist *list, long hint, int lockflags); +void knote_fork(struct knlist *list, int pid); +void knlist_add(struct knlist *knl, struct knote *kn, int islocked); +void knlist_remove(struct knlist *knl, struct knote *kn, int islocked); +void knlist_remove_inevent(struct knlist *knl, struct knote *kn); +int knlist_empty(struct knlist *knl); +void knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *), + void (*kl_unlock)(void *), void (*kl_assert_locked)(void *), + void (*kl_assert_unlocked)(void *)); +void knlist_init_mtx(struct knlist *knl, struct mtx *lock); +void knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock); +void knlist_destroy(struct knlist *knl); +void knlist_cleardel(struct knlist *knl, struct thread *td, int islocked, int killkn); #define knlist_clear(knl, islocked) \ - knlist_cleardel((knl), NULL, (islocked), 0) + knlist_cleardel((knl), NULL, (islocked), 0) #define knlist_delete(knl, td, islocked) \ - knlist_cleardel((knl), (td), (islocked), 1) -extern void knote_fdclose(struct thread *p, int fd); -extern int kqfd_register(int fd, struct kevent *kev, struct thread *p, - int waitok); -extern int kqueue_add_filteropts(int filt, struct filterops *filtops); -extern int kqueue_del_filteropts(int filt); + knlist_cleardel((knl), (td), (islocked), 1) +void knote_fdclose(struct thread *p, int fd); +int kqfd_register(int fd, struct kevent *kev, struct thread *p, + int waitok); +int kqueue_add_filteropts(int filt, struct filterops *filtops); +int kqueue_del_filteropts(int filt); #else /* !_KERNEL */ From owner-svn-src-all@freebsd.org Mon Jan 9 10:18:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E52DACA657E; Mon, 9 Jan 2017 10:18:35 +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 B5E5F1D18; Mon, 9 Jan 2017 10:18:35 +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 v09AIYlN011975; Mon, 9 Jan 2017 10:18:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09AIYhh011974; Mon, 9 Jan 2017 10:18:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091018.v09AIYhh011974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311773 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:18:36 -0000 Author: kib Date: Mon Jan 9 10:18:34 2017 New Revision: 311773 URL: https://svnweb.freebsd.org/changeset/base/311773 Log: MFC r310615: Change knlist_destroy() to assertion. Modified: stable/10/sys/kern/kern_event.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Mon Jan 9 10:13:53 2017 (r311772) +++ stable/10/sys/kern/kern_event.c Mon Jan 9 10:18:34 2017 (r311773) @@ -2177,17 +2177,8 @@ void knlist_destroy(struct knlist *knl) { -#ifdef INVARIANTS - /* - * if we run across this error, we need to find the offending - * driver and have it call knlist_clear or knlist_delete. - */ - if (!SLIST_EMPTY(&knl->kl_list)) - printf("WARNING: destroying knlist w/ knotes on it!\n"); -#endif - - knl->kl_lockarg = knl->kl_lock = knl->kl_unlock = NULL; - SLIST_INIT(&knl->kl_list); + KASSERT(KNLIST_EMPTY(knl), + ("destroying knlist %p with knotes on it", knl)); } /* From owner-svn-src-all@freebsd.org Mon Jan 9 10:21:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EBABCA6702; Mon, 9 Jan 2017 10:21:48 +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 EAEA9100B; Mon, 9 Jan 2017 10:21:47 +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 v09ALlbb014290; Mon, 9 Jan 2017 10:21:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09ALlIB014289; Mon, 9 Jan 2017 10:21:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091021.v09ALlIB014289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311774 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:21:48 -0000 Author: kib Date: Mon Jan 9 10:21:46 2017 New Revision: 311774 URL: https://svnweb.freebsd.org/changeset/base/311774 Log: MFC r311108: Move common code from kern_statfs() and kern_fstatfs() into a new helper. Modified: stable/11/sys/kern/vfs_syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Mon Jan 9 10:18:34 2017 (r311773) +++ stable/11/sys/kern/vfs_syscalls.c Mon Jan 9 10:21:46 2017 (r311774) @@ -244,6 +244,45 @@ statfs_scale_blocks(struct statfs *sf, l sf->f_bavail >>= shift; } +static int +kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) +{ + struct statfs *sp, sb; + int error; + + if (mp == NULL) + return (EBADF); + error = vfs_busy(mp, 0); + vfs_rel(mp); + if (error != 0) + return (error); +#ifdef MAC + error = mac_mount_check_stat(td->td_ucred, mp); + if (error != 0) + goto out; +#endif + /* + * Set these in case the underlying filesystem fails to do so. + */ + sp = &mp->mnt_stat; + sp->f_version = STATFS_VERSION; + sp->f_namemax = NAME_MAX; + sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + error = VFS_STATFS(mp, sp); + if (error != 0) + goto out; + if (priv_check(td, PRIV_VFS_GENERATION)) { + bcopy(sp, &sb, sizeof(sb)); + sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; + prison_enforce_statfs(td->td_ucred, mp, &sb); + sp = &sb; + } + *buf = *sp; +out: + vfs_unbusy(mp); + return (error); +} + /* * Get filesystem statistics. */ @@ -275,7 +314,6 @@ kern_statfs(struct thread *td, char *pat struct statfs *buf) { struct mount *mp; - struct statfs *sp, sb; struct nameidata nd; int error; @@ -288,35 +326,7 @@ kern_statfs(struct thread *td, char *pat vfs_ref(mp); NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); - error = vfs_busy(mp, 0); - vfs_rel(mp); - if (error != 0) - return (error); -#ifdef MAC - error = mac_mount_check_stat(td->td_ucred, mp); - if (error != 0) - goto out; -#endif - /* - * Set these in case the underlying filesystem fails to do so. - */ - sp = &mp->mnt_stat; - sp->f_version = STATFS_VERSION; - sp->f_namemax = NAME_MAX; - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - error = VFS_STATFS(mp, sp); - if (error != 0) - goto out; - if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, &sb, sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, &sb); - sp = &sb; - } - *buf = *sp; -out: - vfs_unbusy(mp); - return (error); + return (kern_do_statfs(td, mp, buf)); } /* @@ -350,7 +360,6 @@ kern_fstatfs(struct thread *td, int fd, { struct file *fp; struct mount *mp; - struct statfs *sp, sb; struct vnode *vp; cap_rights_t rights; int error; @@ -369,40 +378,7 @@ kern_fstatfs(struct thread *td, int fd, vfs_ref(mp); VOP_UNLOCK(vp, 0); fdrop(fp, td); - if (mp == NULL) { - error = EBADF; - goto out; - } - error = vfs_busy(mp, 0); - vfs_rel(mp); - if (error != 0) - return (error); -#ifdef MAC - error = mac_mount_check_stat(td->td_ucred, mp); - if (error != 0) - goto out; -#endif - /* - * Set these in case the underlying filesystem fails to do so. - */ - sp = &mp->mnt_stat; - sp->f_version = STATFS_VERSION; - sp->f_namemax = NAME_MAX; - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - error = VFS_STATFS(mp, sp); - if (error != 0) - goto out; - if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, &sb, sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, &sb); - sp = &sb; - } - *buf = *sp; -out: - if (mp) - vfs_unbusy(mp); - return (error); + return (kern_do_statfs(td, mp, buf)); } /* From owner-svn-src-all@freebsd.org Mon Jan 9 10:23:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0508CA68DB; Mon, 9 Jan 2017 10:23: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 9F89F1365; Mon, 9 Jan 2017 10:23: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 v09ANbnu016019; Mon, 9 Jan 2017 10:23:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09ANbgG016018; Mon, 9 Jan 2017 10:23:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091023.v09ANbgG016018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311775 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:23:38 -0000 Author: kib Date: Mon Jan 9 10:23:37 2017 New Revision: 311775 URL: https://svnweb.freebsd.org/changeset/base/311775 Log: MFC r311111: Style. Modified: stable/11/sys/kern/vfs_syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Mon Jan 9 10:21:46 2017 (r311774) +++ stable/11/sys/kern/vfs_syscalls.c Mon Jan 9 10:23:37 2017 (r311775) @@ -374,7 +374,7 @@ kern_fstatfs(struct thread *td, int fd, AUDIT_ARG_VNODE1(vp); #endif mp = vp->v_mount; - if (mp) + if (mp != NULL) vfs_ref(mp); VOP_UNLOCK(vp, 0); fdrop(fp, td); From owner-svn-src-all@freebsd.org Mon Jan 9 10:26:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1256ECA6A49; Mon, 9 Jan 2017 10:26:04 +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 D2E791642; Mon, 9 Jan 2017 10:26:03 +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 v09AQ2KO016160; Mon, 9 Jan 2017 10:26:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09AQ2bf016159; Mon, 9 Jan 2017 10:26:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091026.v09AQ2bf016159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311776 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:26:04 -0000 Author: kib Date: Mon Jan 9 10:26:02 2017 New Revision: 311776 URL: https://svnweb.freebsd.org/changeset/base/311776 Log: MFC r311113: There is no need to use temporary statfs buffer for fsid obliteration and prison enforcement. Do it on the caller buffer directly. Modified: stable/11/sys/kern/vfs_syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Mon Jan 9 10:23:37 2017 (r311775) +++ stable/11/sys/kern/vfs_syscalls.c Mon Jan 9 10:26:02 2017 (r311776) @@ -247,7 +247,7 @@ statfs_scale_blocks(struct statfs *sf, l static int kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) { - struct statfs *sp, sb; + struct statfs *sp; int error; if (mp == NULL) @@ -271,13 +271,11 @@ kern_do_statfs(struct thread *td, struct error = VFS_STATFS(mp, sp); if (error != 0) goto out; + *buf = *sp; if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, &sb, sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, &sb); - sp = &sb; + buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0; + prison_enforce_statfs(td->td_ucred, mp, buf); } - *buf = *sp; out: vfs_unbusy(mp); return (error); From owner-svn-src-all@freebsd.org Mon Jan 9 10:29:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BB55CA6BAC; Mon, 9 Jan 2017 10:29: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 441BD18CB; Mon, 9 Jan 2017 10:29: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 v09ATDTW016312; Mon, 9 Jan 2017 10:29:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09ATDEG016311; Mon, 9 Jan 2017 10:29:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091029.v09ATDEG016311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311777 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:29:14 -0000 Author: kib Date: Mon Jan 9 10:29:13 2017 New Revision: 311777 URL: https://svnweb.freebsd.org/changeset/base/311777 Log: MFC r311108: Move common code from kern_statfs() and kern_fstatfs() into a new helper. Modified: stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:26:02 2017 (r311776) +++ stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:29:13 2017 (r311777) @@ -256,6 +256,45 @@ statfs_scale_blocks(struct statfs *sf, l sf->f_bavail >>= shift; } +static int +kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) +{ + struct statfs *sp, sb; + int error; + + if (mp == NULL) + return (EBADF); + error = vfs_busy(mp, 0); + vfs_rel(mp); + if (error != 0) + return (error); +#ifdef MAC + error = mac_mount_check_stat(td->td_ucred, mp); + if (error != 0) + goto out; +#endif + /* + * Set these in case the underlying filesystem fails to do so. + */ + sp = &mp->mnt_stat; + sp->f_version = STATFS_VERSION; + sp->f_namemax = NAME_MAX; + sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + error = VFS_STATFS(mp, sp); + if (error != 0) + goto out; + if (priv_check(td, PRIV_VFS_GENERATION)) { + bcopy(sp, &sb, sizeof(sb)); + sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; + prison_enforce_statfs(td->td_ucred, mp, &sb); + sp = &sb; + } + *buf = *sp; +out: + vfs_unbusy(mp); + return (error); +} + /* * Get filesystem statistics. */ @@ -287,7 +326,6 @@ kern_statfs(struct thread *td, char *pat struct statfs *buf) { struct mount *mp; - struct statfs *sp, sb; struct nameidata nd; int error; @@ -300,35 +338,7 @@ kern_statfs(struct thread *td, char *pat vfs_ref(mp); NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); - error = vfs_busy(mp, 0); - vfs_rel(mp); - if (error != 0) - return (error); -#ifdef MAC - error = mac_mount_check_stat(td->td_ucred, mp); - if (error != 0) - goto out; -#endif - /* - * Set these in case the underlying filesystem fails to do so. - */ - sp = &mp->mnt_stat; - sp->f_version = STATFS_VERSION; - sp->f_namemax = NAME_MAX; - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - error = VFS_STATFS(mp, sp); - if (error != 0) - goto out; - if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, &sb, sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, &sb); - sp = &sb; - } - *buf = *sp; -out: - vfs_unbusy(mp); - return (error); + return (kern_do_statfs(td, mp, buf)); } /* @@ -362,7 +372,6 @@ kern_fstatfs(struct thread *td, int fd, { struct file *fp; struct mount *mp; - struct statfs *sp, sb; struct vnode *vp; cap_rights_t rights; int error; @@ -382,40 +391,7 @@ kern_fstatfs(struct thread *td, int fd, vfs_ref(mp); VOP_UNLOCK(vp, 0); fdrop(fp, td); - if (mp == NULL) { - error = EBADF; - goto out; - } - error = vfs_busy(mp, 0); - vfs_rel(mp); - if (error != 0) - return (error); -#ifdef MAC - error = mac_mount_check_stat(td->td_ucred, mp); - if (error != 0) - goto out; -#endif - /* - * Set these in case the underlying filesystem fails to do so. - */ - sp = &mp->mnt_stat; - sp->f_version = STATFS_VERSION; - sp->f_namemax = NAME_MAX; - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - error = VFS_STATFS(mp, sp); - if (error != 0) - goto out; - if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, &sb, sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, &sb); - sp = &sb; - } - *buf = *sp; -out: - if (mp) - vfs_unbusy(mp); - return (error); + return (kern_do_statfs(td, mp, buf)); } /* From owner-svn-src-all@freebsd.org Mon Jan 9 10:30:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F52CCA6C3D; Mon, 9 Jan 2017 10:30:25 +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 6B9731A39; Mon, 9 Jan 2017 10:30:25 +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 v09AUO1O016426; Mon, 9 Jan 2017 10:30:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09AUO1j016425; Mon, 9 Jan 2017 10:30:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091030.v09AUO1j016425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311778 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:30:25 -0000 Author: kib Date: Mon Jan 9 10:30:24 2017 New Revision: 311778 URL: https://svnweb.freebsd.org/changeset/base/311778 Log: MFC r311111: Style. Modified: stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:29:13 2017 (r311777) +++ stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:30:24 2017 (r311778) @@ -387,7 +387,7 @@ kern_fstatfs(struct thread *td, int fd, AUDIT_ARG_VNODE1(vp); #endif mp = vp->v_mount; - if (mp) + if (mp != NULL) vfs_ref(mp); VOP_UNLOCK(vp, 0); fdrop(fp, td); From owner-svn-src-all@freebsd.org Mon Jan 9 10:31:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAD5DCA6DD9; Mon, 9 Jan 2017 10:31:40 +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 7C2761D91; Mon, 9 Jan 2017 10:31:40 +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 v09AVdRA019329; Mon, 9 Jan 2017 10:31:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09AVdnu019328; Mon, 9 Jan 2017 10:31:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091031.v09AVdnu019328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311779 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:31:40 -0000 Author: kib Date: Mon Jan 9 10:31:39 2017 New Revision: 311779 URL: https://svnweb.freebsd.org/changeset/base/311779 Log: MFC r311113: There is no need to use temporary statfs buffer for fsid obliteration and prison enforcement. Do it on the caller buffer directly. Modified: stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:30:24 2017 (r311778) +++ stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:31:39 2017 (r311779) @@ -259,7 +259,7 @@ statfs_scale_blocks(struct statfs *sf, l static int kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) { - struct statfs *sp, sb; + struct statfs *sp; int error; if (mp == NULL) @@ -283,13 +283,11 @@ kern_do_statfs(struct thread *td, struct error = VFS_STATFS(mp, sp); if (error != 0) goto out; + *buf = *sp; if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, &sb, sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, &sb); - sp = &sb; + buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0; + prison_enforce_statfs(td->td_ucred, mp, buf); } - *buf = *sp; out: vfs_unbusy(mp); return (error); From owner-svn-src-all@freebsd.org Mon Jan 9 10:47:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A04BCCA53D0; Mon, 9 Jan 2017 10:47:21 +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 6FCE4167D; Mon, 9 Jan 2017 10:47:21 +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 v09AlKCr024342; Mon, 9 Jan 2017 10:47:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09AlKsD024341; Mon, 9 Jan 2017 10:47:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091047.v09AlKsD024341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311780 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:47:21 -0000 Author: kib Date: Mon Jan 9 10:47:20 2017 New Revision: 311780 URL: https://svnweb.freebsd.org/changeset/base/311780 Log: Use tab for indent. Extracted from: ino64 work by gleb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libprocstat/Makefile Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Mon Jan 9 10:31:39 2017 (r311779) +++ head/lib/libprocstat/Makefile Mon Jan 9 10:47:20 2017 (r311780) @@ -9,7 +9,7 @@ SRCS= cd9660.c \ common_kvm.c \ core.c \ libprocstat.c \ - msdosfs.c \ + msdosfs.c \ smbfs.c \ udf.c From owner-svn-src-all@freebsd.org Mon Jan 9 11:11:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 563F5CA5C8F; Mon, 9 Jan 2017 11:11:53 +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 187341353; Mon, 9 Jan 2017 11:11:53 +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 v09BBqf3036185; Mon, 9 Jan 2017 11:11:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09BBqcN036184; Mon, 9 Jan 2017 11:11:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091111.v09BBqcN036184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 11:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311781 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 11:11:53 -0000 Author: kib Date: Mon Jan 9 11:11:52 2017 New Revision: 311781 URL: https://svnweb.freebsd.org/changeset/base/311781 Log: Use standard Versions.def for libprocstat. This makes the versions inheritance consistent for our versioned libraries. Extracted from: ino64 Discussed with: kan Sponsored by: The FreeBSD Foundation MFC after: 1 week Deleted: head/lib/libprocstat/Versions.def Modified: head/lib/libprocstat/Makefile Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Mon Jan 9 10:47:20 2017 (r311780) +++ head/lib/libprocstat/Makefile Mon Jan 9 11:11:52 2017 (r311781) @@ -13,7 +13,7 @@ SRCS= cd9660.c \ smbfs.c \ udf.c -VERSION_DEF= ${.CURDIR}/Versions.def +VERSION_DEF= ${LIBCSRCDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map INCS= libprocstat.h From owner-svn-src-all@freebsd.org Mon Jan 9 14:13:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC775CA76FC; Mon, 9 Jan 2017 14:13:48 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8ADF1933; Mon, 9 Jan 2017 14:13:48 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09EDlhi010843; Mon, 9 Jan 2017 14:13:47 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09EDl2g010842; Mon, 9 Jan 2017 14:13:47 GMT (envelope-from des@FreeBSD.org) Message-Id: <201701091413.v09EDl2g010842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 9 Jan 2017 14:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311786 - stable/11/lib/libfetch X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 14:13:49 -0000 Author: des Date: Mon Jan 9 14:13:47 2017 New Revision: 311786 URL: https://svnweb.freebsd.org/changeset/base/311786 Log: MFH (r310823): fix multi-line CONNECT responses PR: 194483 Modified: stable/11/lib/libfetch/http.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libfetch/http.c ============================================================================== --- stable/11/lib/libfetch/http.c Mon Jan 9 13:12:09 2017 (r311785) +++ stable/11/lib/libfetch/http.c Mon Jan 9 14:13:47 2017 (r311786) @@ -1432,7 +1432,7 @@ http_connect(struct url *URL, struct url default: /* ignore */ ; } - } while (h < hdr_end); + } while (h > hdr_end); } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, URL, verbose) == -1) { From owner-svn-src-all@freebsd.org Mon Jan 9 16:21:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9761BCA75BB; Mon, 9 Jan 2017 16:21:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59CD01D1F; Mon, 9 Jan 2017 16:21:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09GL6U9062659; Mon, 9 Jan 2017 16:21:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09GL63o062398; Mon, 9 Jan 2017 16:21:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701091621.v09GL63o062398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 9 Jan 2017 16:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311787 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 16:21:07 -0000 Author: mav Date: Mon Jan 9 16:21:06 2017 New Revision: 311787 URL: https://svnweb.freebsd.org/changeset/base/311787 Log: Allocate memory for prevent flags only for removable LUs. This array takes 64KB of RAM now, that was more then half of struct ctl_lun size. If at some point we support more ports, this may need another tune. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Jan 9 14:13:47 2017 (r311786) +++ head/sys/cam/ctl/ctl.c Mon Jan 9 16:21:06 2017 (r311787) @@ -4585,6 +4585,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft lun->ie_reported = 1; callout_init_mtx(&lun->ie_callout, &lun->lun_lock, 0); ctl_tpc_lun_init(lun); + if (lun->flags & CTL_LUN_REMOVABLE) { + lun->prevent = malloc((CTL_MAX_INITIATORS + 31) / 32 * 4, + M_CTL, M_WAITOK); + } /* * Initialize the mode and log page index. @@ -4666,6 +4670,7 @@ ctl_free_lun(struct ctl_lun *lun) for (i = 0; i < CTL_MAX_PORTS; i++) free(lun->pr_keys[i], M_CTL); free(lun->write_buffer, M_CTL); + free(lun->prevent, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); @@ -5276,7 +5281,7 @@ ctl_prevent_allow(struct ctl_scsiio *cts cdb = (struct scsi_prevent *)ctsio->cdb; - if ((lun->flags & CTL_LUN_REMOVABLE) == 0) { + if ((lun->flags & CTL_LUN_REMOVABLE) == 0 || lun->prevent == NULL) { ctl_set_invalid_opcode(ctsio); ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); @@ -11872,8 +11877,10 @@ ctl_do_lun_reset(struct ctl_lun *lun, un ctl_clear_mask(lun->have_ca, i); #endif lun->prevent_count = 0; - for (i = 0; i < CTL_MAX_INITIATORS; i++) - ctl_clear_mask(lun->prevent, i); + if (lun->prevent) { + for (i = 0; i < CTL_MAX_INITIATORS; i++) + ctl_clear_mask(lun->prevent, i); + } mtx_unlock(&lun->lun_lock); return (0); @@ -12019,7 +12026,7 @@ ctl_i_t_nexus_reset(union ctl_io *io) #endif if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == initidx)) lun->flags &= ~CTL_LUN_RESERVED; - if (ctl_is_set(lun->prevent, initidx)) { + if (lun->prevent && ctl_is_set(lun->prevent, initidx)) { ctl_clear_mask(lun->prevent, initidx); lun->prevent_count--; } Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Mon Jan 9 14:13:47 2017 (r311786) +++ head/sys/cam/ctl/ctl_private.h Mon Jan 9 16:21:06 2017 (r311787) @@ -412,7 +412,7 @@ struct ctl_lun { uint32_t pr_res_idx; uint8_t pr_res_type; int prevent_count; - uint32_t prevent[(CTL_MAX_INITIATORS+31)/32]; + uint32_t *prevent; uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; From owner-svn-src-all@freebsd.org Mon Jan 9 16:45:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 673BACA7EAF; Mon, 9 Jan 2017 16:45:09 +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 35FEA111A; Mon, 9 Jan 2017 16:45:09 +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 v09Gj8sH074392; Mon, 9 Jan 2017 16:45:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09Gj8i0074391; Mon, 9 Jan 2017 16:45:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091645.v09Gj8i0074391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 16:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311788 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 16:45:09 -0000 Author: hselasky Date: Mon Jan 9 16:45:08 2017 New Revision: 311788 URL: https://svnweb.freebsd.org/changeset/base/311788 Log: MFC r310388: Make a read only pointer constant. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:21:06 2017 (r311787) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:45:08 2017 (r311788) @@ -314,7 +314,7 @@ mlx5e_update_pport_counters(struct mlx5e struct mlx5e_port_stats_debug *s_debug = &priv->stats.port_stats_debug; u32 *in; u32 *out; - u64 *ptr; + const u64 *ptr; unsigned sz = MLX5_ST_SZ_BYTES(ppcnt_reg); unsigned x; unsigned y; @@ -324,7 +324,7 @@ mlx5e_update_pport_counters(struct mlx5e if (in == NULL || out == NULL) goto free_out; - ptr = (uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set); + ptr = (const uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set); MLX5_SET(ppcnt_reg, in, local_port, 1); From owner-svn-src-all@freebsd.org Mon Jan 9 16:47:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F28E0CA7FAD; Mon, 9 Jan 2017 16:47:40 +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 C3FD71325; Mon, 9 Jan 2017 16:47:40 +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 v09GlegM074533; Mon, 9 Jan 2017 16:47:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09Glemt074532; Mon, 9 Jan 2017 16:47:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091647.v09Glemt074532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 16:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311789 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 16:47:41 -0000 Author: hselasky Date: Mon Jan 9 16:47:39 2017 New Revision: 311789 URL: https://svnweb.freebsd.org/changeset/base/311789 Log: MFC r310388: Make a read only pointer constant. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:45:08 2017 (r311788) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:47:39 2017 (r311789) @@ -314,7 +314,7 @@ mlx5e_update_pport_counters(struct mlx5e struct mlx5e_port_stats_debug *s_debug = &priv->stats.port_stats_debug; u32 *in; u32 *out; - u64 *ptr; + const u64 *ptr; unsigned sz = MLX5_ST_SZ_BYTES(ppcnt_reg); unsigned x; unsigned y; @@ -324,7 +324,7 @@ mlx5e_update_pport_counters(struct mlx5e if (in == NULL || out == NULL) goto free_out; - ptr = (uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set); + ptr = (const uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set); MLX5_SET(ppcnt_reg, in, local_port, 1); From owner-svn-src-all@freebsd.org Mon Jan 9 16:49:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90AB9CA70AE for ; Mon, 9 Jan 2017 16:49:24 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com [IPv6:2607:f8b0:400d:c09::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 4720F159E for ; Mon, 9 Jan 2017 16:49:24 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x233.google.com with SMTP id 11so48011740qkl.3 for ; Mon, 09 Jan 2017 08:49:24 -0800 (PST) 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=701/3LMfEj8sl09rUQzuS0Lg7NacbmwvM2LcUoRgR/E=; b=F/dL+HtDWBZ+H6Wz6DnTIMqPUgL9hFJ5UsY35EcgD4V//Zb7x7SSIzTLVQodUbrcAk oeEG6QhmJhbI2g8W4RFbp66FdBHJaewoukaNTdMRSX1isZYBuOvpbFhxoGX31U67K0++ asUDQABwNSl7ap3sMswsCxj1+09ES0jZdfSEWwELiXskm+PQAuBWRYRwRG2/ikLTqLHM TPgp9mK1+9Ud6NBDh+W05kwDIjV6cePChyvm9Xi1PwWkw5iVHqXPkcCZo/z+ckmvup3i dAZ1zAdw57JEaVBPtqNwNPZtyEY8C8RVqK0unTwoWI8giKt/0fQDeBx/Ttj9J4fWHhJb ZdMw== 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=701/3LMfEj8sl09rUQzuS0Lg7NacbmwvM2LcUoRgR/E=; b=kMXrWeVrnJGl3xfKiXHzbjwEjgQnsU9OtzHWWdwct7swix+1cZaNWizSgQMpkZo4TV +QXsR5RHOZ7TghIyYSmr61bx5fYCRqSaSzTQQF/rGa2PTeQl7GEwd119jFgsTGRmXpzz 3N+sLwXN7lY2tVwAnq5kJEWLtLTTaYJho4aNgtqRlV7dqcbI+uWzRleA6mfuFtA0HOfV LQqqIgxtCZyNQY6GM+aw9NcNGFNMklrONXFmku5IA/CzuPhP4nuqMC3be9ztO84n3yDd NURxU5/MmGyE6tjXxmeWxs4e3IU1BzAqdJk1e7KVufgs+cSvWsebjWbYlLNxufCPieyr Q3jA== X-Gm-Message-State: AIkVDXJx/qbAy3Oous7ZF/wUy1QiOor9ggnbKAYyBEiiPNWkGQusKmnuQKMm+2zbybn+T0ms X-Received: by 10.55.99.81 with SMTP id x78mr27883179qkb.62.1483980563469; Mon, 09 Jan 2017 08:49:23 -0800 (PST) Received: from mutt-hardenedbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id d189sm718349qka.32.2017.01.09.08.49.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2017 08:49:22 -0800 (PST) Date: Mon, 9 Jan 2017 11:49:21 -0500 From: Shawn Webb To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311736 - head/sys/dev/sdhci Message-ID: <20170109164921.nrpezj7b7dk33yor@mutt-hardenedbsd> References: <201701090204.v0924sAV010381@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yius2fbq4uvbn7au" Content-Disposition: inline In-Reply-To: <201701090204.v0924sAV010381@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20161126 (1.7.1) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 16:49:24 -0000 --yius2fbq4uvbn7au Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Ian, On Mon, Jan 09, 2017 at 02:04:54AM +0000, Ian Lepore wrote: > Author: ian > Date: Mon Jan 9 02:04:54 2017 > New Revision: 311736 > URL: https://svnweb.freebsd.org/changeset/base/311736 >=20 > Log: > Use the new sdhci_fdt_gpio helper functions to add full support for FDT > gpio pins for detecting card insert/remove and write protect. Looks like the new sdhci work causes a kernel panic on the RPI3. It was reported to me by one of our users. I'll shortly be in the process of dissecting which exact commit causes it. Screenshots of the kernel panic: http://www.zyxst.net/~bofh/rpi3/hbsd/panic0.jpg http://www.zyxst.net/~bofh/rpi3/hbsd/panic1.jpg 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 --yius2fbq4uvbn7au Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlhzvxAACgkQaoRlj1JF bu5v8w//a/n/NYtH7ubBzmxRIyMf+uXEE7VC2h775yT9MIFaWlfY/OPiaer9sWql 9ZEVAFTtk9rPwktHXAkBNk3aAxAvN0UDvPZ7noYE99Db1lorJlYO0uJgcb9nsKwD BbLDpm92CK2qaZHlYYR7GvyPhUmwgIyqi8aKPMbABOyEsO2601FKfqf7hNT+w3Iq HIAN7DmALWpmb33IuAEKTG0wGRkpyiJXvMbZ21XCp9ySwEsCgLwOSFbQ3jHHKfHQ m6HIRz2fifmKq9sAjN8loko08GIFR+7MdlD+cuX54IJqh+8QcS+xBFb8/mQyLyk4 FeRfTibdPIyGTaNs/C0r96GM1gk/RgxTxVr/Il74e60m3iHdOVQdI6ZWl0rPhDxD 76wI2mHm051bXUFx5j5TXX8lkIlNp9QwH5/xCq0Sx+vOL9dfmkgX01P8eLu2BUix jSGTMmBKeJz46QWGwvs92jl04ujDRjnQLE45RfApMRWHGozz8ism+F4rt3LvnxLF rGNFVVS56OudpXaK0C4K48VrdygIdUvCeMNkunrZX7Nf4Kk/9BKNY5CJS7cVuLKU eaMCkxW4Kkll76AsaKyDrHFMeX03yb6rhjeOWxWp5VSz/Aj1DRYHsuYcMArpkcUT Tp89sHtywevZLcwIXDY7FZvg5BMSBBGugeHYE3oyCCd5Z8DUXPA= =D+vQ -----END PGP SIGNATURE----- --yius2fbq4uvbn7au-- From owner-svn-src-all@freebsd.org Mon Jan 9 16:52:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 026F1CA73CF; Mon, 9 Jan 2017 16:52:37 +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 D11A71B55; Mon, 9 Jan 2017 16:52:36 +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 v09GqaEp078351; Mon, 9 Jan 2017 16:52:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09Gqaww078350; Mon, 9 Jan 2017 16:52:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091652.v09Gqaww078350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 16:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311790 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 16:52:37 -0000 Author: hselasky Date: Mon Jan 9 16:52:35 2017 New Revision: 311790 URL: https://svnweb.freebsd.org/changeset/base/311790 Log: MFC r310387: Add more comments regarding collection of statistics counters. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:47:39 2017 (r311789) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:52:35 2017 (r311790) @@ -306,6 +306,12 @@ mlx5e_update_carrier_work(struct work_st PRIV_UNLOCK(priv); } +/* + * This function reads the physical port counters from the firmware + * using a pre-defined layout defined by various MLX5E_PPORT_XXX() + * macros. The output is converted from big-endian 64-bit values into + * host endian ones and stored in the "priv->stats.pport" structure. + */ static void mlx5e_update_pport_counters(struct mlx5e_priv *priv) { @@ -319,20 +325,27 @@ mlx5e_update_pport_counters(struct mlx5e unsigned x; unsigned y; + /* allocate firmware request structures */ in = mlx5_vzalloc(sz); out = mlx5_vzalloc(sz); if (in == NULL || out == NULL) goto free_out; + /* + * Get pointer to the 64-bit counter set which is located at a + * fixed offset in the output firmware request structure: + */ ptr = (const uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set); MLX5_SET(ppcnt_reg, in, local_port, 1); + /* read IEEE802_3 counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_IEEE_802_3_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = y = 0; x != MLX5E_PPORT_IEEE802_3_STATS_NUM; x++, y++) s->arg[y] = be64toh(ptr[x]); + /* read RFC2819 counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_RFC_2819_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_RFC2819_STATS_NUM; x++, y++) @@ -341,20 +354,29 @@ mlx5e_update_pport_counters(struct mlx5e MLX5E_PPORT_RFC2819_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); + /* read RFC2863 counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_RFC_2863_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_RFC2863_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); + /* read physical layer stats counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); free_out: + /* free firmware request structures */ kvfree(in); kvfree(out); } +/* + * This function is called regularly to collect all statistics + * counters from the firmware. The values can be viewed through the + * sysctl interface. Execution is serialized using the priv's global + * configuration lock. + */ static void mlx5e_update_stats_work(struct work_struct *work) { From owner-svn-src-all@freebsd.org Mon Jan 9 16:55:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBDE3CA74E5; Mon, 9 Jan 2017 16:55:30 +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 A90CB1DAB; Mon, 9 Jan 2017 16:55:30 +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 v09GtTUM078545; Mon, 9 Jan 2017 16:55:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09GtTuc078544; Mon, 9 Jan 2017 16:55:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091655.v09GtTuc078544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 16:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311791 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 16:55:30 -0000 Author: hselasky Date: Mon Jan 9 16:55:29 2017 New Revision: 311791 URL: https://svnweb.freebsd.org/changeset/base/311791 Log: MFC r310387: Add more comments regarding collection of statistics counters. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:52:35 2017 (r311790) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:55:29 2017 (r311791) @@ -306,6 +306,12 @@ mlx5e_update_carrier_work(struct work_st PRIV_UNLOCK(priv); } +/* + * This function reads the physical port counters from the firmware + * using a pre-defined layout defined by various MLX5E_PPORT_XXX() + * macros. The output is converted from big-endian 64-bit values into + * host endian ones and stored in the "priv->stats.pport" structure. + */ static void mlx5e_update_pport_counters(struct mlx5e_priv *priv) { @@ -319,20 +325,27 @@ mlx5e_update_pport_counters(struct mlx5e unsigned x; unsigned y; + /* allocate firmware request structures */ in = mlx5_vzalloc(sz); out = mlx5_vzalloc(sz); if (in == NULL || out == NULL) goto free_out; + /* + * Get pointer to the 64-bit counter set which is located at a + * fixed offset in the output firmware request structure: + */ ptr = (const uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set); MLX5_SET(ppcnt_reg, in, local_port, 1); + /* read IEEE802_3 counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_IEEE_802_3_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = y = 0; x != MLX5E_PPORT_IEEE802_3_STATS_NUM; x++, y++) s->arg[y] = be64toh(ptr[x]); + /* read RFC2819 counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_RFC_2819_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_RFC2819_STATS_NUM; x++, y++) @@ -341,20 +354,29 @@ mlx5e_update_pport_counters(struct mlx5e MLX5E_PPORT_RFC2819_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); + /* read RFC2863 counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_RFC_2863_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_RFC2863_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); + /* read physical layer stats counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); free_out: + /* free firmware request structures */ kvfree(in); kvfree(out); } +/* + * This function is called regularly to collect all statistics + * counters from the firmware. The values can be viewed through the + * sysctl interface. Execution is serialized using the priv's global + * configuration lock. + */ static void mlx5e_update_stats_work(struct work_struct *work) { From owner-svn-src-all@freebsd.org Mon Jan 9 17:04:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E091CA7933; Mon, 9 Jan 2017 17:04:52 +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 0164C1758; Mon, 9 Jan 2017 17:04:51 +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 v09H4p9i083020; Mon, 9 Jan 2017 17:04:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09H4pL9083019; Mon, 9 Jan 2017 17:04:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091704.v09H4pL9083019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311792 - stable/11/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:04:52 -0000 Author: hselasky Date: Mon Jan 9 17:04:51 2017 New Revision: 311792 URL: https://svnweb.freebsd.org/changeset/base/311792 Log: MFC r310058: Fix initialisation of mlx4_pci_table's .driver_data fields. Differential Revision: https://reviews.freebsd.org/D8791 Sponsored by: Mellanox Technologies Submitted by: Dexuan Cui Modified: stable/11/sys/ofed/drivers/net/mlx4/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/11/sys/ofed/drivers/net/mlx4/main.c Mon Jan 9 16:55:29 2017 (r311791) +++ stable/11/sys/ofed/drivers/net/mlx4/main.c Mon Jan 9 17:04:51 2017 (r311792) @@ -3635,47 +3635,61 @@ int mlx4_restart_one(struct pci_dev *pde static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = { /* MT25408 "Hermon" SDR */ - { PCI_VDEVICE(MELLANOX, 0x6340), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6340), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" DDR */ - { PCI_VDEVICE(MELLANOX, 0x634a), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x634a), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" QDR */ - { PCI_VDEVICE(MELLANOX, 0x6354), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6354), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" DDR PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x6732), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6732), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" QDR PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x673c), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x673c), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" EN 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x6368), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6368), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x6750), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6750), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x6372), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6372), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x675a), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x675a), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26468 ConnectX EN 10GigE PCIe gen2*/ - { PCI_VDEVICE(MELLANOX, 0x6764), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6764), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26438 ConnectX EN 40GigE PCIe gen2 5GT/s */ - { PCI_VDEVICE(MELLANOX, 0x6746), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6746), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26478 ConnectX2 40GigE PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x676e), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x676e), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25400 Family [ConnectX-2 Virtual Function] */ - { PCI_VDEVICE(MELLANOX, 0x1002), MLX4_PCI_DEV_IS_VF }, + { PCI_VDEVICE(MELLANOX, 0x1002), + .driver_data = MLX4_PCI_DEV_IS_VF }, /* MT27500 Family [ConnectX-3] */ - { PCI_VDEVICE(MELLANOX, 0x1003), 0 }, + { PCI_VDEVICE(MELLANOX, 0x1003) }, /* MT27500 Family [ConnectX-3 Virtual Function] */ - { PCI_VDEVICE(MELLANOX, 0x1004), MLX4_PCI_DEV_IS_VF }, - { PCI_VDEVICE(MELLANOX, 0x1005), 0 }, /* MT27510 Family */ - { PCI_VDEVICE(MELLANOX, 0x1006), 0 }, /* MT27511 Family */ - { PCI_VDEVICE(MELLANOX, 0x1007), 0 }, /* MT27520 Family */ - { PCI_VDEVICE(MELLANOX, 0x1008), 0 }, /* MT27521 Family */ - { PCI_VDEVICE(MELLANOX, 0x1009), 0 }, /* MT27530 Family */ - { PCI_VDEVICE(MELLANOX, 0x100a), 0 }, /* MT27531 Family */ - { PCI_VDEVICE(MELLANOX, 0x100b), 0 }, /* MT27540 Family */ - { PCI_VDEVICE(MELLANOX, 0x100c), 0 }, /* MT27541 Family */ - { PCI_VDEVICE(MELLANOX, 0x100d), 0 }, /* MT27550 Family */ - { PCI_VDEVICE(MELLANOX, 0x100e), 0 }, /* MT27551 Family */ - { PCI_VDEVICE(MELLANOX, 0x100f), 0 }, /* MT27560 Family */ - { PCI_VDEVICE(MELLANOX, 0x1010), 0 }, /* MT27561 Family */ + { PCI_VDEVICE(MELLANOX, 0x1004), + .driver_data = MLX4_PCI_DEV_IS_VF }, + { PCI_VDEVICE(MELLANOX, 0x1005) }, /* MT27510 Family */ + { PCI_VDEVICE(MELLANOX, 0x1006) }, /* MT27511 Family */ + { PCI_VDEVICE(MELLANOX, 0x1007) }, /* MT27520 Family */ + { PCI_VDEVICE(MELLANOX, 0x1008) }, /* MT27521 Family */ + { PCI_VDEVICE(MELLANOX, 0x1009) }, /* MT27530 Family */ + { PCI_VDEVICE(MELLANOX, 0x100a) }, /* MT27531 Family */ + { PCI_VDEVICE(MELLANOX, 0x100b) }, /* MT27540 Family */ + { PCI_VDEVICE(MELLANOX, 0x100c) }, /* MT27541 Family */ + { PCI_VDEVICE(MELLANOX, 0x100d) }, /* MT27550 Family */ + { PCI_VDEVICE(MELLANOX, 0x100e) }, /* MT27551 Family */ + { PCI_VDEVICE(MELLANOX, 0x100f) }, /* MT27560 Family */ + { PCI_VDEVICE(MELLANOX, 0x1010) }, /* MT27561 Family */ { 0, } }; From owner-svn-src-all@freebsd.org Mon Jan 9 17:05:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23F5ECA7C85; Mon, 9 Jan 2017 17:05:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5BE51A55; Mon, 9 Jan 2017 17:05:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09H5eSX083110; Mon, 9 Jan 2017 17:05:40 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09H5ePE083109; Mon, 9 Jan 2017 17:05:40 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201701091705.v09H5ePE083109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 9 Jan 2017 17:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311793 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:05:41 -0000 Author: marius Date: Mon Jan 9 17:05:39 2017 New Revision: 311793 URL: https://svnweb.freebsd.org/changeset/base/311793 Log: In mmcsd_task(), bio_resid was not being set to 0 on a successful read or write, resulting in random short-read and short-write returns for requests. Fixing this fixes nominal block I/O via mmcsd(4). Obtained from: DragonFlyBSD (fd4b97583be1a1e57234713c25f6e81bc0411cb0) MFC after: 5 days Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Mon Jan 9 17:04:51 2017 (r311792) +++ head/sys/dev/mmc/mmcsd.c Mon Jan 9 17:05:39 2017 (r311793) @@ -545,6 +545,8 @@ mmcsd_task(void *arg) bp->bio_error = EIO; bp->bio_resid = (end - block) * sz; bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_resid = 0; } biodone(bp); } From owner-svn-src-all@freebsd.org Mon Jan 9 17:07:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA761CA7E1B; Mon, 9 Jan 2017 17:07:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 206BB1CF6; Mon, 9 Jan 2017 17:07:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09H7Drh083227; Mon, 9 Jan 2017 17:07:13 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09H7D8A083223; Mon, 9 Jan 2017 17:07:13 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201701091707.v09H7D8A083223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 9 Jan 2017 17:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311794 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:07:16 -0000 Author: marius Date: Mon Jan 9 17:07:13 2017 New Revision: 311794 URL: https://svnweb.freebsd.org/changeset/base/311794 Log: - Add support for Intel Apollo Lake and Bay Trail eMMC controllers. Besides slots always having non-removable media, these HCIs require a custom hardware reset sequence after power-up. - Flesh out the support for Intel Braswell eMMC controllers further. Apart from also requiring said reset code, the timeout clock needs to be hardcoded to 1 MHz for these. Both the special reset and timeout clock handlings are implemented as global sdhci(4) quirks as the same treatment will be necessary for Intel eMMC controllers attached via ACPI (once sdhci(4) grows such a front-end). - In sdhci_init_slot(), use the right capability field for determining the announced bus width based on MMC_CAP_*_BIT_DATA. - Correct inverted sdhci_pci_softc member comments added in r276469. [1] Submitted by: Anton Yuzhaninov [1] MFC after: 5 days Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Jan 9 17:05:39 2017 (r311793) +++ head/sys/dev/sdhci/sdhci.c Mon Jan 9 17:07:13 2017 (r311794) @@ -376,6 +376,13 @@ sdhci_set_power(struct sdhci_slot *slot, /* Turn on the power. */ pwr |= SDHCI_POWER_ON; WR1(slot, SDHCI_POWER_CONTROL, pwr); + + if (slot->quirks & SDHCI_QUIRK_INTEL_POWER_UP_RESET) { + WR1(slot, SDHCI_POWER_CONTROL, pwr | 0x10); + DELAY(10); + WR1(slot, SDHCI_POWER_CONTROL, pwr); + DELAY(300); + } } static void @@ -622,9 +629,11 @@ sdhci_init_slot(device_t dev, struct sdh device_printf(dev, "Hardware doesn't specify base clock " "frequency, using %dMHz as default.\n", SDHCI_DEFAULT_MAX_FREQ); } - /* Calculate timeout clock frequency. */ + /* Calculate/set timeout clock frequency. */ if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) { slot->timeout_clk = slot->max_clk / 1000; + } else if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_1MHZ) { + slot->timeout_clk = 1000; } else { slot->timeout_clk = (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; @@ -668,6 +677,8 @@ sdhci_init_slot(device_t dev, struct sdh slot->opt &= ~SDHCI_HAVE_DMA; if (slot->quirks & SDHCI_QUIRK_FORCE_DMA) slot->opt |= SDHCI_HAVE_DMA; + if (slot->quirks & SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE) + slot->opt |= SDHCI_NON_REMOVABLE; /* * Use platform-provided transfer backend @@ -680,8 +691,9 @@ sdhci_init_slot(device_t dev, struct sdh slot_printf(slot, "%uMHz%s %s%s%s%s %s\n", slot->max_clk / 1000000, (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", - (caps & MMC_CAP_8_BIT_DATA) ? "8bits" : - ((caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"), + (slot->host.caps & MMC_CAP_8_BIT_DATA) ? "8bits" : + ((slot->host.caps & MMC_CAP_4_BIT_DATA) ? "4bits" : + "1bit"), (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Mon Jan 9 17:05:39 2017 (r311793) +++ head/sys/dev/sdhci/sdhci.h Mon Jan 9 17:07:13 2017 (r311794) @@ -66,7 +66,13 @@ /* Alternate clock source is required when supplying a 400 KHz clock. */ #define SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC (1<<16) /* Card insert/remove interrupts don't work, polling required. */ -#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) +#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) +/* All controller slots are non-removable. */ +#define SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE (1<<18) +/* Issue custom Intel controller reset sequence after power-up. */ +#define SDHCI_QUIRK_INTEL_POWER_UP_RESET (1<<19) +/* Data timeout is invalid, use 1 MHz clock instead. */ +#define SDHCI_QUIRK_DATA_TIMEOUT_1MHZ (1<<20) /* * Controller registers Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Mon Jan 9 17:05:39 2017 (r311793) +++ head/sys/dev/sdhci/sdhci_pci.c Mon Jan 9 17:07:13 2017 (r311794) @@ -107,8 +107,19 @@ static const struct sdhci_device { SDHCI_QUIRK_RESET_AFTER_REQUEST }, { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, - { 0x22948086, 0xffff, "Intel Braswell Storage Cluster Control MMC Port", - 0 }, + { 0x0f148086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x0f508086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x22948086, 0xffff, "Intel Braswell eMMC 4.5.1 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_DATA_TIMEOUT_1MHZ | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x5acc8086, 0xffff, "Intel Apollo Lake eMMC 5.0 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, { 0, 0xffff, NULL, 0 } }; @@ -121,8 +132,8 @@ struct sdhci_pci_softc { int num_slots; /* Number of slots on this controller */ struct sdhci_slot slots[6]; struct resource *mem_res[6]; /* Memory resource */ - uint8_t cfg_freq; /* Saved mode */ - uint8_t cfg_mode; /* Saved frequency */ + uint8_t cfg_freq; /* Saved frequency */ + uint8_t cfg_mode; /* Saved mode */ }; static int sdhci_enable_msi = 1; From owner-svn-src-all@freebsd.org Mon Jan 9 17:07:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 470F6CA7EB1; Mon, 9 Jan 2017 17:07:55 +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 7CA351F03; Mon, 9 Jan 2017 17:07:54 +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 v09H7qdj083290; Mon, 9 Jan 2017 17:07:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09H7qr8083289; Mon, 9 Jan 2017 17:07:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091707.v09H7qr8083289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311795 - stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:07:55 -0000 Author: hselasky Date: Mon Jan 9 17:07:52 2017 New Revision: 311795 URL: https://svnweb.freebsd.org/changeset/base/311795 Log: MFC r310058: Fix initialisation of mlx4_pci_table's .driver_data fields. Differential Revision: https://reviews.freebsd.org/D8791 Sponsored by: Mellanox Technologies Submitted by: Dexuan Cui Modified: stable/10/sys/ofed/drivers/net/mlx4/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/main.c Mon Jan 9 17:07:13 2017 (r311794) +++ stable/10/sys/ofed/drivers/net/mlx4/main.c Mon Jan 9 17:07:52 2017 (r311795) @@ -3637,47 +3637,61 @@ int mlx4_restart_one(struct pci_dev *pde static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = { /* MT25408 "Hermon" SDR */ - { PCI_VDEVICE(MELLANOX, 0x6340), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6340), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" DDR */ - { PCI_VDEVICE(MELLANOX, 0x634a), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x634a), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" QDR */ - { PCI_VDEVICE(MELLANOX, 0x6354), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6354), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" DDR PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x6732), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6732), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" QDR PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x673c), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x673c), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" EN 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x6368), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6368), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x6750), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6750), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x6372), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6372), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x675a), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x675a), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26468 ConnectX EN 10GigE PCIe gen2*/ - { PCI_VDEVICE(MELLANOX, 0x6764), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6764), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26438 ConnectX EN 40GigE PCIe gen2 5GT/s */ - { PCI_VDEVICE(MELLANOX, 0x6746), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6746), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26478 ConnectX2 40GigE PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x676e), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x676e), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25400 Family [ConnectX-2 Virtual Function] */ - { PCI_VDEVICE(MELLANOX, 0x1002), MLX4_PCI_DEV_IS_VF }, + { PCI_VDEVICE(MELLANOX, 0x1002), + .driver_data = MLX4_PCI_DEV_IS_VF }, /* MT27500 Family [ConnectX-3] */ - { PCI_VDEVICE(MELLANOX, 0x1003), 0 }, + { PCI_VDEVICE(MELLANOX, 0x1003) }, /* MT27500 Family [ConnectX-3 Virtual Function] */ - { PCI_VDEVICE(MELLANOX, 0x1004), MLX4_PCI_DEV_IS_VF }, - { PCI_VDEVICE(MELLANOX, 0x1005), 0 }, /* MT27510 Family */ - { PCI_VDEVICE(MELLANOX, 0x1006), 0 }, /* MT27511 Family */ - { PCI_VDEVICE(MELLANOX, 0x1007), 0 }, /* MT27520 Family */ - { PCI_VDEVICE(MELLANOX, 0x1008), 0 }, /* MT27521 Family */ - { PCI_VDEVICE(MELLANOX, 0x1009), 0 }, /* MT27530 Family */ - { PCI_VDEVICE(MELLANOX, 0x100a), 0 }, /* MT27531 Family */ - { PCI_VDEVICE(MELLANOX, 0x100b), 0 }, /* MT27540 Family */ - { PCI_VDEVICE(MELLANOX, 0x100c), 0 }, /* MT27541 Family */ - { PCI_VDEVICE(MELLANOX, 0x100d), 0 }, /* MT27550 Family */ - { PCI_VDEVICE(MELLANOX, 0x100e), 0 }, /* MT27551 Family */ - { PCI_VDEVICE(MELLANOX, 0x100f), 0 }, /* MT27560 Family */ - { PCI_VDEVICE(MELLANOX, 0x1010), 0 }, /* MT27561 Family */ + { PCI_VDEVICE(MELLANOX, 0x1004), + .driver_data = MLX4_PCI_DEV_IS_VF }, + { PCI_VDEVICE(MELLANOX, 0x1005) }, /* MT27510 Family */ + { PCI_VDEVICE(MELLANOX, 0x1006) }, /* MT27511 Family */ + { PCI_VDEVICE(MELLANOX, 0x1007) }, /* MT27520 Family */ + { PCI_VDEVICE(MELLANOX, 0x1008) }, /* MT27521 Family */ + { PCI_VDEVICE(MELLANOX, 0x1009) }, /* MT27530 Family */ + { PCI_VDEVICE(MELLANOX, 0x100a) }, /* MT27531 Family */ + { PCI_VDEVICE(MELLANOX, 0x100b) }, /* MT27540 Family */ + { PCI_VDEVICE(MELLANOX, 0x100c) }, /* MT27541 Family */ + { PCI_VDEVICE(MELLANOX, 0x100d) }, /* MT27550 Family */ + { PCI_VDEVICE(MELLANOX, 0x100e) }, /* MT27551 Family */ + { PCI_VDEVICE(MELLANOX, 0x100f) }, /* MT27560 Family */ + { PCI_VDEVICE(MELLANOX, 0x1010) }, /* MT27561 Family */ { 0, } }; From owner-svn-src-all@freebsd.org Mon Jan 9 17:09:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BE51CA7067; Mon, 9 Jan 2017 17:09:55 +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 A79E31165; Mon, 9 Jan 2017 17:09:54 +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 v09H9rap083404; Mon, 9 Jan 2017 17:09:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09H9roZ083403; Mon, 9 Jan 2017 17:09:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091709.v09H9roZ083403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r311796 - stable/9/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:09:55 -0000 Author: hselasky Date: Mon Jan 9 17:09:53 2017 New Revision: 311796 URL: https://svnweb.freebsd.org/changeset/base/311796 Log: MFC r310058: Fix initialisation of mlx4_pci_table's .driver_data fields. Differential Revision: https://reviews.freebsd.org/D8791 Sponsored by: Mellanox Technologies Submitted by: Dexuan Cui Modified: stable/9/sys/ofed/drivers/net/mlx4/main.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/main.c Mon Jan 9 17:07:52 2017 (r311795) +++ stable/9/sys/ofed/drivers/net/mlx4/main.c Mon Jan 9 17:09:53 2017 (r311796) @@ -3637,47 +3637,61 @@ int mlx4_restart_one(struct pci_dev *pde static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = { /* MT25408 "Hermon" SDR */ - { PCI_VDEVICE(MELLANOX, 0x6340), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6340), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" DDR */ - { PCI_VDEVICE(MELLANOX, 0x634a), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x634a), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" QDR */ - { PCI_VDEVICE(MELLANOX, 0x6354), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6354), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" DDR PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x6732), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6732), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" QDR PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x673c), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x673c), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" EN 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x6368), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6368), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x6750), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6750), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x6372), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6372), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x675a), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x675a), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26468 ConnectX EN 10GigE PCIe gen2*/ - { PCI_VDEVICE(MELLANOX, 0x6764), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6764), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26438 ConnectX EN 40GigE PCIe gen2 5GT/s */ - { PCI_VDEVICE(MELLANOX, 0x6746), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6746), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26478 ConnectX2 40GigE PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x676e), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x676e), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25400 Family [ConnectX-2 Virtual Function] */ - { PCI_VDEVICE(MELLANOX, 0x1002), MLX4_PCI_DEV_IS_VF }, + { PCI_VDEVICE(MELLANOX, 0x1002), + .driver_data = MLX4_PCI_DEV_IS_VF }, /* MT27500 Family [ConnectX-3] */ - { PCI_VDEVICE(MELLANOX, 0x1003), 0 }, + { PCI_VDEVICE(MELLANOX, 0x1003) }, /* MT27500 Family [ConnectX-3 Virtual Function] */ - { PCI_VDEVICE(MELLANOX, 0x1004), MLX4_PCI_DEV_IS_VF }, - { PCI_VDEVICE(MELLANOX, 0x1005), 0 }, /* MT27510 Family */ - { PCI_VDEVICE(MELLANOX, 0x1006), 0 }, /* MT27511 Family */ - { PCI_VDEVICE(MELLANOX, 0x1007), 0 }, /* MT27520 Family */ - { PCI_VDEVICE(MELLANOX, 0x1008), 0 }, /* MT27521 Family */ - { PCI_VDEVICE(MELLANOX, 0x1009), 0 }, /* MT27530 Family */ - { PCI_VDEVICE(MELLANOX, 0x100a), 0 }, /* MT27531 Family */ - { PCI_VDEVICE(MELLANOX, 0x100b), 0 }, /* MT27540 Family */ - { PCI_VDEVICE(MELLANOX, 0x100c), 0 }, /* MT27541 Family */ - { PCI_VDEVICE(MELLANOX, 0x100d), 0 }, /* MT27550 Family */ - { PCI_VDEVICE(MELLANOX, 0x100e), 0 }, /* MT27551 Family */ - { PCI_VDEVICE(MELLANOX, 0x100f), 0 }, /* MT27560 Family */ - { PCI_VDEVICE(MELLANOX, 0x1010), 0 }, /* MT27561 Family */ + { PCI_VDEVICE(MELLANOX, 0x1004), + .driver_data = MLX4_PCI_DEV_IS_VF }, + { PCI_VDEVICE(MELLANOX, 0x1005) }, /* MT27510 Family */ + { PCI_VDEVICE(MELLANOX, 0x1006) }, /* MT27511 Family */ + { PCI_VDEVICE(MELLANOX, 0x1007) }, /* MT27520 Family */ + { PCI_VDEVICE(MELLANOX, 0x1008) }, /* MT27521 Family */ + { PCI_VDEVICE(MELLANOX, 0x1009) }, /* MT27530 Family */ + { PCI_VDEVICE(MELLANOX, 0x100a) }, /* MT27531 Family */ + { PCI_VDEVICE(MELLANOX, 0x100b) }, /* MT27540 Family */ + { PCI_VDEVICE(MELLANOX, 0x100c) }, /* MT27541 Family */ + { PCI_VDEVICE(MELLANOX, 0x100d) }, /* MT27550 Family */ + { PCI_VDEVICE(MELLANOX, 0x100e) }, /* MT27551 Family */ + { PCI_VDEVICE(MELLANOX, 0x100f) }, /* MT27560 Family */ + { PCI_VDEVICE(MELLANOX, 0x1010) }, /* MT27561 Family */ { 0, } }; From owner-svn-src-all@freebsd.org Mon Jan 9 17:10:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67A5ECA717A; Mon, 9 Jan 2017 17:10:51 +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 213E5138F; Mon, 9 Jan 2017 17:10:51 +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 v09HAojV083510; Mon, 9 Jan 2017 17:10:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09HAo4j083509; Mon, 9 Jan 2017 17:10:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701091710.v09HAo4j083509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Jan 2017 17:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311797 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:10:51 -0000 Author: ian Date: Mon Jan 9 17:10:50 2017 New Revision: 311797 URL: https://svnweb.freebsd.org/changeset/base/311797 Log: Add sdhci_handle_card_present_locked() that can be called from the interrupt handler which already holds the mutex, and have sdhci_handle_card_present() be just a tiny wrapper that does the locking for external callers. This should fix the recursive locking panics seen on rpi3. Reported by: Shawn Webb Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Jan 9 17:09:53 2017 (r311796) +++ head/sys/dev/sdhci/sdhci.c Mon Jan 9 17:10:50 2017 (r311797) @@ -521,8 +521,8 @@ sdhci_card_task(void *arg, int pending) } } -void -sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present) +static void +sdhci_handle_card_present_locked(struct sdhci_slot *slot, bool is_present) { bool was_present; @@ -537,7 +537,6 @@ sdhci_handle_card_present(struct sdhci_s * because once power is removed, a full card re-init is needed, and * that happens by deleting and recreating the child device. */ - SDHCI_LOCK(slot); was_present = slot->dev != NULL; if (!was_present && is_present) { taskqueue_enqueue_timeout(taskqueue_swi_giant, @@ -545,6 +544,14 @@ sdhci_handle_card_present(struct sdhci_s } else if (was_present && !is_present) { taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); } +} + +void +sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present) +{ + + SDHCI_LOCK(slot); + sdhci_handle_card_present_locked(slot, is_present); SDHCI_UNLOCK(slot); } @@ -1402,7 +1409,7 @@ sdhci_generic_intr(struct sdhci_slot *sl WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); WR4(slot, SDHCI_INT_STATUS, intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)); - sdhci_handle_card_present(slot, present); + sdhci_handle_card_present_locked(slot, present); intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); } /* Handle command interrupts. */ From owner-svn-src-all@freebsd.org Mon Jan 9 17:12:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AB84CA7265; Mon, 9 Jan 2017 17:12:16 +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 412D117E8; Mon, 9 Jan 2017 17:12:16 +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 v09HCFuq084369; Mon, 9 Jan 2017 17:12:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09HCFiR084366; Mon, 9 Jan 2017 17:12:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091712.v09HCFiR084366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311798 - stable/11/sys/dev/usb X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:12:16 -0000 Author: hselasky Date: Mon Jan 9 17:12:15 2017 New Revision: 311798 URL: https://svnweb.freebsd.org/changeset/base/311798 Log: MFC r310242: Defer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid boot panics in conjunction with the recently added EARLY_AP_STARTUP feature. The panics happen due to using kernel facilities like callouts too early. Tested by: jhb @ Modified: stable/11/sys/dev/usb/usb_hub.c stable/11/sys/dev/usb/usb_process.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usb_hub.c ============================================================================== --- stable/11/sys/dev/usb/usb_hub.c Mon Jan 9 17:10:50 2017 (r311797) +++ stable/11/sys/dev/usb/usb_hub.c Mon Jan 9 17:12:15 2017 (r311798) @@ -2261,6 +2261,11 @@ usb_needs_explore(struct usb_bus *bus, u DPRINTF("\n"); + if (cold != 0) { + DPRINTF("Cold\n"); + return; + } + if (bus == NULL) { DPRINTF("No bus pointer!\n"); return; @@ -2326,6 +2331,26 @@ usb_needs_explore_all(void) } /*------------------------------------------------------------------------* + * usb_needs_explore_init + * + * This function will ensure that the USB controllers are not enumerated + * until the "cold" variable is cleared. + *------------------------------------------------------------------------*/ +static void +usb_needs_explore_init(void *arg) +{ + /* + * The cold variable should be cleared prior to this function + * being called: + */ + if (cold == 0) + usb_needs_explore_all(); + else + DPRINTFN(-1, "Cold variable is still set!\n"); +} +SYSINIT(usb_needs_explore_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_SECOND, usb_needs_explore_init, NULL); + +/*------------------------------------------------------------------------* * usb_bus_power_update * * This function will ensure that all USB devices on the given bus are Modified: stable/11/sys/dev/usb/usb_process.c ============================================================================== --- stable/11/sys/dev/usb/usb_process.c Mon Jan 9 17:10:50 2017 (r311797) +++ stable/11/sys/dev/usb/usb_process.c Mon Jan 9 17:12:15 2017 (r311798) @@ -454,14 +454,15 @@ usb_proc_drain(struct usb_process *up) up->up_csleep = 0; cv_signal(&up->up_cv); } +#ifndef EARLY_AP_STARTUP /* Check if we are still cold booted */ - if (cold) { USB_THREAD_SUSPEND(up->up_ptr); printf("WARNING: A USB process has " "been left suspended\n"); break; } +#endif cv_wait(&up->up_cv, up->up_mtx); } /* Check if someone is waiting - should not happen */ From owner-svn-src-all@freebsd.org Mon Jan 9 17:13:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7BDCCA7440; Mon, 9 Jan 2017 17:13:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 C517119E1; Mon, 9 Jan 2017 17:13:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 2203410B56B; Mon, 9 Jan 2017 12:12:56 -0500 (EST) From: John Baldwin To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include Date: Mon, 09 Jan 2017 09:08:26 -0800 Message-ID: <7685799.RHuinLcsJW@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201701080626.v086QXDx022252@repo.freebsd.org> References: <201701080626.v086QXDx022252@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 09 Jan 2017 12:12:56 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:13:04 -0000 On Sunday, January 08, 2017 06:26:33 AM Conrad E. Meyer wrote: > Author: cem > Date: Sun Jan 8 06:26:33 2017 > New Revision: 311667 > URL: https://svnweb.freebsd.org/changeset/base/311667 > > Log: > Add some additional ACPI methods for DRM > > Add AcpiGetDataFull and AcpiGetTableWithSize. > > Submitted by: Matt Macy Have these been submitted upstream? The Intel folks are generally quite responsive on freebsd-acpi@FreeBSD.org and this codebase is actively maintained externally. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jan 9 17:13:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E99ACA74B9; Mon, 9 Jan 2017 17:13:37 +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 0D9591B9C; Mon, 9 Jan 2017 17:13:36 +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 v09HDaNB087422; Mon, 9 Jan 2017 17:13:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09HDaix087420; Mon, 9 Jan 2017 17:13:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091713.v09HDaix087420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311799 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:13:37 -0000 Author: hselasky Date: Mon Jan 9 17:13:35 2017 New Revision: 311799 URL: https://svnweb.freebsd.org/changeset/base/311799 Log: MFC r310242: Defer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid boot panics in conjunction with the recently added EARLY_AP_STARTUP feature. The panics happen due to using kernel facilities like callouts too early. Tested by: jhb @ Modified: stable/10/sys/dev/usb/usb_hub.c stable/10/sys/dev/usb/usb_process.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_hub.c ============================================================================== --- stable/10/sys/dev/usb/usb_hub.c Mon Jan 9 17:12:15 2017 (r311798) +++ stable/10/sys/dev/usb/usb_hub.c Mon Jan 9 17:13:35 2017 (r311799) @@ -2272,6 +2272,11 @@ usb_needs_explore(struct usb_bus *bus, u DPRINTF("\n"); + if (cold != 0) { + DPRINTF("Cold\n"); + return; + } + if (bus == NULL) { DPRINTF("No bus pointer!\n"); return; @@ -2337,6 +2342,26 @@ usb_needs_explore_all(void) } /*------------------------------------------------------------------------* + * usb_needs_explore_init + * + * This function will ensure that the USB controllers are not enumerated + * until the "cold" variable is cleared. + *------------------------------------------------------------------------*/ +static void +usb_needs_explore_init(void *arg) +{ + /* + * The cold variable should be cleared prior to this function + * being called: + */ + if (cold == 0) + usb_needs_explore_all(); + else + DPRINTFN(-1, "Cold variable is still set!\n"); +} +SYSINIT(usb_needs_explore_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_SECOND, usb_needs_explore_init, NULL); + +/*------------------------------------------------------------------------* * usb_bus_power_update * * This function will ensure that all USB devices on the given bus are Modified: stable/10/sys/dev/usb/usb_process.c ============================================================================== --- stable/10/sys/dev/usb/usb_process.c Mon Jan 9 17:12:15 2017 (r311798) +++ stable/10/sys/dev/usb/usb_process.c Mon Jan 9 17:13:35 2017 (r311799) @@ -455,14 +455,15 @@ usb_proc_drain(struct usb_process *up) up->up_csleep = 0; cv_signal(&up->up_cv); } +#ifndef EARLY_AP_STARTUP /* Check if we are still cold booted */ - if (cold) { USB_THREAD_SUSPEND(up->up_ptr); printf("WARNING: A USB process has " "been left suspended\n"); break; } +#endif cv_wait(&up->up_cv, up->up_mtx); } /* Check if someone is waiting - should not happen */ From owner-svn-src-all@freebsd.org Mon Jan 9 17:16:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90808CA773D; Mon, 9 Jan 2017 17:16:17 +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 E962A11C1; Mon, 9 Jan 2017 17:16:15 +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 v09HGELN088125; Mon, 9 Jan 2017 17:16:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09HGEmB088124; Mon, 9 Jan 2017 17:16:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091716.v09HGEmB088124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311800 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:16:17 -0000 Author: hselasky Date: Mon Jan 9 17:16:14 2017 New Revision: 311800 URL: https://svnweb.freebsd.org/changeset/base/311800 Log: MFC r310557: Use correct integer type when computing the maximum physical address for kmem_alloc_contig(). Obtained from: kmacy @ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Mon Jan 9 17:13:35 2017 (r311799) +++ stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Mon Jan 9 17:16:14 2017 (r311800) @@ -136,8 +136,8 @@ alloc_pages(gfp_t gfp_mask, unsigned int size_t size; size = PAGE_SIZE << order; - page = kmem_alloc_contig(kmem_arena, size, gfp_mask, 0, -1, - size, 0, VM_MEMATTR_DEFAULT); + page = kmem_alloc_contig(kmem_arena, size, gfp_mask, + 0, ~(vm_paddr_t)0, size, 0, VM_MEMATTR_DEFAULT); if (page == 0) return (NULL); return (virt_to_page(page)); From owner-svn-src-all@freebsd.org Mon Jan 9 17:18:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EFF5CA7845; Mon, 9 Jan 2017 17:18:40 +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 634B61456; Mon, 9 Jan 2017 17:18:40 +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 v09HIdjU088252; Mon, 9 Jan 2017 17:18:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09HIdAv088251; Mon, 9 Jan 2017 17:18:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091718.v09HIdAv088251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311801 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:18:40 -0000 Author: hselasky Date: Mon Jan 9 17:18:39 2017 New Revision: 311801 URL: https://svnweb.freebsd.org/changeset/base/311801 Log: MFC r310553: Improve LinuxKPI device support. Only delete own BSD devices and not the ones obtained through devclass_get_device(). Some minor code cleanups while at it. Obtained from: kmacy @ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/device.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/device.h Mon Jan 9 17:16:14 2017 (r311800) +++ stable/11/sys/compat/linuxkpi/common/include/linux/device.h Mon Jan 9 17:18:39 2017 (r311801) @@ -63,6 +63,14 @@ struct device { struct device *parent; struct list_head irqents; device_t bsddev; + /* + * The following flag is used to determine if the LinuxKPI is + * responsible for detaching the BSD device or not. If the + * LinuxKPI got the BSD device using devclass_get_device(), it + * must not try to detach or delete it, because it's already + * done somewhere else. + */ + bool bsddev_attached_here; dev_t devt; struct class *class; void (*release)(struct device *dev); @@ -208,23 +216,36 @@ static inline struct device *kobj_to_dev static inline void device_initialize(struct device *dev) { - device_t bsddev; + device_t bsddev = NULL; + int unit = -1; - bsddev = NULL; if (dev->devt) { - int unit = MINOR(dev->devt); + unit = MINOR(dev->devt); bsddev = devclass_get_device(dev->class->bsdclass, unit); + dev->bsddev_attached_here = false; + } else if (dev->parent == NULL) { + bsddev = devclass_get_device(dev->class->bsdclass, 0); + dev->bsddev_attached_here = false; + } else { + dev->bsddev_attached_here = true; + } + + if (bsddev == NULL && dev->parent != NULL) { + bsddev = device_add_child(dev->parent->bsddev, + dev->class->kobj.name, unit); } + if (bsddev != NULL) device_set_softc(bsddev, dev); dev->bsddev = bsddev; + MPASS(dev->bsddev != NULL); kobject_init(&dev->kobj, &linux_dev_ktype); } static inline int device_add(struct device *dev) -{ +{ if (dev->bsddev != NULL) { if (dev->devt == 0) dev->devt = makedev(0, device_get_unit(dev->bsddev)); @@ -256,13 +277,13 @@ device_create_groups_vargs(struct class goto error; } - device_initialize(dev); dev->devt = devt; dev->class = class; dev->parent = parent; dev->groups = groups; dev->release = device_create_release; - dev->bsddev = devclass_get_device(dev->class->bsdclass, MINOR(devt)); + /* device_initialize() needs the class and parent to be set */ + device_initialize(dev); dev_set_drvdata(dev, drvdata); retval = kobject_set_name_vargs(&dev->kobj, fmt, args); @@ -298,17 +319,21 @@ device_create_with_groups(struct class * static inline int device_register(struct device *dev) { - device_t bsddev; - int unit; + device_t bsddev = NULL; + int unit = -1; - bsddev = NULL; - unit = -1; + if (dev->bsddev != NULL) + goto done; if (dev->devt) { unit = MINOR(dev->devt); bsddev = devclass_get_device(dev->class->bsdclass, unit); + dev->bsddev_attached_here = false; } else if (dev->parent == NULL) { bsddev = devclass_get_device(dev->class->bsdclass, 0); + dev->bsddev_attached_here = false; + } else { + dev->bsddev_attached_here = true; } if (bsddev == NULL && dev->parent != NULL) { bsddev = device_add_child(dev->parent->bsddev, @@ -320,6 +345,7 @@ device_register(struct device *dev) device_set_softc(bsddev, dev); } dev->bsddev = bsddev; +done: kobject_init(&dev->kobj, &linux_dev_ktype); kobject_add(&dev->kobj, &dev->class->kobj, dev_name(dev)); @@ -334,7 +360,7 @@ device_unregister(struct device *dev) bsddev = dev->bsddev; dev->bsddev = NULL; - if (bsddev != NULL) { + if (bsddev != NULL && dev->bsddev_attached_here) { mtx_lock(&Giant); device_delete_child(device_get_parent(bsddev), bsddev); mtx_unlock(&Giant); @@ -350,7 +376,7 @@ device_del(struct device *dev) bsddev = dev->bsddev; dev->bsddev = NULL; - if (bsddev != NULL) { + if (bsddev != NULL && dev->bsddev_attached_here) { mtx_lock(&Giant); device_delete_child(device_get_parent(bsddev), bsddev); mtx_unlock(&Giant); From owner-svn-src-all@freebsd.org Mon Jan 9 17:20:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA6BCCA78EA; Mon, 9 Jan 2017 17:20:05 +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 907131628; Mon, 9 Jan 2017 17:20:05 +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 v09HK4Dj088378; Mon, 9 Jan 2017 17:20:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09HK4G8088377; Mon, 9 Jan 2017 17:20:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091720.v09HK4G8088377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311802 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:20:06 -0000 Author: hselasky Date: Mon Jan 9 17:20:04 2017 New Revision: 311802 URL: https://svnweb.freebsd.org/changeset/base/311802 Log: MFC r310589: Implement more list header file functions. Add definition guard for the list_head structure. Obtained from: kmacy @ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/list.h Mon Jan 9 17:18:39 2017 (r311801) +++ stable/11/sys/compat/linuxkpi/common/include/linux/list.h Mon Jan 9 17:20:04 2017 (r311802) @@ -72,10 +72,18 @@ #define prefetch(x) +#define LINUX_LIST_HEAD_INIT(name) { &(name), &(name) } + +#define LINUX_LIST_HEAD(name) \ + struct list_head name = LINUX_LIST_HEAD_INIT(name) + +#ifndef LIST_HEAD_DEF +#define LIST_HEAD_DEF struct list_head { struct list_head *next; struct list_head *prev; }; +#endif static inline void INIT_LIST_HEAD(struct list_head *list) @@ -91,12 +99,26 @@ list_empty(const struct list_head *head) return (head->next == head); } +static inline int +list_empty_careful(const struct list_head *head) +{ + struct list_head *next = head->next; + + return ((next == head) && (next == head->prev)); +} + +static inline void +__list_del(struct list_head *prev, struct list_head *next) +{ + next->prev = prev; + WRITE_ONCE(prev->next, next); +} + static inline void list_del(struct list_head *entry) { - entry->next->prev = entry->prev; - entry->prev->next = entry->next; + __list_del(entry->prev, entry->next); } static inline void @@ -183,6 +205,11 @@ list_del_init(struct list_head *entry) for (p = list_entry((h)->prev, typeof(*p), field); &(p)->field != (h); \ p = list_entry((p)->field.prev, typeof(*p), field)) +#define list_for_each_entry_safe_reverse(p, n, h, field) \ + for (p = list_entry((h)->prev, typeof(*p), field), \ + n = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != (h); \ + p = n, n = list_entry(n->field.prev, typeof(*n), field)) + #define list_for_each_entry_continue_reverse(p, h, field) \ for (p = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != (h); \ p = list_entry((p)->field.prev, typeof(*p), field)) From owner-svn-src-all@freebsd.org Mon Jan 9 17:25:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F768CA7AFF; Mon, 9 Jan 2017 17:25:25 +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 025681BA0; Mon, 9 Jan 2017 17:25:24 +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 v09HPORr092139; Mon, 9 Jan 2017 17:25:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09HPNMT092136; Mon, 9 Jan 2017 17:25:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091725.v09HPNMT092136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311803 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:25:25 -0000 Author: hselasky Date: Mon Jan 9 17:25:23 2017 New Revision: 311803 URL: https://svnweb.freebsd.org/changeset/base/311803 Log: MFC r310559 and r310583: Implement register and unregister chrdev in the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/cdev.h stable/11/sys/compat/linuxkpi/common/include/linux/fs.h stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/cdev.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/cdev.h Mon Jan 9 17:20:04 2017 (r311802) +++ stable/11/sys/compat/linuxkpi/common/include/linux/cdev.h Mon Jan 9 17:25:23 2017 (r311803) @@ -95,7 +95,7 @@ cdev_add(struct linux_cdev *cdev, dev_t args.mda_gid = 0; args.mda_mode = 0700; args.mda_si_drv1 = cdev; - args.mda_unit = MINOR(dev); + args.mda_unit = dev; error = make_dev_s(&args, &cdev->cdev, "%s", kobject_name(&cdev->kobj)); @@ -121,7 +121,7 @@ cdev_add_ext(struct linux_cdev *cdev, de args.mda_gid = gid; args.mda_mode = mode; args.mda_si_drv1 = cdev; - args.mda_unit = MINOR(dev); + args.mda_unit = dev; error = make_dev_s(&args, &cdev->cdev, "%s/%d", kobject_name(&cdev->kobj), MINOR(dev)); @@ -142,6 +142,8 @@ cdev_del(struct linux_cdev *cdev) kobject_put(&cdev->kobj); } +struct linux_cdev *linux_find_cdev(const char *name, unsigned major, unsigned minor); + #define cdev linux_cdev #endif /* _LINUX_CDEV_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Mon Jan 9 17:20:04 2017 (r311802) +++ stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Mon Jan 9 17:25:23 2017 (r311803) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -151,6 +151,39 @@ struct file_operations { #define FMODE_WRITE FWRITE #define FMODE_EXEC FEXEC +int __register_chrdev(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name, + const struct file_operations *fops); +int __register_chrdev_p(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name, + const struct file_operations *fops, uid_t uid, + gid_t gid, int mode); +void __unregister_chrdev(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name); + +static inline void +unregister_chrdev(unsigned int major, const char *name) +{ + + __unregister_chrdev(major, 0, 256, name); +} + +static inline int +register_chrdev(unsigned int major, const char *name, + const struct file_operations *fops) +{ + + return (__register_chrdev(major, 0, 256, name, fops)); +} + +static inline int +register_chrdev_p(unsigned int major, const char *name, + const struct file_operations *fops, uid_t uid, gid_t gid, int mode) +{ + + return (__register_chrdev_p(major, 0, 256, name, fops, uid, gid, mode)); +} + static inline int register_chrdev_region(dev_t dev, unsigned range, const char *name) { @@ -184,7 +217,7 @@ static inline dev_t iminor(struct inode *inode) { - return dev2unit(inode->v_rdev); + return (minor(dev2unit(inode->v_rdev))); } static inline struct inode * Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Mon Jan 9 17:20:04 2017 (r311802) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Mon Jan 9 17:25:23 2017 (r311803) @@ -1418,6 +1418,82 @@ linux_irq_handler(void *ent) irqe->handler(irqe->irq, irqe->arg); } +struct linux_cdev * +linux_find_cdev(const char *name, unsigned major, unsigned minor) +{ + int unit = MKDEV(major, minor); + struct cdev *cdev; + + dev_lock(); + LIST_FOREACH(cdev, &linuxcdevsw.d_devs, si_list) { + struct linux_cdev *ldev = cdev->si_drv1; + if (dev2unit(cdev) == unit && + strcmp(kobject_name(&ldev->kobj), name) == 0) { + break; + } + } + dev_unlock(); + + return (cdev != NULL ? cdev->si_drv1 : NULL); +} + +int +__register_chrdev(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name, + const struct file_operations *fops) +{ + struct linux_cdev *cdev; + int ret = 0; + int i; + + for (i = baseminor; i < baseminor + count; i++) { + cdev = cdev_alloc(); + cdev_init(cdev, fops); + kobject_set_name(&cdev->kobj, name); + + ret = cdev_add(cdev, makedev(major, i), 1); + if (ret != 0) + break; + } + return (ret); +} + +int +__register_chrdev_p(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name, + const struct file_operations *fops, uid_t uid, + gid_t gid, int mode) +{ + struct linux_cdev *cdev; + int ret = 0; + int i; + + for (i = baseminor; i < baseminor + count; i++) { + cdev = cdev_alloc(); + cdev_init(cdev, fops); + kobject_set_name(&cdev->kobj, name); + + ret = cdev_add_ext(cdev, makedev(major, i), uid, gid, mode); + if (ret != 0) + break; + } + return (ret); +} + +void +__unregister_chrdev(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name) +{ + struct linux_cdev *cdevp; + int i; + + for (i = baseminor; i < baseminor + count; i++) { + cdevp = linux_find_cdev(name, major, i); + if (cdevp != NULL) + cdev_del(cdevp); + } +} + #if defined(__i386__) || defined(__amd64__) bool linux_cpu_has_clflush; #endif From owner-svn-src-all@freebsd.org Mon Jan 9 18:01:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0537CA7A63; Mon, 9 Jan 2017 18:01:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5D6197E; Mon, 9 Jan 2017 18:01:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include To: John Baldwin , "Conrad E. Meyer" References: <201701080626.v086QXDx022252@repo.freebsd.org> <7685799.RHuinLcsJW@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jung-uk Kim Message-ID: <53d948ef-9e7e-422f-aead-39437abc8352@FreeBSD.org> Date: Mon, 9 Jan 2017 13:01:41 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <7685799.RHuinLcsJW@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 18:01:42 -0000 On 01/09/2017 12:08, John Baldwin wrote: > On Sunday, January 08, 2017 06:26:33 AM Conrad E. Meyer wrote: >> Author: cem >> Date: Sun Jan 8 06:26:33 2017 >> New Revision: 311667 >> URL: https://svnweb.freebsd.org/changeset/base/311667 >> >> Log: >> Add some additional ACPI methods for DRM >> >> Add AcpiGetDataFull and AcpiGetTableWithSize. >> >> Submitted by: Matt Macy > > Have these been submitted upstream? The Intel folks are generally quite > responsive on freebsd-acpi@FreeBSD.org and this codebase is actively > maintained externally. Please submit upstream first. https://github.com/acpica/acpica Jung-uk Kim From owner-svn-src-all@freebsd.org Mon Jan 9 18:18:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90C08CA72D7; Mon, 9 Jan 2017 18:18:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58D4717C6; Mon, 9 Jan 2017 18:18:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09IIGZ7013902; Mon, 9 Jan 2017 18:18:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09IIFaZ013894; Mon, 9 Jan 2017 18:18:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701091818.v09IIFaZ013894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 9 Jan 2017 18:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311804 - in head: sys/cam/ctl usr.bin/ctlstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 18:18:17 -0000 Author: mav Date: Mon Jan 9 18:18:15 2017 New Revision: 311804 URL: https://svnweb.freebsd.org/changeset/base/311804 Log: Rewrite CTL statistics in more simple and scalable way. Instead of collecting statistics for each combination of ports and logical units, that consumed ~45KB per LU with present number of ports, collect separate statistics for every port and every logical unit separately, that consume only 176 bytes per each single LU/port. This reduces struct ctl_lun size down to just 6KB. Also new IOCTL API/ABI does not hardcode number of LUs/ports, and should allow handling of very large quantities. MFC after: 2 weeks (probably keeping old API enabled for some time) Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_frontend.c head/sys/cam/ctl/ctl_frontend.h head/sys/cam/ctl/ctl_ioctl.h head/sys/cam/ctl/ctl_private.h head/usr.bin/ctlstat/ctlstat.8 head/usr.bin/ctlstat/ctlstat.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Jan 9 17:25:23 2017 (r311803) +++ head/sys/cam/ctl/ctl.c Mon Jan 9 18:18:15 2017 (r311804) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2003-2009 Silicon Graphics International Corp. * Copyright (c) 2012 The FreeBSD Foundation - * Copyright (c) 2015 Alexander Motin + * Copyright (c) 2014-2017 Alexander Motin * All rights reserved. * * Portions of this software were developed by Edward Tomasz Napierala @@ -2567,6 +2567,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, struct thread *td) { struct ctl_softc *softc = dev->si_drv1; + struct ctl_port *port; struct ctl_lun *lun; int retval; @@ -2778,6 +2779,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, #endif /* CTL_IO_DELAY */ break; } +#ifdef CTL_LEGACY_STATS case CTL_GETSTATS: { struct ctl_stats *stats = (struct ctl_stats *)addr; int i; @@ -2790,26 +2792,26 @@ ctl_ioctl(struct cdev *dev, u_long cmd, stats->status = CTL_SS_OK; stats->fill_len = 0; STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (stats->fill_len + sizeof(lun->stats) > + if (stats->fill_len + sizeof(lun->legacy_stats) > stats->alloc_len) { stats->status = CTL_SS_NEED_MORE_SPACE; break; } - retval = copyout(&lun->stats, &stats->lun_stats[i++], - sizeof(lun->stats)); + retval = copyout(&lun->legacy_stats, &stats->lun_stats[i++], + sizeof(lun->legacy_stats)); if (retval != 0) break; - stats->fill_len += sizeof(lun->stats); + stats->fill_len += sizeof(lun->legacy_stats); } stats->num_luns = softc->num_luns; -#ifdef CTL_TIME_IO - stats->flags = CTL_STATS_FLAG_TIME_VALID; -#else stats->flags = CTL_STATS_FLAG_NONE; +#ifdef CTL_TIME_IO + stats->flags |= CTL_STATS_FLAG_TIME_VALID; #endif getnanouptime(&stats->timestamp); break; } +#endif /* CTL_LEGACY_STATS */ case CTL_ERROR_INJECT: { struct ctl_error_desc *err_desc, *new_err_desc; @@ -3397,6 +3399,72 @@ ctl_ioctl(struct cdev *dev, u_long cmd, ctl_isc_announce_port(port); break; } + case CTL_GET_LUN_STATS: { + struct ctl_get_io_stats *stats = (struct ctl_get_io_stats *)addr; + int i; + + /* + * XXX KDM no locking here. If the LUN list changes, + * things can blow up. + */ + i = 0; + stats->status = CTL_SS_OK; + stats->fill_len = 0; + STAILQ_FOREACH(lun, &softc->lun_list, links) { + if (lun->lun < stats->first_item) + continue; + if (stats->fill_len + sizeof(lun->stats) > + stats->alloc_len) { + stats->status = CTL_SS_NEED_MORE_SPACE; + break; + } + retval = copyout(&lun->stats, &stats->stats[i++], + sizeof(lun->stats)); + if (retval != 0) + break; + stats->fill_len += sizeof(lun->stats); + } + stats->num_items = softc->num_luns; + stats->flags = CTL_STATS_FLAG_NONE; +#ifdef CTL_TIME_IO + stats->flags |= CTL_STATS_FLAG_TIME_VALID; +#endif + getnanouptime(&stats->timestamp); + break; + } + case CTL_GET_PORT_STATS: { + struct ctl_get_io_stats *stats = (struct ctl_get_io_stats *)addr; + int i; + + /* + * XXX KDM no locking here. If the LUN list changes, + * things can blow up. + */ + i = 0; + stats->status = CTL_SS_OK; + stats->fill_len = 0; + STAILQ_FOREACH(port, &softc->port_list, links) { + if (port->targ_port < stats->first_item) + continue; + if (stats->fill_len + sizeof(port->stats) > + stats->alloc_len) { + stats->status = CTL_SS_NEED_MORE_SPACE; + break; + } + retval = copyout(&port->stats, &stats->stats[i++], + sizeof(port->stats)); + if (retval != 0) + break; + stats->fill_len += sizeof(port->stats); + } + stats->num_items = softc->num_ports; + stats->flags = CTL_STATS_FLAG_NONE; +#ifdef CTL_TIME_IO + stats->flags |= CTL_STATS_FLAG_TIME_VALID; +#endif + getnanouptime(&stats->timestamp); + break; + } default: { /* XXX KDM should we fix this? */ #if 0 @@ -4391,7 +4459,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft struct scsi_vpd_id_descriptor *desc; struct scsi_vpd_id_t10 *t10id; const char *eui, *naa, *scsiname, *uuid, *vendor, *value; - int lun_number, i, lun_malloced; + int lun_number, lun_malloced; int devidlen, idlen1, idlen2 = 0, len; if (be_lun == NULL) @@ -4613,13 +4681,16 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft ctl_softc->num_luns++; /* Setup statistics gathering */ - lun->stats.device_type = be_lun->lun_type; - lun->stats.lun_number = lun_number; - lun->stats.blocksize = be_lun->blocksize; +#ifdef CTL_LEGACY_STATS + lun->legacy_stats.device_type = be_lun->lun_type; + lun->legacy_stats.lun_number = lun_number; + lun->legacy_stats.blocksize = be_lun->blocksize; if (be_lun->blocksize == 0) - lun->stats.flags = CTL_LUN_STATS_NO_BLOCKSIZE; - for (i = 0;i < CTL_MAX_PORTS;i++) - lun->stats.ports[i].targ_port = i; + lun->legacy_stats.flags = CTL_LUN_STATS_NO_BLOCKSIZE; + for (len = 0; len < CTL_MAX_PORTS; len++) + lun->legacy_stats.ports[len].targ_port = len; +#endif /* CTL_LEGACY_STATS */ + lun->stats.item = lun_number; mtx_unlock(&ctl_softc->ctl_lock); @@ -6685,9 +6756,7 @@ ctl_sap_log_sense_handler(struct ctl_scs { struct ctl_lun *lun = CTL_LUN(ctsio); struct stat_page *data; - uint64_t rn, wn, rb, wb; - struct bintime rt, wt; - int i; + struct bintime *t; data = (struct stat_page *)page_index->page_data; @@ -6695,28 +6764,21 @@ ctl_sap_log_sense_handler(struct ctl_scs data->sap.hdr.param_control = SLP_LBIN; data->sap.hdr.param_len = sizeof(struct scsi_log_stat_and_perf) - sizeof(struct scsi_log_param_header); - rn = wn = rb = wb = 0; - bintime_clear(&rt); - bintime_clear(&wt); - for (i = 0; i < CTL_MAX_PORTS; i++) { - rn += lun->stats.ports[i].operations[CTL_STATS_READ]; - wn += lun->stats.ports[i].operations[CTL_STATS_WRITE]; - rb += lun->stats.ports[i].bytes[CTL_STATS_READ]; - wb += lun->stats.ports[i].bytes[CTL_STATS_WRITE]; - bintime_add(&rt, &lun->stats.ports[i].time[CTL_STATS_READ]); - bintime_add(&wt, &lun->stats.ports[i].time[CTL_STATS_WRITE]); - } - scsi_u64to8b(rn, data->sap.read_num); - scsi_u64to8b(wn, data->sap.write_num); - if (lun->stats.blocksize > 0) { - scsi_u64to8b(wb / lun->stats.blocksize, - data->sap.recvieved_lba); - scsi_u64to8b(rb / lun->stats.blocksize, - data->sap.transmitted_lba); + scsi_u64to8b(lun->stats.operations[CTL_STATS_READ], + data->sap.read_num); + scsi_u64to8b(lun->stats.operations[CTL_STATS_WRITE], + data->sap.write_num); + if (lun->be_lun->blocksize > 0) { + scsi_u64to8b(lun->stats.bytes[CTL_STATS_WRITE] / + lun->be_lun->blocksize, data->sap.recvieved_lba); + scsi_u64to8b(lun->stats.bytes[CTL_STATS_READ] / + lun->be_lun->blocksize, data->sap.transmitted_lba); } - scsi_u64to8b((uint64_t)rt.sec * 1000 + rt.frac / (UINT64_MAX / 1000), + t = &lun->stats.time[CTL_STATS_READ]; + scsi_u64to8b((uint64_t)t->sec * 1000 + t->frac / (UINT64_MAX / 1000), data->sap.read_int); - scsi_u64to8b((uint64_t)wt.sec * 1000 + wt.frac / (UINT64_MAX / 1000), + t = &lun->stats.time[CTL_STATS_WRITE]; + scsi_u64to8b((uint64_t)t->sec * 1000 + t->frac / (UINT64_MAX / 1000), data->sap.write_int); scsi_u64to8b(0, data->sap.weighted_num); scsi_u64to8b(0, data->sap.weighted_int); @@ -13053,13 +13115,13 @@ static void ctl_process_done(union ctl_io *io) { struct ctl_softc *softc = CTL_SOFTC(io); + struct ctl_port *port = CTL_PORT(io); struct ctl_lun *lun = CTL_LUN(io); void (*fe_done)(union ctl_io *io); union ctl_ha_msg msg; - uint32_t targ_port = io->io_hdr.nexus.targ_port; CTL_DEBUG_PRINT(("ctl_process_done\n")); - fe_done = softc->ctl_ports[targ_port]->fe_done; + fe_done = port->fe_done; #ifdef CTL_TIME_IO if ((time_uptime - io->io_hdr.start_time) > ctl_time_io_secs) { @@ -13162,11 +13224,13 @@ ctl_process_done(union ctl_io *io) */ if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS && io->io_hdr.io_type == CTL_IO_SCSI) { -#ifdef CTL_TIME_IO - struct bintime cur_bt; -#endif int type; +#ifdef CTL_TIME_IO + struct bintime bt; + getbinuptime(&bt); + bintime_sub(&bt, &io->io_hdr.start_bt); +#endif if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) type = CTL_STATS_READ; @@ -13176,18 +13240,38 @@ ctl_process_done(union ctl_io *io) else type = CTL_STATS_NO_IO; - lun->stats.ports[targ_port].bytes[type] += +#ifdef CTL_LEGACY_STATS + uint32_t targ_port = port->targ_port; + lun->legacy_stats.ports[targ_port].bytes[type] += io->scsiio.kern_total_len; - lun->stats.ports[targ_port].operations[type]++; + lun->legacy_stats.ports[targ_port].operations[type] ++; + lun->legacy_stats.ports[targ_port].num_dmas[type] += + io->io_hdr.num_dmas; #ifdef CTL_TIME_IO - bintime_add(&lun->stats.ports[targ_port].dma_time[type], + bintime_add(&lun->legacy_stats.ports[targ_port].dma_time[type], &io->io_hdr.dma_bt); - getbinuptime(&cur_bt); - bintime_sub(&cur_bt, &io->io_hdr.start_bt); - bintime_add(&lun->stats.ports[targ_port].time[type], &cur_bt); + bintime_add(&lun->legacy_stats.ports[targ_port].time[type], + &bt); #endif - lun->stats.ports[targ_port].num_dmas[type] += - io->io_hdr.num_dmas; +#endif /* CTL_LEGACY_STATS */ + + lun->stats.bytes[type] += io->scsiio.kern_total_len; + lun->stats.operations[type] ++; + lun->stats.dmas[type] += io->io_hdr.num_dmas; +#ifdef CTL_TIME_IO + bintime_add(&lun->stats.dma_time[type], &io->io_hdr.dma_bt); + bintime_add(&lun->stats.time[type], &bt); +#endif + + mtx_lock(&port->port_lock); + port->stats.bytes[type] += io->scsiio.kern_total_len; + port->stats.operations[type] ++; + port->stats.dmas[type] += io->io_hdr.num_dmas; +#ifdef CTL_TIME_IO + bintime_add(&port->stats.dma_time[type], &io->io_hdr.dma_bt); + bintime_add(&port->stats.time[type], &bt); +#endif + mtx_unlock(&port->port_lock); } /* Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Mon Jan 9 17:25:23 2017 (r311803) +++ head/sys/cam/ctl/ctl_backend.h Mon Jan 9 18:18:15 2017 (r311804) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2003 Silicon Graphics International Corp. - * Copyright (c) 2014-2015 Alexander Motin + * Copyright (c) 2014-2017 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,54 +40,7 @@ #ifndef _CTL_BACKEND_H_ #define _CTL_BACKEND_H_ -/* - * XXX KDM move this to another header file? - */ -#define CTL_BE_NAME_LEN 32 - -/* - * The ID_REQ flag is used to say that the caller has requested a - * particular LUN ID in the req_lun_id field. If we cannot allocate that - * LUN ID, the ctl_add_lun() call will fail. - * - * The STOPPED flag tells us that the LUN should default to the powered - * off state. It will return 0x04,0x02 until it is powered up. ("Logical - * unit not ready, initializing command required.") - * - * The NO_MEDIA flag tells us that the LUN has no media inserted. - * - * The PRIMARY flag tells us that this LUN is registered as a Primary LUN - * which is accessible via the Master shelf controller in an HA. This flag - * being set indicates a Primary LUN. This flag being reset represents a - * Secondary LUN controlled by the Secondary controller in an HA - * configuration. Flag is applicable at this time to T_DIRECT types. - * - * The SERIAL_NUM flag tells us that the serial_num field is filled in and - * valid for use in SCSI INQUIRY VPD page 0x80. - * - * The DEVID flag tells us that the device_id field is filled in and - * valid for use in SCSI INQUIRY VPD page 0x83. - * - * The DEV_TYPE flag tells us that the device_type field is filled in. - * - * The EJECTED flag tells us that the removable LUN has tray open. - * - * The UNMAP flag tells us that this LUN supports UNMAP. - * - * The OFFLINE flag tells us that this LUN can not access backing store. - */ -typedef enum { - CTL_LUN_FLAG_ID_REQ = 0x01, - CTL_LUN_FLAG_STOPPED = 0x02, - CTL_LUN_FLAG_NO_MEDIA = 0x04, - CTL_LUN_FLAG_PRIMARY = 0x08, - CTL_LUN_FLAG_SERIAL_NUM = 0x10, - CTL_LUN_FLAG_DEVID = 0x20, - CTL_LUN_FLAG_DEV_TYPE = 0x40, - CTL_LUN_FLAG_UNMAP = 0x80, - CTL_LUN_FLAG_EJECTED = 0x100, - CTL_LUN_FLAG_READONLY = 0x200 -} ctl_backend_lun_flags; +#include typedef enum { CTL_LUN_SERSEQ_OFF, Modified: head/sys/cam/ctl/ctl_frontend.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend.c Mon Jan 9 17:25:23 2017 (r311803) +++ head/sys/cam/ctl/ctl_frontend.c Mon Jan 9 18:18:15 2017 (r311804) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2003 Silicon Graphics International Corp. + * Copyright (c) 2014-2017 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -192,13 +193,14 @@ error: mtx_unlock(&softc->ctl_lock); return (retval); } + port->targ_port = port_num; port->ctl_pool_ref = pool; - if (port->options.stqh_first == NULL) STAILQ_INIT(&port->options); + port->stats.item = port_num; + mtx_init(&port->port_lock, "CTL port", NULL, MTX_DEF); mtx_lock(&softc->ctl_lock); - port->targ_port = port_num; STAILQ_INSERT_TAIL(&port->frontend->port_list, port, fe_links); for (tport = NULL, nport = STAILQ_FIRST(&softc->port_list); nport != NULL && nport->targ_port < port_num; @@ -218,17 +220,11 @@ int ctl_port_deregister(struct ctl_port *port) { struct ctl_softc *softc = port->ctl_softc; - struct ctl_io_pool *pool; - int retval, i; - - retval = 0; - - pool = (struct ctl_io_pool *)port->ctl_pool_ref; + struct ctl_io_pool *pool = (struct ctl_io_pool *)port->ctl_pool_ref; + int i; - if (port->targ_port == -1) { - retval = 1; - goto bailout; - } + if (port->targ_port == -1) + return (1); mtx_lock(&softc->ctl_lock); STAILQ_REMOVE(&softc->port_list, port, ctl_port, links); @@ -251,9 +247,9 @@ ctl_port_deregister(struct ctl_port *por for (i = 0; i < port->max_initiators; i++) free(port->wwpn_iid[i].name, M_CTL); free(port->wwpn_iid, M_CTL); + mtx_destroy(&port->port_lock); -bailout: - return (retval); + return (0); } void Modified: head/sys/cam/ctl/ctl_frontend.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend.h Mon Jan 9 17:25:23 2017 (r311803) +++ head/sys/cam/ctl/ctl_frontend.h Mon Jan 9 18:18:15 2017 (r311804) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2003 Silicon Graphics International Corp. + * Copyright (c) 2014-2017 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,6 +40,8 @@ #ifndef _CTL_FRONTEND_H_ #define _CTL_FRONTEND_H_ +#include + typedef enum { CTL_PORT_STATUS_NONE = 0x00, CTL_PORT_STATUS_ONLINE = 0x01, @@ -243,6 +246,8 @@ struct ctl_port { struct ctl_devid *port_devid; /* passed to CTL */ struct ctl_devid *target_devid; /* passed to CTL */ struct ctl_devid *init_devid; /* passed to CTL */ + struct ctl_io_stats stats; /* used by CTL */ + struct mtx port_lock; /* used by CTL */ STAILQ_ENTRY(ctl_port) fe_links; /* used by CTL */ STAILQ_ENTRY(ctl_port) links; /* used by CTL */ }; Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Mon Jan 9 17:25:23 2017 (r311803) +++ head/sys/cam/ctl/ctl_ioctl.h Mon Jan 9 18:18:15 2017 (r311804) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2003 Silicon Graphics International Corp. * Copyright (c) 2011 Spectra Logic Corporation + * Copyright (c) 2014-2017 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -80,6 +81,9 @@ /* Hopefully this won't conflict with new misc devices that pop up */ #define CTL_MINOR 225 +/* Legacy statistics accumulated for every port for every LU. */ +//#define CTL_LEGACY_STATS 1 + typedef enum { CTL_DELAY_TYPE_NONE, CTL_DELAY_TYPE_CONT, @@ -117,6 +121,18 @@ typedef enum { #define CTL_STATS_NUM_TYPES 3 typedef enum { + CTL_SS_OK, + CTL_SS_NEED_MORE_SPACE, + CTL_SS_ERROR +} ctl_stats_status; + +typedef enum { + CTL_STATS_FLAG_NONE = 0x00, + CTL_STATS_FLAG_TIME_VALID = 0x01 +} ctl_stats_flags; + +#ifdef CTL_LEGACY_STATS +typedef enum { CTL_LUN_STATS_NO_BLOCKSIZE = 0x01 } ctl_lun_stats_flags; @@ -137,17 +153,6 @@ struct ctl_lun_io_stats { struct ctl_lun_io_port_stats ports[CTL_MAX_PORTS]; }; -typedef enum { - CTL_SS_OK, - CTL_SS_NEED_MORE_SPACE, - CTL_SS_ERROR -} ctl_stats_status; - -typedef enum { - CTL_STATS_FLAG_NONE = 0x00, - CTL_STATS_FLAG_TIME_VALID = 0x01 -} ctl_stats_flags; - struct ctl_stats { int alloc_len; /* passed to kernel */ struct ctl_lun_io_stats *lun_stats; /* passed to/from kernel */ @@ -157,6 +162,27 @@ struct ctl_stats { ctl_stats_flags flags; /* passed to userland */ struct timespec timestamp; /* passed to userland */ }; +#endif /* CTL_LEGACY_STATS */ + +struct ctl_io_stats { + uint32_t item; + uint64_t bytes[CTL_STATS_NUM_TYPES]; + uint64_t operations[CTL_STATS_NUM_TYPES]; + uint64_t dmas[CTL_STATS_NUM_TYPES]; + struct bintime time[CTL_STATS_NUM_TYPES]; + struct bintime dma_time[CTL_STATS_NUM_TYPES]; +}; + +struct ctl_get_io_stats { + struct ctl_io_stats *stats; /* passed to/from kernel */ + size_t alloc_len; /* passed to kernel */ + size_t fill_len; /* passed to userland */ + int first_item; /* passed to kernel */ + int num_items; /* passed to userland */ + ctl_stats_status status; /* passed to userland */ + ctl_stats_flags flags; /* passed to userland */ + struct timespec timestamp; /* passed to userland */ +}; /* * The types of errors that can be injected: @@ -342,12 +368,54 @@ typedef enum { CTL_LUNREQ_MODIFY, } ctl_lunreq_type; +/* + * The ID_REQ flag is used to say that the caller has requested a + * particular LUN ID in the req_lun_id field. If we cannot allocate that + * LUN ID, the ctl_add_lun() call will fail. + * + * The STOPPED flag tells us that the LUN should default to the powered + * off state. It will return 0x04,0x02 until it is powered up. ("Logical + * unit not ready, initializing command required.") + * + * The NO_MEDIA flag tells us that the LUN has no media inserted. + * + * The PRIMARY flag tells us that this LUN is registered as a Primary LUN + * which is accessible via the Master shelf controller in an HA. This flag + * being set indicates a Primary LUN. This flag being reset represents a + * Secondary LUN controlled by the Secondary controller in an HA + * configuration. Flag is applicable at this time to T_DIRECT types. + * + * The SERIAL_NUM flag tells us that the serial_num field is filled in and + * valid for use in SCSI INQUIRY VPD page 0x80. + * + * The DEVID flag tells us that the device_id field is filled in and + * valid for use in SCSI INQUIRY VPD page 0x83. + * + * The DEV_TYPE flag tells us that the device_type field is filled in. + * + * The EJECTED flag tells us that the removable LUN has tray open. + * + * The UNMAP flag tells us that this LUN supports UNMAP. + * + * The OFFLINE flag tells us that this LUN can not access backing store. + */ +typedef enum { + CTL_LUN_FLAG_ID_REQ = 0x01, + CTL_LUN_FLAG_STOPPED = 0x02, + CTL_LUN_FLAG_NO_MEDIA = 0x04, + CTL_LUN_FLAG_PRIMARY = 0x08, + CTL_LUN_FLAG_SERIAL_NUM = 0x10, + CTL_LUN_FLAG_DEVID = 0x20, + CTL_LUN_FLAG_DEV_TYPE = 0x40, + CTL_LUN_FLAG_UNMAP = 0x80, + CTL_LUN_FLAG_EJECTED = 0x100, + CTL_LUN_FLAG_READONLY = 0x200 +} ctl_backend_lun_flags; /* * LUN creation parameters: * - * flags: Various LUN flags, see ctl_backend.h for a - * description of the flag values and meanings. + * flags: Various LUN flags, see above. * * device_type: The SCSI device type. e.g. 0 for Direct Access, * 3 for Processor, etc. Only certain backends may @@ -465,6 +533,7 @@ union ctl_lunreq_data { * kern_be_args: For kernel use only. */ struct ctl_lun_req { +#define CTL_BE_NAME_LEN 32 char backend[CTL_BE_NAME_LEN]; ctl_lunreq_type reqtype; union ctl_lunreq_data reqdata; @@ -777,6 +846,8 @@ struct ctl_lun_map { #define CTL_PORT_REQ _IOWR(CTL_MINOR, 0x26, struct ctl_req) #define CTL_PORT_LIST _IOWR(CTL_MINOR, 0x27, struct ctl_lun_list) #define CTL_LUN_MAP _IOW(CTL_MINOR, 0x28, struct ctl_lun_map) +#define CTL_GET_LUN_STATS _IOWR(CTL_MINOR, 0x29, struct ctl_get_io_stats) +#define CTL_GET_PORT_STATS _IOWR(CTL_MINOR, 0x2a, struct ctl_get_io_stats) #endif /* _CTL_IOCTL_H_ */ Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Mon Jan 9 17:25:23 2017 (r311803) +++ head/sys/cam/ctl/ctl_private.h Mon Jan 9 18:18:15 2017 (r311804) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2003, 2004, 2005, 2008 Silicon Graphics International Corp. - * Copyright (c) 2014-2015 Alexander Motin + * Copyright (c) 2014-2017 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -404,7 +404,10 @@ struct ctl_lun { struct callout ie_callout; /* INTERVAL TIMER */ struct ctl_mode_pages mode_pages; struct ctl_log_pages log_pages; - struct ctl_lun_io_stats stats; +#ifdef CTL_LEGACY_STATS + struct ctl_lun_io_stats legacy_stats; +#endif /* CTL_LEGACY_STATS */ + struct ctl_io_stats stats; uint32_t res_idx; uint32_t pr_generation; uint64_t *pr_keys[CTL_MAX_PORTS]; Modified: head/usr.bin/ctlstat/ctlstat.8 ============================================================================== --- head/usr.bin/ctlstat/ctlstat.8 Mon Jan 9 17:25:23 2017 (r311803) +++ head/usr.bin/ctlstat/ctlstat.8 Mon Jan 9 18:18:15 2017 (r311804) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.bin/ctlstat/ctlstat.8#2 $ .\" $FreeBSD$ .\" -.Dd September 21, 2015 +.Dd January 9, 2017 .Dt CTLSTAT 8 .Os .Sh NAME @@ -120,3 +120,4 @@ every 10 seconds. .Sh AUTHORS .An Ken Merry Aq Mt ken@FreeBSD.org .An Will Andrews Aq Mt will@FreeBSD.org +.An Alexander Motin Aq Mt mav@FreeBSD.org Modified: head/usr.bin/ctlstat/ctlstat.c ============================================================================== --- head/usr.bin/ctlstat/ctlstat.c Mon Jan 9 17:25:23 2017 (r311803) +++ head/usr.bin/ctlstat/ctlstat.c Mon Jan 9 18:18:15 2017 (r311804) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2004, 2008, 2009 Silicon Graphics International Corp. + * Copyright (c) 2017 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,17 +67,17 @@ __FBSDID("$FreeBSD$"); #include /* - * The default amount of space we allocate for LUN storage space. We - * dynamically allocate more if needed. + * The default amount of space we allocate for stats storage space. + * We dynamically allocate more if needed. */ -#define CTL_STAT_NUM_LUNS 30 +#define CTL_STAT_NUM_ITEMS 256 /* * The default number of LUN selection bits we allocate. This is large * because we don't currently increase it if the user specifies a LUN * number of 1024 or larger. */ -#define CTL_STAT_LUN_BITS 1024L +#define CTL_STAT_BITS 1024L static const char *ctlstat_opts = "Cc:Ddhjl:n:p:tw:"; static const char *ctlstat_usage = "Usage: ctlstat [-CDdjht] [-l lunnum]" @@ -101,31 +102,32 @@ typedef enum { #define CTLSTAT_FLAG_FIRST_RUN (1 << 2) #define CTLSTAT_FLAG_TOTALS (1 << 3) #define CTLSTAT_FLAG_DMA_TIME (1 << 4) -#define CTLSTAT_FLAG_LUN_TIME_VALID (1 << 5) -#define CTLSTAT_FLAG_LUN_MASK (1 << 6) -#define CTLSTAT_FLAG_PORT_MASK (1 << 7) +#define CTLSTAT_FLAG_TIME_VALID (1 << 5) +#define CTLSTAT_FLAG_MASK (1 << 6) +#define CTLSTAT_FLAG_LUNS (1 << 7) +#define CTLSTAT_FLAG_PORTS (1 << 8) #define F_CPU(ctx) ((ctx)->flags & CTLSTAT_FLAG_CPU) #define F_HDR(ctx) ((ctx)->flags & CTLSTAT_FLAG_HEADER) #define F_FIRST(ctx) ((ctx)->flags & CTLSTAT_FLAG_FIRST_RUN) #define F_TOTALS(ctx) ((ctx)->flags & CTLSTAT_FLAG_TOTALS) #define F_DMA(ctx) ((ctx)->flags & CTLSTAT_FLAG_DMA_TIME) -#define F_LUNVAL(ctx) ((ctx)->flags & CTLSTAT_FLAG_LUN_TIME_VALID) -#define F_LUNMASK(ctx) ((ctx)->flags & CTLSTAT_FLAG_LUN_MASK) -#define F_PORTMASK(ctx) ((ctx)->flags & CTLSTAT_FLAG_PORT_MASK) +#define F_TIMEVAL(ctx) ((ctx)->flags & CTLSTAT_FLAG_TIME_VALID) +#define F_MASK(ctx) ((ctx)->flags & CTLSTAT_FLAG_MASK) +#define F_LUNS(ctx) ((ctx)->flags & CTLSTAT_FLAG_LUNS) +#define F_PORTS(ctx) ((ctx)->flags & CTLSTAT_FLAG_PORTS) struct ctlstat_context { ctlstat_mode_types mode; int flags; - struct ctl_lun_io_stats *cur_lun_stats, *prev_lun_stats, - *tmp_lun_stats; - struct ctl_lun_io_stats cur_total_stats[3], prev_total_stats[3]; + struct ctl_io_stats *cur_stats, *prev_stats; + struct ctl_io_stats cur_total_stats[3], prev_total_stats[3]; struct timespec cur_time, prev_time; struct ctl_cpu_stats cur_cpu, prev_cpu; uint64_t cur_total_jiffies, prev_total_jiffies; uint64_t cur_idle, prev_idle; - bitstr_t bit_decl(lun_mask, CTL_STAT_LUN_BITS); - bitstr_t bit_decl(port_mask, CTL_MAX_PORTS); - int num_luns; + bitstr_t bit_decl(item_mask, CTL_STAT_BITS); + int cur_items, prev_items; + int cur_alloc, prev_alloc; int numdevs; int header_interval; }; @@ -135,12 +137,11 @@ struct ctlstat_context { #endif static void usage(int error); -static int getstats(int fd, int *num_luns, struct ctl_lun_io_stats **xlun_stats, - struct timespec *cur_time, int *lun_time_valid); +static int getstats(int fd, int *alloc_items, int *num_items, + struct ctl_io_stats **xstats, struct timespec *cur_time, int *time_valid); static int getcpu(struct ctl_cpu_stats *cpu_stats); -static void compute_stats(struct ctlstat_context *ctx, - struct ctl_lun_io_stats *cur_stats, - struct ctl_lun_io_stats *prev_stats, +static void compute_stats(struct ctl_io_stats *cur_stats, + struct ctl_io_stats *prev_stats, long double etime, long double *mbsec, long double *kb_per_transfer, long double *transfers_per_second, @@ -155,64 +156,55 @@ usage(int error) } static int -getstats(int fd, int *num_luns, struct ctl_lun_io_stats **xlun_stats, +getstats(int fd, int *alloc_items, int *num_items, struct ctl_io_stats **stats, struct timespec *cur_time, int *flags) { - struct ctl_lun_io_stats *lun_stats; - struct ctl_stats stats; - int more_space_count; + struct ctl_get_io_stats get_stats; + int more_space_count = 0; - more_space_count = 0; - - if (*num_luns == 0) - *num_luns = CTL_STAT_NUM_LUNS; - - lun_stats = *xlun_stats; + if (*alloc_items == 0) + *alloc_items = CTL_STAT_NUM_ITEMS; retry: + if (*stats == NULL) + *stats = malloc(sizeof(**stats) * *alloc_items); - if (lun_stats == NULL) { - lun_stats = (struct ctl_lun_io_stats *)malloc( - sizeof(*lun_stats) * *num_luns); - } - - memset(&stats, 0, sizeof(stats)); - stats.alloc_len = *num_luns * sizeof(*lun_stats); - memset(lun_stats, 0, stats.alloc_len); - stats.lun_stats = lun_stats; - - if (ioctl(fd, CTL_GETSTATS, &stats) == -1) - err(1, "error returned from CTL_GETSTATS ioctl"); + memset(&get_stats, 0, sizeof(get_stats)); + get_stats.alloc_len = *alloc_items * sizeof(**stats); + memset(*stats, 0, get_stats.alloc_len); + get_stats.stats = *stats; + + if (ioctl(fd, (*flags & CTLSTAT_FLAG_PORTS) ? CTL_GET_PORT_STATS : + CTL_GET_LUN_STATS, &get_stats) == -1) + err(1, "CTL_GET_*_STATS ioctl returned error"); - switch (stats.status) { + switch (get_stats.status) { case CTL_SS_OK: break; case CTL_SS_ERROR: - err(1, "CTL_SS_ERROR returned from CTL_GETSTATS ioctl"); + err(1, "CTL_GET_*_STATS ioctl returned CTL_SS_ERROR"); break; case CTL_SS_NEED_MORE_SPACE: - if (more_space_count > 0) { - errx(1, "CTL_GETSTATS returned NEED_MORE_SPACE again"); - } - *num_luns = stats.num_luns; - free(lun_stats); - lun_stats = NULL; + if (more_space_count >= 2) + errx(1, "CTL_GET_*_STATS returned NEED_MORE_SPACE again"); + *alloc_items = get_stats.num_items * 5 / 4; + free(*stats); + *stats = NULL; more_space_count++; goto retry; break; /* NOTREACHED */ default: - errx(1, "unknown status %d returned from CTL_GETSTATS ioctl", - stats.status); + errx(1, "CTL_GET_*_STATS ioctl returned unknown status %d", + get_stats.status); break; } - *xlun_stats = lun_stats; - *num_luns = stats.num_luns; - cur_time->tv_sec = stats.timestamp.tv_sec; - cur_time->tv_nsec = stats.timestamp.tv_nsec; - if (stats.flags & CTL_STATS_FLAG_TIME_VALID) - *flags |= CTLSTAT_FLAG_LUN_TIME_VALID; + *num_items = get_stats.fill_len / sizeof(**stats); + cur_time->tv_sec = get_stats.timestamp.tv_sec; + cur_time->tv_nsec = get_stats.timestamp.tv_nsec; + if (get_stats.flags & CTL_STATS_FLAG_TIME_VALID) + *flags |= CTLSTAT_FLAG_TIME_VALID; else - *flags &= ~CTLSTAT_FLAG_LUN_TIME_VALID; + *flags &= ~CTLSTAT_FLAG_TIME_VALID; return (0); } @@ -240,14 +232,13 @@ getcpu(struct ctl_cpu_stats *cpu_stats) } static void -compute_stats(struct ctlstat_context *ctx, struct ctl_lun_io_stats *cur_stats, - struct ctl_lun_io_stats *prev_stats, long double etime, +compute_stats(struct ctl_io_stats *cur_stats, + struct ctl_io_stats *prev_stats, long double etime, long double *mbsec, long double *kb_per_transfer, long double *transfers_per_second, long double *ms_per_transfer, long double *ms_per_dma, long double *dmas_per_second) { uint64_t total_bytes = 0, total_operations = 0, total_dmas = 0; - uint32_t port; struct bintime total_time_bt, total_dma_bt; struct timespec total_time_ts, total_dma_ts; int i; @@ -256,31 +247,18 @@ compute_stats(struct ctlstat_context *ct bzero(&total_dma_bt, sizeof(total_dma_bt)); bzero(&total_time_ts, sizeof(total_time_ts)); bzero(&total_dma_ts, sizeof(total_dma_ts)); - for (port = 0; port < CTL_MAX_PORTS; port++) { - if (F_PORTMASK(ctx) && - bit_test(ctx->port_mask, port) == 0) - continue; - for (i = 0; i < CTL_STATS_NUM_TYPES; i++) { - total_bytes += cur_stats->ports[port].bytes[i]; - total_operations += - cur_stats->ports[port].operations[i]; - total_dmas += cur_stats->ports[port].num_dmas[i]; - bintime_add(&total_time_bt, - &cur_stats->ports[port].time[i]); - bintime_add(&total_dma_bt, - &cur_stats->ports[port].dma_time[i]); - if (prev_stats != NULL) { - total_bytes -= - prev_stats->ports[port].bytes[i]; - total_operations -= - prev_stats->ports[port].operations[i]; - total_dmas -= - prev_stats->ports[port].num_dmas[i]; - bintime_sub(&total_time_bt, - &prev_stats->ports[port].time[i]); - bintime_sub(&total_dma_bt, - &prev_stats->ports[port].dma_time[i]); - } + for (i = 0; i < CTL_STATS_NUM_TYPES; i++) { + total_bytes += cur_stats->bytes[i]; + total_operations += cur_stats->operations[i]; + total_dmas += cur_stats->dmas[i]; + bintime_add(&total_time_bt, &cur_stats->time[i]); + bintime_add(&total_dma_bt, &cur_stats->dma_time[i]); + if (prev_stats != NULL) { + total_bytes -= prev_stats->bytes[i]; + total_operations -= prev_stats->operations[i]; + total_dmas -= prev_stats->dmas[i]; + bintime_sub(&total_time_bt, &prev_stats->time[i]); + bintime_sub(&total_dma_bt, &prev_stats->dma_time[i]); } } @@ -340,35 +318,25 @@ compute_stats(struct ctlstat_context *ct static const char *iotypes[] = {"NO IO", "READ", "WRITE"}; static void -ctlstat_dump(struct ctlstat_context *ctx) { - int iotype, lun, port; - struct ctl_lun_io_stats *stats = ctx->cur_lun_stats; +ctlstat_dump(struct ctlstat_context *ctx) +{ + int iotype, i; + struct ctl_io_stats *stats = ctx->cur_stats; - for (lun = 0; lun < ctx->num_luns;lun++) { - if (F_LUNMASK(ctx) && bit_test(ctx->lun_mask, lun) == 0) + for (i = 0; i < ctx->cur_items;i++) { + if (F_MASK(ctx) && bit_test(ctx->item_mask, i) == 0) continue; - printf("lun %d\n", lun); - for (port = 0; port < CTL_MAX_PORTS; port++) { - if (F_PORTMASK(ctx) && - bit_test(ctx->port_mask, port) == 0) - continue; - printf(" port %d\n", - stats[lun].ports[port].targ_port); - for (iotype = 0; iotype < CTL_STATS_NUM_TYPES; - iotype++) { - printf(" io type %d (%s)\n", iotype, - iotypes[iotype]); - printf(" bytes %ju\n", (uintmax_t) - stats[lun].ports[port].bytes[iotype]); - printf(" operations %ju\n", (uintmax_t) - stats[lun].ports[port].operations[iotype]); - PRINT_BINTIME(" io time", - stats[lun].ports[port].time[iotype]); - printf(" num dmas %ju\n", (uintmax_t) - stats[lun].ports[port].num_dmas[iotype]); - PRINT_BINTIME(" dma time", - stats[lun].ports[port].dma_time[iotype]); - } + printf("%s %d\n", F_PORTS(ctx) ? "port" : "lun", stats[i].item); + for (iotype = 0; iotype < CTL_STATS_NUM_TYPES; iotype++) { + printf(" io type %d (%s)\n", iotype, iotypes[iotype]); + printf(" bytes %ju\n", (uintmax_t) + stats[i].bytes[iotype]); + printf(" operations %ju\n", (uintmax_t) + stats[i].operations[iotype]); + printf(" dmas %ju\n", (uintmax_t) + stats[i].dmas[iotype]); + PRINT_BINTIME(" io time", stats[i].time[iotype]); + PRINT_BINTIME(" dma time", stats[i].dma_time[iotype]); } } } @@ -378,63 +346,49 @@ ctlstat_dump(struct ctlstat_context *ctx (uintmax_t)(((bt).frac >> 32) * 1000000 >> 32)) static void ctlstat_json(struct ctlstat_context *ctx) { - int iotype, lun, port; - struct ctl_lun_io_stats *stats = ctx->cur_lun_stats; + int iotype, i; + struct ctl_io_stats *stats = ctx->cur_stats; - printf("{\"luns\":["); - for (lun = 0; lun < ctx->num_luns; lun++) { - if (F_LUNMASK(ctx) && bit_test(ctx->lun_mask, lun) == 0) + printf("{\"%s\":[", F_PORTS(ctx) ? "ports" : "luns"); + for (i = 0; i < ctx->cur_items; i++) { + if (F_MASK(ctx) && bit_test(ctx->item_mask, i) == 0) continue; - printf("{\"ports\":["); - for (port = 0; port < CTL_MAX_PORTS;port++) { - if (F_PORTMASK(ctx) && - bit_test(ctx->port_mask, port) == 0) - continue; - printf("{\"num\":%d,\"io\":[", - stats[lun].ports[port].targ_port); - for (iotype = 0; iotype < CTL_STATS_NUM_TYPES; - iotype++) { - printf("{\"type\":\"%s\",", iotypes[iotype]); - printf("\"bytes\":%ju,", (uintmax_t)stats[ - lun].ports[port].bytes[iotype]); - printf("\"operations\":%ju,", (uintmax_t)stats[ - lun].ports[port].operations[iotype]); - JSON_BINTIME("io time", - stats[lun].ports[port].time[iotype]); - JSON_BINTIME("dma time", - stats[lun].ports[port].dma_time[iotype]); - printf("\"num dmas\":%ju}", (uintmax_t) - stats[lun].ports[port].num_dmas[iotype]); - if (iotype < (CTL_STATS_NUM_TYPES - 1)) - printf(","); /* continue io array */ - } - printf("]}"); /* close port */ - if (port < (CTL_MAX_PORTS - 1)) - printf(","); /* continue port array */ + printf("{\"num\":%d,\"io\":[", + stats[i].item); + for (iotype = 0; iotype < CTL_STATS_NUM_TYPES; iotype++) { + printf("{\"type\":\"%s\",", iotypes[iotype]); + printf("\"bytes\":%ju,", (uintmax_t)stats[ + i].bytes[iotype]); + printf("\"operations\":%ju,", (uintmax_t)stats[ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 9 19:12:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A77FECA75FA; Mon, 9 Jan 2017 19:12:42 +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 748D1197E; Mon, 9 Jan 2017 19:12:42 +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 v09JCfg3040983; Mon, 9 Jan 2017 19:12:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09JCfak040982; Mon, 9 Jan 2017 19:12:41 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701091912.v09JCfak040982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 19:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311806 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 19:12:42 -0000 Author: dim Date: Mon Jan 9 19:12:41 2017 New Revision: 311806 URL: https://svnweb.freebsd.org/changeset/base/311806 Log: After r311565, also remove llvm-ranlib from ObsoleteFiles.inc. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Jan 9 18:35:41 2017 (r311805) +++ head/ObsoleteFiles.inc Mon Jan 9 19:12:41 2017 (r311806) @@ -2260,7 +2260,6 @@ OLD_LIBS+=usr/lib32/private/libyaml.so.1 OLD_FILES+=usr/lib32/private/libyaml_p.a # 20140216: new clang import which bumps version from 3.3 to 3.4. OLD_FILES+=usr/bin/llvm-prof -OLD_FILES+=usr/bin/llvm-ranlib OLD_FILES+=usr/include/clang/3.3/__wmmintrin_aes.h OLD_FILES+=usr/include/clang/3.3/__wmmintrin_pclmul.h OLD_FILES+=usr/include/clang/3.3/altivec.h From owner-svn-src-all@freebsd.org Mon Jan 9 19:22:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87493CA795A; Mon, 9 Jan 2017 19:22:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6182510B8; Mon, 9 Jan 2017 19:22:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09JMTP3045282; Mon, 9 Jan 2017 19:22:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09JMTvO045281; Mon, 9 Jan 2017 19:22:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701091922.v09JMTvO045281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 19:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311807 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 19:22:30 -0000 Author: dim Date: Mon Jan 9 19:22:29 2017 New Revision: 311807 URL: https://svnweb.freebsd.org/changeset/base/311807 Log: Add recently added libc++ headers to OptionalObsoleteFiles.inc. MFC after: 3 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 9 19:12:41 2017 (r311806) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 9 19:22:29 2017 (r311807) @@ -4438,6 +4438,8 @@ OLD_FILES+=usr/lib/libcxxrt.a OLD_FILES+=usr/lib/libcxxrt.so OLD_FILES+=usr/lib/libcxxrt_p.a OLD_FILES+=usr/include/c++/v1/__bit_reference +OLD_FILES+=usr/include/c++/v1/__bsd_locale_defaults.h +OLD_FILES+=usr/include/c++/v1/__bsd_locale_fallbacks.h OLD_FILES+=usr/include/c++/v1/__config OLD_FILES+=usr/include/c++/v1/__debug OLD_FILES+=usr/include/c++/v1/__functional_03 @@ -4446,10 +4448,12 @@ OLD_FILES+=usr/include/c++/v1/__function OLD_FILES+=usr/include/c++/v1/__hash_table OLD_FILES+=usr/include/c++/v1/__locale OLD_FILES+=usr/include/c++/v1/__mutex_base +OLD_FILES+=usr/include/c++/v1/__nullptr OLD_FILES+=usr/include/c++/v1/__refstring OLD_FILES+=usr/include/c++/v1/__split_buffer OLD_FILES+=usr/include/c++/v1/__sso_allocator OLD_FILES+=usr/include/c++/v1/__std_stream +OLD_FILES+=usr/include/c++/v1/__threading_support OLD_FILES+=usr/include/c++/v1/__tree OLD_FILES+=usr/include/c++/v1/__tuple OLD_FILES+=usr/include/c++/v1/__undef___deallocate @@ -4485,30 +4489,51 @@ OLD_FILES+=usr/include/c++/v1/cstdlib OLD_FILES+=usr/include/c++/v1/cstring OLD_FILES+=usr/include/c++/v1/ctgmath OLD_FILES+=usr/include/c++/v1/ctime +OLD_FILES+=usr/include/c++/v1/ctype.h OLD_FILES+=usr/include/c++/v1/cwchar OLD_FILES+=usr/include/c++/v1/cwctype OLD_FILES+=usr/include/c++/v1/cxxabi.h OLD_FILES+=usr/include/c++/v1/deque +OLD_FILES+=usr/include/c++/v1/errno.h OLD_FILES+=usr/include/c++/v1/exception OLD_FILES+=usr/include/c++/v1/experimental/__config +OLD_FILES+=usr/include/c++/v1/experimental/__memory +OLD_FILES+=usr/include/c++/v1/experimental/algorithm +OLD_FILES+=usr/include/c++/v1/experimental/any OLD_FILES+=usr/include/c++/v1/experimental/chrono +OLD_FILES+=usr/include/c++/v1/experimental/deque OLD_FILES+=usr/include/c++/v1/experimental/dynarray -OLD_FILES+=usr/include/c++/v1/experimental/dynarray +OLD_FILES+=usr/include/c++/v1/experimental/filesystem +OLD_FILES+=usr/include/c++/v1/experimental/forward_list +OLD_FILES+=usr/include/c++/v1/experimental/functional +OLD_FILES+=usr/include/c++/v1/experimental/iterator +OLD_FILES+=usr/include/c++/v1/experimental/list +OLD_FILES+=usr/include/c++/v1/experimental/map +OLD_FILES+=usr/include/c++/v1/experimental/memory_resource OLD_FILES+=usr/include/c++/v1/experimental/optional +OLD_FILES+=usr/include/c++/v1/experimental/propagate_const OLD_FILES+=usr/include/c++/v1/experimental/ratio +OLD_FILES+=usr/include/c++/v1/experimental/regex +OLD_FILES+=usr/include/c++/v1/experimental/set +OLD_FILES+=usr/include/c++/v1/experimental/string OLD_FILES+=usr/include/c++/v1/experimental/string_view OLD_FILES+=usr/include/c++/v1/experimental/system_error OLD_FILES+=usr/include/c++/v1/experimental/tuple OLD_FILES+=usr/include/c++/v1/experimental/type_traits +OLD_FILES+=usr/include/c++/v1/experimental/unordered_map +OLD_FILES+=usr/include/c++/v1/experimental/unordered_set OLD_FILES+=usr/include/c++/v1/experimental/utility +OLD_FILES+=usr/include/c++/v1/experimental/vector OLD_FILES+=usr/include/c++/v1/ext/__hash OLD_FILES+=usr/include/c++/v1/ext/hash_map OLD_FILES+=usr/include/c++/v1/ext/hash_set +OLD_FILES+=usr/include/c++/v1/float.h OLD_FILES+=usr/include/c++/v1/forward_list OLD_FILES+=usr/include/c++/v1/fstream OLD_FILES+=usr/include/c++/v1/functional OLD_FILES+=usr/include/c++/v1/future OLD_FILES+=usr/include/c++/v1/initializer_list +OLD_FILES+=usr/include/c++/v1/inttypes.h OLD_FILES+=usr/include/c++/v1/iomanip OLD_FILES+=usr/include/c++/v1/ios OLD_FILES+=usr/include/c++/v1/iosfwd @@ -4519,6 +4544,7 @@ OLD_FILES+=usr/include/c++/v1/limits OLD_FILES+=usr/include/c++/v1/list OLD_FILES+=usr/include/c++/v1/locale OLD_FILES+=usr/include/c++/v1/map +OLD_FILES+=usr/include/c++/v1/math.h OLD_FILES+=usr/include/c++/v1/memory OLD_FILES+=usr/include/c++/v1/mutex OLD_FILES+=usr/include/c++/v1/new @@ -4530,17 +4556,25 @@ OLD_FILES+=usr/include/c++/v1/ratio OLD_FILES+=usr/include/c++/v1/regex OLD_FILES+=usr/include/c++/v1/scoped_allocator OLD_FILES+=usr/include/c++/v1/set +OLD_FILES+=usr/include/c++/v1/setjmp.h OLD_FILES+=usr/include/c++/v1/shared_mutex OLD_FILES+=usr/include/c++/v1/sstream OLD_FILES+=usr/include/c++/v1/stack +OLD_FILES+=usr/include/c++/v1/stdbool.h +OLD_FILES+=usr/include/c++/v1/stddef.h OLD_FILES+=usr/include/c++/v1/stdexcept +OLD_FILES+=usr/include/c++/v1/stdio.h +OLD_FILES+=usr/include/c++/v1/stdlib.h OLD_FILES+=usr/include/c++/v1/streambuf OLD_FILES+=usr/include/c++/v1/string +OLD_FILES+=usr/include/c++/v1/string.h OLD_FILES+=usr/include/c++/v1/strstream OLD_FILES+=usr/include/c++/v1/system_error OLD_FILES+=usr/include/c++/v1/tgmath.h OLD_FILES+=usr/include/c++/v1/thread OLD_FILES+=usr/include/c++/v1/tr1/__bit_reference +OLD_FILES+=usr/include/c++/v1/tr1/__bsd_locale_defaults.h +OLD_FILES+=usr/include/c++/v1/tr1/__bsd_locale_fallbacks.h OLD_FILES+=usr/include/c++/v1/tr1/__config OLD_FILES+=usr/include/c++/v1/tr1/__debug OLD_FILES+=usr/include/c++/v1/tr1/__functional_03 @@ -4549,13 +4583,15 @@ OLD_FILES+=usr/include/c++/v1/tr1/__func OLD_FILES+=usr/include/c++/v1/tr1/__hash_table OLD_FILES+=usr/include/c++/v1/tr1/__locale OLD_FILES+=usr/include/c++/v1/tr1/__mutex_base +OLD_FILES+=usr/include/c++/v1/tr1/__nullptr OLD_FILES+=usr/include/c++/v1/tr1/__refstring OLD_FILES+=usr/include/c++/v1/tr1/__split_buffer OLD_FILES+=usr/include/c++/v1/tr1/__sso_allocator OLD_FILES+=usr/include/c++/v1/tr1/__std_stream +OLD_FILES+=usr/include/c++/v1/tr1/__threading_support OLD_FILES+=usr/include/c++/v1/tr1/__tree OLD_FILES+=usr/include/c++/v1/tr1/__tuple -OLD_FILES+=usr/include/c++/v1/tr1/__tuple_03 +OLD_FILES+=usr/include/c++/v1/tr1/__undef___deallocate OLD_FILES+=usr/include/c++/v1/tr1/__undef_min_max OLD_FILES+=usr/include/c++/v1/tr1/algorithm OLD_FILES+=usr/include/c++/v1/tr1/array @@ -4588,15 +4624,19 @@ OLD_FILES+=usr/include/c++/v1/tr1/cstdli OLD_FILES+=usr/include/c++/v1/tr1/cstring OLD_FILES+=usr/include/c++/v1/tr1/ctgmath OLD_FILES+=usr/include/c++/v1/tr1/ctime +OLD_FILES+=usr/include/c++/v1/tr1/ctype.h OLD_FILES+=usr/include/c++/v1/tr1/cwchar OLD_FILES+=usr/include/c++/v1/tr1/cwctype OLD_FILES+=usr/include/c++/v1/tr1/deque +OLD_FILES+=usr/include/c++/v1/tr1/errno.h OLD_FILES+=usr/include/c++/v1/tr1/exception +OLD_FILES+=usr/include/c++/v1/tr1/float.h OLD_FILES+=usr/include/c++/v1/tr1/forward_list OLD_FILES+=usr/include/c++/v1/tr1/fstream OLD_FILES+=usr/include/c++/v1/tr1/functional OLD_FILES+=usr/include/c++/v1/tr1/future OLD_FILES+=usr/include/c++/v1/tr1/initializer_list +OLD_FILES+=usr/include/c++/v1/tr1/inttypes.h OLD_FILES+=usr/include/c++/v1/tr1/iomanip OLD_FILES+=usr/include/c++/v1/tr1/ios OLD_FILES+=usr/include/c++/v1/tr1/iosfwd @@ -4607,6 +4647,7 @@ OLD_FILES+=usr/include/c++/v1/tr1/limits OLD_FILES+=usr/include/c++/v1/tr1/list OLD_FILES+=usr/include/c++/v1/tr1/locale OLD_FILES+=usr/include/c++/v1/tr1/map +OLD_FILES+=usr/include/c++/v1/tr1/math.h OLD_FILES+=usr/include/c++/v1/tr1/memory OLD_FILES+=usr/include/c++/v1/tr1/mutex OLD_FILES+=usr/include/c++/v1/tr1/new @@ -4618,12 +4659,18 @@ OLD_FILES+=usr/include/c++/v1/tr1/ratio OLD_FILES+=usr/include/c++/v1/tr1/regex OLD_FILES+=usr/include/c++/v1/tr1/scoped_allocator OLD_FILES+=usr/include/c++/v1/tr1/set +OLD_FILES+=usr/include/c++/v1/tr1/setjmp.h OLD_FILES+=usr/include/c++/v1/tr1/shared_mutex OLD_FILES+=usr/include/c++/v1/tr1/sstream OLD_FILES+=usr/include/c++/v1/tr1/stack +OLD_FILES+=usr/include/c++/v1/tr1/stdbool.h +OLD_FILES+=usr/include/c++/v1/tr1/stddef.h OLD_FILES+=usr/include/c++/v1/tr1/stdexcept +OLD_FILES+=usr/include/c++/v1/tr1/stdio.h +OLD_FILES+=usr/include/c++/v1/tr1/stdlib.h OLD_FILES+=usr/include/c++/v1/tr1/streambuf OLD_FILES+=usr/include/c++/v1/tr1/string +OLD_FILES+=usr/include/c++/v1/tr1/string.h OLD_FILES+=usr/include/c++/v1/tr1/strstream OLD_FILES+=usr/include/c++/v1/tr1/system_error OLD_FILES+=usr/include/c++/v1/tr1/tgmath.h @@ -4637,6 +4684,8 @@ OLD_FILES+=usr/include/c++/v1/tr1/unorde OLD_FILES+=usr/include/c++/v1/tr1/utility OLD_FILES+=usr/include/c++/v1/tr1/valarray OLD_FILES+=usr/include/c++/v1/tr1/vector +OLD_FILES+=usr/include/c++/v1/tr1/wchar.h +OLD_FILES+=usr/include/c++/v1/tr1/wctype.h OLD_FILES+=usr/include/c++/v1/tuple OLD_FILES+=usr/include/c++/v1/type_traits OLD_FILES+=usr/include/c++/v1/typeindex @@ -4649,6 +4698,8 @@ OLD_FILES+=usr/include/c++/v1/unwind.h OLD_FILES+=usr/include/c++/v1/utility OLD_FILES+=usr/include/c++/v1/valarray OLD_FILES+=usr/include/c++/v1/vector +OLD_FILES+=usr/include/c++/v1/wchar.h +OLD_FILES+=usr/include/c++/v1/wctype.h OLD_FILES+=usr/lib32/libc++.a OLD_FILES+=usr/lib32/libc++.so OLD_LIBS+=usr/lib32/libc++.so.1 From owner-svn-src-all@freebsd.org Mon Jan 9 19:32:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB7D3CA7F5B; Mon, 9 Jan 2017 19:32:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 768BE1A5F; Mon, 9 Jan 2017 19:32:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09JWw1N049579; Mon, 9 Jan 2017 19:32:58 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09JWw04049573; Mon, 9 Jan 2017 19:32:58 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201701091932.v09JWw04049573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 9 Jan 2017 19:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311809 - in stable/11/sys: conf dev/ichiic modules/i2c/controllers/ichiic X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 19:32:59 -0000 Author: gonzo Date: Mon Jan 9 19:32:57 2017 New Revision: 311809 URL: https://svnweb.freebsd.org/changeset/base/311809 Log: MFC r310621: [ig4] Add ACPI platform support for ig4 driver Add ACPI part for ig4 driver to make it work on Intel BayTrail SoC where ig4 device is available only through ACPI Reviewed by: avg Differential Revision: https://reviews.freebsd.org/D8742 Added: stable/11/sys/dev/ichiic/ig4_acpi.c - copied unchanged from r310621, head/sys/dev/ichiic/ig4_acpi.c Modified: stable/11/sys/conf/files stable/11/sys/dev/ichiic/ig4_iic.c stable/11/sys/dev/ichiic/ig4_pci.c stable/11/sys/dev/ichiic/ig4_var.h stable/11/sys/modules/i2c/controllers/ichiic/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Mon Jan 9 19:25:49 2017 (r311808) +++ stable/11/sys/conf/files Mon Jan 9 19:32:57 2017 (r311809) @@ -1614,6 +1614,7 @@ dev/hptiop/hptiop.c optional hptiop scb dev/hwpmc/hwpmc_logging.c optional hwpmc dev/hwpmc/hwpmc_mod.c optional hwpmc dev/hwpmc/hwpmc_soft.c optional hwpmc +dev/ichiic/ig4_acpi.c optional ig4 acpi iicbus dev/ichiic/ig4_iic.c optional ig4 iicbus dev/ichiic/ig4_pci.c optional ig4 pci iicbus dev/ichsmb/ichsmb.c optional ichsmb Copied: stable/11/sys/dev/ichiic/ig4_acpi.c (from r310621, head/sys/dev/ichiic/ig4_acpi.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/ichiic/ig4_acpi.c Mon Jan 9 19:32:57 2017 (r311809, copy of r310621, head/sys/dev/ichiic/ig4_acpi.c) @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 2016 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +static int ig4iic_acpi_probe(device_t dev); +static int ig4iic_acpi_attach(device_t dev); +static int ig4iic_acpi_detach(device_t dev); + +static char *ig4iic_ids[] = { + "INT33C2", + "INT33C3", + "INT3432", + "INT3433", + "80860F41", + "808622C1", + "AMDI0510", + "APMC0D0F", + NULL +}; + +static int +ig4iic_acpi_probe(device_t dev) +{ + + if (acpi_disabled("ig4iic") || + ACPI_ID_PROBE(device_get_parent(dev), dev, ig4iic_ids) == NULL) + return (ENXIO); + + device_set_desc(dev, "Designware I2C Controller"); + return (0); +} + +static int +ig4iic_acpi_attach(device_t dev) +{ + ig4iic_softc_t *sc; + int error; + + sc = device_get_softc(dev); + + sc->dev = dev; + sc->regs_rid = 0; + sc->regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->regs_rid, RF_ACTIVE); + if (sc->regs_res == NULL) { + device_printf(dev, "unable to map registers\n"); + ig4iic_acpi_detach(dev); + return (ENXIO); + } + sc->intr_rid = 0; + sc->intr_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->intr_rid, RF_SHAREABLE | RF_ACTIVE); + if (sc->intr_res == NULL) { + device_printf(dev, "unable to map interrupt\n"); + ig4iic_acpi_detach(dev); + return (ENXIO); + } + sc->platform_attached = 1; + + error = ig4iic_attach(sc); + if (error) + ig4iic_acpi_detach(dev); + + return (error); +} + +static int +ig4iic_acpi_detach(device_t dev) +{ + ig4iic_softc_t *sc = device_get_softc(dev); + int error; + + if (sc->platform_attached) { + error = ig4iic_detach(sc); + if (error) + return (error); + sc->platform_attached = 0; + } + + if (sc->intr_res) { + bus_release_resource(dev, SYS_RES_IRQ, + sc->intr_rid, sc->intr_res); + sc->intr_res = NULL; + } + if (sc->regs_res) { + bus_release_resource(dev, SYS_RES_MEMORY, + sc->regs_rid, sc->regs_res); + sc->regs_res = NULL; + } + + return (0); +} + +static device_method_t ig4iic_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ig4iic_acpi_probe), + DEVMETHOD(device_attach, ig4iic_acpi_attach), + DEVMETHOD(device_detach, ig4iic_acpi_detach), + + /* iicbus interface */ + DEVMETHOD(iicbus_transfer, ig4iic_transfer), + DEVMETHOD(iicbus_reset, ig4iic_reset), + DEVMETHOD(iicbus_callback, iicbus_null_callback), + + DEVMETHOD_END +}; + +static driver_t ig4iic_acpi_driver = { + "ig4iic_acpi", + ig4iic_acpi_methods, + sizeof(struct ig4iic_softc), +}; + +static devclass_t ig4iic_acpi_devclass; +DRIVER_MODULE(ig4iic_acpi, acpi, ig4iic_acpi_driver, ig4iic_acpi_devclass, 0, 0); + +MODULE_DEPEND(ig4iic_acpi, acpi, 1, 1, 1); +MODULE_DEPEND(ig4iic_acpi, pci, 1, 1, 1); +MODULE_DEPEND(ig4iic_acpi, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(ig4iic_acpi, 1); Modified: stable/11/sys/dev/ichiic/ig4_iic.c ============================================================================== --- stable/11/sys/dev/ichiic/ig4_iic.c Mon Jan 9 19:25:49 2017 (r311808) +++ stable/11/sys/dev/ichiic/ig4_iic.c Mon Jan 9 19:32:57 2017 (r311809) @@ -522,6 +522,9 @@ ig4iic_attach(ig4iic_softc_t *sc) int error; uint32_t v; + mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); + sx_init(&sc->call_lock, "IG4 call lock"); + v = reg_read(sc, IG4_REG_COMP_TYPE); v = reg_read(sc, IG4_REG_COMP_PARAM1); v = reg_read(sc, IG4_REG_GENERAL); @@ -664,6 +667,10 @@ ig4iic_detach(ig4iic_softc_t *sc) mtx_unlock(&sc->io_lock); sx_xunlock(&sc->call_lock); + + mtx_destroy(&sc->io_lock); + sx_destroy(&sc->call_lock); + return (0); } @@ -731,4 +738,5 @@ ig4iic_dump(ig4iic_softc_t *sc) } #undef REGDUMP -DRIVER_MODULE(iicbus, ig4iic, iicbus_driver, iicbus_devclass, NULL, NULL); +DRIVER_MODULE(iicbus, ig4iic_acpi, iicbus_driver, iicbus_devclass, NULL, NULL); +DRIVER_MODULE(iicbus, ig4iic_pci, iicbus_driver, iicbus_devclass, NULL, NULL); Modified: stable/11/sys/dev/ichiic/ig4_pci.c ============================================================================== --- stable/11/sys/dev/ichiic/ig4_pci.c Mon Jan 9 19:25:49 2017 (r311808) +++ stable/11/sys/dev/ichiic/ig4_pci.c Mon Jan 9 19:32:57 2017 (r311809) @@ -91,11 +91,6 @@ ig4iic_pci_attach(device_t dev) ig4iic_softc_t *sc = device_get_softc(dev); int error; - bzero(sc, sizeof(*sc)); - - mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); - sx_init(&sc->call_lock, "IG4 call lock"); - sc->dev = dev; sc->regs_rid = PCIR_BAR(0); sc->regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, @@ -116,7 +111,7 @@ ig4iic_pci_attach(device_t dev) ig4iic_pci_detach(dev); return (ENXIO); } - sc->pci_attached = 1; + sc->platform_attached = 1; error = ig4iic_attach(sc); if (error) @@ -131,11 +126,11 @@ ig4iic_pci_detach(device_t dev) ig4iic_softc_t *sc = device_get_softc(dev); int error; - if (sc->pci_attached) { + if (sc->platform_attached) { error = ig4iic_detach(sc); if (error) return (error); - sc->pci_attached = 0; + sc->platform_attached = 0; } if (sc->intr_res) { @@ -150,10 +145,6 @@ ig4iic_pci_detach(device_t dev) sc->regs_rid, sc->regs_res); sc->regs_res = NULL; } - if (mtx_initialized(&sc->io_lock)) { - mtx_destroy(&sc->io_lock); - sx_destroy(&sc->call_lock); - } return (0); } @@ -172,15 +163,15 @@ static device_method_t ig4iic_pci_method }; static driver_t ig4iic_pci_driver = { - "ig4iic", + "ig4iic_pci", ig4iic_pci_methods, sizeof(struct ig4iic_softc) }; static devclass_t ig4iic_pci_devclass; -DRIVER_MODULE_ORDERED(ig4iic, pci, ig4iic_pci_driver, ig4iic_pci_devclass, 0, 0, +DRIVER_MODULE_ORDERED(ig4iic_pci, pci, ig4iic_pci_driver, ig4iic_pci_devclass, 0, 0, SI_ORDER_ANY); -MODULE_DEPEND(ig4iic, pci, 1, 1, 1); -MODULE_DEPEND(ig4iic, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); -MODULE_VERSION(ig4iic, 1); +MODULE_DEPEND(ig4iic_pci, pci, 1, 1, 1); +MODULE_DEPEND(ig4iic_pci, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(ig4iic_pci, 1); Modified: stable/11/sys/dev/ichiic/ig4_var.h ============================================================================== --- stable/11/sys/dev/ichiic/ig4_var.h Mon Jan 9 19:25:49 2017 (r311808) +++ stable/11/sys/dev/ichiic/ig4_var.h Mon Jan 9 19:32:57 2017 (r311809) @@ -65,7 +65,7 @@ struct ig4iic_softc { char rbuf[IG4_RBUFSIZE]; int error; uint8_t last_slave; - int pci_attached : 1; + int platform_attached : 1; int use_10bit : 1; int slave_valid : 1; int read_started : 1; Modified: stable/11/sys/modules/i2c/controllers/ichiic/Makefile ============================================================================== --- stable/11/sys/modules/i2c/controllers/ichiic/Makefile Mon Jan 9 19:25:49 2017 (r311808) +++ stable/11/sys/modules/i2c/controllers/ichiic/Makefile Mon Jan 9 19:32:57 2017 (r311809) @@ -2,7 +2,12 @@ .PATH: ${.CURDIR}/../../../../dev/ichiic KMOD = ig4 -SRCS = device_if.h bus_if.h iicbus_if.h pci_if.h smbus_if.h \ - ig4_iic.c ig4_pci.c ig4_reg.h ig4_var.h +SRCS = acpi_if.h device_if.h bus_if.h iicbus_if.h pci_if.h \ + smbus_if.h ${ig4_acpi} ig4_iic.c ig4_pci.c ig4_reg.h \ + ig4_var.h opt_acpi.h + +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +ig4_acpi= ig4_acpi.c +.endif .include From owner-svn-src-all@freebsd.org Mon Jan 9 19:39:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B2E0CA61B9; Mon, 9 Jan 2017 19:39:37 +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 E0DA310A8; Mon, 9 Jan 2017 19:39:36 +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 v09JdaAB050295; Mon, 9 Jan 2017 19:39:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09JdawM050294; Mon, 9 Jan 2017 19:39:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701091939.v09JdawM050294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 19:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311811 - head/usr.sbin/mfiutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 19:39:37 -0000 Author: dim Date: Mon Jan 9 19:39:35 2017 New Revision: 311811 URL: https://svnweb.freebsd.org/changeset/base/311811 Log: Avoid taking the address of a packed struct member in mfiutil Fix a clang 4.0.0 warning about taking the address of a packed member of struct mfi_evt in mfiutil: usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed member 'members' of class or structure 'mfi_evt' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] if (parse_locale(optarg, &filter.members.locale) < 0) { ^~~~~~~~~~~~~~~~~~~~~ Use a local variable instead, and copy that into the struct. Reviewed by: jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9069 Modified: head/usr.sbin/mfiutil/mfi_evt.c Modified: head/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_evt.c Mon Jan 9 19:37:17 2017 (r311810) +++ head/usr.sbin/mfiutil/mfi_evt.c Mon Jan 9 19:39:35 2017 (r311811) @@ -540,6 +540,7 @@ show_events(int ac, char **av) char *cp; ssize_t size; uint32_t seq, start, stop; + uint16_t locale; uint8_t status; int ch, error, fd, num_events, verbose; u_int i; @@ -580,12 +581,13 @@ show_events(int ac, char **av) } break; case 'l': - if (parse_locale(optarg, &filter.members.locale) < 0) { + if (parse_locale(optarg, &locale) < 0) { error = errno; warn("Error parsing event locale"); close(fd); return (error); } + filter.members.locale = locale; break; case 'n': val = strtol(optarg, &cp, 0); From owner-svn-src-all@freebsd.org Mon Jan 9 20:13:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 757DECA7497; Mon, 9 Jan 2017 20:13:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DD1E1E79; Mon, 9 Jan 2017 20:13:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09KDox7066838; Mon, 9 Jan 2017 20:13:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09KDoPO066836; Mon, 9 Jan 2017 20:13:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092013.v09KDoPO066836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 20:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311813 - stable/11/contrib/tcp_wrappers X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 20:13:51 -0000 Author: dim Date: Mon Jan 9 20:13:50 2017 New Revision: 311813 URL: https://svnweb.freebsd.org/changeset/base/311813 Log: MFC r311459: Put proper prototypes in tcpd.h Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.: /usr/include/tcpd.h:75:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] extern int hosts_access(); /* access control */ ^ To fix this, turn these declarations into real prototypes. While here, garbage collect the incompatible rfc931() function from scaffold.c, as it is never used. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D9052 MFC r311461: Also remove unnecessary extern keywords from tcpd.h. Noticed by: kib MFC r311556: After r311459, some ports can break, because a few of the newly added prototypes in use FILE. Pull in a minimal forward declaration of FILE from to minimize impact. Sorry for the breakage. Reported by: Shawn Webb Modified: stable/11/contrib/tcp_wrappers/scaffold.c stable/11/contrib/tcp_wrappers/tcpd.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcp_wrappers/scaffold.c ============================================================================== --- stable/11/contrib/tcp_wrappers/scaffold.c Mon Jan 9 19:42:22 2017 (r311812) +++ stable/11/contrib/tcp_wrappers/scaffold.c Mon Jan 9 20:13:50 2017 (r311813) @@ -235,16 +235,6 @@ struct request_info *request; exit(0); } -/* dummy function to intercept the real rfc931() */ - -/* ARGSUSED */ - -void rfc931(request) -struct request_info *request; -{ - strcpy(request->user, unknown); -} - /* check_path - examine accessibility */ int check_path(path, st) Modified: stable/11/contrib/tcp_wrappers/tcpd.h ============================================================================== --- stable/11/contrib/tcp_wrappers/tcpd.h Mon Jan 9 19:42:22 2017 (r311812) +++ stable/11/contrib/tcp_wrappers/tcpd.h Mon Jan 9 20:13:50 2017 (r311813) @@ -6,6 +6,17 @@ * $FreeBSD$ */ +#ifdef INET6 +#define TCPD_SOCKADDR struct sockaddr +#else +#define TCPD_SOCKADDR struct sockaddr_in +#endif + +#ifndef _STDFILE_DECLARED +#define _STDFILE_DECLARED +typedef struct __sFILE FILE; +#endif + /* Structure to describe one communications endpoint. */ #define STRING_LENGTH 128 /* hosts, users, processes */ @@ -13,11 +24,7 @@ struct host_info { char name[STRING_LENGTH]; /* access via eval_hostname(host) */ char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */ -#ifdef INET6 - struct sockaddr *sin; /* socket address or 0 */ -#else - struct sockaddr_in *sin; /* socket address or 0 */ -#endif + TCPD_SOCKADDR *sin; /* socket address or 0 */ struct t_unitdata *unit; /* TLI transport address or 0 */ struct request_info *request; /* for shared information */ }; @@ -67,21 +74,22 @@ extern char paranoid[]; /* Global functions. */ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) -extern void fromhost(); /* get/validate client host info */ +void fromhost(struct request_info *); /* get/validate client host info */ #else #define fromhost sock_host /* no TLI support needed */ #endif -extern int hosts_access(); /* access control */ -extern int hosts_ctl(); /* wrapper around request_init() */ -extern void shell_cmd(); /* execute shell command */ -extern char *percent_x(); /* do % expansion */ -extern void rfc931(); /* client name from RFC 931 daemon */ -extern void clean_exit(); /* clean up and exit */ -extern void refuse(); /* clean up and exit */ -extern char *xgets(); /* fgets() on steroids */ -extern char *split_at(); /* strchr() and split */ -extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ +int hosts_access(struct request_info *); /* access control */ +int hosts_ctl(char *, char *, char *, char *); /* wrapper around request_init() */ +void shell_cmd(char *); /* execute shell command */ +char *percent_x(char *, int, char *, struct request_info *); /* do % expansion */ +void rfc931(TCPD_SOCKADDR *, TCPD_SOCKADDR *, char *); /* client name from RFC 931 daemon */ +void clean_exit(struct request_info *); /* clean up and exit */ +void refuse(struct request_info *); /* clean up and exit */ +char *xgets(char *, int, FILE *); /* fgets() on steroids */ + +char *split_at(char *, int); /* strchr() and split */ +unsigned long dot_quad_addr(char *); /* restricted inet_addr() */ /* Global variables. */ @@ -98,13 +106,8 @@ extern int resident; /* > 0 if residen * attributes. Each attribute has its own key. */ -#ifdef __STDC__ -extern struct request_info *request_init(struct request_info *,...); -extern struct request_info *request_set(struct request_info *,...); -#else -extern struct request_info *request_init(); /* initialize request */ -extern struct request_info *request_set(); /* update request structure */ -#endif +struct request_info *request_init(struct request_info *,...); /* initialize request */ +struct request_info *request_set(struct request_info *,...); /* update request structure */ #define RQ_FILE 1 /* file descriptor */ #define RQ_DAEMON 2 /* server process (argv[0]) */ @@ -124,27 +127,27 @@ extern struct request_info *request_set( * host_info structures serve as caches for the lookup results. */ -extern char *eval_user(); /* client user */ -extern char *eval_hostname(); /* printable hostname */ -extern char *eval_hostaddr(); /* printable host address */ -extern char *eval_hostinfo(); /* host name or address */ -extern char *eval_client(); /* whatever is available */ -extern char *eval_server(); /* whatever is available */ +char *eval_user(struct request_info *); /* client user */ +char *eval_hostname(struct host_info *); /* printable hostname */ +char *eval_hostaddr(struct host_info *); /* printable host address */ +char *eval_hostinfo(struct host_info *); /* host name or address */ +char *eval_client(struct request_info *); /* whatever is available */ +char *eval_server(struct request_info *); /* whatever is available */ #define eval_daemon(r) ((r)->daemon) /* daemon process name */ #define eval_pid(r) ((r)->pid) /* process id */ /* Socket-specific methods, including DNS hostname lookups. */ -extern void sock_host(); /* look up endpoint addresses */ -extern void sock_hostname(); /* translate address to hostname */ -extern void sock_hostaddr(); /* address to printable address */ +void sock_host(struct request_info *); /* look up endpoint addresses */ +void sock_hostname(struct host_info *); /* translate address to hostname */ +void sock_hostaddr(struct host_info *); /* address to printable address */ #define sock_methods(r) \ { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } /* The System V Transport-Level Interface (TLI) interface. */ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) -extern void tli_host(); /* look up endpoint addresses etc. */ +void tli_host(struct request_info *); /* look up endpoint addresses etc. */ #endif /* @@ -153,13 +156,8 @@ extern void tli_host(); /* look up end * everyone would have to include . */ -#ifdef __STDC__ -extern void tcpd_warn(char *, ...); /* report problem and proceed */ -extern void tcpd_jump(char *, ...); /* report problem and jump */ -#else -extern void tcpd_warn(); -extern void tcpd_jump(); -#endif +void tcpd_warn(char *, ...); /* report problem and proceed */ +void tcpd_jump(char *, ...); /* report problem and jump */ struct tcpd_context { char *file; /* current file */ @@ -185,42 +183,42 @@ extern struct tcpd_context tcpd_context; * behavior. */ -extern void process_options(); /* execute options */ -extern int dry_run; /* verification flag */ +void process_options(char *, struct request_info *); /* execute options */ +extern int dry_run; /* verification flag */ /* Bug workarounds. */ #ifdef INET_ADDR_BUG /* inet_addr() returns struct */ #define inet_addr fix_inet_addr -extern long fix_inet_addr(); +long fix_inet_addr(char *); #endif #ifdef BROKEN_FGETS /* partial reads from sockets */ #define fgets fix_fgets -extern char *fix_fgets(); +char *fix_fgets(char *, int, FILE *); #endif #ifdef RECVFROM_BUG /* no address family info */ #define recvfrom fix_recvfrom -extern int fix_recvfrom(); +int fix_recvfrom(int, char *, int, int, struct sockaddr *, int *); #endif #ifdef GETPEERNAME_BUG /* claims success with UDP */ #define getpeername fix_getpeername -extern int fix_getpeername(); +int fix_getpeername(int, struct sockaddr *, int *); #endif #ifdef SOLARIS_24_GETHOSTBYNAME_BUG /* lists addresses as aliases */ #define gethostbyname fix_gethostbyname -extern struct hostent *fix_gethostbyname(); +struct hostent *fix_gethostbyname(char *); #endif #ifdef USE_STRSEP /* libc calls strtok() */ #define strtok fix_strtok -extern char *fix_strtok(); +char *fix_strtok(char *, char *); #endif #ifdef LIBC_CALLS_STRTOK /* libc calls strtok() */ #define strtok my_strtok -extern char *my_strtok(); +char *my_strtok(char *, char *); #endif From owner-svn-src-all@freebsd.org Mon Jan 9 20:14:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58842CA74F6; Mon, 9 Jan 2017 20:14:04 +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 246541F35; Mon, 9 Jan 2017 20:14:04 +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 v09KE3Jm066901; Mon, 9 Jan 2017 20:14:03 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09KE2oK066891; Mon, 9 Jan 2017 20:14:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092014.v09KE2oK066891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 20:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311814 - stable/10/contrib/tcp_wrappers X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 20:14:04 -0000 Author: dim Date: Mon Jan 9 20:14:02 2017 New Revision: 311814 URL: https://svnweb.freebsd.org/changeset/base/311814 Log: MFC r257398 (by sbruno): Quiesce warnings by updating headerfile includes r257404 | sbruno | 2013-10-30 23:41:18 +0100 (Wed, 30 Oct 2013) | 9 lines Quiesce two warnings: 1. define the CODE * as const 2. restructure function to eliminate warning about exiting with no return. severity_map() never returns when it can't find an appropriate sysylog facility, and it longjmp()'s away into error code handling. Keep this behavior by stashing the facility value found during our search and checking for -1 if found. MFC r257405 (by sbruno): Quiesce warning, which could be a bug IMO, by correctly defining the host_info structure name MFC r257406 (by sbruno): Queisce warning about undeclared function usage. yp_get_default_domain is defined in workaround.c but is not declared in any header file. Tie the declaration to the same #define conditional used when the function is called, NETGROUP MFC r311459: Put proper prototypes in tcpd.h Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.: /usr/include/tcpd.h:75:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] extern int hosts_access(); /* access control */ ^ To fix this, turn these declarations into real prototypes. While here, garbage collect the incompatible rfc931() function from scaffold.c, as it is never used. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D9052 MFC r311461: Also remove unnecessary extern keywords from tcpd.h. Noticed by: kib MFC r311556: After r311459, some ports can break, because a few of the newly added prototypes in use FILE. Pull in a minimal forward declaration of FILE from to minimize impact. Sorry for the breakage. Reported by: Shawn Webb Modified: stable/10/contrib/tcp_wrappers/clean_exit.c stable/10/contrib/tcp_wrappers/hosts_access.c stable/10/contrib/tcp_wrappers/options.c stable/10/contrib/tcp_wrappers/percent_x.c stable/10/contrib/tcp_wrappers/rfc931.c stable/10/contrib/tcp_wrappers/scaffold.c stable/10/contrib/tcp_wrappers/shell_cmd.c stable/10/contrib/tcp_wrappers/tcpd.h stable/10/contrib/tcp_wrappers/update.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tcp_wrappers/clean_exit.c ============================================================================== --- stable/10/contrib/tcp_wrappers/clean_exit.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/clean_exit.c Mon Jan 9 20:14:02 2017 (r311814) @@ -13,6 +13,7 @@ static char sccsid[] = "@(#) clean_exit. #endif #include +#include extern void exit(); Modified: stable/10/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- stable/10/contrib/tcp_wrappers/hosts_access.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/hosts_access.c Mon Jan 9 20:14:02 2017 (r311814) @@ -44,6 +44,7 @@ static char sccsid[] = "@(#) hosts_acces #ifdef INET6 #include #endif +#include extern char *fgets(); extern int errno; @@ -102,6 +103,11 @@ static int masked_match6(); #define BUFLEN 2048 +/* definition to be used from workarounds.c */ +#ifdef NETGROUP +int yp_get_default_domain(char **); +#endif + /* hosts_access - host access control facility */ int hosts_access(request) @@ -269,7 +275,7 @@ struct request_info *request; static int hostfile_match(path, host) char *path; -struct hosts_info *host; +struct host_info *host; { char tok[BUFSIZ]; int match = NO; Modified: stable/10/contrib/tcp_wrappers/options.c ============================================================================== --- stable/10/contrib/tcp_wrappers/options.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/options.c Mon Jan 9 20:14:02 2017 (r311814) @@ -50,6 +50,8 @@ static char sccsid[] = "@(#) options.c 1 #include #include #include +#include +#include #ifndef MAXPATHNAMELEN #define MAXPATHNAMELEN BUFSIZ @@ -441,16 +443,21 @@ struct request_info *request; /* severity_map - lookup facility or severity value */ static int severity_map(table, name) -CODE *table; +const CODE *table; char *name; { - CODE *t; + const CODE *t; + int ret = -1; for (t = table; t->c_name; t++) - if (STR_EQ(t->c_name, name)) - return (t->c_val); - tcpd_jump("bad syslog facility or severity: \"%s\"", name); - /* NOTREACHED */ + if (STR_EQ(t->c_name, name)) { + ret = t->c_val; + break; + } + if (ret == -1) + tcpd_jump("bad syslog facility or severity: \"%s\"", name); + + return (ret); } /* severity_option - change logging severity for this event (Dave Mitchell) */ Modified: stable/10/contrib/tcp_wrappers/percent_x.c ============================================================================== --- stable/10/contrib/tcp_wrappers/percent_x.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/percent_x.c Mon Jan 9 20:14:02 2017 (r311814) @@ -19,6 +19,7 @@ static char sccsid[] = "@(#) percent_x.c #include #include #include +#include extern void exit(); Modified: stable/10/contrib/tcp_wrappers/rfc931.c ============================================================================== --- stable/10/contrib/tcp_wrappers/rfc931.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/rfc931.c Mon Jan 9 20:14:02 2017 (r311814) @@ -25,6 +25,7 @@ static char sccsid[] = "@(#) rfc931.c 1. #include #include #include +#include #ifndef SEEK_SET #define SEEK_SET 0 Modified: stable/10/contrib/tcp_wrappers/scaffold.c ============================================================================== --- stable/10/contrib/tcp_wrappers/scaffold.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/scaffold.c Mon Jan 9 20:14:02 2017 (r311814) @@ -235,16 +235,6 @@ struct request_info *request; exit(0); } -/* dummy function to intercept the real rfc931() */ - -/* ARGSUSED */ - -void rfc931(request) -struct request_info *request; -{ - strcpy(request->user, unknown); -} - /* check_path - examine accessibility */ int check_path(path, st) Modified: stable/10/contrib/tcp_wrappers/shell_cmd.c ============================================================================== --- stable/10/contrib/tcp_wrappers/shell_cmd.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/shell_cmd.c Mon Jan 9 20:14:02 2017 (r311814) @@ -16,10 +16,13 @@ static char sccsid[] = "@(#) shell_cmd.c #include #include +#include #include #include #include #include +#include +#include extern void exit(); Modified: stable/10/contrib/tcp_wrappers/tcpd.h ============================================================================== --- stable/10/contrib/tcp_wrappers/tcpd.h Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/tcpd.h Mon Jan 9 20:14:02 2017 (r311814) @@ -6,6 +6,17 @@ * $FreeBSD$ */ +#ifdef INET6 +#define TCPD_SOCKADDR struct sockaddr +#else +#define TCPD_SOCKADDR struct sockaddr_in +#endif + +#ifndef _STDFILE_DECLARED +#define _STDFILE_DECLARED +typedef struct __sFILE FILE; +#endif + /* Structure to describe one communications endpoint. */ #define STRING_LENGTH 128 /* hosts, users, processes */ @@ -13,11 +24,7 @@ struct host_info { char name[STRING_LENGTH]; /* access via eval_hostname(host) */ char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */ -#ifdef INET6 - struct sockaddr *sin; /* socket address or 0 */ -#else - struct sockaddr_in *sin; /* socket address or 0 */ -#endif + TCPD_SOCKADDR *sin; /* socket address or 0 */ struct t_unitdata *unit; /* TLI transport address or 0 */ struct request_info *request; /* for shared information */ }; @@ -67,21 +74,22 @@ extern char paranoid[]; /* Global functions. */ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) -extern void fromhost(); /* get/validate client host info */ +void fromhost(struct request_info *); /* get/validate client host info */ #else #define fromhost sock_host /* no TLI support needed */ #endif -extern int hosts_access(); /* access control */ -extern int hosts_ctl(); /* wrapper around request_init() */ -extern void shell_cmd(); /* execute shell command */ -extern char *percent_x(); /* do % expansion */ -extern void rfc931(); /* client name from RFC 931 daemon */ -extern void clean_exit(); /* clean up and exit */ -extern void refuse(); /* clean up and exit */ -extern char *xgets(); /* fgets() on steroids */ -extern char *split_at(); /* strchr() and split */ -extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ +int hosts_access(struct request_info *); /* access control */ +int hosts_ctl(char *, char *, char *, char *); /* wrapper around request_init() */ +void shell_cmd(char *); /* execute shell command */ +char *percent_x(char *, int, char *, struct request_info *); /* do % expansion */ +void rfc931(TCPD_SOCKADDR *, TCPD_SOCKADDR *, char *); /* client name from RFC 931 daemon */ +void clean_exit(struct request_info *); /* clean up and exit */ +void refuse(struct request_info *); /* clean up and exit */ +char *xgets(char *, int, FILE *); /* fgets() on steroids */ + +char *split_at(char *, int); /* strchr() and split */ +unsigned long dot_quad_addr(char *); /* restricted inet_addr() */ /* Global variables. */ @@ -98,13 +106,8 @@ extern int resident; /* > 0 if residen * attributes. Each attribute has its own key. */ -#ifdef __STDC__ -extern struct request_info *request_init(struct request_info *,...); -extern struct request_info *request_set(struct request_info *,...); -#else -extern struct request_info *request_init(); /* initialize request */ -extern struct request_info *request_set(); /* update request structure */ -#endif +struct request_info *request_init(struct request_info *,...); /* initialize request */ +struct request_info *request_set(struct request_info *,...); /* update request structure */ #define RQ_FILE 1 /* file descriptor */ #define RQ_DAEMON 2 /* server process (argv[0]) */ @@ -124,27 +127,27 @@ extern struct request_info *request_set( * host_info structures serve as caches for the lookup results. */ -extern char *eval_user(); /* client user */ -extern char *eval_hostname(); /* printable hostname */ -extern char *eval_hostaddr(); /* printable host address */ -extern char *eval_hostinfo(); /* host name or address */ -extern char *eval_client(); /* whatever is available */ -extern char *eval_server(); /* whatever is available */ +char *eval_user(struct request_info *); /* client user */ +char *eval_hostname(struct host_info *); /* printable hostname */ +char *eval_hostaddr(struct host_info *); /* printable host address */ +char *eval_hostinfo(struct host_info *); /* host name or address */ +char *eval_client(struct request_info *); /* whatever is available */ +char *eval_server(struct request_info *); /* whatever is available */ #define eval_daemon(r) ((r)->daemon) /* daemon process name */ #define eval_pid(r) ((r)->pid) /* process id */ /* Socket-specific methods, including DNS hostname lookups. */ -extern void sock_host(); /* look up endpoint addresses */ -extern void sock_hostname(); /* translate address to hostname */ -extern void sock_hostaddr(); /* address to printable address */ +void sock_host(struct request_info *); /* look up endpoint addresses */ +void sock_hostname(struct host_info *); /* translate address to hostname */ +void sock_hostaddr(struct host_info *); /* address to printable address */ #define sock_methods(r) \ { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } /* The System V Transport-Level Interface (TLI) interface. */ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) -extern void tli_host(); /* look up endpoint addresses etc. */ +void tli_host(struct request_info *); /* look up endpoint addresses etc. */ #endif /* @@ -153,13 +156,8 @@ extern void tli_host(); /* look up end * everyone would have to include . */ -#ifdef __STDC__ -extern void tcpd_warn(char *, ...); /* report problem and proceed */ -extern void tcpd_jump(char *, ...); /* report problem and jump */ -#else -extern void tcpd_warn(); -extern void tcpd_jump(); -#endif +void tcpd_warn(char *, ...); /* report problem and proceed */ +void tcpd_jump(char *, ...); /* report problem and jump */ struct tcpd_context { char *file; /* current file */ @@ -185,42 +183,42 @@ extern struct tcpd_context tcpd_context; * behavior. */ -extern void process_options(); /* execute options */ -extern int dry_run; /* verification flag */ +void process_options(char *, struct request_info *); /* execute options */ +extern int dry_run; /* verification flag */ /* Bug workarounds. */ #ifdef INET_ADDR_BUG /* inet_addr() returns struct */ #define inet_addr fix_inet_addr -extern long fix_inet_addr(); +long fix_inet_addr(char *); #endif #ifdef BROKEN_FGETS /* partial reads from sockets */ #define fgets fix_fgets -extern char *fix_fgets(); +char *fix_fgets(char *, int, FILE *); #endif #ifdef RECVFROM_BUG /* no address family info */ #define recvfrom fix_recvfrom -extern int fix_recvfrom(); +int fix_recvfrom(int, char *, int, int, struct sockaddr *, int *); #endif #ifdef GETPEERNAME_BUG /* claims success with UDP */ #define getpeername fix_getpeername -extern int fix_getpeername(); +int fix_getpeername(int, struct sockaddr *, int *); #endif #ifdef SOLARIS_24_GETHOSTBYNAME_BUG /* lists addresses as aliases */ #define gethostbyname fix_gethostbyname -extern struct hostent *fix_gethostbyname(); +struct hostent *fix_gethostbyname(char *); #endif #ifdef USE_STRSEP /* libc calls strtok() */ #define strtok fix_strtok -extern char *fix_strtok(); +char *fix_strtok(char *, char *); #endif #ifdef LIBC_CALLS_STRTOK /* libc calls strtok() */ #define strtok my_strtok -extern char *my_strtok(); +char *my_strtok(char *, char *); #endif Modified: stable/10/contrib/tcp_wrappers/update.c ============================================================================== --- stable/10/contrib/tcp_wrappers/update.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/update.c Mon Jan 9 20:14:02 2017 (r311814) @@ -24,6 +24,7 @@ static char sccsid[] = "@(#) update.c 1. #include #include #include +#include /* Local stuff. */ From owner-svn-src-all@freebsd.org Mon Jan 9 20:14:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43430CA75EE; Mon, 9 Jan 2017 20:14:22 +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 0BEB010EC; Mon, 9 Jan 2017 20:14:21 +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 v09KELTG067127; Mon, 9 Jan 2017 20:14:21 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09KEKWH067118; Mon, 9 Jan 2017 20:14:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092014.v09KEKWH067118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 20:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r311816 - stable/9/contrib/tcp_wrappers X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 20:14:22 -0000 Author: dim Date: Mon Jan 9 20:14:20 2017 New Revision: 311816 URL: https://svnweb.freebsd.org/changeset/base/311816 Log: MFC r257398 (by sbruno): Quiesce warnings by updating headerfile includes r257404 | sbruno | 2013-10-30 23:41:18 +0100 (Wed, 30 Oct 2013) | 9 lines Quiesce two warnings: 1. define the CODE * as const 2. restructure function to eliminate warning about exiting with no return. severity_map() never returns when it can't find an appropriate sysylog facility, and it longjmp()'s away into error code handling. Keep this behavior by stashing the facility value found during our search and checking for -1 if found. MFC r257405 (by sbruno): Quiesce warning, which could be a bug IMO, by correctly defining the host_info structure name MFC r257406 (by sbruno): Queisce warning about undeclared function usage. yp_get_default_domain is defined in workaround.c but is not declared in any header file. Tie the declaration to the same #define conditional used when the function is called, NETGROUP MFC r272949 (by pfg): tcpd: complete function prototypes. This clears up at least a build issues on mysql-server ports. While here also replace some spaces with tabs in our headers. PR: 42336 MFC r272950 (by pfg): tcpd.h: add prototype for hosts_ctl According the hosts_access(3) man page the hosts_ctl() prototype should be in tcpd.h. For now, follow other declarations and don't add the arguments in the prototype. Reference: https://www.illumos.org/issues/4385 PR: 32808 MFC r311459: Put proper prototypes in tcpd.h Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.: /usr/include/tcpd.h:75:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] extern int hosts_access(); /* access control */ ^ To fix this, turn these declarations into real prototypes. While here, garbage collect the incompatible rfc931() function from scaffold.c, as it is never used. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D9052 MFC r311461: Also remove unnecessary extern keywords from tcpd.h. Noticed by: kib MFC r311556: After r311459, some ports can break, because a few of the newly added prototypes in use FILE. Pull in a minimal forward declaration of FILE from to minimize impact. Sorry for the breakage. Reported by: Shawn Webb Modified: stable/9/contrib/tcp_wrappers/clean_exit.c stable/9/contrib/tcp_wrappers/hosts_access.c stable/9/contrib/tcp_wrappers/options.c stable/9/contrib/tcp_wrappers/percent_x.c stable/9/contrib/tcp_wrappers/rfc931.c stable/9/contrib/tcp_wrappers/scaffold.c stable/9/contrib/tcp_wrappers/shell_cmd.c stable/9/contrib/tcp_wrappers/tcpd.h stable/9/contrib/tcp_wrappers/update.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) Modified: stable/9/contrib/tcp_wrappers/clean_exit.c ============================================================================== --- stable/9/contrib/tcp_wrappers/clean_exit.c Mon Jan 9 20:14:18 2017 (r311815) +++ stable/9/contrib/tcp_wrappers/clean_exit.c Mon Jan 9 20:14:20 2017 (r311816) @@ -13,6 +13,7 @@ static char sccsid[] = "@(#) clean_exit. #endif #include +#include extern void exit(); Modified: stable/9/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- stable/9/contrib/tcp_wrappers/hosts_access.c Mon Jan 9 20:14:18 2017 (r311815) +++ stable/9/contrib/tcp_wrappers/hosts_access.c Mon Jan 9 20:14:20 2017 (r311816) @@ -44,6 +44,7 @@ static char sccsid[] = "@(#) hosts_acces #ifdef INET6 #include #endif +#include extern char *fgets(); extern int errno; @@ -102,6 +103,11 @@ static int masked_match6(); #define BUFLEN 2048 +/* definition to be used from workarounds.c */ +#ifdef NETGROUP +int yp_get_default_domain(char **); +#endif + /* hosts_access - host access control facility */ int hosts_access(request) @@ -269,7 +275,7 @@ struct request_info *request; static int hostfile_match(path, host) char *path; -struct hosts_info *host; +struct host_info *host; { char tok[BUFSIZ]; int match = NO; Modified: stable/9/contrib/tcp_wrappers/options.c ============================================================================== --- stable/9/contrib/tcp_wrappers/options.c Mon Jan 9 20:14:18 2017 (r311815) +++ stable/9/contrib/tcp_wrappers/options.c Mon Jan 9 20:14:20 2017 (r311816) @@ -50,6 +50,8 @@ static char sccsid[] = "@(#) options.c 1 #include #include #include +#include +#include #ifndef MAXPATHNAMELEN #define MAXPATHNAMELEN BUFSIZ @@ -441,16 +443,21 @@ struct request_info *request; /* severity_map - lookup facility or severity value */ static int severity_map(table, name) -CODE *table; +const CODE *table; char *name; { - CODE *t; + const CODE *t; + int ret = -1; for (t = table; t->c_name; t++) - if (STR_EQ(t->c_name, name)) - return (t->c_val); - tcpd_jump("bad syslog facility or severity: \"%s\"", name); - /* NOTREACHED */ + if (STR_EQ(t->c_name, name)) { + ret = t->c_val; + break; + } + if (ret == -1) + tcpd_jump("bad syslog facility or severity: \"%s\"", name); + + return (ret); } /* severity_option - change logging severity for this event (Dave Mitchell) */ Modified: stable/9/contrib/tcp_wrappers/percent_x.c ============================================================================== --- stable/9/contrib/tcp_wrappers/percent_x.c Mon Jan 9 20:14:18 2017 (r311815) +++ stable/9/contrib/tcp_wrappers/percent_x.c Mon Jan 9 20:14:20 2017 (r311816) @@ -19,6 +19,7 @@ static char sccsid[] = "@(#) percent_x.c #include #include #include +#include extern void exit(); Modified: stable/9/contrib/tcp_wrappers/rfc931.c ============================================================================== --- stable/9/contrib/tcp_wrappers/rfc931.c Mon Jan 9 20:14:18 2017 (r311815) +++ stable/9/contrib/tcp_wrappers/rfc931.c Mon Jan 9 20:14:20 2017 (r311816) @@ -25,6 +25,7 @@ static char sccsid[] = "@(#) rfc931.c 1. #include #include #include +#include #ifndef SEEK_SET #define SEEK_SET 0 Modified: stable/9/contrib/tcp_wrappers/scaffold.c ============================================================================== --- stable/9/contrib/tcp_wrappers/scaffold.c Mon Jan 9 20:14:18 2017 (r311815) +++ stable/9/contrib/tcp_wrappers/scaffold.c Mon Jan 9 20:14:20 2017 (r311816) @@ -235,16 +235,6 @@ struct request_info *request; exit(0); } -/* dummy function to intercept the real rfc931() */ - -/* ARGSUSED */ - -void rfc931(request) -struct request_info *request; -{ - strcpy(request->user, unknown); -} - /* check_path - examine accessibility */ int check_path(path, st) Modified: stable/9/contrib/tcp_wrappers/shell_cmd.c ============================================================================== --- stable/9/contrib/tcp_wrappers/shell_cmd.c Mon Jan 9 20:14:18 2017 (r311815) +++ stable/9/contrib/tcp_wrappers/shell_cmd.c Mon Jan 9 20:14:20 2017 (r311816) @@ -16,10 +16,13 @@ static char sccsid[] = "@(#) shell_cmd.c #include #include +#include #include #include #include #include +#include +#include extern void exit(); Modified: stable/9/contrib/tcp_wrappers/tcpd.h ============================================================================== --- stable/9/contrib/tcp_wrappers/tcpd.h Mon Jan 9 20:14:18 2017 (r311815) +++ stable/9/contrib/tcp_wrappers/tcpd.h Mon Jan 9 20:14:20 2017 (r311816) @@ -6,6 +6,17 @@ * $FreeBSD$ */ +#ifdef INET6 +#define TCPD_SOCKADDR struct sockaddr +#else +#define TCPD_SOCKADDR struct sockaddr_in +#endif + +#ifndef _STDFILE_DECLARED +#define _STDFILE_DECLARED +typedef struct __sFILE FILE; +#endif + /* Structure to describe one communications endpoint. */ #define STRING_LENGTH 128 /* hosts, users, processes */ @@ -13,11 +24,7 @@ struct host_info { char name[STRING_LENGTH]; /* access via eval_hostname(host) */ char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */ -#ifdef INET6 - struct sockaddr *sin; /* socket address or 0 */ -#else - struct sockaddr_in *sin; /* socket address or 0 */ -#endif + TCPD_SOCKADDR *sin; /* socket address or 0 */ struct t_unitdata *unit; /* TLI transport address or 0 */ struct request_info *request; /* for shared information */ }; @@ -67,21 +74,22 @@ extern char paranoid[]; /* Global functions. */ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) -extern void fromhost(); /* get/validate client host info */ +void fromhost(struct request_info *); /* get/validate client host info */ #else #define fromhost sock_host /* no TLI support needed */ #endif -extern int hosts_access(); /* access control */ -extern int hosts_ctl(); /* wrapper around request_init() */ -extern void shell_cmd(); /* execute shell command */ -extern char *percent_x(); /* do % expansion */ -extern void rfc931(); /* client name from RFC 931 daemon */ -extern void clean_exit(); /* clean up and exit */ -extern void refuse(); /* clean up and exit */ -extern char *xgets(); /* fgets() on steroids */ -extern char *split_at(); /* strchr() and split */ -extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ +int hosts_access(struct request_info *); /* access control */ +int hosts_ctl(char *, char *, char *, char *); /* wrapper around request_init() */ +void shell_cmd(char *); /* execute shell command */ +char *percent_x(char *, int, char *, struct request_info *); /* do % expansion */ +void rfc931(TCPD_SOCKADDR *, TCPD_SOCKADDR *, char *); /* client name from RFC 931 daemon */ +void clean_exit(struct request_info *); /* clean up and exit */ +void refuse(struct request_info *); /* clean up and exit */ +char *xgets(char *, int, FILE *); /* fgets() on steroids */ + +char *split_at(char *, int); /* strchr() and split */ +unsigned long dot_quad_addr(char *); /* restricted inet_addr() */ /* Global variables. */ @@ -98,13 +106,8 @@ extern int resident; /* > 0 if residen * attributes. Each attribute has its own key. */ -#ifdef __STDC__ -extern struct request_info *request_init(struct request_info *,...); -extern struct request_info *request_set(struct request_info *,...); -#else -extern struct request_info *request_init(); /* initialize request */ -extern struct request_info *request_set(); /* update request structure */ -#endif +struct request_info *request_init(struct request_info *,...); /* initialize request */ +struct request_info *request_set(struct request_info *,...); /* update request structure */ #define RQ_FILE 1 /* file descriptor */ #define RQ_DAEMON 2 /* server process (argv[0]) */ @@ -124,27 +127,27 @@ extern struct request_info *request_set( * host_info structures serve as caches for the lookup results. */ -extern char *eval_user(); /* client user */ -extern char *eval_hostname(); /* printable hostname */ -extern char *eval_hostaddr(); /* printable host address */ -extern char *eval_hostinfo(); /* host name or address */ -extern char *eval_client(); /* whatever is available */ -extern char *eval_server(); /* whatever is available */ +char *eval_user(struct request_info *); /* client user */ +char *eval_hostname(struct host_info *); /* printable hostname */ +char *eval_hostaddr(struct host_info *); /* printable host address */ +char *eval_hostinfo(struct host_info *); /* host name or address */ +char *eval_client(struct request_info *); /* whatever is available */ +char *eval_server(struct request_info *); /* whatever is available */ #define eval_daemon(r) ((r)->daemon) /* daemon process name */ #define eval_pid(r) ((r)->pid) /* process id */ /* Socket-specific methods, including DNS hostname lookups. */ -extern void sock_host(); /* look up endpoint addresses */ -extern void sock_hostname(); /* translate address to hostname */ -extern void sock_hostaddr(); /* address to printable address */ +void sock_host(struct request_info *); /* look up endpoint addresses */ +void sock_hostname(struct host_info *); /* translate address to hostname */ +void sock_hostaddr(struct host_info *); /* address to printable address */ #define sock_methods(r) \ { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } /* The System V Transport-Level Interface (TLI) interface. */ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) -extern void tli_host(); /* look up endpoint addresses etc. */ +void tli_host(struct request_info *); /* look up endpoint addresses etc. */ #endif /* @@ -153,13 +156,8 @@ extern void tli_host(); /* look up end * everyone would have to include . */ -#ifdef __STDC__ -extern void tcpd_warn(char *, ...); /* report problem and proceed */ -extern void tcpd_jump(char *, ...); /* report problem and jump */ -#else -extern void tcpd_warn(); -extern void tcpd_jump(); -#endif +void tcpd_warn(char *, ...); /* report problem and proceed */ +void tcpd_jump(char *, ...); /* report problem and jump */ struct tcpd_context { char *file; /* current file */ @@ -185,42 +183,42 @@ extern struct tcpd_context tcpd_context; * behavior. */ -extern void process_options(); /* execute options */ -extern int dry_run; /* verification flag */ +void process_options(char *, struct request_info *); /* execute options */ +extern int dry_run; /* verification flag */ /* Bug workarounds. */ #ifdef INET_ADDR_BUG /* inet_addr() returns struct */ #define inet_addr fix_inet_addr -extern long fix_inet_addr(); +long fix_inet_addr(char *); #endif #ifdef BROKEN_FGETS /* partial reads from sockets */ #define fgets fix_fgets -extern char *fix_fgets(); +char *fix_fgets(char *, int, FILE *); #endif #ifdef RECVFROM_BUG /* no address family info */ #define recvfrom fix_recvfrom -extern int fix_recvfrom(); +int fix_recvfrom(int, char *, int, int, struct sockaddr *, int *); #endif #ifdef GETPEERNAME_BUG /* claims success with UDP */ #define getpeername fix_getpeername -extern int fix_getpeername(); +int fix_getpeername(int, struct sockaddr *, int *); #endif #ifdef SOLARIS_24_GETHOSTBYNAME_BUG /* lists addresses as aliases */ #define gethostbyname fix_gethostbyname -extern struct hostent *fix_gethostbyname(); +struct hostent *fix_gethostbyname(char *); #endif #ifdef USE_STRSEP /* libc calls strtok() */ #define strtok fix_strtok -extern char *fix_strtok(); +char *fix_strtok(char *, char *); #endif #ifdef LIBC_CALLS_STRTOK /* libc calls strtok() */ #define strtok my_strtok -extern char *my_strtok(); +char *my_strtok(char *, char *); #endif Modified: stable/9/contrib/tcp_wrappers/update.c ============================================================================== --- stable/9/contrib/tcp_wrappers/update.c Mon Jan 9 20:14:18 2017 (r311815) +++ stable/9/contrib/tcp_wrappers/update.c Mon Jan 9 20:14:20 2017 (r311816) @@ -24,6 +24,7 @@ static char sccsid[] = "@(#) update.c 1. #include #include #include +#include /* Local stuff. */ From owner-svn-src-all@freebsd.org Mon Jan 9 20:14:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44B64CA75E6; Mon, 9 Jan 2017 20:14: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 EB69C10BA; Mon, 9 Jan 2017 20:14: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 v09KEJuf067072; Mon, 9 Jan 2017 20:14:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09KEJIK067071; Mon, 9 Jan 2017 20:14:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701092014.v09KEJIK067071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 20:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311815 - head/sys/fs/pseudofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 20:14:20 -0000 Author: kib Date: Mon Jan 9 20:14:18 2017 New Revision: 311815 URL: https://svnweb.freebsd.org/changeset/base/311815 Log: Forcibly remove the cached items from pseudofs vncache on module unload. If some process' nodes were accessed using procfs and the process cannot exit properly at the time modunload event is reported to the pseudofs-backed filesystem, the assertion in pfs_vncache_unload() is triggered. Assertion is correct, the cache should be cleaned. Approved by: des (pseudofs maintainer) Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/pseudofs/pseudofs_vncache.c Modified: head/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan 9 20:14:02 2017 (r311814) +++ head/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan 9 20:14:18 2017 (r311815) @@ -51,6 +51,7 @@ static struct mtx pfs_vncache_mutex; static struct pfs_vdata *pfs_vncache; static eventhandler_tag pfs_exit_tag; static void pfs_exit(void *arg, struct proc *p); +static void pfs_purge_locked(struct pfs_node *pn, bool force); static SYSCTL_NODE(_vfs_pfs, OID_AUTO, vncache, CTLFLAG_RW, 0, "pseudofs vnode cache"); @@ -97,6 +98,9 @@ pfs_vncache_unload(void) { EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag); + mtx_lock(&pfs_vncache_mutex); + pfs_purge_locked(NULL, true); + mtx_unlock(&pfs_vncache_mutex); KASSERT(pfs_vncache_entries == 0, ("%d vncache entries remaining", pfs_vncache_entries)); mtx_destroy(&pfs_vncache_mutex); @@ -272,7 +276,7 @@ pfs_vncache_free(struct vnode *vp) * used to implement the cache. */ static void -pfs_purge_locked(struct pfs_node *pn) +pfs_purge_locked(struct pfs_node *pn, bool force) { struct pfs_vdata *pvd; struct vnode *vnp; @@ -280,7 +284,8 @@ pfs_purge_locked(struct pfs_node *pn) mtx_assert(&pfs_vncache_mutex, MA_OWNED); pvd = pfs_vncache; while (pvd != NULL) { - if (pvd->pvd_dead || (pn != NULL && pvd->pvd_pn == pn)) { + if (force || pvd->pvd_dead || + (pn != NULL && pvd->pvd_pn == pn)) { vnp = pvd->pvd_vnode; vhold(vnp); mtx_unlock(&pfs_vncache_mutex); @@ -301,7 +306,7 @@ pfs_purge(struct pfs_node *pn) { mtx_lock(&pfs_vncache_mutex); - pfs_purge_locked(pn); + pfs_purge_locked(pn, false); mtx_unlock(&pfs_vncache_mutex); } @@ -321,6 +326,6 @@ pfs_exit(void *arg, struct proc *p) if (pvd->pvd_pid == p->p_pid) dead = pvd->pvd_dead = 1; if (dead) - pfs_purge_locked(NULL); + pfs_purge_locked(NULL, false); mtx_unlock(&pfs_vncache_mutex); } From owner-svn-src-all@freebsd.org Mon Jan 9 20:51:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9ABCCA7819; Mon, 9 Jan 2017 20:51:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C2E11EC0; Mon, 9 Jan 2017 20:51:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09Kpp0t080453; Mon, 9 Jan 2017 20:51:51 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09Kpp3D080452; Mon, 9 Jan 2017 20:51:51 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201701092051.v09Kpp3D080452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 9 Jan 2017 20:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311817 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 20:51:52 -0000 Author: marius Date: Mon Jan 9 20:51:51 2017 New Revision: 311817 URL: https://svnweb.freebsd.org/changeset/base/311817 Log: In dummynet(4), random chunks of memory are casted to struct dn_*, potentially leading to fatal unaligned accesses on architectures with strict alignment requirements. This change fixes dummynet(4) as far as accesses to 64-bit members of struct dn_* are concerned, tripping up on sparc64 with accesses to 32-bit members happening to be correctly aligned there. In other words, this only fixes the tip of the iceberg; larger parts of dummynet(4) still need to be rewritten in order to properly work on all of !x86. In principle, considering the amount of code in dummynet(4) that needs this erroneous pattern corrected, an acceptable workaround would be to declare all struct dn_* packed, forcing compilers to do byte-accesses as a side-effect. However, given that the structs in question aren't laid out well either, this would break ABI/KBI. While at it, replace all existing bcopy(9) calls with memcpy(9) for performance reasons, as there is no need to check for overlap in these cases. PR: 189219 MFC after: 5 days Modified: head/sys/netpfil/ipfw/ip_dummynet.c Modified: head/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dummynet.c Mon Jan 9 20:14:20 2017 (r311816) +++ head/sys/netpfil/ipfw/ip_dummynet.c Mon Jan 9 20:51:51 2017 (r311817) @@ -931,29 +931,35 @@ delete_schk(int i) static int copy_obj(char **start, char *end, void *_o, const char *msg, int i) { - struct dn_id *o = _o; + struct dn_id o; + union { + struct dn_link l; + struct dn_schk s; + } dn; int have = end - *start; - if (have < o->len || o->len == 0 || o->type == 0) { + memcpy(&o, _o, sizeof(o)); + if (have < o.len || o.len == 0 || o.type == 0) { D("(WARN) type %d %s %d have %d need %d", - o->type, msg, i, have, o->len); + o.type, msg, i, have, o.len); return 1; } - ND("type %d %s %d len %d", o->type, msg, i, o->len); - bcopy(_o, *start, o->len); - if (o->type == DN_LINK) { + ND("type %d %s %d len %d", o.type, msg, i, o.len); + if (o.type == DN_LINK) { + memcpy(&dn.l, _o, sizeof(dn.l)); /* Adjust burst parameter for link */ - struct dn_link *l = (struct dn_link *)*start; - l->burst = div64(l->burst, 8 * hz); - l->delay = l->delay * 1000 / hz; - } else if (o->type == DN_SCH) { - /* Set id->id to the number of instances */ - struct dn_schk *s = _o; - struct dn_id *id = (struct dn_id *)(*start); - id->id = (s->sch.flags & DN_HAVE_MASK) ? - dn_ht_entries(s->siht) : (s->siht ? 1 : 0); - } - *start += o->len; + dn.l.burst = div64(dn.l.burst, 8 * hz); + dn.l.delay = dn.l.delay * 1000 / hz; + memcpy(*start, &dn.l, sizeof(dn.l)); + } else if (o.type == DN_SCH) { + /* Set dn.s.sch.oid.id to the number of instances */ + memcpy(&dn.s, _o, sizeof(dn.s)); + dn.s.sch.oid.id = (dn.s.sch.flags & DN_HAVE_MASK) ? + dn_ht_entries(dn.s.siht) : (dn.s.siht ? 1 : 0); + memcpy(*start, &dn.s, sizeof(dn.s)); + } else + memcpy(*start, _o, o.len); + *start += o.len; return 0; } @@ -974,7 +980,7 @@ copy_obj_q(char **start, char *end, void return 1; } ND("type %d %s %d len %d", o->type, msg, i, len); - bcopy(_o, *start, len); + memcpy(*start, _o, len); ((struct dn_id*)(*start))->len = len; *start += len; return 0; @@ -1022,7 +1028,7 @@ copy_profile(struct copy_args *a, struct D("error have %d need %d", have, profile_len); return 1; } - bcopy(p, *a->start, profile_len); + memcpy(*a->start, p, profile_len); ((struct dn_id *)(*a->start))->len = profile_len; *a->start += profile_len; return 0; @@ -1584,6 +1590,9 @@ config_fs(struct dn_fs *nfs, struct dn_i { int i; struct dn_fsk *fs; +#ifdef NEW_AQM + struct dn_extra_parms *ep; +#endif if (nfs->oid.len != sizeof(*nfs)) { D("invalid flowset len %d", nfs->oid.len); @@ -1592,6 +1601,15 @@ config_fs(struct dn_fs *nfs, struct dn_i i = nfs->fs_nr; if (i <= 0 || i >= 3*DN_MAX_ID) return NULL; +#ifdef NEW_AQM + ep = NULL; + if (arg != NULL) { + ep = malloc(sizeof(*ep), M_TEMP, locked ? M_NOWAIT : M_WAITOK); + if (ep == NULL) + return (NULL); + memcpy(ep, arg, sizeof(*ep)); + } +#endif ND("flowset %d", i); /* XXX other sanity checks */ if (nfs->flags & DN_QSIZE_BYTES) { @@ -1630,12 +1648,15 @@ config_fs(struct dn_fs *nfs, struct dn_i if (bcmp(&fs->fs, nfs, sizeof(*nfs)) == 0) { ND("flowset %d unchanged", i); #ifdef NEW_AQM - /* reconfigure AQM as the parameters can be changed. - * we consider the flowsetis busy if it has scheduler instance(s) - */ - s = locate_scheduler(nfs->sched_nr); - config_aqm(fs, (struct dn_extra_parms *) arg, - s != NULL && s->siht != NULL); + if (ep != NULL) { + /* + * Reconfigure AQM as the parameters can be changed. + * We consider the flowset as busy if it has scheduler + * instance(s). + */ + s = locate_scheduler(nfs->sched_nr); + config_aqm(fs, ep, s != NULL && s->siht != NULL); + } #endif break; /* no change, nothing to do */ } @@ -1657,13 +1678,19 @@ config_fs(struct dn_fs *nfs, struct dn_i fs->fs = *nfs; /* copy configuration */ #ifdef NEW_AQM fs->aqmfp = NULL; - config_aqm(fs, (struct dn_extra_parms *) arg, s != NULL && s->siht != NULL); + if (ep != NULL) + config_aqm(fs, ep, s != NULL && + s->siht != NULL); #endif if (s != NULL) fsk_attach(fs, s); } while (0); if (!locked) DN_BH_WUNLOCK(); +#ifdef NEW_AQM + if (ep != NULL) + free(ep, M_TEMP); +#endif return fs; } @@ -1773,7 +1800,7 @@ again: /* run twice, for wfq and fifo */ D("cannot allocate profile"); goto error; //XXX } - bcopy(pf, s->profile, sizeof(*pf)); + memcpy(s->profile, pf, sizeof(*pf)); } } p.link_nr = 0; @@ -1795,7 +1822,7 @@ again: /* run twice, for wfq and fifo */ pf = malloc(sizeof(*pf), M_DUMMYNET, M_NOWAIT | M_ZERO); if (pf) /* XXX should issue a warning otherwise */ - bcopy(s->profile, pf, sizeof(*pf)); + memcpy(pf, s->profile, sizeof(*pf)); } /* remove from the hash */ dn_ht_find(dn_cfg.schedhash, i, DNHT_REMOVE, NULL); @@ -1917,7 +1944,7 @@ config_profile(struct dn_profile *pf, st olen = s->profile->oid.len; if (olen < pf->oid.len) olen = pf->oid.len; - bcopy(pf, s->profile, pf->oid.len); + memcpy(s->profile, pf, pf->oid.len); s->profile->oid.len = olen; } DN_BH_WUNLOCK(); @@ -1953,30 +1980,35 @@ dummynet_flush(void) int do_config(void *p, int l) { - struct dn_id *next, *o; - int err = 0, err2 = 0; - struct dn_id *arg = NULL; - uintptr_t *a; - - o = p; - if (o->id != DN_API_VERSION) { - D("invalid api version got %d need %d", - o->id, DN_API_VERSION); + struct dn_id o; + union { + struct dn_profile profile; + struct dn_fs fs; + struct dn_link link; + struct dn_sch sched; + } *dn; + struct dn_id *arg; + uintptr_t a; + int err, err2, off; + + memcpy(&o, p, sizeof(o)); + if (o.id != DN_API_VERSION) { + D("invalid api version got %d need %d", o.id, DN_API_VERSION); return EINVAL; } - for (; l >= sizeof(*o); o = next) { - struct dn_id *prev = arg; - if (o->len < sizeof(*o) || l < o->len) { - D("bad len o->len %d len %d", o->len, l); + arg = NULL; + dn = NULL; + for (off = 0; l >= sizeof(o); memcpy(&o, (char *)p + off, sizeof(o))) { + if (o.len < sizeof(o) || l < o.len) { + D("bad len o.len %d len %d", o.len, l); err = EINVAL; break; } - l -= o->len; - next = (struct dn_id *)((char *)o + o->len); + l -= o.len; err = 0; - switch (o->type) { + switch (o.type) { default: - D("cmd %d not implemented", o->type); + D("cmd %d not implemented", o.type); break; #ifdef EMULATE_SYSCTL @@ -1994,31 +2026,30 @@ do_config(void *p, int l) case DN_CMD_DELETE: /* the argument is in the first uintptr_t after o */ - a = (uintptr_t *)(o+1); - if (o->len < sizeof(*o) + sizeof(*a)) { + if (o.len < sizeof(o) + sizeof(a)) { err = EINVAL; break; } - switch (o->subtype) { + memcpy(&a, (char *)p + off + sizeof(o), sizeof(a)); + switch (o.subtype) { case DN_LINK: /* delete base and derived schedulers */ DN_BH_WLOCK(); - err = delete_schk(*a); - err2 = delete_schk(*a + DN_MAX_ID); + err = delete_schk(a); + err2 = delete_schk(a + DN_MAX_ID); DN_BH_WUNLOCK(); if (!err) err = err2; break; default: - D("invalid delete type %d", - o->subtype); + D("invalid delete type %d", o.subtype); err = EINVAL; break; case DN_FS: - err = (*a <1 || *a >= DN_MAX_ID) ? - EINVAL : delete_fs(*a, 0) ; + err = (a < 1 || a >= DN_MAX_ID) ? + EINVAL : delete_fs(a, 0) ; break; } break; @@ -2028,28 +2059,47 @@ do_config(void *p, int l) dummynet_flush(); DN_BH_WUNLOCK(); break; - case DN_TEXT: /* store argument the next block */ - prev = NULL; - arg = o; + case DN_TEXT: /* store argument of next block */ + if (arg != NULL) + free(arg, M_TEMP); + arg = malloc(o.len, M_TEMP, M_WAITOK); + memcpy(arg, (char *)p + off, o.len); break; case DN_LINK: - err = config_link((struct dn_link *)o, arg); + if (dn == NULL) + dn = malloc(sizeof(*dn), M_TEMP, M_WAITOK); + memcpy(&dn->link, (char *)p + off, sizeof(dn->link)); + err = config_link(&dn->link, arg); break; case DN_PROFILE: - err = config_profile((struct dn_profile *)o, arg); + if (dn == NULL) + dn = malloc(sizeof(*dn), M_TEMP, M_WAITOK); + memcpy(&dn->profile, (char *)p + off, + sizeof(dn->profile)); + err = config_profile(&dn->profile, arg); break; case DN_SCH: - err = config_sched((struct dn_sch *)o, arg); + if (dn == NULL) + dn = malloc(sizeof(*dn), M_TEMP, M_WAITOK); + memcpy(&dn->sched, (char *)p + off, + sizeof(dn->sched)); + err = config_sched(&dn->sched, arg); break; case DN_FS: - err = (NULL==config_fs((struct dn_fs *)o, arg, 0)); + if (dn == NULL) + dn = malloc(sizeof(*dn), M_TEMP, M_WAITOK); + memcpy(&dn->fs, (char *)p + off, sizeof(dn->fs)); + err = (NULL == config_fs(&dn->fs, arg, 0)); break; } - if (prev) - arg = NULL; if (err != 0) break; + off += o.len; } + if (arg != NULL) + free(arg, M_TEMP); + if (dn != NULL) + free(dn, M_TEMP); return err; } @@ -2261,7 +2311,7 @@ dummynet_get(struct sockopt *sopt, void a.type = cmd->subtype; if (compat == NULL) { - bcopy(cmd, start, sizeof(*cmd)); + memcpy(start, cmd, sizeof(*cmd)); ((struct dn_id*)(start))->len = sizeof(struct dn_id); buf = start + sizeof(*cmd); } else From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFDFBCA8073; Mon, 9 Jan 2017 21:23:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68D52116E; Mon, 9 Jan 2017 21:23:12 +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 v09LNBv2095492; Mon, 9 Jan 2017 21:23:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNAnB095478; Mon, 9 Jan 2017 21:23:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNAnB095478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311818 - in vendor/llvm/dist: cmake cmake/modules include/llvm/Analysis include/llvm/CodeGen include/llvm/DebugInfo/MSF include/llvm/ExecutionEngine/Orc include/llvm/IR include/llvm/Su... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:12 -0000 Author: dim Date: Mon Jan 9 21:23:09 2017 New Revision: 311818 URL: https://svnweb.freebsd.org/changeset/base/311818 Log: Vendor import of llvm trunk r291476: https://llvm.org/svn/llvm-project/llvm/trunk@291476 Added: vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp (contents, props changed) vendor/llvm/dist/test/Analysis/ScalarEvolution/invalidation.ll vendor/llvm/dist/test/CodeGen/AMDGPU/r600-legalize-umax-bug.ll vendor/llvm/dist/test/CodeGen/AMDGPU/store-private.ll vendor/llvm/dist/test/CodeGen/AVR/intrinsics/ vendor/llvm/dist/test/CodeGen/AVR/intrinsics/read_register.ll vendor/llvm/dist/test/CodeGen/WebAssembly/function-bitcasts.ll vendor/llvm/dist/test/CodeGen/WebAssembly/unsupported-function-bitcasts.ll vendor/llvm/dist/test/CodeGen/X86/fmaddsub-combine.ll vendor/llvm/dist/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_local_branch.s (contents, props changed) vendor/llvm/dist/test/ThinLTO/X86/Inputs/funcimport-tbaa.ll vendor/llvm/dist/test/ThinLTO/X86/Inputs/local_name_conflict1.ll vendor/llvm/dist/test/ThinLTO/X86/Inputs/local_name_conflict2.ll vendor/llvm/dist/test/ThinLTO/X86/funcimport-tbaa.ll vendor/llvm/dist/test/ThinLTO/X86/local_name_conflict.ll vendor/llvm/dist/test/Transforms/InstSimplify/div.ll vendor/llvm/dist/test/Transforms/NewGVN/basic-cyclic-opt.ll vendor/llvm/dist/test/Transforms/NewGVN/cyclic-phi-handling.ll vendor/llvm/dist/test/Transforms/NewGVN/memory-handling.ll vendor/llvm/dist/test/Transforms/NewGVN/pr31501.ll vendor/llvm/dist/test/Transforms/NewGVN/pr31573.ll vendor/llvm/dist/test/tools/llvm-opt-report/Inputs/dm.c (contents, props changed) vendor/llvm/dist/test/tools/llvm-opt-report/Inputs/dm.yaml vendor/llvm/dist/test/tools/llvm-opt-report/func-dm.test Modified: vendor/llvm/dist/cmake/config-ix.cmake vendor/llvm/dist/cmake/modules/AddLLVM.cmake vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h vendor/llvm/dist/include/llvm/Analysis/TargetLibraryInfo.h vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h vendor/llvm/dist/include/llvm/DebugInfo/MSF/StreamArray.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RPCUtils.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RawByteChannel.h vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h vendor/llvm/dist/include/llvm/IR/PassManager.h vendor/llvm/dist/include/llvm/IR/User.h vendor/llvm/dist/include/llvm/Support/Path.h vendor/llvm/dist/include/llvm/Transforms/IPO.h vendor/llvm/dist/include/llvm/Transforms/IPO/PassManagerBuilder.h vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/LoopInfo.cpp vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/Bitcode/Reader/MetadataLoader.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp vendor/llvm/dist/lib/CodeGen/StackSlotColoring.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp vendor/llvm/dist/lib/Object/MachOObjectFile.cpp vendor/llvm/dist/lib/Object/ModuleSummaryIndexObjectFile.cpp vendor/llvm/dist/lib/Support/CommandLine.cpp vendor/llvm/dist/lib/Support/Path.cpp vendor/llvm/dist/lib/Support/TarWriter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp vendor/llvm/dist/lib/Target/AMDGPU/R600ISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/R600Instructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.h vendor/llvm/dist/lib/Target/AVR/AVRISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/AVR/AVRISelLowering.cpp vendor/llvm/dist/lib/Target/AVR/AVRISelLowering.h vendor/llvm/dist/lib/Target/BPF/BPFInstrInfo.cpp vendor/llvm/dist/lib/Target/BPF/Disassembler/BPFDisassembler.cpp vendor/llvm/dist/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp vendor/llvm/dist/lib/Target/BPF/MCTargetDesc/BPFELFObjectWriter.cpp vendor/llvm/dist/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp vendor/llvm/dist/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp vendor/llvm/dist/lib/Target/TargetMachineC.cpp vendor/llvm/dist/lib/Target/WebAssembly/CMakeLists.txt vendor/llvm/dist/lib/Target/WebAssembly/WebAssembly.h vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyInstrInteger.td vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td vendor/llvm/dist/lib/Target/X86/X86InstrInfo.cpp vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Target/X86/X86TargetTransformInfo.cpp vendor/llvm/dist/lib/Transforms/IPO/LowerTypeTests.cpp vendor/llvm/dist/lib/Transforms/IPO/PassManagerBuilder.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/AddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/IndVarSimplify.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopLoadElimination.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopUnswitch.cpp vendor/llvm/dist/lib/Transforms/Scalar/NewGVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/SCCP.cpp vendor/llvm/dist/lib/Transforms/Utils/FunctionImportUtils.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyLibCalls.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/test/Analysis/CostModel/X86/shuffle-reverse.ll vendor/llvm/dist/test/Analysis/CostModel/X86/testshiftlshr.ll vendor/llvm/dist/test/Analysis/CostModel/X86/testshiftshl.ll vendor/llvm/dist/test/Analysis/CostModel/X86/vshift-ashr-cost.ll vendor/llvm/dist/test/Analysis/CostModel/X86/vshift-lshr-cost.ll vendor/llvm/dist/test/Analysis/CostModel/X86/vshift-shl-cost.ll vendor/llvm/dist/test/Analysis/ValueTracking/assume.ll vendor/llvm/dist/test/Bindings/Go/lit.local.cfg vendor/llvm/dist/test/Bindings/OCaml/lit.local.cfg vendor/llvm/dist/test/CMakeLists.txt vendor/llvm/dist/test/CodeGen/AMDGPU/load-constant-i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-global-i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/min.ll vendor/llvm/dist/test/CodeGen/X86/avx2-arith.ll vendor/llvm/dist/test/CodeGen/X86/avx512-bugfix-23634.ll vendor/llvm/dist/test/CodeGen/X86/avx512-calling-conv.ll vendor/llvm/dist/test/CodeGen/X86/avx512-cvt.ll vendor/llvm/dist/test/CodeGen/X86/avx512-ext.ll vendor/llvm/dist/test/CodeGen/X86/avx512-insert-extract.ll vendor/llvm/dist/test/CodeGen/X86/avx512-mask-op.ll vendor/llvm/dist/test/CodeGen/X86/avx512-mov.ll vendor/llvm/dist/test/CodeGen/X86/avx512-regcall-NoMask.ll vendor/llvm/dist/test/CodeGen/X86/avx512-vbroadcast.ll vendor/llvm/dist/test/CodeGen/X86/avx512-vec-cmp.ll vendor/llvm/dist/test/CodeGen/X86/avx512bw-mov.ll vendor/llvm/dist/test/CodeGen/X86/avx512bw-vec-cmp.ll vendor/llvm/dist/test/CodeGen/X86/avx512bwvl-mov.ll vendor/llvm/dist/test/CodeGen/X86/avx512bwvl-vec-cmp.ll vendor/llvm/dist/test/CodeGen/X86/avx512vl-mov.ll vendor/llvm/dist/test/CodeGen/X86/avx512vl-vec-cmp.ll vendor/llvm/dist/test/CodeGen/X86/cmov.ll vendor/llvm/dist/test/CodeGen/X86/fma-fneg-combine.ll vendor/llvm/dist/test/CodeGen/X86/sse-fsignum.ll vendor/llvm/dist/test/CodeGen/X86/vector-compare-results.ll vendor/llvm/dist/test/CodeGen/X86/vector-sext.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-lshr-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-lshr-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-lshr-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-shl-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-shl-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-shl-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-512-v64.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-masked.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-v1.ll vendor/llvm/dist/test/ExecutionEngine/Interpreter/lit.local.cfg vendor/llvm/dist/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_BE-relocations.s vendor/llvm/dist/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s vendor/llvm/dist/test/Instrumentation/AddressSanitizer/global_metadata_darwin.ll vendor/llvm/dist/test/JitListener/lit.local.cfg vendor/llvm/dist/test/Transforms/GVN/invariant.group.ll vendor/llvm/dist/test/Transforms/InstCombine/assume.ll vendor/llvm/dist/test/Transforms/InstCombine/assume2.ll vendor/llvm/dist/test/Transforms/InstCombine/fabs.ll vendor/llvm/dist/test/Transforms/InstCombine/fast-math.ll vendor/llvm/dist/test/Transforms/InstCombine/urem-simplify-bug.ll vendor/llvm/dist/test/Transforms/InstSimplify/rem.ll vendor/llvm/dist/test/Transforms/LICM/hoisting.ll vendor/llvm/dist/test/Transforms/LoopLoadElim/forward.ll vendor/llvm/dist/test/Transforms/LoopVectorize/iv_outside_user.ll vendor/llvm/dist/test/Transforms/NewGVN/invariant.group.ll vendor/llvm/dist/test/lit.cfg vendor/llvm/dist/test/lit.site.cfg.in vendor/llvm/dist/test/tools/llvm-config/system-libs.test vendor/llvm/dist/test/tools/llvm-config/system-libs.windows.test vendor/llvm/dist/tools/llvm-config/llvm-config.cpp vendor/llvm/dist/tools/llvm-objdump/MachODump.cpp vendor/llvm/dist/tools/llvm-opt-report/OptReport.cpp vendor/llvm/dist/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp vendor/llvm/dist/unittests/IR/UserTest.cpp vendor/llvm/dist/utils/unittest/CMakeLists.txt vendor/llvm/dist/utils/update_test_checks.py Modified: vendor/llvm/dist/cmake/config-ix.cmake ============================================================================== --- vendor/llvm/dist/cmake/config-ix.cmake Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/cmake/config-ix.cmake Mon Jan 9 21:23:09 2017 (r311818) @@ -316,9 +316,9 @@ else() endif() endif() -check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG) -check_cxx_compiler_flag("-Wno-gnu-zero-variadic-macro-arguments" - SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG) +check_cxx_compiler_flag("-Wvariadic-macros" SUPPORTS_VARIADIC_MACROS_FLAG) +check_cxx_compiler_flag("-Wgnu-zero-variadic-macro-arguments" + SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG) set(USE_NO_MAYBE_UNINITIALIZED 0) set(USE_NO_UNINITIALIZED 0) @@ -462,13 +462,6 @@ if( MSVC ) if(LLVM_ENABLE_DIA_SDK AND NOT HAVE_DIA_SDK) message(FATAL_ERROR "DIA SDK not found. If you have both VS 2012 and 2013 installed, you may need to uninstall the former and re-install the latter afterwards.") endif() - - # Normalize to 0/1 for lit.site.cfg - if(LLVM_ENABLE_DIA_SDK) - set(LLVM_ENABLE_DIA_SDK 1) - else() - set(LLVM_ENABLE_DIA_SDK 0) - endif() else() set(LLVM_ENABLE_DIA_SDK 0) endif( MSVC ) Modified: vendor/llvm/dist/cmake/modules/AddLLVM.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/AddLLVM.cmake Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/cmake/modules/AddLLVM.cmake Mon Jan 9 21:23:09 2017 (r311818) @@ -1011,11 +1011,11 @@ function(add_unittest test_suite test_na list(APPEND LLVM_COMPILE_DEFINITIONS GTEST_HAS_PTHREAD=0) endif () - if (SUPPORTS_NO_VARIADIC_MACROS_FLAG) + if (SUPPORTS_VARIADIC_MACROS_FLAG) list(APPEND LLVM_COMPILE_FLAGS "-Wno-variadic-macros") endif () # Some parts of gtest rely on this GNU extension, don't warn on it. - if(SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG) + if(SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG) list(APPEND LLVM_COMPILE_FLAGS "-Wno-gnu-zero-variadic-macro-arguments") endif() @@ -1067,6 +1067,19 @@ function(llvm_add_go_executable binary p endif() endfunction() +# This function canonicalize the CMake variables passed by names +# from CMake boolean to 0/1 suitable for passing into Python or C++, +# in place. +function(llvm_canonicalize_cmake_booleans) + foreach(var ${ARGN}) + if(${var}) + set(${var} 1 PARENT_SCOPE) + else() + set(${var} 0 PARENT_SCOPE) + endif() + endforeach() +endfunction(llvm_canonicalize_cmake_booleans) + # This function provides an automatic way to 'configure'-like generate a file # based on a set of common and custom variables, specifically targeting the # variables needed for the 'lit.site.cfg' files. This function bundles the Modified: vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Mon Jan 9 21:23:09 2017 (r311818) @@ -1491,6 +1491,8 @@ public: void print(raw_ostream &OS) const; void verify() const; + bool invalidate(Function &F, const PreservedAnalyses &PA, + FunctionAnalysisManager::Invalidator &Inv); /// Collect parametric terms occurring in step expressions (first step of /// delinearization). Modified: vendor/llvm/dist/include/llvm/Analysis/TargetLibraryInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetLibraryInfo.h Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/include/llvm/Analysis/TargetLibraryInfo.h Mon Jan 9 21:23:09 2017 (r311818) @@ -290,7 +290,7 @@ public: } /// Returns extension attribute kind to be used for i32 parameters - /// correpsonding to C-level int or unsigned int. May be zeroext, signext, + /// corresponding to C-level int or unsigned int. May be zeroext, signext, /// or none. Attribute::AttrKind getExtAttrForI32Param(bool Signed = true) const { if (Impl->ShouldExtI32Param) @@ -301,7 +301,7 @@ public: } /// Returns extension attribute kind to be used for i32 return values - /// correpsonding to C-level int or unsigned int. May be zeroext, signext, + /// corresponding to C-level int or unsigned int. May be zeroext, signext, /// or none. Attribute::AttrKind getExtAttrForI32Return(bool Signed = true) const { if (Impl->ShouldExtI32Return) Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h Mon Jan 9 21:23:09 2017 (r311818) @@ -308,6 +308,16 @@ public: // Iteration support for live in sets. These sets are kept in sorted // order by their register number. typedef LiveInVector::const_iterator livein_iterator; +#ifndef NDEBUG + /// Unlike livein_begin, this method does not check that the liveness + /// information is accurate. Still for debug purposes it may be useful + /// to have iterators that won't assert if the liveness information + /// is not current. + livein_iterator livein_begin_dbg() const { return LiveIns.begin(); } + iterator_range liveins_dbg() const { + return make_range(livein_begin_dbg(), livein_end()); + } +#endif livein_iterator livein_begin() const; livein_iterator livein_end() const { return LiveIns.end(); } bool livein_empty() const { return LiveIns.empty(); } Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h Mon Jan 9 21:23:09 2017 (r311818) @@ -148,8 +148,7 @@ class MachineFrameInfo { /// grouping overaligned allocas into a "secondary stack frame" and /// then only use a single alloca to allocate this frame and only a /// single virtual register to access it. Currently, without such an - /// optimization, each such alloca gets it's own dynamic - /// realignment. + /// optimization, each such alloca gets its own dynamic realignment. bool StackRealignable; /// Whether the function has the \c alignstack attribute. Modified: vendor/llvm/dist/include/llvm/DebugInfo/MSF/StreamArray.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/MSF/StreamArray.h Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/include/llvm/DebugInfo/MSF/StreamArray.h Mon Jan 9 21:23:09 2017 (r311818) @@ -11,6 +11,7 @@ #define LLVM_DEBUGINFO_MSF_STREAMARRAY_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/iterator.h" #include "llvm/DebugInfo/MSF/StreamRef.h" #include "llvm/Support/Error.h" #include @@ -107,7 +108,10 @@ private: Extractor E; }; -template class VarStreamArrayIterator { +template +class VarStreamArrayIterator + : public iterator_facade_base, + std::forward_iterator_tag, ValueType> { typedef VarStreamArrayIterator IterType; typedef VarStreamArray ArrayType; @@ -144,41 +148,39 @@ public: return false; } - bool operator!=(const IterType &R) { return !(*this == R); } - const ValueType &operator*() const { assert(Array && !HasError); return ThisValue; } - IterType &operator++() { - // We are done with the current record, discard it so that we are - // positioned at the next record. - IterRef = IterRef.drop_front(ThisLen); - if (IterRef.getLength() == 0) { - // There is nothing after the current record, we must make this an end - // iterator. - moveToEnd(); - } else { - // There is some data after the current record. - auto EC = Extract(IterRef, ThisLen, ThisValue); - if (EC) { - consumeError(std::move(EC)); - markError(); - } else if (ThisLen == 0) { - // An empty record? Make this an end iterator. + IterType &operator+=(std::ptrdiff_t N) { + while (N > 0) { + // We are done with the current record, discard it so that we are + // positioned at the next record. + IterRef = IterRef.drop_front(ThisLen); + if (IterRef.getLength() == 0) { + // There is nothing after the current record, we must make this an end + // iterator. moveToEnd(); + return *this; + } else { + // There is some data after the current record. + auto EC = Extract(IterRef, ThisLen, ThisValue); + if (EC) { + consumeError(std::move(EC)); + markError(); + return *this; + } else if (ThisLen == 0) { + // An empty record? Make this an end iterator. + moveToEnd(); + return *this; + } } + --N; } return *this; } - IterType operator++(int) { - IterType Original = *this; - ++*this; - return Original; - } - private: void moveToEnd() { Array = nullptr; @@ -211,6 +213,16 @@ public: assert(Stream.getLength() % sizeof(T) == 0); } + bool operator==(const FixedStreamArray &Other) const { + return Stream == Other.Stream; + } + + bool operator!=(const FixedStreamArray &Other) const { + return !(*this == Other); + } + + FixedStreamArray &operator=(const FixedStreamArray &) = default; + const T &operator[](uint32_t Index) const { assert(Index < size()); uint32_t Off = Index * sizeof(T); @@ -226,6 +238,8 @@ public: uint32_t size() const { return Stream.getLength() / sizeof(T); } + bool empty() const { return size() == 0; } + FixedStreamArrayIterator begin() const { return FixedStreamArrayIterator(*this, 0); } @@ -240,36 +254,53 @@ private: ReadableStreamRef Stream; }; -template class FixedStreamArrayIterator { +template +class FixedStreamArrayIterator + : public iterator_facade_base, + std::random_access_iterator_tag, T> { + public: FixedStreamArrayIterator(const FixedStreamArray &Array, uint32_t Index) : Array(Array), Index(Index) {} - bool operator==(const FixedStreamArrayIterator &R) { - assert(&Array == &R.Array); - return Index == R.Index; + FixedStreamArrayIterator & + operator=(const FixedStreamArrayIterator &Other) { + Array = Other.Array; + Index = Other.Index; + return *this; } - bool operator!=(const FixedStreamArrayIterator &R) { - return !(*this == R); + const T &operator*() const { return Array[Index]; } + + bool operator==(const FixedStreamArrayIterator &R) const { + assert(Array == R.Array); + return (Index == R.Index) && (Array == R.Array); } - const T &operator*() const { return Array[Index]; } + FixedStreamArrayIterator &operator+=(std::ptrdiff_t N) { + Index += N; + return *this; + } - FixedStreamArrayIterator &operator++() { - assert(Index < Array.size()); - ++Index; + FixedStreamArrayIterator &operator-=(std::ptrdiff_t N) { + assert(Index >= N); + Index -= N; return *this; } - FixedStreamArrayIterator operator++(int) { - FixedStreamArrayIterator Original = *this; - ++*this; - return Original; + std::ptrdiff_t operator-(const FixedStreamArrayIterator &R) const { + assert(Array == R.Array); + assert(Index >= R.Index); + return Index - R.Index; + } + + bool operator<(const FixedStreamArrayIterator &RHS) const { + assert(Array == RHS.Array); + return Index < RHS.Index; } private: - const FixedStreamArray &Array; + FixedStreamArray Array; uint32_t Index; }; Modified: vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h ============================================================================== --- vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h Mon Jan 9 21:23:09 2017 (r311818) @@ -83,7 +83,7 @@ public: namespace remote { class OrcRemoteTargetRPCAPI - : public rpc::SingleThreadedRPC { + : public rpc::SingleThreadedRPCEndpoint { protected: class ResourceIdMgr { public: @@ -108,7 +108,7 @@ protected: public: // FIXME: Remove constructors once MSVC supports synthesizing move-ops. OrcRemoteTargetRPCAPI(rpc::RawByteChannel &C) - : rpc::SingleThreadedRPC(C, true) {} + : rpc::SingleThreadedRPCEndpoint(C, true) {} class CallIntVoid : public rpc::Function { Modified: vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RPCUtils.h ============================================================================== --- vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RPCUtils.h Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RPCUtils.h Mon Jan 9 21:23:09 2017 (r311818) @@ -702,7 +702,7 @@ public: /// sync. template -class RPCBase { +class RPCEndpointBase { protected: class OrcRPCInvalid : public Function { public: @@ -747,7 +747,7 @@ protected: public: /// Construct an RPC instance on a channel. - RPCBase(ChannelT &C, bool LazyAutoNegotiation) + RPCEndpointBase(ChannelT &C, bool LazyAutoNegotiation) : C(C), LazyAutoNegotiation(LazyAutoNegotiation) { // Hold ResponseId in a special variable, since we expect Response to be // called relatively frequently, and want to avoid the map lookup. @@ -788,15 +788,21 @@ public: return FnIdOrErr.takeError(); } - // Allocate a sequence number. - auto SeqNo = SequenceNumberMgr.getSequenceNumber(); - assert(!PendingResponses.count(SeqNo) && - "Sequence number already allocated"); + SequenceNumberT SeqNo; // initialized in locked scope below. + { + // Lock the pending responses map and sequence number manager. + std::lock_guard Lock(ResponsesMutex); + + // Allocate a sequence number. + SeqNo = SequenceNumberMgr.getSequenceNumber(); + assert(!PendingResponses.count(SeqNo) && + "Sequence number already allocated"); - // Install the user handler. - PendingResponses[SeqNo] = + // Install the user handler. + PendingResponses[SeqNo] = detail::createResponseHandler( std::move(Handler)); + } // Open the function call message. if (auto Err = C.startSendMessage(FnId, SeqNo)) { @@ -863,11 +869,33 @@ public: return detail::ReadArgs(Args...); } + /// Abandon all outstanding result handlers. + /// + /// This will call all currently registered result handlers to receive an + /// "abandoned" error as their argument. This is used internally by the RPC + /// in error situations, but can also be called directly by clients who are + /// disconnecting from the remote and don't or can't expect responses to their + /// outstanding calls. (Especially for outstanding blocking calls, calling + /// this function may be necessary to avoid dead threads). + void abandonPendingResponses() { + // Lock the pending responses map and sequence number manager. + std::lock_guard Lock(ResponsesMutex); + + for (auto &KV : PendingResponses) + KV.second->abandon(); + PendingResponses.clear(); + SequenceNumberMgr.reset(); + } + protected: // The LaunchPolicy type allows a launch policy to be specified when adding // a function handler. See addHandlerImpl. using LaunchPolicy = std::function)>; + FunctionIdT getInvalidFunctionId() const { + return FnIdAllocator.getInvalidId(); + } + /// Add the given handler to the handler map and make it available for /// autonegotiation and execution. template @@ -884,28 +912,32 @@ protected: wrapHandler(std::move(Handler), std::move(Launch)); } - // Abandon all outstanding results. - void abandonPendingResponses() { - for (auto &KV : PendingResponses) - KV.second->abandon(); - PendingResponses.clear(); - SequenceNumberMgr.reset(); - } - Error handleResponse(SequenceNumberT SeqNo) { - auto I = PendingResponses.find(SeqNo); - if (I == PendingResponses.end()) { - abandonPendingResponses(); - return orcError(OrcErrorCode::UnexpectedRPCResponse); + using Handler = typename decltype(PendingResponses)::mapped_type; + Handler PRHandler; + + { + // Lock the pending responses map and sequence number manager. + std::unique_lock Lock(ResponsesMutex); + auto I = PendingResponses.find(SeqNo); + + if (I != PendingResponses.end()) { + PRHandler = std::move(I->second); + PendingResponses.erase(I); + SequenceNumberMgr.releaseSequenceNumber(SeqNo); + } else { + // Unlock the pending results map to prevent recursive lock. + Lock.unlock(); + abandonPendingResponses(); + return orcError(OrcErrorCode::UnexpectedRPCResponse); + } } - auto PRHandler = std::move(I->second); - PendingResponses.erase(I); - SequenceNumberMgr.releaseSequenceNumber(SeqNo); + assert(PRHandler && + "If we didn't find a response handler we should have bailed out"); if (auto Err = PRHandler->handleResponse(C)) { abandonPendingResponses(); - SequenceNumberMgr.reset(); return Err; } @@ -915,7 +947,7 @@ protected: FunctionIdT handleNegotiate(const std::string &Name) { auto I = LocalFunctionIds.find(Name); if (I == LocalFunctionIds.end()) - return FnIdAllocator.getInvalidId(); + return getInvalidFunctionId(); return I->second; } @@ -938,7 +970,7 @@ protected: // If autonegotiation indicates that the remote end doesn't support this // function, return an unknown function error. - if (RemoteId == FnIdAllocator.getInvalidId()) + if (RemoteId == getInvalidFunctionId()) return orcError(OrcErrorCode::UnknownRPCFunction); // Autonegotiation succeeded and returned a valid id. Update the map and @@ -1012,6 +1044,7 @@ protected: std::map Handlers; + std::mutex ResponsesMutex; detail::SequenceNumberManager SequenceNumberMgr; std::map>> PendingResponses; @@ -1021,17 +1054,18 @@ protected: template -class MultiThreadedRPC - : public detail::RPCBase< - MultiThreadedRPC, ChannelT, - FunctionIdT, SequenceNumberT> { +class MultiThreadedRPCEndpoint + : public detail::RPCEndpointBase< + MultiThreadedRPCEndpoint, + ChannelT, FunctionIdT, SequenceNumberT> { private: using BaseClass = - detail::RPCBase, - ChannelT, FunctionIdT, SequenceNumberT>; + detail::RPCEndpointBase< + MultiThreadedRPCEndpoint, + ChannelT, FunctionIdT, SequenceNumberT>; public: - MultiThreadedRPC(ChannelT &C, bool LazyAutoNegotiation) + MultiThreadedRPCEndpoint(ChannelT &C, bool LazyAutoNegotiation) : BaseClass(C, LazyAutoNegotiation) {} /// The LaunchPolicy type allows a launch policy to be specified when adding @@ -1061,30 +1095,41 @@ public: std::move(Launch)); } + /// Add a class-method as a handler. + template + void addHandler(ClassT &Object, RetT (ClassT::*Method)(ArgTs...), + LaunchPolicy Launch = LaunchPolicy()) { + addHandler( + detail::MemberFnWrapper(Object, Method), + Launch); + } + /// Negotiate a function id for Func with the other end of the channel. - template Error negotiateFunction() { + template Error negotiateFunction(bool Retry = false) { using OrcRPCNegotiate = typename BaseClass::OrcRPCNegotiate; + // Check if we already have a function id... + auto I = this->RemoteFunctionIds.find(Func::getPrototype()); + if (I != this->RemoteFunctionIds.end()) { + // If it's valid there's nothing left to do. + if (I->second != this->getInvalidFunctionId()) + return Error::success(); + // If it's invalid and we can't re-attempt negotiation, throw an error. + if (!Retry) + return orcError(OrcErrorCode::UnknownRPCFunction); + } + + // We don't have a function id for Func yet, call the remote to try to + // negotiate one. if (auto RemoteIdOrErr = callB(Func::getPrototype())) { this->RemoteFunctionIds[Func::getPrototype()] = *RemoteIdOrErr; + if (*RemoteIdOrErr == this->getInvalidFunctionId()) + return orcError(OrcErrorCode::UnknownRPCFunction); return Error::success(); } else return RemoteIdOrErr.takeError(); } - /// Convenience method for negotiating multiple functions at once. - template Error negotiateFunctions() { - return negotiateFunction(); - } - - /// Convenience method for negotiating multiple functions at once. - template - Error negotiateFunctions() { - if (auto Err = negotiateFunction()) - return Err; - return negotiateFunctions(); - } - /// Return type for non-blocking call primitives. template using NonBlockingCallResult = typename detail::ResultTraits< @@ -1169,19 +1214,20 @@ public: template -class SingleThreadedRPC - : public detail::RPCBase< - SingleThreadedRPC, ChannelT, - FunctionIdT, SequenceNumberT> { +class SingleThreadedRPCEndpoint + : public detail::RPCEndpointBase< + SingleThreadedRPCEndpoint, + ChannelT, FunctionIdT, SequenceNumberT> { private: using BaseClass = - detail::RPCBase, - ChannelT, FunctionIdT, SequenceNumberT>; + detail::RPCEndpointBase< + SingleThreadedRPCEndpoint, + ChannelT, FunctionIdT, SequenceNumberT>; using LaunchPolicy = typename BaseClass::LaunchPolicy; public: - SingleThreadedRPC(ChannelT &C, bool LazyAutoNegotiation) + SingleThreadedRPCEndpoint(ChannelT &C, bool LazyAutoNegotiation) : BaseClass(C, LazyAutoNegotiation) {} template @@ -1197,29 +1243,31 @@ public: } /// Negotiate a function id for Func with the other end of the channel. - template Error negotiateFunction() { + template Error negotiateFunction(bool Retry = false) { using OrcRPCNegotiate = typename BaseClass::OrcRPCNegotiate; + // Check if we already have a function id... + auto I = this->RemoteFunctionIds.find(Func::getPrototype()); + if (I != this->RemoteFunctionIds.end()) { + // If it's valid there's nothing left to do. + if (I->second != this->getInvalidFunctionId()) + return Error::success(); + // If it's invalid and we can't re-attempt negotiation, throw an error. + if (!Retry) + return orcError(OrcErrorCode::UnknownRPCFunction); + } + + // We don't have a function id for Func yet, call the remote to try to + // negotiate one. if (auto RemoteIdOrErr = callB(Func::getPrototype())) { this->RemoteFunctionIds[Func::getPrototype()] = *RemoteIdOrErr; + if (*RemoteIdOrErr == this->getInvalidFunctionId()) + return orcError(OrcErrorCode::UnknownRPCFunction); return Error::success(); } else return RemoteIdOrErr.takeError(); } - /// Convenience method for negotiating multiple functions at once. - template Error negotiateFunctions() { - return negotiateFunction(); - } - - /// Convenience method for negotiating multiple functions at once. - template - Error negotiateFunctions() { - if (auto Err = negotiateFunction()) - return Err; - return negotiateFunctions(); - } - template typename detail::ResultTraits::ErrorReturnType @@ -1332,6 +1380,68 @@ private: uint32_t NumOutstandingCalls; }; +/// @brief Convenience class for grouping RPC Functions into APIs that can be +/// negotiated as a block. +/// +template +class APICalls { +public: + + /// @brief Test whether this API contains Function F. + template + class Contains { + public: + static const bool value = false; + }; + + /// @brief Negotiate all functions in this API. + template + static Error negotiate(RPCEndpoint &R) { + return Error::success(); + } +}; + +template +class APICalls { +public: + + template + class Contains { + public: + static const bool value = std::is_same::value | + APICalls::template Contains::value; + }; + + template + static Error negotiate(RPCEndpoint &R) { + if (auto Err = R.template negotiateFunction()) + return Err; + return APICalls::negotiate(R); + } + +}; + +template +class APICalls, Funcs...> { +public: + + template + class Contains { + public: + static const bool value = + APICalls::template Contains::value | + APICalls::template Contains::value; + }; + + template + static Error negotiate(RPCEndpoint &R) { + if (auto Err = APICalls::negotiate(R)) + return Err; + return APICalls::negotiate(R); + } + +}; + } // end namespace rpc } // end namespace orc } // end namespace llvm Modified: vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RawByteChannel.h ============================================================================== --- vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RawByteChannel.h Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RawByteChannel.h Mon Jan 9 21:23:09 2017 (r311818) @@ -48,9 +48,7 @@ public: template Error startSendMessage(const FunctionIdT &FnId, const SequenceIdT &SeqNo) { writeLock.lock(); - if (auto Err = serializeSeq(*this, FnId, SeqNo)) - return Err; - return Error::success(); + return serializeSeq(*this, FnId, SeqNo); } /// Notify the channel that we're ending a message send. Modified: vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h Mon Jan 9 21:23:09 2017 (r311818) @@ -28,14 +28,14 @@ template <> struct ScalarEnumerationTrai template <> struct MappingTraits { static void mapping(IO &io, TypeTestResolution &res) { - io.mapRequired("Kind", res.TheKind); - io.mapRequired("SizeBitWidth", res.SizeBitWidth); + io.mapOptional("Kind", res.TheKind); + io.mapOptional("SizeBitWidth", res.SizeBitWidth); } }; template <> struct MappingTraits { static void mapping(IO &io, TypeIdSummary& summary) { - io.mapRequired("TTRes", summary.TTRes); + io.mapOptional("TTRes", summary.TTRes); } }; @@ -53,7 +53,7 @@ namespace yaml { template <> struct MappingTraits { static void mapping(IO &io, FunctionSummaryYaml& summary) { - io.mapRequired("TypeTests", summary.TypeTests); + io.mapOptional("TypeTests", summary.TypeTests); } }; @@ -100,8 +100,8 @@ template <> struct CustomMappingTraits struct MappingTraits { static void mapping(IO &io, ModuleSummaryIndex& index) { - io.mapRequired("GlobalValueMap", index.GlobalValueMap); - io.mapRequired("TypeIdMap", index.TypeIdMap); + io.mapOptional("GlobalValueMap", index.GlobalValueMap); + io.mapOptional("TypeIdMap", index.TypeIdMap); } }; Modified: vendor/llvm/dist/include/llvm/IR/PassManager.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/PassManager.h Mon Jan 9 20:51:51 2017 (r311817) +++ vendor/llvm/dist/include/llvm/IR/PassManager.h Mon Jan 9 21:23:09 2017 (r311818) @@ -879,18 +879,22 @@ extern template class AnalysisManager FunctionAnalysisManager; -/// \brief A module analysis which acts as a proxy for a function analysis -/// manager. +/// \brief An analysis over an "outer" IR unit that provides access to an +/// analysis manager over an "inner" IR unit. The inner unit must be contained +/// in the outer unit. +/// +/// Fore example, InnerAnalysisManagerProxy is +/// an analysis over Modules (the "outer" unit) that provides access to a +/// Function analysis manager. The FunctionAnalysisManager is the "inner" +/// manager being proxied, and Functions are the "inner" unit. The inner/outer +/// relationship is valid because each Function is contained in one Module. +/// +/// If you're (transitively) within a pass manager for an IR unit U that +/// contains IR unit V, you should never use an analysis manager over V, except +/// via one of these proxies. /// -/// This primarily proxies invalidation information from the module analysis -/// manager and module pass manager to a function analysis manager. You should -/// never use a function analysis manager from within (transitively) a module -/// pass manager unless your parent module pass has received a proxy result -/// object for it. -/// -/// Note that the proxy's result is a move-only object and represents ownership -/// of the validity of the analyses in the \c FunctionAnalysisManager it -/// provides. +/// Note that the proxy's result is a move-only RAII object. The validity of +/// the analyses in the inner analysis manager is tied to its lifetime. template class InnerAnalysisManagerProxy : public AnalysisInfoMixin< @@ -926,23 +930,16 @@ public: /// \brief Accessor for the analysis manager. AnalysisManagerT &getManager() { return *InnerAM; } - /// \brief Handler for invalidation of the outer IR unit. + /// \brief Handler for invalidation of the outer IR unit, \c IRUnitT. /// - /// If this analysis itself is preserved, then we assume that the set of \c - /// IR units that the inner analysis manager controls hasn't changed and - /// thus we don't need to invalidate *all* cached data associated with any - /// \c IRUnitT* in the \c AnalysisManagerT. + /// If the proxy analysis itself is not preserved, we assume that the set of + /// inner IR objects contained in IRUnit may have changed. In this case, + /// we have to call \c clear() on the inner analysis manager, as it may now + /// have stale pointers to its inner IR objects. /// - /// Regardless of whether this analysis is marked as preserved, all of the - /// analyses in the \c AnalysisManagerT are potentially invalidated (for - /// the relevant inner set of their IR units) based on the set of preserved - /// analyses. - /// - /// Because this needs to understand the mapping from one IR unit to an - /// inner IR unit, this method isn't defined in the primary template. - /// Instead, each specialization of this template will need to provide an - /// explicit specialization of this method to handle that particular pair - /// of IR unit and inner AnalysisManagerT. + /// Regardless of whether the proxy analysis is marked as preserved, all of + /// the analyses in the inner analysis manager are potentially invalidated + /// based on the set of preserved analyses. bool invalidate( IRUnitT &IR, const PreservedAnalyses &PA, typename AnalysisManager::Invalidator &Inv); @@ -956,13 +953,9 @@ public: /// \brief Run the analysis pass and create our proxy result object. /// - /// This doesn't do any interesting work, it is primarily used to insert our - /// proxy result object into the module analysis cache so that we can proxy - /// invalidation to the function analysis manager. - /// - /// In debug builds, it will also assert that the analysis manager is empty - /// as no queries should arrive at the function analysis manager prior to - /// this analysis being requested. + /// This doesn't do any interesting work; it is primarily used to insert our + /// proxy result object into the outer analysis cache so that we can proxy + /// invalidation to the inner analysis manager. Result run(IRUnitT &IR, AnalysisManager &AM, ExtraArgTs...) { return Result(*InnerAM); @@ -996,22 +989,24 @@ bool FunctionAnalysisManagerModuleProxy: extern template class InnerAnalysisManagerProxy; -/// \brief A function analysis which acts as a proxy for a module analysis -/// manager. -/// -/// This primarily provides an accessor to a parent module analysis manager to -/// function passes. Only the const interface of the module analysis manager is -/// provided to indicate that once inside of a function analysis pass you -/// cannot request a module analysis to actually run. Instead, the user must -/// rely on the \c getCachedResult API. -/// -/// The invalidation provided by this proxy involves tracking when an -/// invalidation event in the outer analysis manager needs to trigger an -/// invalidation of a particular analysis on this IR unit. -/// -/// Because outer analyses aren't invalidated while these IR units are being -/// precessed, we have to register and handle these as deferred invalidation -/// events. +/// \brief An analysis over an "inner" IR unit that provides access to an +/// analysis manager over a "outer" IR unit. The inner unit must be contained +/// in the outer unit. +/// +/// For example OuterAnalysisManagerProxy is an +/// analysis over Functions (the "inner" unit) which provides access to a Module +/// analysis manager. The ModuleAnalysisManager is the "outer" manager being +/// proxied, and Modules are the "outer" IR unit. The inner/outer relationship +/// is valid because each Function is contained in one Module. +/// +/// This proxy only exposes the const interface of the outer analysis manager, +/// to indicate that you cannot cause an outer analysis to run from within an +/// inner pass. Instead, you must rely on the \c getCachedResult API. +/// +/// This proxy doesn't manage invalidation in any way -- that is handled by the +/// recursive return path of each layer of the pass manager. A consequence of +/// this is the outer analyses may be stale. We invalidate the outer analyses +/// only when we're done running passes over the inner IR units. template class OuterAnalysisManagerProxy : public AnalysisInfoMixin< @@ -1024,7 +1019,7 @@ public: const AnalysisManagerT &getManager() const { return *AM; } - /// \brief Handle invalidation by ignoring it, this pass is immutable. + /// \brief Handle invalidation by ignoring it; this pass is immutable. bool invalidate( IRUnitT &, const PreservedAnalyses &, typename AnalysisManager::Invalidator &) { @@ -1089,18 +1084,15 @@ AnalysisKey extern template class OuterAnalysisManagerProxy; -/// Provide the \c ModuleAnalysisManager to \c Fucntion proxy. +/// Provide the \c ModuleAnalysisManager to \c Function proxy. typedef OuterAnalysisManagerProxy ModuleAnalysisManagerFunctionProxy; /// \brief Trivial adaptor that maps from a module to its functions. /// /// Designed to allow composition of a FunctionPass(Manager) and -/// a ModulePassManager. Note that if this pass is constructed with a pointer -/// to a \c ModuleAnalysisManager it will run the -/// \c FunctionAnalysisManagerModuleProxy analysis prior to running the function -/// pass over the module to enable a \c FunctionAnalysisManager to be used -/// within this run safely. +/// a ModulePassManager, by running the FunctionPass(Manager) over every +/// function in the module. /// /// Function passes run within this adaptor can rely on having exclusive access /// to the function they are run over. They should not read or modify any other @@ -1115,6 +1107,10 @@ typedef OuterAnalysisManagerProxy class ModuleToFunctionPassAdaptor : public PassInfoMixin> { @@ -1124,7 +1120,6 @@ public: /// \brief Runs the function pass across every function in the module. PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM) { - // Setup the function analysis manager from its proxy. FunctionAnalysisManager &FAM = AM.getResult(M).getManager(); @@ -1145,10 +1140,11 @@ public: PA.intersect(std::move(PassPA)); } - // By definition we preserve the proxy. We also preserve all analyses on - // Function units. This precludes *any* invalidation of function analyses - // by the proxy, but that's OK because we've taken care to invalidate - // analyses in the function analysis manager incrementally above. + // The FunctionAnalysisManagerModuleProxy is preserved because (we assume) + // the function passes we ran didn't add or remove any functions. + // + // We also preserve all analyses on Functions, because we did all the + // invalidation we needed to do above. PA.preserveSet>(); PA.preserve(); return PA; @@ -1166,7 +1162,7 @@ createModuleToFunctionPassAdaptor(Functi return ModuleToFunctionPassAdaptor(std::move(Pass)); } -/// \brief A template utility pass to force an analysis result to be available. +/// \brief A utility pass template to force an analysis result to be available. /// /// If there are extra arguments at the pass's run level there may also be /// extra arguments to the analysis manager's \c getResult routine. We can't @@ -1196,17 +1192,14 @@ struct RequireAnalysisPass } }; -/// \brief A template utility pass to force an analysis result to be -/// invalidated. -/// -/// This is a no-op pass which simply forces a specific analysis result to be -/// invalidated when it is run. +/// \brief A no-op pass template which simply forces a specific analysis result +/// to be invalidated. template struct InvalidateAnalysisPass : PassInfoMixin> { /// \brief Run this pass over some unit of IR. /// - /// This pass can be run over any unit of IR and use any analysis manager + /// This pass can be run over any unit of IR and use any analysis manager, /// provided they satisfy the basic API requirements. When this pass is /// created, these methods can be instantiated to satisfy whatever the /// context requires. @@ -1218,10 +1211,10 @@ struct InvalidateAnalysisPass } }; -/// \brief A utility pass that does nothing but preserves no analyses. +/// \brief A utility pass that does nothing, but preserves no analyses. /// -/// As a consequence fo not preserving any analyses, this pass will force all -/// analysis passes to be re-run to produce fresh results if any are needed. +/// Because this preserves no analyses, any analysis passes queried after this +/// pass runs will recompute fresh results. struct InvalidateAllAnalysesPass : PassInfoMixin { /// \brief Run this pass over some unit of IR. template Modified: vendor/llvm/dist/include/llvm/IR/User.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/User.h Mon Jan 9 20:51:51 2017 (r311817) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52ADFCA80B2; Mon, 9 Jan 2017 21:23:25 +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 0C320122F; Mon, 9 Jan 2017 21:23:24 +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 v09LNOVs095609; Mon, 9 Jan 2017 21:23:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNMpZ095589; Mon, 9 Jan 2017 21:23:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNMpZ095589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311820 - in vendor/clang/dist: docs include/clang/AST include/clang/Basic include/clang/Driver include/clang/Frontend include/clang/Index include/clang/Sema include/clang/StaticAnalyze... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:25 -0000 Author: dim Date: Mon Jan 9 21:23:21 2017 New Revision: 311820 URL: https://svnweb.freebsd.org/changeset/base/311820 Log: Vendor import of clang trunk r291476: https://llvm.org/svn/llvm-project/cfe/trunk@291476 Added: vendor/clang/dist/lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp (contents, props changed) vendor/clang/dist/test/Analysis/iterator-past-end.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCXX/dllexport-ctor-closure.cpp (contents, props changed) vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/ vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/A.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/C.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/C.m vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/D.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/module.modulemap vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/test.h (contents, props changed) vendor/clang/dist/test/Modules/pch-with-module-name.m vendor/clang/dist/test/Sema/diagnose_if.c (contents, props changed) vendor/clang/dist/test/SemaCXX/diagnose_if.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/libstdcxx_gets_hack.cpp (contents, props changed) Modified: vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/include/clang/AST/Expr.h vendor/clang/dist/include/clang/Basic/Attr.td vendor/clang/dist/include/clang/Basic/AttrDocs.td vendor/clang/dist/include/clang/Basic/DiagnosticCommonKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/LangOptions.def vendor/clang/dist/include/clang/Driver/CC1Options.td vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def vendor/clang/dist/include/clang/Frontend/FrontendActions.h vendor/clang/dist/include/clang/Index/IndexSymbol.h vendor/clang/dist/include/clang/Sema/Initialization.h vendor/clang/dist/include/clang/Sema/Overload.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/StaticAnalyzer/Checkers/Checkers.td vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/MicrosoftMangle.cpp vendor/clang/dist/lib/CodeGen/BackendUtil.cpp vendor/clang/dist/lib/CodeGen/CGCleanup.h vendor/clang/dist/lib/CodeGen/CGException.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp vendor/clang/dist/lib/Driver/ToolChains.cpp vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Format/TokenAnnotator.cpp vendor/clang/dist/lib/Format/UnwrappedLineParser.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/FrontendActions.cpp vendor/clang/dist/lib/Index/IndexSymbol.cpp vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseInit.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprMember.cpp vendor/clang/dist/lib/Sema/SemaInit.cpp vendor/clang/dist/lib/Sema/SemaLambda.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaTemplate.cpp vendor/clang/dist/lib/Sema/SemaTemplateDeduction.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/CMakeLists.txt vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngine.cpp vendor/clang/dist/test/Analysis/Inputs/system-header-simulator-cxx.h vendor/clang/dist/test/Analysis/diagnostics/explicit-suppression.cpp vendor/clang/dist/test/Analysis/inlining/stl.cpp vendor/clang/dist/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp vendor/clang/dist/test/CXX/drs/dr13xx.cpp vendor/clang/dist/test/CXX/drs/dr19xx.cpp vendor/clang/dist/test/CXX/expr/expr.prim/expr.prim.lambda/templates.cpp vendor/clang/dist/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p1-0x.cpp vendor/clang/dist/test/CXX/temp/temp.param/p5.cpp vendor/clang/dist/test/CodeGen/lifetime2.c vendor/clang/dist/test/CodeGen/thinlto_backend.ll vendor/clang/dist/test/CodeGenCXX/arm.cpp vendor/clang/dist/test/CodeGenCXX/debug-info-class.cpp vendor/clang/dist/test/CodeGenCXX/dllexport.cpp vendor/clang/dist/test/CodeGenCXX/eh-aggregate-copy-destroy.cpp vendor/clang/dist/test/CodeGenCXX/exceptions.cpp vendor/clang/dist/test/CodeGenCXX/goto.cpp vendor/clang/dist/test/Driver/B-opt.c vendor/clang/dist/test/Driver/coverage-ld.c vendor/clang/dist/test/Driver/cross-linux.c vendor/clang/dist/test/Driver/fuchsia.c vendor/clang/dist/test/Driver/fuchsia.cpp vendor/clang/dist/test/Driver/fuse-ld.c vendor/clang/dist/test/Driver/instrprof-ld.c vendor/clang/dist/test/Driver/mips-mti-linux.c vendor/clang/dist/test/Driver/netbsd.c vendor/clang/dist/test/Driver/netbsd.cpp vendor/clang/dist/test/Driver/nostdlib.c vendor/clang/dist/test/Driver/prefixed-tools.c vendor/clang/dist/test/Driver/sanitizer-ld.c vendor/clang/dist/test/Driver/windows-cross.c vendor/clang/dist/test/Index/Core/index-source.cpp vendor/clang/dist/test/Misc/diag-template-diffing.cpp vendor/clang/dist/test/OpenMP/atomic_codegen.cpp vendor/clang/dist/test/OpenMP/threadprivate_codegen.cpp vendor/clang/dist/test/SemaCXX/PR10177.cpp vendor/clang/dist/test/SemaCXX/attr-mode-tmpl.cpp vendor/clang/dist/test/SemaCXX/attr-noreturn.cpp vendor/clang/dist/test/SemaCXX/constant-expression-cxx11.cpp vendor/clang/dist/test/SemaCXX/cxx1z-constexpr-lambdas.cpp vendor/clang/dist/test/SemaCXX/enable_if.cpp vendor/clang/dist/test/SemaCXX/implicit-exception-spec.cpp vendor/clang/dist/test/SemaCXX/member-init.cpp vendor/clang/dist/test/SemaCXX/overload-call.cpp vendor/clang/dist/test/SemaCXX/overload-member-call.cpp vendor/clang/dist/test/SemaCXX/undefined-internal.cpp vendor/clang/dist/test/SemaTemplate/alias-templates.cpp vendor/clang/dist/test/SemaTemplate/constexpr-instantiate.cpp vendor/clang/dist/test/SemaTemplate/deduction.cpp vendor/clang/dist/test/SemaTemplate/default-arguments-cxx0x.cpp vendor/clang/dist/test/SemaTemplate/instantiate-init.cpp vendor/clang/dist/test/SemaTemplate/temp_arg_nontype.cpp vendor/clang/dist/tools/c-index-test/core_main.cpp vendor/clang/dist/tools/driver/CMakeLists.txt vendor/clang/dist/unittests/Format/FormatTest.cpp vendor/clang/dist/unittests/Format/FormatTestJS.cpp vendor/clang/dist/www/cxx_dr_status.html Modified: vendor/clang/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.rst Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/docs/ReleaseNotes.rst Mon Jan 9 21:23:21 2017 (r311820) @@ -47,6 +47,10 @@ sections with improvements to Clang's su Major New Features ------------------ +- The ``diagnose_if`` attribute has been added to clang. This attribute allows + clang to emit a warning or error if a function call meets one or more + user-specified conditions. + - ... Improvements to Clang's diagnostics Modified: vendor/clang/dist/include/clang/AST/Expr.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Expr.h Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/AST/Expr.h Mon Jan 9 21:23:21 2017 (r311820) @@ -651,7 +651,8 @@ public: /// constant. bool EvaluateWithSubstitution(APValue &Value, ASTContext &Ctx, const FunctionDecl *Callee, - ArrayRef Args) const; + ArrayRef Args, + const Expr *This = nullptr) const; /// \brief If the current Expr is a pointer, this will try to statically /// determine the number of bytes available where the pointer is pointing. Modified: vendor/clang/dist/include/clang/Basic/Attr.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/Attr.td Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Basic/Attr.td Mon Jan 9 21:23:21 2017 (r311820) @@ -140,12 +140,15 @@ class Argument : Argument; +class BoolArgument : Argument; class IdentifierArgument : Argument; class IntArgument : Argument; class StringArgument : Argument; class ExprArgument : Argument; -class FunctionArgument : Argument; +class FunctionArgument : Argument; class TypeArgument : Argument; class UnsignedArgument : Argument; class VariadicUnsignedArgument : Argument; @@ -1591,6 +1594,26 @@ def Unavailable : InheritableAttr { let Documentation = [Undocumented]; } +def DiagnoseIf : InheritableAttr { + let Spellings = [GNU<"diagnose_if">]; + let Subjects = SubjectList<[Function]>; + let Args = [ExprArgument<"Cond">, StringArgument<"Message">, + EnumArgument<"DiagnosticType", + "DiagnosticType", + ["error", "warning"], + ["DT_Error", "DT_Warning"]>, + BoolArgument<"ArgDependent", 0, /*fake*/ 1>, + FunctionArgument<"Parent", 0, /*fake*/ 1>]; + let DuplicatesAllowedWhileMerging = 1; + let LateParsed = 1; + let AdditionalMembers = [{ + bool isError() const { return diagnosticType == DT_Error; } + bool isWarning() const { return diagnosticType == DT_Warning; } + }]; + let TemplateDependent = 1; + let Documentation = [DiagnoseIfDocs]; +} + def ArcWeakrefUnavailable : InheritableAttr { let Spellings = [GNU<"objc_arc_weak_reference_unavailable">]; let Subjects = SubjectList<[ObjCInterface], ErrorDiag>; Modified: vendor/clang/dist/include/clang/Basic/AttrDocs.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/AttrDocs.td Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Basic/AttrDocs.td Mon Jan 9 21:23:21 2017 (r311820) @@ -378,6 +378,65 @@ template instantiation, so the value for }]; } +def DiagnoseIfDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``diagnose_if`` attribute can be placed on function declarations to emit +warnings or errors at compile-time if calls to the attributed function meet +certain user-defined criteria. For example: + +.. code-block:: c + void abs(int a) + __attribute__((diagnose_if(a >= 0, "Redundant abs call", "warning"))); + void must_abs(int a) + __attribute__((diagnose_if(a >= 0, "Redundant abs call", "error"))); + + int val = abs(1); // warning: Redundant abs call + int val2 = must_abs(1); // error: Redundant abs call + int val3 = abs(val); + int val4 = must_abs(val); // Because run-time checks are not emitted for + // diagnose_if attributes, this executes without + // issue. + + +``diagnose_if`` is closely related to ``enable_if``, with a few key differences: + +* Overload resolution is not aware of ``diagnose_if`` attributes: they're + considered only after we select the best candidate from a given candidate set. +* Function declarations that differ only in their ``diagnose_if`` attributes are + considered to be redeclarations of the same function (not overloads). +* If the condition provided to ``diagnose_if`` cannot be evaluated, no + diagnostic will be emitted. + +Otherwise, ``diagnose_if`` is essentially the logical negation of ``enable_if``. + +As a result of bullet number two, ``diagnose_if`` attributes will stack on the +same function. For example: + +.. code-block:: c + + int foo() __attribute__((diagnose_if(1, "diag1", "warning"))); + int foo() __attribute__((diagnose_if(1, "diag2", "warning"))); + + int bar = foo(); // warning: diag1 + // warning: diag2 + int (*fooptr)(void) = foo; // warning: diag1 + // warning: diag2 + + constexpr int supportsAPILevel(int N) { return N < 5; } + int baz(int a) + __attribute__((diagnose_if(!supportsAPILevel(10), + "Upgrade to API level 10 to use baz", "error"))); + int baz(int a) + __attribute__((diagnose_if(!a, "0 is not recommended.", "warning"))); + + int (*bazptr)(int) = baz; // error: Upgrade to API level 10 to use baz + int v = baz(0); // error: Upgrade to API level 10 to use baz + +Query for this feature with ``__has_attribute(diagnose_if)``. + }]; +} + def PassObjectSizeDocs : Documentation { let Category = DocCatVariable; // Technically it's a parameter doc, but eh. let Content = [{ Modified: vendor/clang/dist/include/clang/Basic/DiagnosticCommonKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticCommonKinds.td Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Basic/DiagnosticCommonKinds.td Mon Jan 9 21:23:21 2017 (r311820) @@ -161,6 +161,8 @@ def ext_old_implicitly_unsigned_long_cxx InGroup; def ext_clang_enable_if : Extension<"'enable_if' is a clang extension">, InGroup; +def ext_clang_diagnose_if : Extension<"'diagnose_if' is a clang extension">, + InGroup; // SEH def err_seh_expected_handler : Error< Modified: vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Mon Jan 9 21:23:21 2017 (r311820) @@ -495,6 +495,7 @@ def UnusedPropertyIvar : DiagGroup<"unu def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">; def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">; def UserDefinedLiterals : DiagGroup<"user-defined-literals">; +def UserDefinedWarnings : DiagGroup<"user-defined-warnings">; def Reorder : DiagGroup<"reorder">; def UndeclaredSelector : DiagGroup<"undeclared-selector">; def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">; @@ -683,7 +684,8 @@ def Most : DiagGroup<"most", [ OverloadedVirtual, PrivateExtern, SelTypeCast, - ExternCCompat + ExternCCompat, + UserDefinedWarnings ]>; // Thread Safety warnings Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Mon Jan 9 21:23:21 2017 (r311820) @@ -2141,8 +2141,11 @@ def err_constexpr_local_var_no_init : Er def ext_constexpr_function_never_constant_expr : ExtWarn< "constexpr %select{function|constructor}0 never produces a " "constant expression">, InGroup>, DefaultError; -def err_enable_if_never_constant_expr : Error< - "'enable_if' attribute expression never produces a constant expression">; +def err_attr_cond_never_constant_expr : Error< + "%0 attribute expression never produces a constant expression">; +def err_diagnose_if_invalid_diagnostic_type : Error< + "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" " + "instead">; def err_constexpr_body_no_return : Error< "no return statement in constexpr function">; def err_constexpr_return_missing_expr : Error< @@ -3333,6 +3336,9 @@ def note_ovl_candidate : Note<"candidate def note_ovl_candidate_inherited_constructor : Note< "constructor from base class %0 inherited here">; +def note_ovl_candidate_inherited_constructor_slice : Note< + "constructor inherited from base class cannot be used to initialize from " + "an argument of the derived class type">; def note_ovl_candidate_illegal_constructor : Note< "candidate %select{constructor|template}0 ignored: " "instantiation %select{takes|would take}0 its own class type by value">; @@ -3366,7 +3372,9 @@ def note_ovl_candidate_disabled_by_enabl def note_ovl_candidate_has_pass_object_size_params: Note< "candidate address cannot be taken because parameter %0 has " "pass_object_size attribute">; -def note_ovl_candidate_disabled_by_enable_if_attr : Note< +def err_diagnose_if_succeeded : Error<"%0">; +def warn_diagnose_if_succeeded : Warning<"%0">, InGroup; +def note_ovl_candidate_disabled_by_function_cond_attr : Note< "candidate disabled: %0">; def note_ovl_candidate_disabled_by_extension : Note< "candidate disabled due to OpenCL extension">; @@ -4395,6 +4403,7 @@ def note_not_found_by_two_phase_lookup : def err_undeclared_use : Error<"use of undeclared %0">; def warn_deprecated : Warning<"%0 is deprecated">, InGroup; +def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">; def warn_property_method_deprecated : Warning<"property access is using %0 method which is deprecated">, InGroup; Modified: vendor/clang/dist/include/clang/Basic/LangOptions.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/LangOptions.def Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Basic/LangOptions.def Mon Jan 9 21:23:21 2017 (r311820) @@ -146,6 +146,7 @@ LANGOPT(Modules , 1, 0, "modul COMPATIBLE_LANGOPT(ModulesTS , 1, 0, "C++ Modules TS") BENIGN_ENUM_LANGOPT(CompilingModule, CompilingModuleKind, 2, CMK_None, "compiling a module interface") +BENIGN_LANGOPT(CompilingPCH, 1, 0, "building a pch") COMPATIBLE_LANGOPT(ModulesDeclUse , 1, 0, "require declaration of module uses") BENIGN_LANGOPT(ModulesSearchAll , 1, 1, "searching even non-imported modules to find unresolved references") COMPATIBLE_LANGOPT(ModulesStrictDeclUse, 1, 0, "requiring declaration of module uses and all headers to be in modules") Modified: vendor/clang/dist/include/clang/Driver/CC1Options.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/CC1Options.td Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Driver/CC1Options.td Mon Jan 9 21:23:21 2017 (r311820) @@ -167,6 +167,9 @@ def disable_llvm_passes : Flag<["-"], "d "frontend by not running any LLVM passes at all">; def disable_llvm_optzns : Flag<["-"], "disable-llvm-optzns">, Alias; +def disable_lifetimemarkers : Flag<["-"], "disable-lifetime-markers">, + HelpText<"Disable lifetime-markers emission even when optimizations are " + "enabled">; def disable_red_zone : Flag<["-"], "disable-red-zone">, HelpText<"Do not emit code that uses the red zone.">; def dwarf_column_info : Flag<["-"], "dwarf-column-info">, Modified: vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def ============================================================================== --- vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Mon Jan 9 21:23:21 2017 (r311820) @@ -52,6 +52,7 @@ CODEGENOPT(DisableGCov , 1, 0) /// CODEGENOPT(DisableLLVMPasses , 1, 0) ///< Don't run any LLVM IR passes to get ///< the pristine IR generated by the ///< frontend. +CODEGENOPT(DisableLifetimeMarkers, 1, 0) ///< Don't emit any lifetime markers CODEGENOPT(ExperimentalNewPassManager, 1, 0) ///< Enables the new, experimental ///< pass manager. CODEGENOPT(DisableRedZone , 1, 0) ///< Set when -mno-red-zone is enabled. Modified: vendor/clang/dist/include/clang/Frontend/FrontendActions.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/FrontendActions.h Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Frontend/FrontendActions.h Mon Jan 9 21:23:21 2017 (r311820) @@ -88,6 +88,8 @@ public: static std::unique_ptr ComputeASTConsumerArguments(CompilerInstance &CI, StringRef InFile, std::string &Sysroot, std::string &OutputFile); + + bool BeginSourceFileAction(CompilerInstance &CI, StringRef Filename) override; }; class GenerateModuleAction : public ASTFrontendAction { Modified: vendor/clang/dist/include/clang/Index/IndexSymbol.h ============================================================================== --- vendor/clang/dist/include/clang/Index/IndexSymbol.h Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Index/IndexSymbol.h Mon Jan 9 21:23:21 2017 (r311820) @@ -59,6 +59,13 @@ enum class SymbolLanguage { CXX, }; +/// Language specific sub-kinds. +enum class SymbolSubKind { + None, + CXXCopyConstructor, + CXXMoveConstructor, +}; + /// Set of properties that provide additional info about a symbol. enum class SymbolProperty : uint8_t { Generic = 1 << 0, @@ -107,6 +114,7 @@ struct SymbolRelation { struct SymbolInfo { SymbolKind Kind; + SymbolSubKind SubKind; SymbolPropertySet Properties; SymbolLanguage Lang; }; @@ -121,6 +129,7 @@ void printSymbolRoles(SymbolRoleSet Role bool printSymbolName(const Decl *D, const LangOptions &LO, raw_ostream &OS); StringRef getSymbolKindString(SymbolKind K); +StringRef getSymbolSubKindString(SymbolSubKind K); StringRef getSymbolLanguageString(SymbolLanguage K); void applyForEachSymbolProperty(SymbolPropertySet Props, Modified: vendor/clang/dist/include/clang/Sema/Initialization.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Initialization.h Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Sema/Initialization.h Mon Jan 9 21:23:21 2017 (r311820) @@ -215,14 +215,14 @@ public: /// \brief Create the initialization entity for a parameter. static InitializedEntity InitializeParameter(ASTContext &Context, - ParmVarDecl *Parm) { + const ParmVarDecl *Parm) { return InitializeParameter(Context, Parm, Parm->getType()); } /// \brief Create the initialization entity for a parameter, but use /// another type. static InitializedEntity InitializeParameter(ASTContext &Context, - ParmVarDecl *Parm, + const ParmVarDecl *Parm, QualType Type) { bool Consumed = (Context.getLangOpts().ObjCAutoRefCount && Parm->hasAttr()); Modified: vendor/clang/dist/include/clang/Sema/Overload.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Overload.h Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Sema/Overload.h Mon Jan 9 21:23:21 2017 (r311820) @@ -531,6 +531,13 @@ namespace clang { Ambiguous.construct(); } + void setAsIdentityConversion(QualType T) { + setStandard(); + Standard.setAsIdentityConversion(); + Standard.setFromType(T); + Standard.setAllToTypes(T); + } + /// \brief Whether the target is really a std::initializer_list, and the /// sequence only represents the worst element conversion. bool isStdInitializerListElement() const { @@ -601,8 +608,17 @@ namespace clang { /// This candidate was not viable because its OpenCL extension is disabled. ovl_fail_ext_disabled, + + /// This inherited constructor is not viable because it would slice the + /// argument. + ovl_fail_inhctor_slice, }; + /// A list of implicit conversion sequences for the arguments of an + /// OverloadCandidate. + typedef llvm::MutableArrayRef + ConversionSequenceList; + /// OverloadCandidate - A single candidate in an overload set (C++ 13.3). struct OverloadCandidate { /// Function - The actual function that this candidate @@ -627,18 +643,13 @@ namespace clang { /// is a surrogate, but only if IsSurrogate is true. CXXConversionDecl *Surrogate; - /// Conversions - The conversion sequences used to convert the - /// function arguments to the function parameters, the pointer points to a - /// fixed size array with NumConversions elements. The memory is owned by - /// the OverloadCandidateSet. - ImplicitConversionSequence *Conversions; + /// The conversion sequences used to convert the function arguments + /// to the function parameters. + ConversionSequenceList Conversions; /// The FixIt hints which can be used to fix the Bad candidate. ConversionFixItGenerator Fix; - /// NumConversions - The number of elements in the Conversions array. - unsigned NumConversions; - /// Viable - True to indicate that this overload candidate is viable. bool Viable; @@ -664,6 +675,26 @@ namespace clang { /// to be used while performing partial ordering of function templates. unsigned ExplicitCallArguments; + /// The number of diagnose_if attributes that this overload triggered. + /// If any of the triggered attributes are errors, this won't count + /// diagnose_if warnings. + unsigned NumTriggeredDiagnoseIfs = 0; + + /// Basically a TinyPtrVector that doesn't own the vector: + /// If NumTriggeredDiagnoseIfs is 0 or 1, this is a DiagnoseIfAttr *, + /// otherwise it's a pointer to an array of `NumTriggeredDiagnoseIfs` + /// DiagnoseIfAttr *s. + llvm::PointerUnion DiagnoseIfInfo; + + /// Gets an ArrayRef for the data at DiagnoseIfInfo. Note that this may give + /// you a pointer into DiagnoseIfInfo. + ArrayRef getDiagnoseIfInfo() const { + auto *Ptr = NumTriggeredDiagnoseIfs <= 1 + ? DiagnoseIfInfo.getAddrOfPtr1() + : DiagnoseIfInfo.get(); + return {Ptr, NumTriggeredDiagnoseIfs}; + } + union { DeductionFailureInfo DeductionFailure; @@ -677,9 +708,9 @@ namespace clang { /// hasAmbiguousConversion - Returns whether this overload /// candidate requires an ambiguous conversion or not. bool hasAmbiguousConversion() const { - for (unsigned i = 0, e = NumConversions; i != e; ++i) { - if (!Conversions[i].isInitialized()) return false; - if (Conversions[i].isAmbiguous()) return true; + for (auto &C : Conversions) { + if (!C.isInitialized()) return false; + if (C.isAmbiguous()) return true; } return false; } @@ -728,17 +759,42 @@ namespace clang { SmallVector Candidates; llvm::SmallPtrSet Functions; - // Allocator for OverloadCandidate::Conversions. We store the first few - // elements inline to avoid allocation for small sets. - llvm::BumpPtrAllocator ConversionSequenceAllocator; + // Allocator for ConversionSequenceLists and DiagnoseIfAttr* arrays. + // We store the first few of each of these inline to avoid allocation for + // small sets. + llvm::BumpPtrAllocator SlabAllocator; SourceLocation Loc; CandidateSetKind Kind; - unsigned NumInlineSequences; - llvm::AlignedCharArray - InlineSpace; + constexpr static unsigned NumInlineBytes = + 24 * sizeof(ImplicitConversionSequence); + unsigned NumInlineBytesUsed; + llvm::AlignedCharArray InlineSpace; + + /// If we have space, allocates from inline storage. Otherwise, allocates + /// from the slab allocator. + /// FIXME: It would probably be nice to have a SmallBumpPtrAllocator + /// instead. + template + T *slabAllocate(unsigned N) { + // It's simpler if this doesn't need to consider alignment. + static_assert(alignof(T) == alignof(void *), + "Only works for pointer-aligned types."); + static_assert(std::is_trivial::value || + std::is_same::value, + "Add destruction logic to OverloadCandidateSet::clear()."); + + unsigned NBytes = sizeof(T) * N; + if (NBytes > NumInlineBytes - NumInlineBytesUsed) + return SlabAllocator.Allocate(N); + char *FreeSpaceStart = InlineSpace.buffer + NumInlineBytesUsed; + assert(uintptr_t(FreeSpaceStart) % alignof(void *) == 0 && + "Misaligned storage!"); + + NumInlineBytesUsed += NBytes; + return reinterpret_cast(FreeSpaceStart); + } OverloadCandidateSet(const OverloadCandidateSet &) = delete; void operator=(const OverloadCandidateSet &) = delete; @@ -747,12 +803,17 @@ namespace clang { public: OverloadCandidateSet(SourceLocation Loc, CandidateSetKind CSK) - : Loc(Loc), Kind(CSK), NumInlineSequences(0) {} + : Loc(Loc), Kind(CSK), NumInlineBytesUsed(0) {} ~OverloadCandidateSet() { destroyCandidates(); } SourceLocation getLocation() const { return Loc; } CandidateSetKind getKind() const { return Kind; } + /// Make a DiagnoseIfAttr* array in a block of memory that will live for + /// as long as this OverloadCandidateSet. Returns a pointer to the start + /// of that array. + DiagnoseIfAttr **addDiagnoseIfComplaints(ArrayRef CA); + /// \brief Determine when this overload candidate will be new to the /// overload set. bool isNewCandidate(Decl *F) { @@ -769,30 +830,32 @@ namespace clang { size_t size() const { return Candidates.size(); } bool empty() const { return Candidates.empty(); } + /// \brief Allocate storage for conversion sequences for NumConversions + /// conversions. + ConversionSequenceList + allocateConversionSequences(unsigned NumConversions) { + ImplicitConversionSequence *Conversions = + slabAllocate(NumConversions); + + // Construct the new objects. + for (unsigned I = 0; I != NumConversions; ++I) + new (&Conversions[I]) ImplicitConversionSequence(); + + return ConversionSequenceList(Conversions, NumConversions); + } + /// \brief Add a new candidate with NumConversions conversion sequence slots /// to the overload set. - OverloadCandidate &addCandidate(unsigned NumConversions = 0) { + OverloadCandidate &addCandidate(unsigned NumConversions = 0, + ConversionSequenceList Conversions = None) { + assert((Conversions.empty() || Conversions.size() == NumConversions) && + "preallocated conversion sequence has wrong length"); + Candidates.push_back(OverloadCandidate()); OverloadCandidate &C = Candidates.back(); - - // Assign space from the inline array if there are enough free slots - // available. - if (NumConversions + NumInlineSequences <= 16) { - ImplicitConversionSequence *I = - (ImplicitConversionSequence *)InlineSpace.buffer; - C.Conversions = &I[NumInlineSequences]; - NumInlineSequences += NumConversions; - } else { - // Otherwise get memory from the allocator. - C.Conversions = ConversionSequenceAllocator - .Allocate(NumConversions); - } - - // Construct the new objects. - for (unsigned i = 0; i != NumConversions; ++i) - new (&C.Conversions[i]) ImplicitConversionSequence(); - - C.NumConversions = NumConversions; + C.Conversions = Conversions.empty() + ? allocateConversionSequences(NumConversions) + : Conversions; return C; } Modified: vendor/clang/dist/include/clang/Sema/Sema.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Sema.h Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/Sema/Sema.h Mon Jan 9 21:23:21 2017 (r311820) @@ -27,6 +27,7 @@ #include "clang/AST/NSAPI.h" #include "clang/AST/PrettyPrinter.h" #include "clang/AST/TypeLoc.h" +#include "clang/AST/TypeOrdering.h" #include "clang/Basic/ExpressionTraits.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/Module.h" @@ -119,6 +120,7 @@ namespace clang { class FunctionProtoType; class FunctionTemplateDecl; class ImplicitConversionSequence; + typedef MutableArrayRef ConversionSequenceList; class InitListExpr; class InitializationKind; class InitializationSequence; @@ -806,6 +808,12 @@ public: /// run time. Unevaluated, + /// \brief The current expression occurs within a braced-init-list within + /// an unevaluated operand. This is mostly like a regular unevaluated + /// context, except that we still instantiate constexpr functions that are + /// referenced here so that we can perform narrowing checks correctly. + UnevaluatedList, + /// \brief The current expression occurs within a discarded statement. /// This behaves largely similarly to an unevaluated operand in preventing /// definitions from being required, but not in other ways. @@ -898,7 +906,8 @@ public: MangleNumberingContext &getMangleNumberingContext(ASTContext &Ctx); bool isUnevaluated() const { - return Context == Unevaluated || Context == UnevaluatedAbstract; + return Context == Unevaluated || Context == UnevaluatedAbstract || + Context == UnevaluatedList; } }; @@ -2510,10 +2519,11 @@ public: void AddOverloadCandidate(FunctionDecl *Function, DeclAccessPair FoundDecl, ArrayRef Args, - OverloadCandidateSet& CandidateSet, + OverloadCandidateSet &CandidateSet, bool SuppressUserConversions = false, bool PartialOverloading = false, - bool AllowExplicit = false); + bool AllowExplicit = false, + ConversionSequenceList EarlyConversions = None); void AddFunctionCandidates(const UnresolvedSetImpl &Functions, ArrayRef Args, OverloadCandidateSet &CandidateSet, @@ -2523,23 +2533,25 @@ public: void AddMethodCandidate(DeclAccessPair FoundDecl, QualType ObjectType, Expr::Classification ObjectClassification, - ArrayRef Args, + Expr *ThisArg, ArrayRef Args, OverloadCandidateSet& CandidateSet, bool SuppressUserConversion = false); void AddMethodCandidate(CXXMethodDecl *Method, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, QualType ObjectType, Expr::Classification ObjectClassification, - ArrayRef Args, + Expr *ThisArg, ArrayRef Args, OverloadCandidateSet& CandidateSet, bool SuppressUserConversions = false, - bool PartialOverloading = false); + bool PartialOverloading = false, + ConversionSequenceList EarlyConversions = None); void AddMethodTemplateCandidate(FunctionTemplateDecl *MethodTmpl, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, TemplateArgumentListInfo *ExplicitTemplateArgs, QualType ObjectType, Expr::Classification ObjectClassification, + Expr *ThisArg, ArrayRef Args, OverloadCandidateSet& CandidateSet, bool SuppressUserConversions = false, @@ -2551,6 +2563,16 @@ public: OverloadCandidateSet& CandidateSet, bool SuppressUserConversions = false, bool PartialOverloading = false); + bool CheckNonDependentConversions(FunctionTemplateDecl *FunctionTemplate, + ArrayRef ParamTypes, + ArrayRef Args, + OverloadCandidateSet &CandidateSet, + ConversionSequenceList &Conversions, + bool SuppressUserConversions, + CXXRecordDecl *ActingContext = nullptr, + QualType ObjectType = QualType(), + Expr::Classification + ObjectClassification = {}); void AddConversionCandidate(CXXConversionDecl *Conversion, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, @@ -2603,6 +2625,38 @@ public: EnableIfAttr *CheckEnableIf(FunctionDecl *Function, ArrayRef Args, bool MissingImplicitThis = false); + /// Check the diagnose_if attributes on the given function. Returns the + /// first succesful fatal attribute, or null if calling Function(Args) isn't + /// an error. + /// + /// This only considers ArgDependent DiagnoseIfAttrs. + /// + /// This will populate Nonfatal with all non-error DiagnoseIfAttrs that + /// succeed. If this function returns non-null, the contents of Nonfatal are + /// unspecified. + DiagnoseIfAttr * + checkArgDependentDiagnoseIf(FunctionDecl *Function, ArrayRef Args, + SmallVectorImpl &Nonfatal, + bool MissingImplicitThis = false, + Expr *ThisArg = nullptr); + + /// Check the diagnose_if expressions on the given function. Returns the + /// first succesful fatal attribute, or null if using Function isn't + /// an error. + /// + /// This ignores all ArgDependent DiagnoseIfAttrs. + /// + /// This will populate Nonfatal with all non-error DiagnoseIfAttrs that + /// succeed. If this function returns non-null, the contents of Nonfatal are + /// unspecified. + DiagnoseIfAttr * + checkArgIndependentDiagnoseIf(FunctionDecl *Function, + SmallVectorImpl &Nonfatal); + + /// Emits the diagnostic contained in the given DiagnoseIfAttr at Loc. Also + /// emits a note about the location of said attribute. + void emitDiagnoseIfDiagnostic(SourceLocation Loc, const DiagnoseIfAttr *DIA); + /// Returns whether the given function's address can be taken or not, /// optionally emitting a diagnostic if the address can't be taken. /// @@ -3801,6 +3855,9 @@ public: /// variable will have in the given scope. QualType getCapturedDeclRefType(VarDecl *Var, SourceLocation Loc); + /// Mark all of the declarations referenced within a particular AST node as + /// referenced. Used when template instantiation instantiates a non-dependent + /// type -- entities referenced by the type are now referenced. void MarkDeclarationsReferencedInType(SourceLocation Loc, QualType T); void MarkDeclarationsReferencedInExpr(Expr *E, bool SkipLocalVariables = false); @@ -6580,6 +6637,8 @@ public: /// \brief The explicitly-specified template arguments were not valid /// template arguments for the given template. TDK_InvalidExplicitArguments, + /// \brief Checking non-dependent argument conversions failed. + TDK_NonDependentConversionFailure, /// \brief Deduction failed; that's all we know. TDK_MiscellaneousDeductionFailure, /// \brief CUDA Target attributes do not match. @@ -6618,22 +6677,21 @@ public: QualType OriginalArgType; }; - TemplateDeductionResult - FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate, - SmallVectorImpl &Deduced, - unsigned NumExplicitlySpecified, - FunctionDecl *&Specialization, - sema::TemplateDeductionInfo &Info, - SmallVectorImpl const *OriginalCallArgs = nullptr, - bool PartialOverloading = false); + TemplateDeductionResult FinishTemplateArgumentDeduction( + FunctionTemplateDecl *FunctionTemplate, + SmallVectorImpl &Deduced, + unsigned NumExplicitlySpecified, FunctionDecl *&Specialization, + sema::TemplateDeductionInfo &Info, + SmallVectorImpl const *OriginalCallArgs = nullptr, + bool PartialOverloading = false, + llvm::function_ref CheckNonDependent = []{ return false; }); - TemplateDeductionResult - DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate, - TemplateArgumentListInfo *ExplicitTemplateArgs, - ArrayRef Args, - FunctionDecl *&Specialization, - sema::TemplateDeductionInfo &Info, - bool PartialOverloading = false); + TemplateDeductionResult DeduceTemplateArguments( + FunctionTemplateDecl *FunctionTemplate, + TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef Args, + FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info, + bool PartialOverloading, + llvm::function_ref)> CheckNonDependent); TemplateDeductionResult DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate, @@ -6877,6 +6935,10 @@ public: /// Specializations whose definitions are currently being instantiated. llvm::DenseSet> InstantiatingSpecializations; + /// Non-dependent types used in templates that have already been instantiated + /// by some template instantiation. + llvm::DenseSet InstantiatedNonDependentTypes; + /// \brief Extra modules inspected when performing a lookup during a template /// instantiation. Computed lazily. SmallVector ActiveTemplateInstantiationLookupModules; @@ -10186,6 +10248,22 @@ public: IsDecltype); } + enum InitListTag { InitList }; + EnterExpressionEvaluationContext(Sema &Actions, InitListTag, + bool ShouldEnter = true) + : Actions(Actions), Entered(false) { + // In C++11 onwards, narrowing checks are performed on the contents of + // braced-init-lists, even when they occur within unevaluated operands. + // Therefore we still need to instantiate constexpr functions used in such + // a context. + if (ShouldEnter && Actions.isUnevaluatedContext() && + Actions.getLangOpts().CPlusPlus11) { + Actions.PushExpressionEvaluationContext(Sema::UnevaluatedList, nullptr, + false); + Entered = true; + } + } + ~EnterExpressionEvaluationContext() { if (Entered) Actions.PopExpressionEvaluationContext(); Modified: vendor/clang/dist/include/clang/StaticAnalyzer/Checkers/Checkers.td ============================================================================== --- vendor/clang/dist/include/clang/StaticAnalyzer/Checkers/Checkers.td Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/include/clang/StaticAnalyzer/Checkers/Checkers.td Mon Jan 9 21:23:21 2017 (r311820) @@ -278,6 +278,14 @@ def VirtualCallChecker : Checker<"Virtua } // end: "optin.cplusplus" +let ParentPackage = CplusplusAlpha in { + +def IteratorPastEndChecker : Checker<"IteratorPastEnd">, + HelpText<"Check iterators used past end">, + DescFile<"IteratorPastEndChecker.cpp">; + +} // end: "alpha.cplusplus" + //===----------------------------------------------------------------------===// // Valist checkers. Modified: vendor/clang/dist/lib/AST/ExprConstant.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ExprConstant.cpp Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/lib/AST/ExprConstant.cpp Mon Jan 9 21:23:21 2017 (r311820) @@ -4543,6 +4543,12 @@ public: Call.getLValueBase().dyn_cast()); if (!FD) return Error(Callee); + // Don't call function pointers which have been cast to some other type. + // Per DR (no number yet), the caller and callee can differ in noexcept. + if (!Info.Ctx.hasSameFunctionTypeIgnoringExceptionSpec( + CalleeType->getPointeeType(), FD->getType())) { + return Error(E); + } // Overloaded operator calls to member functions are represented as normal // calls with '*this' as the first argument. @@ -4558,14 +4564,42 @@ public: return false; This = &ThisVal; Args = Args.slice(1); + } else if (MD && MD->isLambdaStaticInvoker()) { + // Map the static invoker for the lambda back to the call operator. + // Conveniently, we don't have to slice out the 'this' argument (as is + // being done for the non-static case), since a static member function + // doesn't have an implicit argument passed in. + const CXXRecordDecl *ClosureClass = MD->getParent(); + assert( + ClosureClass->captures_begin() == ClosureClass->captures_end() && + "Number of captures must be zero for conversion to function-ptr"); + + const CXXMethodDecl *LambdaCallOp = + ClosureClass->getLambdaCallOperator(); + + // Set 'FD', the function that will be called below, to the call + // operator. If the closure object represents a generic lambda, find + // the corresponding specialization of the call operator. + + if (ClosureClass->isGenericLambda()) { + assert(MD->isFunctionTemplateSpecialization() && + "A generic lambda's static-invoker function must be a " + "template specialization"); + const TemplateArgumentList *TAL = MD->getTemplateSpecializationArgs(); + FunctionTemplateDecl *CallOpTemplate = + LambdaCallOp->getDescribedFunctionTemplate(); + void *InsertPos = nullptr; + FunctionDecl *CorrespondingCallOpSpecialization = + CallOpTemplate->findSpecialization(TAL->asArray(), InsertPos); + assert(CorrespondingCallOpSpecialization && + "We must always have a function call operator specialization " + "that corresponds to our static invoker specialization"); + FD = cast(CorrespondingCallOpSpecialization); + } else + FD = LambdaCallOp; } - // Don't call function pointers which have been cast to some other type. - // Per DR (no number yet), the caller and callee can differ in noexcept. - if (!Info.Ctx.hasSameFunctionTypeIgnoringExceptionSpec( - CalleeType->getPointeeType(), FD->getType())) { - return Error(E); - } + } else return Error(E); @@ -5834,6 +5868,7 @@ namespace { bool VisitCXXConstructExpr(const CXXConstructExpr *E) { return VisitCXXConstructExpr(E, E->getType()); } + bool VisitLambdaExpr(const LambdaExpr *E); bool VisitCXXInheritedCtorInitExpr(const CXXInheritedCtorInitExpr *E); bool VisitCXXConstructExpr(const CXXConstructExpr *E, QualType T); bool VisitCXXStdInitializerListExpr(const CXXStdInitializerListExpr *E); @@ -6168,6 +6203,21 @@ bool RecordExprEvaluator::VisitCXXStdIni return true; } +bool RecordExprEvaluator::VisitLambdaExpr(const LambdaExpr *E) { + const CXXRecordDecl *ClosureClass = E->getLambdaClass(); + if (ClosureClass->isInvalidDecl()) return false; + + if (Info.checkingPotentialConstantExpression()) return true; + if (E->capture_size()) { + Info.FFDiag(E, diag::note_unimplemented_constexpr_lambda_feature_ast) + << "can not evaluate lambda expressions with captures"; + return false; + } + // FIXME: Implement captures. + Result = APValue(APValue::UninitStruct(), /*NumBases*/0, /*NumFields*/0); + return true; +} + static bool EvaluateRecord(const Expr *E, const LValue &This, APValue &Result, EvalInfo &Info) { assert(E->isRValue() && E->getType()->isRecordType() && @@ -6217,6 +6267,9 @@ public: bool VisitCXXStdInitializerListExpr(const CXXStdInitializerListExpr *E) { return VisitConstructExpr(E); } + bool VisitLambdaExpr(const LambdaExpr *E) { + return VisitConstructExpr(E); + } }; } // end anonymous namespace @@ -10357,10 +10410,25 @@ bool Expr::isCXX11ConstantExpr(const AST bool Expr::EvaluateWithSubstitution(APValue &Value, ASTContext &Ctx, const FunctionDecl *Callee, - ArrayRef Args) const { + ArrayRef Args, + const Expr *This) const { Expr::EvalStatus Status; EvalInfo Info(Ctx, Status, EvalInfo::EM_ConstantExpressionUnevaluated); + LValue ThisVal; + const LValue *ThisPtr = nullptr; + if (This) { +#ifndef NDEBUG + auto *MD = dyn_cast(Callee); + assert(MD && "Don't provide `this` for non-methods."); + assert(!MD->isStatic() && "Don't provide `this` for static methods."); +#endif + if (EvaluateObjectArgument(Info, This, ThisVal)) + ThisPtr = &ThisVal; + if (Info.EvalStatus.HasSideEffects) + return false; + } + ArgVector ArgValues(Args.size()); for (ArrayRef::iterator I = Args.begin(), E = Args.end(); I != E; ++I) { @@ -10373,7 +10441,7 @@ bool Expr::EvaluateWithSubstitution(APVa } // Build fake call to Callee. - CallStackFrame Frame(Info, Callee->getLocation(), Callee, /*This*/nullptr, + CallStackFrame Frame(Info, Callee->getLocation(), Callee, ThisPtr, ArgValues.data()); return Evaluate(Value, Info, this) && !Info.EvalStatus.HasSideEffects; } Modified: vendor/clang/dist/lib/AST/MicrosoftMangle.cpp ============================================================================== --- vendor/clang/dist/lib/AST/MicrosoftMangle.cpp Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/lib/AST/MicrosoftMangle.cpp Mon Jan 9 21:23:21 2017 (r311820) @@ -109,13 +109,13 @@ static const DeclContext *getEffectivePa static const FunctionDecl *getStructor(const NamedDecl *ND) { if (const auto *FTD = dyn_cast(ND)) - return FTD->getTemplatedDecl(); + return FTD->getTemplatedDecl()->getCanonicalDecl(); const auto *FD = cast(ND); if (const auto *FTD = FD->getPrimaryTemplate()) - return FTD->getTemplatedDecl(); + return FTD->getTemplatedDecl()->getCanonicalDecl(); - return FD; + return FD->getCanonicalDecl(); } /// MicrosoftMangleContextImpl - Overrides the default MangleContext for the @@ -312,6 +312,10 @@ public: void mangleNestedName(const NamedDecl *ND); private: + bool isStructorDecl(const NamedDecl *ND) const { + return ND == Structor || getStructor(ND) == Structor; + } + void mangleUnqualifiedName(const NamedDecl *ND) { mangleUnqualifiedName(ND, ND->getDeclName()); } @@ -898,7 +902,7 @@ void MicrosoftCXXNameMangler::mangleUnqu llvm_unreachable("Can't mangle Objective-C selector names here!"); case DeclarationName::CXXConstructorName: - if (Structor == getStructor(ND)) { + if (isStructorDecl(ND)) { if (StructorType == Ctor_CopyingClosure) { Out << "?_O"; return; @@ -912,7 +916,7 @@ void MicrosoftCXXNameMangler::mangleUnqu return; case DeclarationName::CXXDestructorName: - if (ND == Structor) + if (isStructorDecl(ND)) // If the named decl is the C++ destructor we're mangling, // use the type we were given. mangleCXXDtorType(static_cast(StructorType)); @@ -1862,7 +1866,7 @@ void MicrosoftCXXNameMangler::mangleFunc IsStructor = true; IsCtorClosure = (StructorType == Ctor_CopyingClosure || StructorType == Ctor_DefaultClosure) && - getStructor(MD) == Structor; + isStructorDecl(MD); if (IsCtorClosure) CC = getASTContext().getDefaultCallingConvention( /*IsVariadic=*/false, /*IsCXXMethod=*/true); @@ -1883,7 +1887,7 @@ void MicrosoftCXXNameMangler::mangleFunc // ::= // ::= @ # structors (they have no declared return type) if (IsStructor) { - if (isa(D) && D == Structor && + if (isa(D) && isStructorDecl(D) && StructorType == Dtor_Deleting) { // The scalar deleting destructor takes an extra int argument. // However, the FunctionType generated has 0 arguments. Modified: vendor/clang/dist/lib/CodeGen/BackendUtil.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/BackendUtil.cpp Mon Jan 9 21:23:15 2017 (r311819) +++ vendor/clang/dist/lib/CodeGen/BackendUtil.cpp Mon Jan 9 21:23:21 2017 (r311820) @@ -312,7 +312,8 @@ void EmitAssemblyHelper::CreatePasses(le // At O0 and O1 we only run the always inliner which is more efficient. At // higher optimization levels we run the normal inliner. if (CodeGenOpts.OptimizationLevel <= 1) { - bool InsertLifetimeIntrinsics = CodeGenOpts.OptimizationLevel != 0; + bool InsertLifetimeIntrinsics = (CodeGenOpts.OptimizationLevel != 0 && + !CodeGenOpts.DisableLifetimeMarkers); PMBuilder.Inliner = createAlwaysInlinerLegacyPass(InsertLifetimeIntrinsics); } else { PMBuilder.Inliner = createFunctionInliningPass( @@ -519,11 +520,22 @@ void EmitAssemblyHelper::CreateTargetMac .Case("dynamic-no-pic", llvm::Reloc::DynamicNoPIC); assert(RM.hasValue() && "invalid PIC model!"); - CodeGenOpt::Level OptLevel = CodeGenOpt::Default; + CodeGenOpt::Level OptLevel; switch (CodeGenOpts.OptimizationLevel) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE79FCA807A; Mon, 9 Jan 2017 21:23:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7641D116F; Mon, 9 Jan 2017 21:23:16 +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 v09LNFv6095539; Mon, 9 Jan 2017 21:23:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNFNv095538; Mon, 9 Jan 2017 21:23:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNFNv095538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311819 - vendor/llvm/llvm-trunk-r291476 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:16 -0000 Author: dim Date: Mon Jan 9 21:23:15 2017 New Revision: 311819 URL: https://svnweb.freebsd.org/changeset/base/311819 Log: Tag llvm trunk r291476. Added: vendor/llvm/llvm-trunk-r291476/ - copied from r311818, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CF39CA8104; Mon, 9 Jan 2017 21:23:35 +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 EB34B1320; Mon, 9 Jan 2017 21:23:34 +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 v09LNYkj095731; Mon, 9 Jan 2017 21:23:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNVw8095704; Mon, 9 Jan 2017 21:23:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNVw8095704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311822 - in vendor/compiler-rt/dist: cmake/Modules lib/asan lib/asan/scripts lib/asan/tests lib/builtins/arm lib/lsan lib/sanitizer_common lib/sanitizer_common/tests lib/stats lib/tsan... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:35 -0000 Author: dim Date: Mon Jan 9 21:23:31 2017 New Revision: 311822 URL: https://svnweb.freebsd.org/changeset/base/311822 Log: Vendor import of compiler-rt trunk r291476: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291476 Added: vendor/compiler-rt/dist/lib/asan/weak_symbols.txt (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/weak_symbols.txt (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/weak_symbols.txt (contents, props changed) vendor/compiler-rt/dist/test/asan/TestCases/Darwin/haswell-symbolication.cc (contents, props changed) vendor/compiler-rt/dist/test/asan/TestCases/Darwin/uuid.cc (contents, props changed) Modified: vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake vendor/compiler-rt/dist/lib/asan/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/asan_report.cc vendor/compiler-rt/dist/lib/asan/asan_rtl.cc vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/builtins/arm/aeabi_fcmp.S vendor/compiler-rt/dist/lib/builtins/arm/comparesf2.S vendor/compiler-rt/dist/lib/lsan/CMakeLists.txt vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc vendor/compiler-rt/dist/lib/lsan/lsan_common.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_internal_defs.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_printf.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_printer.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_printer.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_internal.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc vendor/compiler-rt/dist/lib/stats/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/rtl/tsan.syms.extra vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.cc vendor/compiler-rt/dist/lib/tsan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt vendor/compiler-rt/dist/lib/ubsan/ubsan_diag.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cc vendor/compiler-rt/dist/test/lit.common.cfg vendor/compiler-rt/dist/test/tsan/simple_stack2.cc Modified: vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake Mon Jan 9 21:23:31 2017 (r311822) @@ -46,6 +46,17 @@ macro(add_sanitizer_rt_symbols name) endforeach() endmacro() +# This function is only used on Darwin, where undefined symbols must be specified +# in the linker invocation. +function(add_weak_symbols libname linkflags) + file(STRINGS "${COMPILER_RT_SOURCE_DIR}/lib/${libname}/weak_symbols.txt" WEAK_SYMBOLS) + set(local_linkflags ${${linkflags}}) + foreach(SYMBOL ${WEAK_SYMBOLS}) + set(local_linkflags ${local_linkflags} -Wl,-U,${SYMBOL}) + endforeach() + set(${linkflags} ${local_linkflags} PARENT_SCOPE) +endfunction() + macro(add_sanitizer_rt_version_list name) set(vers ${CMAKE_CURRENT_BINARY_DIR}/${name}.vers) cmake_parse_arguments(ARG "" "" "LIBS;EXTRA" ${ARGN}) Modified: vendor/compiler-rt/dist/lib/asan/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/asan/CMakeLists.txt Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/asan/CMakeLists.txt Mon Jan 9 21:23:31 2017 (r311822) @@ -106,6 +106,10 @@ endif() add_compiler_rt_component(asan) if(APPLE) + add_weak_symbols("asan" WEAK_SYMBOL_LINKFLAGS) + add_weak_symbols("ubsan" WEAK_SYMBOL_LINKFLAGS) + add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINKFLAGS) + add_compiler_rt_runtime(clang_rt.asan SHARED OS ${SANITIZER_COMMON_SUPPORTED_OS} @@ -117,6 +121,7 @@ if(APPLE) RTLSanCommon RTUbsan CFLAGS ${ASAN_DYNAMIC_CFLAGS} + LINKFLAGS ${WEAK_SYMBOL_LINKFLAGS} DEFS ${ASAN_DYNAMIC_DEFINITIONS} PARENT_TARGET asan) else() Modified: vendor/compiler-rt/dist/lib/asan/asan_report.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_report.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/asan/asan_report.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -179,6 +179,8 @@ class ScopedInErrorReport { if (common_flags()->print_cmdline) PrintCmdline(); + if (common_flags()->print_module_map == 2) PrintModuleMap(); + // Copy the message buffer so that we could start logging without holding a // lock that gets aquired during printing. InternalScopedBuffer buffer_copy(kErrorMessageBufferSize); Modified: vendor/compiler-rt/dist/lib/asan/asan_rtl.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_rtl.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/asan/asan_rtl.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -46,6 +46,7 @@ static void AsanDie() { // Don't die twice - run a busy loop. while (1) { } } + if (common_flags()->print_module_map >= 1) PrintModuleMap(); if (flags()->sleep_before_dying) { Report("Sleeping for %d second(s)\n", flags()->sleep_before_dying); SleepForSeconds(flags()->sleep_before_dying); Modified: vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py ============================================================================== --- vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py Mon Jan 9 21:23:31 2017 (r311822) @@ -24,6 +24,7 @@ binary_name_filter = None fix_filename_patterns = None logfile = sys.stdin allow_system_symbolizer = True +force_system_symbolizer = False # FIXME: merge the code that calls fix_filename(). def fix_filename(file_name): @@ -37,6 +38,10 @@ def fix_filename(file_name): def sysroot_path_filter(binary_name): return sysroot_path + binary_name +def is_valid_arch(s): + return s in ["i386", "x86_64", "x86_64h", "arm", "armv6", "armv7", "armv7s", + "armv7k", "arm64", "powerpc64", "powerpc64le", "s390x", "s390"] + def guess_arch(addr): # Guess which arch we're running. 10 = len('0x') + 8 hex digits. if len(addr) > 10: @@ -206,10 +211,10 @@ class UnbufferedLineConverter(object): class DarwinSymbolizer(Symbolizer): - def __init__(self, addr, binary): + def __init__(self, addr, binary, arch): super(DarwinSymbolizer, self).__init__() self.binary = binary - self.arch = guess_arch(addr) + self.arch = arch self.open_atos() def open_atos(self): @@ -268,9 +273,9 @@ def BreakpadSymbolizerFactory(binary): return None -def SystemSymbolizerFactory(system, addr, binary): +def SystemSymbolizerFactory(system, addr, binary, arch): if system == 'Darwin': - return DarwinSymbolizer(addr, binary) + return DarwinSymbolizer(addr, binary, arch) elif system == 'Linux' or system == 'FreeBSD': return Addr2LineSymbolizer(binary) @@ -369,7 +374,7 @@ class SymbolizationLoop(object): self.frame_no = 0 self.process_line = self.process_line_posix - def symbolize_address(self, addr, binary, offset): + def symbolize_address(self, addr, binary, offset, arch): # On non-Darwin (i.e. on platforms without .dSYM debug info) always use # a single symbolizer binary. # On Darwin, if the dsym hint producer is present: @@ -381,31 +386,35 @@ class SymbolizationLoop(object): # if so, reuse |last_llvm_symbolizer| which has the full set of hints; # 3. otherwise create a new symbolizer and pass all currently known # .dSYM hints to it. - if not binary in self.llvm_symbolizers: - use_new_symbolizer = True - if self.system == 'Darwin' and self.dsym_hint_producer: - dsym_hints_for_binary = set(self.dsym_hint_producer(binary)) - use_new_symbolizer = bool(dsym_hints_for_binary - self.dsym_hints) - self.dsym_hints |= dsym_hints_for_binary - if self.last_llvm_symbolizer and not use_new_symbolizer: + result = None + if not force_system_symbolizer: + if not binary in self.llvm_symbolizers: + use_new_symbolizer = True + if self.system == 'Darwin' and self.dsym_hint_producer: + dsym_hints_for_binary = set(self.dsym_hint_producer(binary)) + use_new_symbolizer = bool(dsym_hints_for_binary - self.dsym_hints) + self.dsym_hints |= dsym_hints_for_binary + if self.last_llvm_symbolizer and not use_new_symbolizer: + self.llvm_symbolizers[binary] = self.last_llvm_symbolizer + else: + self.last_llvm_symbolizer = LLVMSymbolizerFactory( + self.system, arch, self.dsym_hints) self.llvm_symbolizers[binary] = self.last_llvm_symbolizer - else: - self.last_llvm_symbolizer = LLVMSymbolizerFactory( - self.system, guess_arch(addr), self.dsym_hints) - self.llvm_symbolizers[binary] = self.last_llvm_symbolizer - # Use the chain of symbolizers: - # Breakpad symbolizer -> LLVM symbolizer -> addr2line/atos - # (fall back to next symbolizer if the previous one fails). - if not binary in symbolizers: - symbolizers[binary] = ChainSymbolizer( - [BreakpadSymbolizerFactory(binary), self.llvm_symbolizers[binary]]) - result = symbolizers[binary].symbolize(addr, binary, offset) + # Use the chain of symbolizers: + # Breakpad symbolizer -> LLVM symbolizer -> addr2line/atos + # (fall back to next symbolizer if the previous one fails). + if not binary in symbolizers: + symbolizers[binary] = ChainSymbolizer( + [BreakpadSymbolizerFactory(binary), self.llvm_symbolizers[binary]]) + result = symbolizers[binary].symbolize(addr, binary, offset) + else: + symbolizers[binary] = ChainSymbolizer([]) if result is None: if not allow_system_symbolizer: raise Exception('Failed to launch or use llvm-symbolizer.') # Initialize system symbolizer only if other symbolizers failed. symbolizers[binary].append_symbolizer( - SystemSymbolizerFactory(self.system, addr, binary)) + SystemSymbolizerFactory(self.system, addr, binary, arch)) result = symbolizers[binary].symbolize(addr, binary, offset) # The system symbolizer must produce some result. assert result @@ -441,16 +450,26 @@ class SymbolizationLoop(object): if DEBUG: print line _, frameno_str, addr, binary, offset = match.groups() + arch = "" + # Arch can be embedded in the filename, e.g.: "libabc.dylib:x86_64h" + colon_pos = binary.rfind(":") + if colon_pos != -1: + maybe_arch = binary[colon_pos+1:] + if is_valid_arch(maybe_arch): + arch = maybe_arch + binary = binary[0:colon_pos] + if arch == "": + arch = guess_arch(addr) if frameno_str == '0': # Assume that frame #0 is the first frame of new stack trace. self.frame_no = 0 original_binary = binary if self.binary_name_filter: binary = self.binary_name_filter(binary) - symbolized_line = self.symbolize_address(addr, binary, offset) + symbolized_line = self.symbolize_address(addr, binary, offset, arch) if not symbolized_line: if original_binary != binary: - symbolized_line = self.symbolize_address(addr, binary, offset) + symbolized_line = self.symbolize_address(addr, binary, offset, arch) return self.get_symbolized_lines(symbolized_line) @@ -472,6 +491,8 @@ if __name__ == '__main__': parser.add_argument('-l','--logfile', default=sys.stdin, type=argparse.FileType('r'), help='set log file name to parse, default is stdin') + parser.add_argument('--force-system-symbolizer', action='store_true', + help='don\'t use llvm-symbolizer') args = parser.parse_args() if args.path_to_cut: fix_filename_patterns = args.path_to_cut @@ -486,5 +507,9 @@ if __name__ == '__main__': logfile = args.logfile else: logfile = sys.stdin + if args.force_system_symbolizer: + force_system_symbolizer = True + if force_system_symbolizer: + assert(allow_system_symbolizer) loop = SymbolizationLoop(binary_name_filter) loop.process_logfile() Modified: vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt Mon Jan 9 21:23:31 2017 (r311822) @@ -59,6 +59,11 @@ list(APPEND ASAN_UNITTEST_COMMON_CFLAGS if(APPLE) list(APPEND ASAN_UNITTEST_COMMON_CFLAGS ${DARWIN_osx_CFLAGS}) list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS ${DARWIN_osx_LINKFLAGS}) + + add_weak_symbols("asan" WEAK_SYMBOL_LINKFLAGS) + add_weak_symbols("ubsan" WEAK_SYMBOL_LINKFLAGS) + add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINKFLAGS) + list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS ${WEAK_SYMBOL_LINKFLAGS}) endif() if(MSVC) Added: vendor/compiler-rt/dist/lib/asan/weak_symbols.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/asan/weak_symbols.txt Mon Jan 9 21:23:31 2017 (r311822) @@ -0,0 +1,3 @@ +___asan_default_options +___asan_default_suppressions +___asan_on_error Modified: vendor/compiler-rt/dist/lib/builtins/arm/aeabi_fcmp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/aeabi_fcmp.S Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/builtins/arm/aeabi_fcmp.S Mon Jan 9 21:23:31 2017 (r311822) @@ -26,10 +26,10 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_fcmp bl SYMBOL_NAME(__ ## cond ## sf2) SEPARATOR \ cmp r0, #0 SEPARATOR \ b ## cond 1f SEPARATOR \ - mov r0, #0 SEPARATOR \ + movs r0, #0 SEPARATOR \ pop { r4, pc } SEPARATOR \ 1: SEPARATOR \ - mov r0, #1 SEPARATOR \ + movs r0, #1 SEPARATOR \ pop { r4, pc } SEPARATOR \ END_COMPILERRT_FUNCTION(__aeabi_fcmp ## cond) Modified: vendor/compiler-rt/dist/lib/builtins/arm/comparesf2.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/comparesf2.S Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/builtins/arm/comparesf2.S Mon Jan 9 21:23:31 2017 (r311822) @@ -47,27 +47,50 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2) // Make copies of a and b with the sign bit shifted off the top. These will // be used to detect zeros and NaNs. +#if __ARM_ARCH_ISA_THUMB == 1 + push {r6, lr} + lsls r2, r0, #1 + lsls r3, r1, #1 +#else mov r2, r0, lsl #1 mov r3, r1, lsl #1 +#endif // We do the comparison in three stages (ignoring NaN values for the time // being). First, we orr the absolute values of a and b; this sets the Z // flag if both a and b are zero (of either sign). The shift of r3 doesn't // effect this at all, but it *does* make sure that the C flag is clear for // the subsequent operations. +#if __ARM_ARCH_ISA_THUMB == 1 + lsrs r6, r3, #1 + orrs r6, r2, r6 +#else orrs r12, r2, r3, lsr #1 - +#endif // Next, we check if a and b have the same or different signs. If they have // opposite signs, this eor will set the N flag. +#if __ARM_ARCH_ISA_THUMB == 1 + beq 1f + movs r6, r0 + eors r6, r1 +1: +#else it ne eorsne r12, r0, r1 +#endif // If a and b are equal (either both zeros or bit identical; again, we're // ignoring NaNs for now), this subtract will zero out r0. If they have the // same sign, the flags are updated as they would be for a comparison of the // absolute values of a and b. +#if __ARM_ARCH_ISA_THUMB == 1 + bmi 1f + subs r0, r2, r3 +1: +#else it pl subspl r0, r2, r3 +#endif // If a is smaller in magnitude than b and both have the same sign, place // the negation of the sign of b in r0. Thus, if both are negative and @@ -79,30 +102,69 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2) // still clear from the shift argument in orrs; if a is positive and b // negative, this places 0 in r0; if a is negative and b positive, -1 is // placed in r0. +#if __ARM_ARCH_ISA_THUMB == 1 + bhs 1f + // Here if a and b have the same sign and absA < absB, the result is thus + // b < 0 ? 1 : -1. Same if a and b have the opposite sign (ignoring Nan). + movs r0, #1 + lsrs r1, #31 + bne LOCAL_LABEL(CHECK_NAN) + negs r0, r0 + b LOCAL_LABEL(CHECK_NAN) +1: +#else it lo mvnlo r0, r1, asr #31 +#endif // If a is greater in magnitude than b and both have the same sign, place // the sign of b in r0. Thus, if both are negative and a < b, -1 is placed // in r0, which is the desired result. Conversely, if both are positive // and a > b, zero is placed in r0. +#if __ARM_ARCH_ISA_THUMB == 1 + bls 1f + // Here both have the same sign and absA > absB. + movs r0, #1 + lsrs r1, #31 + beq LOCAL_LABEL(CHECK_NAN) + negs r0, r0 +1: +#else it hi movhi r0, r1, asr #31 +#endif // If you've been keeping track, at this point r0 contains -1 if a < b and // 0 if a >= b. All that remains to be done is to set it to 1 if a > b. // If a == b, then the Z flag is set, so we can get the correct final value // into r0 by simply or'ing with 1 if Z is clear. + // For Thumb-1, r0 contains -1 if a < b, 0 if a > b and 0 if a == b. +#if __ARM_ARCH_ISA_THUMB != 1 it ne orrne r0, r0, #1 +#endif // Finally, we need to deal with NaNs. If either argument is NaN, replace // the value in r0 with 1. +#if __ARM_ARCH_ISA_THUMB == 1 +LOCAL_LABEL(CHECK_NAN): + movs r6, #0xff + lsls r6, #24 + cmp r2, r6 + bhi 1f + cmp r3, r6 +1: + bls 2f + movs r0, #1 +2: + pop {r6, pc} +#else cmp r2, #0xff000000 ite ls cmpls r3, #0xff000000 movhi r0, #1 JMP(lr) +#endif END_COMPILERRT_FUNCTION(__eqsf2) DEFINE_COMPILERRT_FUNCTION_ALIAS(__lesf2, __eqsf2) DEFINE_COMPILERRT_FUNCTION_ALIAS(__ltsf2, __eqsf2) @@ -111,11 +173,48 @@ DEFINE_COMPILERRT_FUNCTION_ALIAS(__nesf2 .p2align 2 DEFINE_COMPILERRT_FUNCTION(__gtsf2) // Identical to the preceding except in that we return -1 for NaN values. - // Given that the two paths share so much code, one might be tempted to + // Given that the two paths share so much code, one might be tempted to // unify them; however, the extra code needed to do so makes the code size // to performance tradeoff very hard to justify for such small functions. - mov r2, r0, lsl #1 - mov r3, r1, lsl #1 +#if __ARM_ARCH_ISA_THUMB == 1 + push {r6, lr} + lsls r2, r0, #1 + lsls r3, r1, #1 + lsrs r6, r3, #1 + orrs r6, r2, r6 + beq 1f + movs r6, r0 + eors r6, r1 +1: + bmi 2f + subs r0, r2, r3 +2: + bhs 3f + movs r0, #1 + lsrs r1, #31 + bne LOCAL_LABEL(CHECK_NAN_2) + negs r0, r0 + b LOCAL_LABEL(CHECK_NAN_2) +3: + bls 4f + movs r0, #1 + lsrs r1, #31 + beq LOCAL_LABEL(CHECK_NAN_2) + negs r0, r0 +4: +LOCAL_LABEL(CHECK_NAN_2): + movs r6, #0xff + lsls r6, #24 + cmp r2, r6 + bhi 5f + cmp r3, r6 +5: + bls 6f + movs r0, #1 + negs r0, r0 +6: + pop {r6, pc} +#else orrs r12, r2, r3, lsr #1 it ne eorsne r12, r0, r1 @@ -132,19 +231,32 @@ DEFINE_COMPILERRT_FUNCTION(__gtsf2) cmpls r3, #0xff000000 movhi r0, #-1 JMP(lr) +#endif END_COMPILERRT_FUNCTION(__gtsf2) DEFINE_COMPILERRT_FUNCTION_ALIAS(__gesf2, __gtsf2) .p2align 2 DEFINE_COMPILERRT_FUNCTION(__unordsf2) // Return 1 for NaN values, 0 otherwise. - mov r2, r0, lsl #1 - mov r3, r1, lsl #1 - mov r0, #0 + lsls r2, r0, #1 + lsls r3, r1, #1 + movs r0, #0 +#if __ARM_ARCH_ISA_THUMB == 1 + movs r1, #0xff + lsls r1, #24 + cmp r2, r1 + bhi 1f + cmp r3, r1 +1: + bls 2f + movs r0, #1 +2: +#else cmp r2, #0xff000000 ite ls cmpls r3, #0xff000000 movhi r0, #1 +#endif JMP(lr) END_COMPILERRT_FUNCTION(__unordsf2) Modified: vendor/compiler-rt/dist/lib/lsan/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/CMakeLists.txt Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/lsan/CMakeLists.txt Mon Jan 9 21:23:31 2017 (r311822) @@ -23,9 +23,8 @@ add_compiler_rt_object_libraries(RTLSanC CFLAGS ${LSAN_CFLAGS}) if(COMPILER_RT_HAS_LSAN) + add_compiler_rt_component(lsan) foreach(arch ${LSAN_SUPPORTED_ARCH}) - add_compiler_rt_component(lsan) - add_compiler_rt_runtime(clang_rt.lsan STATIC ARCHS ${arch} Modified: vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -258,4 +258,17 @@ SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_allocated_size(const void *p) { return GetMallocUsableSize(p); } + +#if !SANITIZER_SUPPORTS_WEAK_HOOKS +// Provide default (no-op) implementation of malloc hooks. +SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE +void __sanitizer_malloc_hook(void *ptr, uptr size) { + (void)ptr; + (void)size; +} +SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE +void __sanitizer_free_hook(void *ptr) { + (void)ptr; +} +#endif } // extern "C" Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -758,5 +758,10 @@ SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_ int __lsan_is_turned_off() { return 0; } + +SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE +const char *__lsan_default_suppressions() { + return ""; +} #endif } // extern "C" Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -270,6 +270,8 @@ void LoadedModule::set(const char *modul void LoadedModule::clear() { InternalFree(full_name_); + base_address_ = 0; + max_executable_address_ = 0; full_name_ = nullptr; arch_ = kModuleArchUnknown; internal_memset(uuid_, 0, kModuleUUIDSize); @@ -285,6 +287,8 @@ void LoadedModule::addAddressRange(uptr void *mem = InternalAlloc(sizeof(AddressRange)); AddressRange *r = new(mem) AddressRange(beg, end, executable); ranges_.push_back(r); + if (executable && end > max_executable_address_) + max_executable_address_ = end; } bool LoadedModule::containsAddress(uptr address) const { Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h Mon Jan 9 21:23:31 2017 (r311822) @@ -283,6 +283,7 @@ void UpdateProcessName(); void CacheBinaryName(); void DisableCoreDumperIfNecessary(); void DumpProcessMap(); +void PrintModuleMap(); bool FileExists(const char *filename); const char *GetEnv(const char *name); bool SetEnv(const char *name, const char *value); @@ -665,6 +666,32 @@ enum ModuleArch { kModuleArchARM64 }; +// When adding a new architecture, don't forget to also update +// script/asan_symbolize.py and sanitizer_symbolizer_libcdep.cc. +inline const char *ModuleArchToString(ModuleArch arch) { + switch (arch) { + case kModuleArchUnknown: + return ""; + case kModuleArchI386: + return "i386"; + case kModuleArchX86_64: + return "x86_64"; + case kModuleArchX86_64H: + return "x86_64h"; + case kModuleArchARMV6: + return "armv6"; + case kModuleArchARMV7: + return "armv7"; + case kModuleArchARMV7S: + return "armv7s"; + case kModuleArchARMV7K: + return "armv7k"; + case kModuleArchARM64: + return "arm64"; + } + CHECK(0 && "Invalid module arch"); +} + const uptr kModuleUUIDSize = 16; // Represents a binary loaded into virtual memory (e.g. this can be an @@ -674,6 +701,7 @@ class LoadedModule { LoadedModule() : full_name_(nullptr), base_address_(0), + max_executable_address_(0), arch_(kModuleArchUnknown), instrumented_(false) { internal_memset(uuid_, 0, kModuleUUIDSize); @@ -688,6 +716,7 @@ class LoadedModule { const char *full_name() const { return full_name_; } uptr base_address() const { return base_address_; } + uptr max_executable_address() const { return max_executable_address_; } ModuleArch arch() const { return arch_; } const u8 *uuid() const { return uuid_; } bool instrumented() const { return instrumented_; } @@ -707,6 +736,7 @@ class LoadedModule { private: char *full_name_; // Owned. uptr base_address_; + uptr max_executable_address_; ModuleArch arch_; u8 uuid_[kModuleUUIDSize]; bool instrumented_; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Mon Jan 9 21:23:31 2017 (r311822) @@ -74,6 +74,9 @@ COMMON_FLAG(bool, allocator_may_return_n COMMON_FLAG(bool, print_summary, true, "If false, disable printing error summaries in addition to error " "reports.") +COMMON_FLAG(int, print_module_map, 0, + "OS X only. 0 = don't print, 1 = print only once before process " + "exits, 2 = print after each report.") COMMON_FLAG(bool, check_printf, true, "Check printf arguments.") COMMON_FLAG(bool, handle_segv, true, "If set, registers the tool's custom SIGSEGV/SIGBUS handler.") Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_internal_defs.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_internal_defs.h Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_internal_defs.h Mon Jan 9 21:23:31 2017 (r311822) @@ -32,7 +32,7 @@ # define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak)) #endif -#if (SANITIZER_LINUX || SANITIZER_WINDOWS) && !SANITIZER_GO +#if (SANITIZER_LINUX || SANITIZER_MAC || SANITIZER_WINDOWS) && !SANITIZER_GO # define SANITIZER_SUPPORTS_WEAK_HOOKS 1 #else # define SANITIZER_SUPPORTS_WEAK_HOOKS 0 Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -1393,6 +1393,8 @@ void MaybeReexec() { // No need to re-exec on Linux. } +void PrintModuleMap() { } + uptr FindAvailableMemoryRange(uptr size, uptr alignment, uptr left_padding) { UNREACHABLE("FindAvailableMemoryRange is not available"); return 0; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -26,10 +26,7 @@ #include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" -#if SANITIZER_ANDROID || SANITIZER_FREEBSD #include // for dlsym() -#endif - #include #include #include Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -854,6 +854,36 @@ void SignalContext::DumpAllRegisters(voi # undef DUMPREG } +static inline bool CompareBaseAddress(const LoadedModule &a, + const LoadedModule &b) { + return a.base_address() < b.base_address(); +} + +void FormatUUID(char *out, uptr size, const u8 *uuid) { + internal_snprintf(out, size, + "<%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-" + "%02X%02X%02X%02X%02X%02X>", + uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], + uuid[6], uuid[7], uuid[8], uuid[9], uuid[10], uuid[11], + uuid[12], uuid[13], uuid[14], uuid[15]); +} + +void PrintModuleMap() { + Printf("Process module map:\n"); + MemoryMappingLayout memory_mapping(false); + InternalMmapVector modules(/*initial_capacity*/ 128); + memory_mapping.DumpListOfModules(&modules); + InternalSort(&modules, modules.size(), CompareBaseAddress); + for (uptr i = 0; i < modules.size(); ++i) { + char uuid_str[128]; + FormatUUID(uuid_str, sizeof(uuid_str), modules[i].uuid()); + Printf("0x%zx-0x%zx %s (%s) %s\n", modules[i].base_address(), + modules[i].max_executable_address(), modules[i].full_name(), + ModuleArchToString(modules[i].arch()), uuid_str); + } + Printf("End of module map.\n"); +} + } // namespace __sanitizer #endif // SANITIZER_MAC Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_printf.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_printf.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_printf.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -43,7 +43,7 @@ static int AppendChar(char **buff, const // on the value of |pad_with_zero|. static int AppendNumber(char **buff, const char *buff_end, u64 absolute_value, u8 base, u8 minimal_num_length, bool pad_with_zero, - bool negative) { + bool negative, bool uppercase) { uptr const kMaxLen = 30; RAW_CHECK(base == 10 || base == 16); RAW_CHECK(base == 10 || !negative); @@ -76,23 +76,25 @@ static int AppendNumber(char **buff, con if (negative && !pad_with_zero) result += AppendChar(buff, buff_end, '-'); for (; pos >= 0; pos--) { char digit = static_cast(num_buffer[pos]); - result += AppendChar(buff, buff_end, (digit < 10) ? '0' + digit - : 'a' + digit - 10); + digit = (digit < 10) ? '0' + digit : (uppercase ? 'A' : 'a') + digit - 10; + result += AppendChar(buff, buff_end, digit); } return result; } static int AppendUnsigned(char **buff, const char *buff_end, u64 num, u8 base, - u8 minimal_num_length, bool pad_with_zero) { + u8 minimal_num_length, bool pad_with_zero, + bool uppercase) { return AppendNumber(buff, buff_end, num, base, minimal_num_length, - pad_with_zero, false /* negative */); + pad_with_zero, false /* negative */, uppercase); } static int AppendSignedDecimal(char **buff, const char *buff_end, s64 num, u8 minimal_num_length, bool pad_with_zero) { bool negative = (num < 0); return AppendNumber(buff, buff_end, (u64)(negative ? -num : num), 10, - minimal_num_length, pad_with_zero, negative); + minimal_num_length, pad_with_zero, negative, + false /* uppercase */); } static int AppendString(char **buff, const char *buff_end, int precision, @@ -112,14 +114,16 @@ static int AppendPointer(char **buff, co int result = 0; result += AppendString(buff, buff_end, -1, "0x"); result += AppendUnsigned(buff, buff_end, ptr_value, 16, - SANITIZER_POINTER_FORMAT_LENGTH, true); + SANITIZER_POINTER_FORMAT_LENGTH, + true /* pad_with_zero */, false /* uppercase */); return result; } int VSNPrintf(char *buff, int buff_length, const char *format, va_list args) { static const char *kPrintfFormatsHelp = - "Supported Printf formats: %([0-9]*)?(z|ll)?{d,u,x}; %p; %(\\.\\*)?s; %c\n"; + "Supported Printf formats: %([0-9]*)?(z|ll)?{d,u,x,X}; %p; %(\\.\\*)?s; " + "%c\n"; RAW_CHECK(format); RAW_CHECK(buff_length > 0); const char *buff_end = &buff[buff_length - 1]; @@ -164,12 +168,14 @@ int VSNPrintf(char *buff, int buff_lengt break; } case 'u': - case 'x': { + case 'x': + case 'X': { uval = have_ll ? va_arg(args, u64) : have_z ? va_arg(args, uptr) : va_arg(args, unsigned); - result += AppendUnsigned(&buff, buff_end, uval, - (*cur == 'u') ? 10 : 16, width, pad_with_zero); + bool uppercase = (*cur == 'X'); + result += AppendUnsigned(&buff, buff_end, uval, (*cur == 'u') ? 10 : 16, + width, pad_with_zero, uppercase); break; } case 'p': { Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_printer.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_printer.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_printer.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -93,7 +93,7 @@ void RenderFrame(InternalScopedString *b vs_style, strip_path_prefix); } else if (info.module) { RenderModuleLocation(buffer, info.module, info.module_offset, - strip_path_prefix); + info.module_arch, strip_path_prefix); } else { buffer->append("()"); } @@ -103,8 +103,9 @@ void RenderFrame(InternalScopedString *b if (info.address & kExternalPCBit) {} // There PCs are not meaningful. else if (info.module) - buffer->append("(%s+%p)", StripModuleName(info.module), - (void *)info.module_offset); + // Always strip the module name for %M. + RenderModuleLocation(buffer, StripModuleName(info.module), + info.module_offset, info.module_arch, ""); else buffer->append("(%p)", (void *)info.address); break; @@ -165,9 +166,13 @@ void RenderSourceLocation(InternalScoped } void RenderModuleLocation(InternalScopedString *buffer, const char *module, - uptr offset, const char *strip_path_prefix) { - buffer->append("(%s+0x%zx)", StripPathPrefix(module, strip_path_prefix), - offset); + uptr offset, ModuleArch arch, + const char *strip_path_prefix) { + buffer->append("(%s", StripPathPrefix(module, strip_path_prefix)); + if (arch != kModuleArchUnknown) { + buffer->append(":%s", ModuleArchToString(arch)); + } + buffer->append("+0x%zx)", offset); } } // namespace __sanitizer Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_printer.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_printer.h Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_printer.h Mon Jan 9 21:23:31 2017 (r311822) @@ -57,7 +57,8 @@ void RenderSourceLocation(InternalScoped const char *strip_path_prefix); void RenderModuleLocation(InternalScopedString *buffer, const char *module, - uptr offset, const char *strip_path_prefix); + uptr offset, ModuleArch arch, + const char *strip_path_prefix); // Same as RenderFrame, but for data section (global variables). // Accepts %s, %l from above. Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -33,9 +33,11 @@ void AddressInfo::Clear() { function_offset = kUnknown; } -void AddressInfo::FillModuleInfo(const char *mod_name, uptr mod_offset) { +void AddressInfo::FillModuleInfo(const char *mod_name, uptr mod_offset, + ModuleArch mod_arch) { module = internal_strdup(mod_name); module_offset = mod_offset; + module_arch = mod_arch; } SymbolizedStack::SymbolizedStack() : next(nullptr), info() {} Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.h Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.h Mon Jan 9 21:23:31 2017 (r311822) @@ -31,6 +31,7 @@ struct AddressInfo { char *module; uptr module_offset; + ModuleArch module_arch; static const uptr kUnknown = ~(uptr)0; char *function; @@ -43,7 +44,7 @@ struct AddressInfo { AddressInfo(); // Deletes all strings and resets all fields. void Clear(); - void FillModuleInfo(const char *mod_name, uptr mod_offset); + void FillModuleInfo(const char *mod_name, uptr mod_offset, ModuleArch arch); }; // Linked list of symbolized frames (each frame is described by AddressInfo). @@ -65,6 +66,8 @@ struct DataInfo { // (de)allocated using sanitizer internal allocator. char *module; uptr module_offset; + ModuleArch module_arch; + char *file; uptr line; char *name; @@ -143,7 +146,8 @@ class Symbolizer final { static Symbolizer *PlatformInit(); bool FindModuleNameAndOffsetForAddress(uptr address, const char **module_name, - uptr *module_offset); + uptr *module_offset, + ModuleArch *module_arch); ListOfModules modules_; // If stale, need to reload the modules before looking up addresses. bool modules_fresh_; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_internal.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_internal.h Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_internal.h Mon Jan 9 21:23:31 2017 (r311822) @@ -124,8 +124,8 @@ class LLVMSymbolizer : public Symbolizer bool SymbolizeData(uptr addr, DataInfo *info) override; private: - const char *SendCommand(bool is_data, const char *module_name, - uptr module_offset); + const char *FormatAndSendCommand(bool is_data, const char *module_name, + uptr module_offset, ModuleArch arch); LLVMSymbolizerProcess *symbolizer_process_; static const uptr kBufferSize = 16 * 1024; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc Mon Jan 9 21:23:28 2017 (r311821) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc Mon Jan 9 21:23:31 2017 (r311822) @@ -64,11 +64,13 @@ SymbolizedStack *Symbolizer::SymbolizePC BlockingMutexLock l(&mu_); const char *module_name; uptr module_offset; + ModuleArch arch; SymbolizedStack *res = SymbolizedStack::New(addr); - if (!FindModuleNameAndOffsetForAddress(addr, &module_name, &module_offset)) + if (!FindModuleNameAndOffsetForAddress(addr, &module_name, &module_offset, + &arch)) return res; // Always fill data about module name and offset. - res->info.FillModuleInfo(module_name, module_offset); + res->info.FillModuleInfo(module_name, module_offset, arch); for (auto &tool : tools_) { SymbolizerScope sym_scope(this); if (tool.SymbolizePC(addr, res)) { @@ -82,11 +84,14 @@ bool Symbolizer::SymbolizeData(uptr addr BlockingMutexLock l(&mu_); const char *module_name; uptr module_offset; - if (!FindModuleNameAndOffsetForAddress(addr, &module_name, &module_offset)) + ModuleArch arch; + if (!FindModuleNameAndOffsetForAddress(addr, &module_name, &module_offset, + &arch)) return false; info->Clear(); info->module = internal_strdup(module_name); info->module_offset = module_offset; + info->module_arch = arch; for (auto &tool : tools_) { SymbolizerScope sym_scope(this); if (tool.SymbolizeData(addr, info)) { @@ -100,8 +105,9 @@ bool Symbolizer::GetModuleNameAndOffsetF uptr *module_address) { BlockingMutexLock l(&mu_); const char *internal_module_name = nullptr; + ModuleArch arch; if (!FindModuleNameAndOffsetForAddress(pc, &internal_module_name, - module_address)) + module_address, &arch)) return false; if (module_name) @@ -134,12 +140,14 @@ void Symbolizer::PrepareForSandboxing() bool Symbolizer::FindModuleNameAndOffsetForAddress(uptr address, const char **module_name, - uptr *module_offset) { + uptr *module_offset, + ModuleArch *module_arch) { const LoadedModule *module = FindModuleForAddress(address); if (module == nullptr) return false; *module_name = module->full_name(); *module_offset = address - module->base_address(); + *module_arch = module->arch(); return true; } @@ -197,6 +205,8 @@ class LLVMSymbolizerProcess : public Sym buffer[length - 2] == '\n'; } + // When adding a new architecture, don't forget to also update + // script/asan_symbolize.py and sanitizer_common.h. void GetArgV(const char *path_to_binary, const char *(&argv)[kArgVMax]) const override { #if defined(__x86_64h__) @@ -284,7 +294,8 @@ void ParseSymbolizePCOutput(const char * top_frame = false; } else { cur = SymbolizedStack::New(res->info.address); - cur->info.FillModuleInfo(res->info.module, res->info.module_offset); + cur->info.FillModuleInfo(res->info.module, res->info.module_offset, + res->info.module_arch); last->next = cur; last = cur; } @@ -317,8 +328,10 @@ void ParseSymbolizeDataOutput(const char } bool LLVMSymbolizer::SymbolizePC(uptr addr, SymbolizedStack *stack) { - if (const char *buf = SendCommand(/*is_data*/ false, stack->info.module, - stack->info.module_offset)) { + AddressInfo *info = &stack->info; + const char *buf = FormatAndSendCommand( + /*is_data*/ false, info->module, info->module_offset, info->module_arch); + if (buf) { ParseSymbolizePCOutput(buf, stack); return true; } @@ -326,8 +339,9 @@ bool LLVMSymbolizer::SymbolizePC(uptr ad } bool LLVMSymbolizer::SymbolizeData(uptr addr, DataInfo *info) { - if (const char *buf = - SendCommand(/*is_data*/ true, info->module, info->module_offset)) { + const char *buf = FormatAndSendCommand( + /*is_data*/ true, info->module, info->module_offset, info->module_arch); + if (buf) { ParseSymbolizeDataOutput(buf, info); info->start += (addr - info->module_offset); // Add the base address. return true; @@ -335,11 +349,19 @@ bool LLVMSymbolizer::SymbolizeData(uptr return false; } -const char *LLVMSymbolizer::SendCommand(bool is_data, const char *module_name, - uptr module_offset) { +const char *LLVMSymbolizer::FormatAndSendCommand(bool is_data, + const char *module_name, + uptr module_offset, + ModuleArch arch) { CHECK(module_name); - internal_snprintf(buffer_, kBufferSize, "%s\"%s\" 0x%zx\n", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D590BCA80C1; Mon, 9 Jan 2017 21:23:29 +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 8A2D4129C; Mon, 9 Jan 2017 21:23:29 +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 v09LNSZx095656; Mon, 9 Jan 2017 21:23:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNSXk095655; Mon, 9 Jan 2017 21:23:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNSXk095655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311821 - vendor/clang/clang-trunk-r291476 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:30 -0000 Author: dim Date: Mon Jan 9 21:23:28 2017 New Revision: 311821 URL: https://svnweb.freebsd.org/changeset/base/311821 Log: Tag clang trunk r291476. Added: vendor/clang/clang-trunk-r291476/ - copied from r311820, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B958CA813C; Mon, 9 Jan 2017 21:23:39 +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 B4FF6138E; Mon, 9 Jan 2017 21:23:38 +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 v09LNbdg095779; Mon, 9 Jan 2017 21:23:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNbjF095778; Mon, 9 Jan 2017 21:23:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNbjF095778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311823 - vendor/compiler-rt/compiler-rt-trunk-r291476 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:39 -0000 Author: dim Date: Mon Jan 9 21:23:37 2017 New Revision: 311823 URL: https://svnweb.freebsd.org/changeset/base/311823 Log: Tag compiler-rt trunk r291476. Added: vendor/compiler-rt/compiler-rt-trunk-r291476/ - copied from r311822, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0086ACA8176; Mon, 9 Jan 2017 21:23:44 +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 969FB147A; Mon, 9 Jan 2017 21:23:43 +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 v09LNgRQ095841; Mon, 9 Jan 2017 21:23:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNfEs095826; Mon, 9 Jan 2017 21:23:41 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNfEs095826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311824 - in vendor/libc++/dist: . docs docs/DesignDocs include include/experimental include/support/win32 lib src src/experimental src/include test test/libcxx/iterators test/libcxx/te... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:44 -0000 Author: dim Date: Mon Jan 9 21:23:41 2017 New Revision: 311824 URL: https://svnweb.freebsd.org/changeset/base/311824 Log: Vendor import of libc++ trunk r291476: https://llvm.org/svn/llvm-project/libcxx/trunk@291476 Added: vendor/libc++/dist/docs/DesignDocs/ThreadingSupportAPI.rst vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream/istream.cons/copy.fail.cpp (contents, props changed) vendor/libc++/dist/test/std/strings/string.view/string_view.literals/ vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal1.fail.cpp (contents, props changed) vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal1.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal2.fail.cpp (contents, props changed) vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal2.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal3.pass.cpp (contents, props changed) Deleted: vendor/libc++/dist/include/__undef___deallocate Modified: vendor/libc++/dist/CMakeLists.txt vendor/libc++/dist/CREDITS.TXT vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst vendor/libc++/dist/docs/index.rst vendor/libc++/dist/include/__bit_reference vendor/libc++/dist/include/__config vendor/libc++/dist/include/__config_site.in vendor/libc++/dist/include/__debug vendor/libc++/dist/include/__functional_base vendor/libc++/dist/include/__hash_table vendor/libc++/dist/include/__sso_allocator vendor/libc++/dist/include/__threading_support vendor/libc++/dist/include/algorithm vendor/libc++/dist/include/atomic vendor/libc++/dist/include/experimental/algorithm vendor/libc++/dist/include/experimental/dynarray vendor/libc++/dist/include/experimental/iterator vendor/libc++/dist/include/istream vendor/libc++/dist/include/memory vendor/libc++/dist/include/module.modulemap vendor/libc++/dist/include/new vendor/libc++/dist/include/ostream vendor/libc++/dist/include/regex vendor/libc++/dist/include/string_view vendor/libc++/dist/include/support/win32/support.h vendor/libc++/dist/include/thread vendor/libc++/dist/include/type_traits vendor/libc++/dist/include/valarray vendor/libc++/dist/lib/CMakeLists.txt vendor/libc++/dist/src/chrono.cpp vendor/libc++/dist/src/exception.cpp vendor/libc++/dist/src/experimental/memory_resource.cpp vendor/libc++/dist/src/include/config_elast.h vendor/libc++/dist/src/iostream.cpp vendor/libc++/dist/src/locale.cpp vendor/libc++/dist/src/thread.cpp vendor/libc++/dist/test/CMakeLists.txt vendor/libc++/dist/test/libcxx/iterators/trivial_iterators.pass.cpp vendor/libc++/dist/test/libcxx/test/config.py vendor/libc++/dist/test/libcxx/test/executor.py vendor/libc++/dist/test/libcxx/test/format.py vendor/libc++/dist/test/lit.site.cfg.in vendor/libc++/dist/test/std/containers/sequences/array/iterators.pass.cpp vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp vendor/libc++/dist/test/std/iterators/iterator.range/begin-end.pass.cpp vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h vendor/libc++/dist/test/std/utilities/time/time.duration/time.duration.arithmetic/op_mod=duration.pass.cpp vendor/libc++/dist/test/std/utilities/time/time.duration/time.duration.arithmetic/op_mod=rep.pass.cpp vendor/libc++/dist/test/std/utilities/time/time.duration/time.duration.arithmetic/op_times=.pass.cpp vendor/libc++/dist/test/support/disable_missing_braces_warning.h vendor/libc++/dist/test/support/external_threads.cpp vendor/libc++/dist/test/support/nasty_macros.hpp vendor/libc++/dist/test/support/test_iterators.h vendor/libc++/dist/www/cxx1z_status.html Modified: vendor/libc++/dist/CMakeLists.txt ============================================================================== --- vendor/libc++/dist/CMakeLists.txt Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/CMakeLists.txt Mon Jan 9 21:23:41 2017 (r311824) @@ -116,7 +116,12 @@ if (LIBCXX_CXX_ABI STREQUAL "default") set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}") set(LIBCXX_CXX_ABI_INTREE 1) else() - set(LIBCXX_CXX_ABI_LIBNAME "default") + if (WIN32 AND NOT MINGW) + # FIXME: Figure out how to configure the ABI library on Windows. + set(LIBCXX_CXX_ABI_LIBNAME "none") + else() + set(LIBCXX_CXX_ABI_LIBNAME "default") + endif() endif() else() set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}") @@ -169,6 +174,9 @@ option(LIBCXX_HAS_PTHREAD_API "Ignore au option(LIBCXX_HAS_EXTERNAL_THREAD_API "Build libc++ with an externalized threading API. This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON." OFF) +option(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY + "Build libc++ with an externalized threading library. + This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON" OFF) # Misc options ---------------------------------------------------------------- # FIXME: Turn -pedantic back ON. It is currently off because it warns @@ -230,12 +238,24 @@ if(NOT LIBCXX_ENABLE_THREADS) message(FATAL_ERROR "LIBCXX_HAS_EXTERNAL_THREAD_API can only be set to ON" " when LIBCXX_ENABLE_THREADS is also set to ON.") endif() + if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) + message(FATAL_ERROR "LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY can only be set " + "to ON when LIBCXX_ENABLE_THREADS is also set to ON.") + endif() + endif() -if(LIBCXX_HAS_PTHREAD_API AND LIBCXX_HAS_EXTERNAL_THREAD_API) - message(FATAL_ERROR "The options LIBCXX_HAS_EXTERNAL_THREAD_API" - "and LIBCXX_HAS_PTHREAD_API cannot be both" - "set to ON at the same time.") +if (LIBCXX_HAS_EXTERNAL_THREAD_API) + if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) + message(FATAL_ERROR "The options LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY and " + "LIBCXX_HAS_EXTERNAL_THREAD_API cannot both be ON at " + "the same time") + endif() + if (LIBCXX_HAS_PTHREAD_API) + message(FATAL_ERROR "The options LIBCXX_HAS_EXTERNAL_THREAD_API" + "and LIBCXX_HAS_PTHREAD_API cannot be both" + "set to ON at the same time.") + endif() endif() # Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE @@ -441,7 +461,7 @@ if (NOT LIBCXX_ENABLE_RTTI) endif() # Threading flags ============================================================= -if (LIBCXX_HAS_EXTERNAL_THREAD_API AND LIBCXX_ENABLE_SHARED) +if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY AND LIBCXX_ENABLE_SHARED) # Need to allow unresolved symbols if this is to work with shared library builds if (APPLE) add_link_flags("-undefined dynamic_lookup") @@ -520,6 +540,7 @@ config_define_if_not(LIBCXX_ENABLE_THREA config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCPP_HAS_THREAD_API_PTHREAD) config_define_if(LIBCXX_HAS_EXTERNAL_THREAD_API _LIBCPP_HAS_THREAD_API_EXTERNAL) +config_define_if(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC) # By default libc++ on Windows expects to use a shared library, which requires Modified: vendor/libc++/dist/CREDITS.TXT ============================================================================== --- vendor/libc++/dist/CREDITS.TXT Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/CREDITS.TXT Mon Jan 9 21:23:41 2017 (r311824) @@ -80,6 +80,10 @@ N: Andrew Morrow E: andrew.c.morrow@gmail.com D: Minor patches and Linux fixes. +N: Michael Park +E: mpark@apache.org +D: Implementation of . + N: Arvid Picciani E: aep at exys dot org D: Minor patches and musl port. Added: vendor/libc++/dist/docs/DesignDocs/ThreadingSupportAPI.rst ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/docs/DesignDocs/ThreadingSupportAPI.rst Mon Jan 9 21:23:41 2017 (r311824) @@ -0,0 +1,70 @@ +===================== +Threading Support API +===================== + +.. contents:: + :local: + +Overview +======== + +Libc++ supports using multiple different threading models and configurations +to implement the threading parts of libc++, including ```` and ````. +These different models provide entirely different interfaces from each +other. To address this libc++ wraps the underlying threading API in a new and +consistent API, which it uses internally to implement threading primitives. + +The ``<__threading_support>`` header is where libc++ defines its internal +threading interface. It contains forward declarations of the internal threading +interface as well as definitions for the interface. + +External Threading API and the ``<__external_threading>`` header +================================================================ + +In order to support vendors with custom threading API's libc++ allows the +entire internal threading interface to be provided by an external, +vendor provided, header. + +When ``_LIBCPP_HAS_THREAD_API_EXTERNAL`` is defined the ``<__threading_support>`` +header simply forwards to the ``<__external_threading>`` header (which must exist). +It is expected that the ``<__external_threading>`` header provide the exact +interface normally provided by ``<__threading_support>``. + +External Threading Library +========================== + +Normally ``<__threading_support>`` provides inline definitions to each internal +threading API function it declares. However libc++ also supports using an +external library to provide the definitions. + +When ``_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL`` libc++ does not provide inline +definitions for the internal API, instead assuming the definitions will be +provided by an external library. + +Threading Configuration Macros +============================== + +**_LIBCPP_HAS_NO_THREADS** + This macro is defined when libc++ is built without threading support. It + should not be manually defined by the user. + +**_LIBCPP_HAS_THREAD_API_EXTERNAL** + This macro is defined when libc++ should use the ``<__external_threading>`` + header to provide the internal threading API. This macro overrides + ``_LIBCPP_HAS_THREAD_API_PTHREAD``. + +**_LIBCPP_HAS_THREAD_API_PTHREAD** + This macro is defined when libc++ should use POSIX threads to implement the + internal threading API. + +**_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL** + This macro is defined when libc++ expects the definitions of the internal + threading API to be provided by an external library. When defined + ``<__threading_support>`` will only provide the forward declarations and + typedefs for the internal threading API. + +**_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL** + This macro is used to build an external threading library using the + ``<__threading_support>``. Specifically it exposes the threading API + definitions in ``<__threading_support>`` as non-inline definitions meant to + be compiled into a library. Modified: vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst ============================================================================== --- vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst Mon Jan 9 21:23:41 2017 (r311824) @@ -49,7 +49,7 @@ Visibility Macros attribute. With GCC the `visibility(...)` attribute is used and member functions are affected. -**_LIBCPP_TEMPLATE_ONLY** +**_LIBCPP_TEMPLATE_VIS** The same as `_LIBCPP_TYPE_VIS` except that it may be applied to class templates. Modified: vendor/libc++/dist/docs/index.rst ============================================================================== --- vendor/libc++/dist/docs/index.rst Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/docs/index.rst Mon Jan 9 21:23:41 2017 (r311824) @@ -131,7 +131,7 @@ Design Documents DesignDocs/CapturingConfigInfo DesignDocs/ABIVersioning DesignDocs/VisibilityMacros - + DesignDocs/ThreadingSupportAPI * ` design `_ * ` design `_ Modified: vendor/libc++/dist/include/__bit_reference ============================================================================== --- vendor/libc++/dist/include/__bit_reference Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/include/__bit_reference Mon Jan 9 21:23:41 2017 (r311824) @@ -40,11 +40,8 @@ class __bit_reference __storage_pointer __seg_; __storage_type __mask_; -#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC) friend typename _Cp::__self; -#else - friend class _Cp::__self; -#endif + friend class __bit_const_reference<_Cp>; friend class __bit_iterator<_Cp, false>; public: @@ -130,11 +127,7 @@ class __bit_const_reference __storage_pointer __seg_; __storage_type __mask_; -#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC) friend typename _Cp::__self; -#else - friend class _Cp::__self; -#endif friend class __bit_iterator<_Cp, true>; public: _LIBCPP_INLINE_VISIBILITY @@ -1221,11 +1214,8 @@ private: __bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT : __seg_(__s), __ctz_(__ctz) {} -#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC) friend typename _Cp::__self; -#else - friend class _Cp::__self; -#endif + friend class __bit_reference<_Cp>; friend class __bit_const_reference<_Cp>; friend class __bit_iterator<_Cp, true>; Modified: vendor/libc++/dist/include/__config ============================================================================== --- vendor/libc++/dist/include/__config Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/include/__config Mon Jan 9 21:23:41 2017 (r311824) @@ -101,6 +101,25 @@ #define __is_identifier(__x) 1 #endif +#if defined(__clang__) +#define _LIBCPP_COMPILER_CLANG +#elif defined(__GNUC__) +#define _LIBCPP_COMPILER_GCC +#elif defined(_MSC_VER) +#define _LIBCPP_COMPILER_MSVC +#elif defined(__IBMCPP__) +#define _LIBCPP_COMPILER_IBM +#endif + +// FIXME: ABI detection should be done via compiler builtin macros. This +// is just a placeholder until Clang implements such macros. For now assume +// that Windows compilers pretending to be MSVC++ target the microsoft ABI. +#if defined(_WIN32) && defined(_MSC_VER) +# define _LIBCPP_ABI_MICROSOFT +#else +# define _LIBCPP_ABI_ITANIUM +#endif + // Need to detect which libc we're using if we're on Linux. #if defined(__linux__) #include @@ -164,16 +183,7 @@ # define _LIBCPP_LITTLE_ENDIAN 1 # define _LIBCPP_BIG_ENDIAN 0 # define _LIBCPP_SHORT_WCHAR 1 -// Compiler intrinsics (MSVC) -# if defined(_MSC_VER) && _MSC_VER >= 1400 -# define _LIBCPP_HAS_IS_BASE_OF -# endif -# if defined(_MSC_VER) && !defined(__clang__) -# define _LIBCPP_MSVC // Using Microsoft Visual C++ compiler -# define _LIBCPP_TOSTRING2(x) #x -# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x) -# define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x)) -# endif + // If mingw not explicitly detected, assume using MS C runtime only. # ifndef __MINGW32__ # define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library @@ -230,7 +240,7 @@ #define _LIBCPP_NO_CFI #endif -#if defined(__clang__) +#if defined(_LIBCPP_COMPILER_CLANG) // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility. @@ -275,10 +285,6 @@ typedef __char32_t char32_t; # define _LIBCPP_NORETURN __attribute__ ((noreturn)) #endif -#if !(__has_feature(cxx_deleted_functions)) -#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS -#endif // !(__has_feature(cxx_deleted_functions)) - #if !(__has_feature(cxx_lambdas)) #define _LIBCPP_HAS_NO_LAMBDAS #endif @@ -390,7 +396,7 @@ namespace std { #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow"))) #endif -#elif defined(__GNUC__) +#elif defined(_LIBCPP_COMPILER_GCC) #define _ALIGNAS(x) __attribute__((__aligned__(x))) #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) @@ -431,7 +437,6 @@ namespace std { #ifndef __GXX_EXPERIMENTAL_CXX0X__ #define _LIBCPP_HAS_NO_DECLTYPE -#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS #define _LIBCPP_HAS_NO_NULLPTR #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_VARIADICS @@ -448,7 +453,6 @@ namespace std { #if _GNUC_VER < 404 #define _LIBCPP_HAS_NO_DECLTYPE -#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_VARIADICS #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS @@ -475,15 +479,23 @@ using namespace _LIBCPP_NAMESPACE __attr #define _LIBCPP_HAS_NO_ASAN #endif -#elif defined(_LIBCPP_MSVC) +#elif defined(_LIBCPP_COMPILER_MSVC) + +#define _LIBCPP_TOSTRING2(x) #x +#define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x) +#define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x)) +#if _MSC_VER < 1900 +#error "MSVC versions prior to Visual Studio 2015 are not supported" +#endif + +#define _LIBCPP_HAS_IS_BASE_OF #define _LIBCPP_HAS_NO_CONSTEXPR #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES #if _MSC_VER <= 1800 #define _LIBCPP_HAS_NO_UNICODE_CHARS #endif -#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS #define _LIBCPP_HAS_NO_NOEXCEPT #define __alignof__ __alignof #define _LIBCPP_NORETURN __declspec(noreturn) @@ -500,7 +512,7 @@ namespace std { #define _LIBCPP_HAS_NO_ASAN -#elif defined(__IBMCPP__) +#elif defined(_LIBCPP_COMPILER_IBM) #define _ALIGNAS(x) __attribute__((__aligned__(x))) #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) @@ -530,7 +542,7 @@ namespace std { #define _LIBCPP_HAS_NO_ASAN -#endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__ +#endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM] #if defined(__ELF__) #define _LIBCPP_OBJECT_FORMAT_ELF 1 @@ -566,7 +578,7 @@ namespace std { #define _LIBCPP_FUNC_VIS_ONLY #define _LIBCPP_ENUM_VIS -#if defined(_LIBCPP_MSVC) +#if defined(_LIBCPP_COMPILER_MSVC) # define _LIBCPP_INLINE_VISIBILITY __forceinline # define _LIBCPP_ALWAYS_INLINE __forceinline # define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline @@ -739,7 +751,7 @@ template struct __static_asse #define _LIBCPP_DEFAULT = default; #endif -#ifdef _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#ifdef _LIBCPP_CXX03_LANG #define _LIBCPP_EQUAL_DELETE #else #define _LIBCPP_EQUAL_DELETE = delete @@ -892,8 +904,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit // Thread API #if !defined(_LIBCPP_HAS_NO_THREADS) && \ - !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && \ - !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) + !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) # if defined(__FreeBSD__) || \ defined(__Fuchsia__) || \ defined(__NetBSD__) || \ @@ -901,7 +912,9 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit defined(__APPLE__) || \ defined(__CloudABI__) || \ defined(__sun__) -# define _LIBCPP_HAS_THREAD_API_PTHREAD +# define _LIBCPP_HAS_THREAD_API_PTHREAD +# elif defined(_LIBCPP_WIN32API) +# define _LIBCPP_HAS_THREAD_API_WIN32 # else # error "No thread API" # endif // _LIBCPP_HAS_THREAD_API Modified: vendor/libc++/dist/include/__config_site.in ============================================================================== --- vendor/libc++/dist/include/__config_site.in Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/include/__config_site.in Mon Jan 9 21:23:41 2017 (r311824) @@ -21,6 +21,7 @@ #cmakedefine _LIBCPP_HAS_MUSL_LIBC #cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD #cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL +#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL #cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS #endif // _LIBCPP_CONFIG_SITE Modified: vendor/libc++/dist/include/__debug ============================================================================== --- vendor/libc++/dist/include/__debug Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/include/__debug Mon Jan 9 21:23:41 2017 (r311824) @@ -122,7 +122,7 @@ struct _LIBCPP_TYPE_VIS __i_node __i_node* __next_; __c_node* __c_; -#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#ifndef _LIBCPP_CXX03_LANG __i_node(const __i_node&) = delete; __i_node& operator=(const __i_node&) = delete; #else @@ -145,7 +145,7 @@ struct _LIBCPP_TYPE_VIS __c_node __i_node** end_; __i_node** cap_; -#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#ifndef _LIBCPP_CXX03_LANG __c_node(const __c_node&) = delete; __c_node& operator=(const __c_node&) = delete; #else @@ -232,7 +232,7 @@ class _LIBCPP_TYPE_VIS __libcpp_db __libcpp_db(); public: -#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#ifndef _LIBCPP_CXX03_LANG __libcpp_db(const __libcpp_db&) = delete; __libcpp_db& operator=(const __libcpp_db&) = delete; #else Modified: vendor/libc++/dist/include/__functional_base ============================================================================== --- vendor/libc++/dist/include/__functional_base Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/include/__functional_base Mon Jan 9 21:23:41 2017 (r311824) @@ -552,23 +552,10 @@ cref(reference_wrapper<_Tp> __t) _NOEXCE return cref(__t.get()); } -#ifndef _LIBCPP_HAS_NO_VARIADICS -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS - +#ifndef _LIBCPP_CXX03_LANG template void ref(const _Tp&&) = delete; template void cref(const _Tp&&) = delete; - -#else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS - -template void ref(const _Tp&&);// = delete; -template void cref(const _Tp&&);// = delete; - -#endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif #if _LIBCPP_STD_VER > 11 template Modified: vendor/libc++/dist/include/__hash_table ============================================================================== --- vendor/libc++/dist/include/__hash_table Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/include/__hash_table Mon Jan 9 21:23:41 2017 (r311824) @@ -20,7 +20,6 @@ #include #include <__undef_min_max> -#include <__undef___deallocate> #include <__debug> @@ -1321,7 +1320,7 @@ private: void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {} #endif // _LIBCPP_CXX03_LANG - void __deallocate(__next_pointer __np) _NOEXCEPT; + void __deallocate_node(__next_pointer __np) _NOEXCEPT; __next_pointer __detach() _NOEXCEPT; template friend class _LIBCPP_TEMPLATE_VIS unordered_map; @@ -1454,7 +1453,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> "Predicate must be copy-constructible."); static_assert((is_copy_constructible::value), "Hasher must be copy-constructible."); - __deallocate(__p1_.first().__next_); + __deallocate_node(__p1_.first().__next_); #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__erase_c(this); #endif @@ -1492,7 +1491,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> template void -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__next_pointer __np) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np) _NOEXCEPT { __node_allocator& __na = __node_alloc(); @@ -1599,11 +1598,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> } catch (...) { - __deallocate(__cache); + __deallocate_node(__cache); throw; } #endif // _LIBCPP_NO_EXCEPTIONS - __deallocate(__cache); + __deallocate_node(__cache); } const_iterator __i = __u.begin(); while (__u.size() != 0) @@ -1661,11 +1660,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> } catch (...) { - __deallocate(__cache); + __deallocate_node(__cache); throw; } #endif // _LIBCPP_NO_EXCEPTIONS - __deallocate(__cache); + __deallocate_node(__cache); } for (; __first != __last; ++__first) __insert_unique(*__first); @@ -1701,11 +1700,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> } catch (...) { - __deallocate(__cache); + __deallocate_node(__cache); throw; } #endif // _LIBCPP_NO_EXCEPTIONS - __deallocate(__cache); + __deallocate_node(__cache); } for (; __first != __last; ++__first) __insert_multi(_NodeTypes::__get_value(*__first)); @@ -1765,7 +1764,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> { if (size() > 0) { - __deallocate(__p1_.first().__next_); + __deallocate_node(__p1_.first().__next_); __p1_.first().__next_ = nullptr; size_type __bc = bucket_count(); for (size_type __i = 0; __i < __bc; ++__i) Modified: vendor/libc++/dist/include/__sso_allocator ============================================================================== --- vendor/libc++/dist/include/__sso_allocator Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/include/__sso_allocator Mon Jan 9 21:23:41 2017 (r311824) @@ -15,8 +15,6 @@ #include #include -#include <__undef___deallocate> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif @@ -64,7 +62,7 @@ public: if (__p == (pointer)&buf_) __allocated_ = false; else - _VSTD::__deallocate(__p); + _VSTD::__libcpp_deallocate(__p); } _LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);} Modified: vendor/libc++/dist/include/__threading_support ============================================================================== --- vendor/libc++/dist/include/__threading_support Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/include/__threading_support Mon Jan 9 21:23:41 2017 (r311824) @@ -17,39 +17,24 @@ #pragma GCC system_header #endif -#ifndef _LIBCPP_HAS_NO_THREADS - -#ifndef __libcpp_has_include - #ifndef __has_include - #define __libcpp_has_include(x) 0 - #else - #define __libcpp_has_include(x) __has_include(x) - #endif -#endif - -#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) && \ - !__libcpp_has_include(<__external_threading>) -// If the <__external_threading> header is absent, build libc++ against a -// pthread-oriented thread api but leave out its implementation. This setup -// allows building+testing of an externally-threaded library variant (on any -// platform that supports pthreads). Here, an 'externally-threaded' library -// variant is one where the implementation of the libc++ thread api is provided -// as a separate library. -#define _LIBCPP_HAS_THREAD_API_EXTERNAL_PTHREAD -#endif +#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) +# include <__external_threading> +#elif !defined(_LIBCPP_HAS_NO_THREADS) -#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) && \ - __libcpp_has_include(<__external_threading>) -#include <__external_threading> -#else +#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) +# include +# include +#elif defined(_LIBCPP_HAS_THREAD_API_WIN32) +#include +#include +#include +#include -#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) || \ - defined(_LIBCPP_HAS_THREAD_API_EXTERNAL_PTHREAD) -#include -#include +#include #endif -#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) +#if defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \ + defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) #define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS #else #define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY @@ -57,8 +42,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) || \ - defined(_LIBCPP_HAS_THREAD_API_EXTERNAL_PTHREAD) +#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) // Mutex typedef pthread_mutex_t __libcpp_mutex_t; #define _LIBCPP_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER @@ -81,6 +65,33 @@ typedef pthread_t __libcpp_thread_t; // Thrad Local Storage typedef pthread_key_t __libcpp_tls_key; + +#define _LIBCPP_TLS_DESTRUCTOR_CC +#else +// Mutex +typedef SRWLOCK __libcpp_mutex_t; +#define _LIBCPP_MUTEX_INITIALIZER SRWLOCK_INIT + +typedef CRITICAL_SECTION __libcpp_recursive_mutex_t; + +// Condition Variable +typedef CONDITION_VARIABLE __libcpp_condvar_t; +#define _LIBCPP_CONDVAR_INITIALIZER CONDITION_VARIABLE_INIT + +// Execute Once +typedef INIT_ONCE __libcpp_exec_once_flag; +#define _LIBCPP_EXEC_ONCE_INITIALIZER INIT_ONCE_STATIC_INIT + +// Thread ID +typedef DWORD __libcpp_thread_id; + +// Thread +typedef HANDLE __libcpp_thread_t; + +// Thread Local Storage +typedef DWORD __libcpp_tls_key; + +#define _LIBCPP_TLS_DESTRUCTOR_CC WINAPI #endif // Mutex @@ -167,7 +178,8 @@ void __libcpp_thread_yield(); // Thread local storage _LIBCPP_THREAD_ABI_VISIBILITY -int __libcpp_tls_create(__libcpp_tls_key *__key, void (*__at_exit)(void *)); +int __libcpp_tls_create(__libcpp_tls_key* __key, + void(_LIBCPP_TLS_DESTRUCTOR_CC* __at_exit)(void*)); _LIBCPP_THREAD_ABI_VISIBILITY void *__libcpp_tls_get(__libcpp_tls_key __key); @@ -175,8 +187,10 @@ void *__libcpp_tls_get(__libcpp_tls_key _LIBCPP_THREAD_ABI_VISIBILITY int __libcpp_tls_set(__libcpp_tls_key __key, void *__p); -#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) || \ - defined(_LIBCPP_BUILDING_THREAD_API_EXTERNAL_PTHREAD) +#if !defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \ + defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) + +#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m) { @@ -342,12 +356,230 @@ int __libcpp_tls_set(__libcpp_tls_key __ return pthread_setspecific(__key, __p); } +#elif defined(_LIBCPP_HAS_THREAD_API_WIN32) + +// Mutex +int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m) +{ + InitializeCriticalSection(__m); + return 0; +} + +int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m) +{ + EnterCriticalSection(__m); + return 0; +} + +int __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m) +{ + TryEnterCriticalSection(__m); + return 0; +} + +int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m) +{ + LeaveCriticalSection(__m); + return 0; +} + +int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m) +{ + static_cast(__m); + return 0; +} + +int __libcpp_mutex_lock(__libcpp_mutex_t *__m) +{ + AcquireSRWLockExclusive(__m); + return 0; +} + +int __libcpp_mutex_trylock(__libcpp_mutex_t *__m) +{ + TryAcquireSRWLockExclusive(__m); + return 0; +} + +int __libcpp_mutex_unlock(__libcpp_mutex_t *__m) +{ + ReleaseSRWLockExclusive(__m); + return 0; +} + +int __libcpp_mutex_destroy(__libcpp_mutex_t *__m) +{ + static_cast(__m); + return 0; +} + +// Condition Variable +int __libcpp_condvar_signal(__libcpp_condvar_t *__cv) +{ + WakeConditionVariable(__cv); + return 0; +} + +int __libcpp_condvar_broadcast(__libcpp_condvar_t *__cv) +{ + WakeAllConditionVariable(__cv); + return 0; +} + +int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m) +{ + SleepConditionVariableSRW(__cv, __m, INFINITE, 0); + return 0; +} + +int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m, + timespec *__ts) +{ + using namespace _VSTD::chrono; + + auto duration = seconds(__ts->tv_sec) + nanoseconds(__ts->tv_nsec); + auto abstime = + system_clock::time_point(duration_cast(duration)); + auto timeout_ms = duration_cast(abstime - system_clock::now()); + + if (!SleepConditionVariableSRW(__cv, __m, + timeout_ms.count() > 0 ? timeout_ms.count() + : 0, + 0)) + return GetLastError(); + return 0; +} + +int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv) +{ + static_cast(__cv); + return 0; +} + +// Execute Once +static inline _LIBCPP_ALWAYS_INLINE BOOL CALLBACK +__libcpp_init_once_execute_once_thunk(PINIT_ONCE __init_once, PVOID __parameter, + PVOID *__context) +{ + static_cast(__init_once); + static_cast(__context); + + void (*init_routine)(void) = reinterpret_cast(__parameter); + init_routine(); + return TRUE; +} + +int __libcpp_execute_once(__libcpp_exec_once_flag *__flag, + void (*__init_routine)(void)) +{ + if (!InitOnceExecuteOnce(__flag, __libcpp_init_once_execute_once_thunk, + reinterpret_cast(__init_routine), NULL)) + return GetLastError(); + return 0; +} + +// Thread ID +bool __libcpp_thread_id_equal(__libcpp_thread_id __lhs, + __libcpp_thread_id __rhs) +{ + return __lhs == __rhs; +} + +bool __libcpp_thread_id_less(__libcpp_thread_id __lhs, __libcpp_thread_id __rhs) +{ + return __lhs < __rhs; +} + +// Thread +struct __libcpp_beginthreadex_thunk_data +{ + void *(*__func)(void *); + void *__arg; +}; + +static inline _LIBCPP_ALWAYS_INLINE unsigned int WINAPI +__libcpp_beginthreadex_thunk(void *__data) +{ + __libcpp_beginthreadex_thunk_data data = + *reinterpret_cast<__libcpp_beginthreadex_thunk_data *>(__data); + delete reinterpret_cast<__libcpp_beginthreadex_thunk_data *>(__data); + return reinterpret_cast(data.__func(data.__arg)); +} + +int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *), + void *__arg) +{ + auto *data = new __libcpp_beginthreadex_thunk_data; + data->__func = __func; + data->__arg = __arg; + + *__t = reinterpret_cast(_beginthreadex(NULL, 0, + __libcpp_beginthreadex_thunk, + data, 0, NULL)); + if (*__t) + return 0; + return GetLastError(); +} + +__libcpp_thread_id __libcpp_thread_get_current_id() +{ + return GetCurrentThreadId(); +} + +__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t) +{ + return GetThreadId(*__t); +} + +int __libcpp_thread_join(__libcpp_thread_t *__t) +{ + if (WaitForSingleObjectEx(*__t, INFINITE, FALSE) == WAIT_FAILED) + return GetLastError(); + if (!CloseHandle(*__t)) + return GetLastError(); + return 0; +} + +int __libcpp_thread_detach(__libcpp_thread_t *__t) +{ + if (!CloseHandle(*__t)) + return GetLastError(); + return 0; +} + +void __libcpp_thread_yield() +{ + SwitchToThread(); +} + +// Thread Local Storage +int __libcpp_tls_create(__libcpp_tls_key* __key, + void(_LIBCPP_TLS_DESTRUCTOR_CC* __at_exit)(void*)) +{ + *__key = FlsAlloc(__at_exit); + if (*__key == FLS_OUT_OF_INDEXES) + return GetLastError(); + return 0; +} + +void *__libcpp_tls_get(__libcpp_tls_key __key) +{ + return FlsGetValue(__key); +} + +int __libcpp_tls_set(__libcpp_tls_key __key, void *__p) +{ + if (!FlsSetValue(__key, __p)) + return GetLastError(); + return 0; +} + #endif // _LIBCPP_HAS_THREAD_API_PTHREAD -_LIBCPP_END_NAMESPACE_STD +#endif // !_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL || _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL -#endif // !_LIBCPP_HAS_THREAD_API_EXTERNAL || !__libcpp_has_include(<__external_threading>) +_LIBCPP_END_NAMESPACE_STD -#endif // _LIBCPP_HAS_NO_THREADS +#endif // !_LIBCPP_HAS_NO_THREADS #endif // _LIBCPP_THREADING_SUPPORT Modified: vendor/libc++/dist/include/algorithm ============================================================================== --- vendor/libc++/dist/include/algorithm Mon Jan 9 21:23:37 2017 (r311823) +++ vendor/libc++/dist/include/algorithm Mon Jan 9 21:23:41 2017 (r311824) @@ -3100,28 +3100,28 @@ template _LIBCPP_INLINE_VISIBILITY _SampleIterator __sample(_PopulationIterator __first, - _PopulationIterator __last, _SampleIterator __out, + _PopulationIterator __last, _SampleIterator __output, _Distance __n, _UniformRandomNumberGenerator & __g, input_iterator_tag) { _Distance __k = 0; for (; __first != __last && __k < __n; ++__first, (void)++__k) - __out[__k] = *__first; + __output[__k] = *__first; _Distance __sz = __k; for (; __first != __last; ++__first, (void)++__k) { _Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, __k)(__g); if (__r < __sz) - __out[__r] = *__first; + __output[__r] = *__first; } - return __out + _VSTD::min(__n, __k); + return __output + _VSTD::min(__n, __k); } template _LIBCPP_INLINE_VISIBILITY _SampleIterator __sample(_PopulationIterator __first, - _PopulationIterator __last, _SampleIterator __out, + _PopulationIterator __last, _SampleIterator __output, _Distance __n, _UniformRandomNumberGenerator& __g, forward_iterator_tag) { @@ -3130,18 +3130,18 @@ _SampleIterator __sample(_PopulationIter _Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g); if (__r < __n) { - *__out++ = *__first; + *__output++ = *__first; --__n; } } - return __out; + return __output; } template _LIBCPP_INLINE_VISIBILITY _SampleIterator __sample(_PopulationIterator __first, - _PopulationIterator __last, _SampleIterator __out, + _PopulationIterator __last, _SampleIterator __output, _Distance __n, _UniformRandomNumberGenerator& __g) { typedef typename iterator_traits<_PopulationIterator>::iterator_category _PopCategory; @@ -3153,7 +3153,7 @@ _SampleIterator __sample(_PopulationIter typedef typename common_type<_Distance, _Difference>::type _CommonType; _LIBCPP_ASSERT(__n >= 0, "N must be a positive number."); return _VSTD::__sample( - __first, __last, __out, _CommonType(__n), + __first, __last, __output, _CommonType(__n), __g, _PopCategory()); } @@ -3162,9 +3162,9 @@ template inline _LIBCPP_INLINE_VISIBILITY _SampleIterator sample(_PopulationIterator __first, - _PopulationIterator __last, _SampleIterator __out, + _PopulationIterator __last, _SampleIterator __output, _Distance __n, _UniformRandomNumberGenerator&& __g) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D5D1CA81E2; Mon, 9 Jan 2017 21:23:52 +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 1041115CC; Mon, 9 Jan 2017 21:23:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09LNpJG095958; Mon, 9 Jan 2017 21:23:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNnPh095936; Mon, 9 Jan 2017 21:23:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNnPh095936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311826 - in vendor/lld/dist: ELF cmake/modules include/lld/Core lib/Config lib/Core lib/Driver lib/ReaderWriter lib/ReaderWriter/MachO lib/ReaderWriter/YAML test/COFF test/ELF test/ELF... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:52 -0000 Author: dim Date: Mon Jan 9 21:23:48 2017 New Revision: 311826 URL: https://svnweb.freebsd.org/changeset/base/311826 Log: Vendor import of lld trunk r291476: https://llvm.org/svn/llvm-project/lld/trunk@291476 Added: vendor/lld/dist/test/ELF/comdat-linkonce.s (contents, props changed) vendor/lld/dist/test/ELF/undefined-versioned-symbol.s (contents, props changed) Modified: vendor/lld/dist/ELF/Driver.cpp vendor/lld/dist/ELF/Driver.h vendor/lld/dist/ELF/InputFiles.cpp vendor/lld/dist/ELF/InputFiles.h vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/Symbols.cpp vendor/lld/dist/cmake/modules/AddLLD.cmake vendor/lld/dist/include/lld/Core/Reproduce.h vendor/lld/dist/lib/Config/CMakeLists.txt vendor/lld/dist/lib/Core/CMakeLists.txt vendor/lld/dist/lib/Core/Reproduce.cpp vendor/lld/dist/lib/Driver/CMakeLists.txt vendor/lld/dist/lib/ReaderWriter/CMakeLists.txt vendor/lld/dist/lib/ReaderWriter/MachO/CMakeLists.txt vendor/lld/dist/lib/ReaderWriter/YAML/CMakeLists.txt vendor/lld/dist/test/COFF/linkrepro.test vendor/lld/dist/test/ELF/linkerscript/symbol-assignexpr.s vendor/lld/dist/test/ELF/mips-gp-ext.s vendor/lld/dist/test/ELF/reproduce-linkerscript.s vendor/lld/dist/tools/lld/CMakeLists.txt Modified: vendor/lld/dist/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist/ELF/Driver.cpp Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/ELF/Driver.cpp Mon Jan 9 21:23:48 2017 (r311826) @@ -26,6 +26,7 @@ #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Path.h" +#include "llvm/Support/TarWriter.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/raw_ostream.h" #include @@ -51,6 +52,7 @@ bool elf::link(ArrayRef Ar ErrorCount = 0; ErrorOS = &Error; Argv0 = Args[0]; + Tar = nullptr; Config = make(); Driver = make(); @@ -170,25 +172,6 @@ void LinkerDriver::addFile(StringRef Pat } } -Optional LinkerDriver::readFile(StringRef Path) { - if (Config->Verbose) - outs() << Path << "\n"; - - auto MBOrErr = MemoryBuffer::getFile(Path); - if (auto EC = MBOrErr.getError()) { - error(EC, "cannot open " + Path); - return None; - } - std::unique_ptr &MB = *MBOrErr; - MemoryBufferRef MBRef = MB->getMemBufferRef(); - make>(std::move(MB)); // take MB ownership - - if (Tar) - Tar->append(relativeToRoot(Path), MBRef.getBuffer()); - - return MBRef; -} - // Add a given library by searching it from input search paths. void LinkerDriver::addLibrary(StringRef Name) { if (Optional Path = searchLibrary(Name)) @@ -313,9 +296,10 @@ void LinkerDriver::main(ArrayRef> ErrOrWriter = TarWriter::create(Path, path::stem(Path)); if (ErrOrWriter) { - Tar = std::move(*ErrOrWriter); + Tar = ErrOrWriter->get(); Tar->append("response.txt", createResponseFile(Args)); Tar->append("version.txt", getLLDVersion() + "\n"); + make>(std::move(*ErrOrWriter)); } else { error(Twine("--reproduce: failed to open ") + Path + ": " + toString(ErrOrWriter.takeError())); Modified: vendor/lld/dist/ELF/Driver.h ============================================================================== --- vendor/lld/dist/ELF/Driver.h Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/ELF/Driver.h Mon Jan 9 21:23:48 2017 (r311826) @@ -17,7 +17,6 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSet.h" #include "llvm/Option/ArgList.h" -#include "llvm/Support/TarWriter.h" #include "llvm/Support/raw_ostream.h" namespace lld { @@ -30,11 +29,9 @@ public: void main(ArrayRef Args, bool CanExitEarly); void addFile(StringRef Path); void addLibrary(StringRef Name); - std::unique_ptr Tar; // for reproduce private: std::vector getArchiveMembers(MemoryBufferRef MB); - llvm::Optional readFile(StringRef Path); void readConfigs(llvm::opt::InputArgList &Args); void createFiles(llvm::opt::InputArgList &Args); void inferMachineType(); Modified: vendor/lld/dist/ELF/InputFiles.cpp ============================================================================== --- vendor/lld/dist/ELF/InputFiles.cpp Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/ELF/InputFiles.cpp Mon Jan 9 21:23:48 2017 (r311826) @@ -8,7 +8,6 @@ //===----------------------------------------------------------------------===// #include "InputFiles.h" -#include "Driver.h" #include "Error.h" #include "InputSection.h" #include "LinkerScript.h" @@ -26,6 +25,7 @@ #include "llvm/MC/StringTableBuilder.h" #include "llvm/Object/ELFObjectFile.h" #include "llvm/Support/Path.h" +#include "llvm/Support/TarWriter.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -36,6 +36,8 @@ using namespace llvm::sys::fs; using namespace lld; using namespace lld::elf; +TarWriter *elf::Tar; + namespace { // In ELF object file all section addresses are zero. If we have multiple // .text sections (when using -ffunction-section or comdat group) then @@ -53,6 +55,24 @@ public: }; } +Optional elf::readFile(StringRef Path) { + if (Config->Verbose) + outs() << Path << "\n"; + + auto MBOrErr = MemoryBuffer::getFile(Path); + if (auto EC = MBOrErr.getError()) { + error(EC, "cannot open " + Path); + return None; + } + std::unique_ptr &MB = *MBOrErr; + MemoryBufferRef MBRef = MB->getMemBufferRef(); + make>(std::move(MB)); // take MB ownership + + if (Tar) + Tar->append(relativeToRoot(Path), MBRef.getBuffer()); + return MBRef; +} + template void elf::ObjectFile::initializeDwarfLine() { std::unique_ptr Obj = check(object::ObjectFile::createObjectFile(this->MB), @@ -398,6 +418,14 @@ elf::ObjectFile::createInputSectio if (Config->Strip != StripPolicy::None && Name.startswith(".debug")) return &InputSection::Discarded; + // The linkonce feature is a sort of proto-comdat. Some glibc i386 object + // files contain definitions of symbol "__x86.get_pc_thunk.bx" in linkonce + // sections. Drop those sections to avoid duplicate symbol errors. + // FIXME: This is glibc PR20543, we should remove this hack once that has been + // fixed for a while. + if (Name.startswith(".gnu.linkonce.")) + return &InputSection::Discarded; + // The linker merges EH (exception handling) frames and creates a // .eh_frame_hdr section for runtime. So we handle them with a special // class. For relocatable outputs, they are just passed through. @@ -524,9 +552,8 @@ ArchiveFile::getMember(const Archive::Sy "could not get the buffer for the member defining symbol " + Sym->getName()); - if (C.getParent()->isThin() && Driver->Tar) - Driver->Tar->append(relativeToRoot(check(C.getFullName())), - Ret.getBuffer()); + if (C.getParent()->isThin() && Tar) + Tar->append(relativeToRoot(check(C.getFullName())), Ret.getBuffer()); if (C.getParent()->isThin()) return {Ret, 0}; return {Ret, C.getChildOffset()}; @@ -651,6 +678,8 @@ template void SharedFilevs_index; ++Versym; } + bool Hidden = VersymIndex & VERSYM_HIDDEN; + VersymIndex = VersymIndex & ~VERSYM_HIDDEN; StringRef Name = check(Sym.getName(this->StringTable)); if (Sym.isUndefined()) { @@ -658,15 +687,23 @@ template void SharedFile::X->addShared(this, Name, Sym, V); + + if (!Hidden) + elf::Symtab::X->addShared(this, Name, Sym, V); + + // Also add the symbol with the versioned name to handle undefined symbols + // with explicit versions. + if (V) { + StringRef VerName = this->StringTable.data() + V->getAux()->vda_name; + Name = Saver.save(Twine(Name) + "@" + VerName); + elf::Symtab::X->addShared(this, Name, Sym, V); + } } } Modified: vendor/lld/dist/ELF/InputFiles.h ============================================================================== --- vendor/lld/dist/ELF/InputFiles.h Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/ELF/InputFiles.h Mon Jan 9 21:23:48 2017 (r311826) @@ -29,6 +29,7 @@ namespace llvm { class DWARFDebugLine; +class TarWriter; namespace lto { class InputFile; } @@ -49,6 +50,13 @@ using llvm::object::Archive; class Lazy; class SymbolBody; +// If -reproduce option is given, all input files are written +// to this tar archive. +extern llvm::TarWriter *Tar; + +// Opens a given file. +llvm::Optional readFile(StringRef Path); + // The root class of input files. class InputFile { public: Modified: vendor/lld/dist/ELF/LinkerScript.cpp ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.cpp Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/ELF/LinkerScript.cpp Mon Jan 9 21:23:48 2017 (r311826) @@ -56,29 +56,30 @@ using namespace lld::elf; LinkerScriptBase *elf::ScriptBase; ScriptConfiguration *elf::ScriptConfig; -template static void addRegular(SymbolAssignment *Cmd) { +template static SymbolBody *addRegular(SymbolAssignment *Cmd) { uint8_t Visibility = Cmd->Hidden ? STV_HIDDEN : STV_DEFAULT; - Symbol *Sym = Symtab::X->addRegular(Cmd->Name, Visibility, STT_NOTYPE, - 0, 0, STB_GLOBAL, nullptr, nullptr); - Cmd->Sym = Sym->body(); - - // If we have no SECTIONS then we don't have '.' and don't call - // assignAddresses(). We calculate symbol value immediately in this case. - if (!ScriptConfig->HasSections) - cast>(Cmd->Sym)->Value = Cmd->Expression(0); + Symbol *Sym = Symtab::X->addUndefined( + Cmd->Name, /*IsLocal=*/false, STB_GLOBAL, Visibility, + /*Type*/ 0, + /*CanOmitFromDynSym*/ false, /*File*/ nullptr); + + replaceBody>(Sym, Cmd->Name, /*IsLocal=*/false, + Visibility, STT_NOTYPE, 0, 0, nullptr, + nullptr); + return Sym->body(); } -template static void addSynthetic(SymbolAssignment *Cmd) { - // If we have SECTIONS block then output sections haven't been created yet. +template static SymbolBody *addSynthetic(SymbolAssignment *Cmd) { + uint8_t Visibility = Cmd->Hidden ? STV_HIDDEN : STV_DEFAULT; const OutputSectionBase *Sec = ScriptConfig->HasSections ? nullptr : Cmd->Expression.Section(); - Symbol *Sym = Symtab::X->addSynthetic( - Cmd->Name, Sec, 0, Cmd->Hidden ? STV_HIDDEN : STV_DEFAULT); - Cmd->Sym = Sym->body(); - - // If we already know section then we can calculate symbol value immediately. - if (Sec) - cast(Cmd->Sym)->Value = Cmd->Expression(0) - Sec->Addr; + Symbol *Sym = Symtab::X->addUndefined( + Cmd->Name, /*IsLocal=*/false, STB_GLOBAL, Visibility, + /*Type*/ 0, + /*CanOmitFromDynSym*/ false, /*File*/ nullptr); + + replaceBody(Sym, Cmd->Name, 0, Sec); + return Sym->body(); } static bool isUnderSysroot(StringRef Path) { @@ -90,21 +91,39 @@ static bool isUnderSysroot(StringRef Pat return false; } -template static void addSymbol(SymbolAssignment *Cmd) { - if (Cmd->Expression.IsAbsolute()) - addRegular(Cmd); - else - addSynthetic(Cmd); +template static void assignSymbol(SymbolAssignment *Cmd) { + // If there are sections, then let the value be assigned later in + // `assignAddresses`. + if (ScriptConfig->HasSections) + return; + + uint64_t Value = Cmd->Expression(0); + if (Cmd->Expression.IsAbsolute()) { + cast>(Cmd->Sym)->Value = Value; + } else { + const OutputSectionBase *Sec = Cmd->Expression.Section(); + if (Sec) + cast(Cmd->Sym)->Value = Value - Sec->Addr; + } } -// If a symbol was in PROVIDE(), we need to define it only when -// it is an undefined symbol. -template static bool shouldDefine(SymbolAssignment *Cmd) { + +template static void addSymbol(SymbolAssignment *Cmd) { if (Cmd->Name == ".") - return false; - if (!Cmd->Provide) - return true; + return; + + // If a symbol was in PROVIDE(), we need to define it only when + // it is a referenced undefined symbol. SymbolBody *B = Symtab::X->find(Cmd->Name); - return B && B->isUndefined(); + if (Cmd->Provide && (!B || B->isDefined())) + return; + + // Otherwise, create a new symbol if one does not exist or an + // undefined one does exist. + if (Cmd->Expression.IsAbsolute()) + Cmd->Sym = addRegular(Cmd); + else + Cmd->Sym = addSynthetic(Cmd); + assignSymbol(Cmd); } bool SymbolAssignment::classof(const BaseCommand *C) { @@ -283,8 +302,7 @@ void LinkerScript::processCommands // Handle symbol assignments outside of any output section. if (auto *Cmd = dyn_cast(Base1.get())) { - if (shouldDefine(Cmd)) - addSymbol(Cmd); + addSymbol(Cmd); continue; } @@ -326,8 +344,7 @@ void LinkerScript::processCommands // ".foo : { ...; bar = .; }". Handle them. for (const std::unique_ptr &Base : Cmd->Commands) if (auto *OutCmd = dyn_cast(Base.get())) - if (shouldDefine(OutCmd)) - addSymbol(OutCmd); + addSymbol(OutCmd); // Handle subalign (e.g. ".foo : SUBALIGN(32) { ... }"). If subalign // is given, input sections are aligned to that value, whether the @@ -1143,20 +1160,21 @@ void ScriptParser::readGroup() { void ScriptParser::readInclude() { StringRef Tok = unquote(next()); + // https://sourceware.org/binutils/docs/ld/File-Commands.html: // The file will be searched for in the current directory, and in any // directory specified with the -L option. - auto MBOrErr = MemoryBuffer::getFile(Tok); - if (!MBOrErr) - if (Optional Path = findFromSearchPaths(Tok)) - MBOrErr = MemoryBuffer::getFile(*Path); - if (!MBOrErr) { - setError("cannot open " + Tok); + if (sys::fs::exists(Tok)) { + if (Optional MB = readFile(Tok)) + tokenize(*MB); + return; + } + if (Optional Path = findFromSearchPaths(Tok)) { + if (Optional MB = readFile(*Path)) + tokenize(*MB); return; } - MemoryBufferRef MBRef = (*MBOrErr)->getMemBufferRef(); - make>(std::move(*MBOrErr)); // take MB ownership - tokenize(MBRef); + setError("cannot open " + Tok); } void ScriptParser::readOutput() { Modified: vendor/lld/dist/ELF/Symbols.cpp ============================================================================== --- vendor/lld/dist/ELF/Symbols.cpp Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/ELF/Symbols.cpp Mon Jan 9 21:23:48 2017 (r311826) @@ -202,6 +202,10 @@ void SymbolBody::parseSymbolVersion() { // Truncate the symbol name so that it doesn't include the version string. Name = {S.data(), Pos}; + // If this is an undefined or shared symbol it is not a definition. + if (isUndefined() || isShared()) + return; + // '@@' in a symbol name means the default version. // It is usually the most recent one. bool IsDefault = (Verstr[0] == '@'); Modified: vendor/lld/dist/cmake/modules/AddLLD.cmake ============================================================================== --- vendor/lld/dist/cmake/modules/AddLLD.cmake Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/cmake/modules/AddLLD.cmake Mon Jan 9 21:23:48 2017 (r311826) @@ -1,5 +1,5 @@ macro(add_lld_library name) - add_llvm_library(${name} ${ARGN}) + llvm_add_library(${name} ${ARGN}) set_target_properties(${name} PROPERTIES FOLDER "lld libraries") endmacro(add_lld_library) Modified: vendor/lld/dist/include/lld/Core/Reproduce.h ============================================================================== --- vendor/lld/dist/include/lld/Core/Reproduce.h Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/include/lld/Core/Reproduce.h Mon Jan 9 21:23:48 2017 (r311826) @@ -34,9 +34,6 @@ std::string rewritePath(StringRef S); // Returns the string form of the given argument. std::string toString(llvm::opt::Arg *Arg); - -// Replaces backslashes with slashes if Windows. -std::string convertToUnixPathSeparator(StringRef S); } #endif Modified: vendor/lld/dist/lib/Config/CMakeLists.txt ============================================================================== --- vendor/lld/dist/lib/Config/CMakeLists.txt Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/lib/Config/CMakeLists.txt Mon Jan 9 21:23:48 2017 (r311826) @@ -4,6 +4,6 @@ add_lld_library(lldConfig ADDITIONAL_HEADER_DIRS ${LLD_INCLUDE_DIR}/lld/Config - LINK_LIBS - LLVMSupport + LINK_COMPONENTS + Support ) Modified: vendor/lld/dist/lib/Core/CMakeLists.txt ============================================================================== --- vendor/lld/dist/lib/Core/CMakeLists.txt Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/lib/Core/CMakeLists.txt Mon Jan 9 21:23:48 2017 (r311826) @@ -12,6 +12,6 @@ add_lld_library(lldCore ADDITIONAL_HEADER_DIRS ${LLD_INCLUDE_DIR}/lld/Core - LINK_LIBS - LLVMSupport + LINK_COMPONENTS + Support ) Modified: vendor/lld/dist/lib/Core/Reproduce.cpp ============================================================================== --- vendor/lld/dist/lib/Core/Reproduce.cpp Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/lib/Core/Reproduce.cpp Mon Jan 9 21:23:48 2017 (r311826) @@ -39,7 +39,7 @@ std::string lld::relativeToRoot(StringRe Res = Root.substr(2); path::append(Res, path::relative_path(Abs)); - return convertToUnixPathSeparator(Res); + return path::convert_to_slash(Res); } // Quote a given string if it contains a space character. @@ -64,13 +64,3 @@ std::string lld::toString(opt::Arg *Arg) return K + V; return K + " " + V; } - -std::string lld::convertToUnixPathSeparator(StringRef S) { -#ifdef LLVM_ON_WIN32 - std::string Ret = S.str(); - std::replace(Ret.begin(), Ret.end(), '\\', '/'); - return Ret; -#else - return S; -#endif -} Modified: vendor/lld/dist/lib/Driver/CMakeLists.txt ============================================================================== --- vendor/lld/dist/lib/Driver/CMakeLists.txt Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/lib/Driver/CMakeLists.txt Mon Jan 9 21:23:48 2017 (r311826) @@ -8,15 +8,17 @@ add_lld_library(lldDriver ADDITIONAL_HEADER_DIRS ${LLD_INCLUDE_DIR}/lld/Driver + LINK_COMPONENTS + Object + Option + Support + LINK_LIBS lldConfig lldMachO lldCore lldReaderWriter lldYAML - LLVMObject - LLVMOption - LLVMSupport ) add_dependencies(lldDriver DriverOptionsTableGen) Modified: vendor/lld/dist/lib/ReaderWriter/CMakeLists.txt ============================================================================== --- vendor/lld/dist/lib/ReaderWriter/CMakeLists.txt Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/lib/ReaderWriter/CMakeLists.txt Mon Jan 9 21:23:48 2017 (r311826) @@ -11,9 +11,11 @@ add_lld_library(lldReaderWriter ADDITIONAL_HEADER_DIRS ${LLD_INCLUDE_DIR}/lld/ReaderWriter + LINK_COMPONENTS + Object + Support + LINK_LIBS lldCore lldYAML - LLVMObject - LLVMSupport ) Modified: vendor/lld/dist/lib/ReaderWriter/MachO/CMakeLists.txt ============================================================================== --- vendor/lld/dist/lib/ReaderWriter/MachO/CMakeLists.txt Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/lib/ReaderWriter/MachO/CMakeLists.txt Mon Jan 9 21:23:48 2017 (r311826) @@ -18,13 +18,16 @@ add_lld_library(lldMachO StubsPass.cpp TLVPass.cpp WriterMachO.cpp + + LINK_COMPONENTS + DebugInfoDWARF + Object + Support + Demangle + LINK_LIBS lldCore lldYAML - LLVMDebugInfoDWARF - LLVMObject - LLVMSupport - LLVMDemangle ${PTHREAD_LIB} ) Modified: vendor/lld/dist/lib/ReaderWriter/YAML/CMakeLists.txt ============================================================================== --- vendor/lld/dist/lib/ReaderWriter/YAML/CMakeLists.txt Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/lib/ReaderWriter/YAML/CMakeLists.txt Mon Jan 9 21:23:48 2017 (r311826) @@ -1,6 +1,9 @@ add_lld_library(lldYAML ReaderWriterYAML.cpp + + LINK_COMPONENTS + Support + LINK_LIBS lldCore - LLVMSupport ) Modified: vendor/lld/dist/test/COFF/linkrepro.test ============================================================================== --- vendor/lld/dist/test/COFF/linkrepro.test Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/test/COFF/linkrepro.test Mon Jan 9 21:23:48 2017 (r311826) @@ -1,3 +1,5 @@ +# REQUIRES: x86, shell + # RUN: rm -rf %t.dir # RUN: mkdir -p %t.dir/build1 %t.dir/build2 %t.dir/build3 # RUN: yaml2obj < %p/Inputs/hello32.yaml > %t.obj Added: vendor/lld/dist/test/ELF/comdat-linkonce.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/ELF/comdat-linkonce.s Mon Jan 9 21:23:48 2017 (r311826) @@ -0,0 +1,9 @@ +// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/comdat.s -o %t2.o +// RUN: ld.lld -shared %t.o %t2.o -o %t +// RUN: ld.lld -shared %t2.o %t.o -o %t + +.section .gnu.linkonce.t.zed +.globl abc +abc: +nop Modified: vendor/lld/dist/test/ELF/linkerscript/symbol-assignexpr.s ============================================================================== --- vendor/lld/dist/test/ELF/linkerscript/symbol-assignexpr.s Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/test/ELF/linkerscript/symbol-assignexpr.s Mon Jan 9 21:23:48 2017 (r311826) @@ -13,14 +13,20 @@ # RUN: symbol9 = - 4; \ # RUN: symbol10 = 0xfedcba9876543210; \ # RUN: symbol11 = ((0x28000 + 0x1fff) & ~(0x1000 + -1)); \ +# RUN: symbol12 = 0x1234; \ +# RUN: symbol12 += 1; \ +# RUN: bar = 0x5678; \ +# RUN: baz = 0x9abc; \ # RUN: }" > %t.script # RUN: ld.lld -o %t1 --script %t.script %t # RUN: llvm-objdump -t %t1 | FileCheck %s # CHECK: SYMBOL TABLE: # CHECK-NEXT: 0000000000000000 *UND* 00000000 -# CHECK-NEXT: .text 00000000 _start -# CHECK-NEXT: .text 00000000 foo +# CHECK-NEXT: 0000000000000000 .text 00000000 _start +# CHECK-NEXT: 0000000000005678 *ABS* 00000000 bar +# CHECK-NEXT: 0000000000009abc *ABS* 00000000 baz +# CHECK-NEXT: 0000000000000001 .text 00000000 foo # CHECK-NEXT: 0000000000001000 *ABS* 00000000 symbol # CHECK-NEXT: 0000000000002234 *ABS* 00000000 symbol2 # CHECK-NEXT: 0000000000002234 *ABS* 00000000 symbol3 @@ -32,6 +38,7 @@ # CHECK-NEXT: fffffffffffffffc *ABS* 00000000 symbol9 # CHECK-NEXT: fedcba9876543210 *ABS* 00000000 symbol10 # CHECK-NEXT: 0000000000029000 *ABS* 00000000 symbol11 +# CHECK-NEXT: 0000000000001235 *ABS* 00000000 symbol12 # RUN: echo "SECTIONS { \ # RUN: symbol2 = symbol; \ @@ -46,3 +53,9 @@ _start: .global foo foo: + nop + +.global bar +bar = 0x1234 + +.comm baz,8,8 Modified: vendor/lld/dist/test/ELF/mips-gp-ext.s ============================================================================== --- vendor/lld/dist/test/ELF/mips-gp-ext.s Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/test/ELF/mips-gp-ext.s Mon Jan 9 21:23:48 2017 (r311826) @@ -1,8 +1,10 @@ # Check that the linker use a value of _gp symbol defined # in a linker script to calculate GOT relocations. -# FIXME: This test is xfailed because it depends on D27276 patch -# that enables absolute symbols redefinition by a linker's script. +# FIXME: This test is xfailed because there is currently a bug +# that causes symbols defined by linker scripts to be put in the +# wrong sections. In particular, `_gp = . + 0x100` ends up in +# `.text` when it should be in `*ABS*`. # XFAIL: * # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o Modified: vendor/lld/dist/test/ELF/reproduce-linkerscript.s ============================================================================== --- vendor/lld/dist/test/ELF/reproduce-linkerscript.s Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/test/ELF/reproduce-linkerscript.s Mon Jan 9 21:23:48 2017 (r311826) @@ -4,10 +4,13 @@ # RUN: mkdir -p %t.dir/build # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.dir/build/foo.o # RUN: echo "INPUT(\"%t.dir/build/foo.o\")" > %t.dir/build/foo.script +# RUN: echo "INCLUDE \"%t.dir/build/bar.script\"" >> %t.dir/build/foo.script +# RUN: echo "/* empty */" > %t.dir/build/bar.script # RUN: cd %t.dir # RUN: ld.lld build/foo.script -o bar --reproduce repro.tar # RUN: tar xf repro.tar # RUN: diff build/foo.script repro/%:t.dir/build/foo.script +# RUN: diff build/bar.script repro/%:t.dir/build/bar.script # RUN: diff build/foo.o repro/%:t.dir/build/foo.o .globl _start Added: vendor/lld/dist/test/ELF/undefined-versioned-symbol.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/ELF/undefined-versioned-symbol.s Mon Jan 9 21:23:48 2017 (r311826) @@ -0,0 +1,74 @@ +// REQUIRES: x86 +// RUN: echo ".data; \ +// RUN: .quad \"basename\"; \ +// RUN: .quad \"basename@FBSD_1.0\"; \ +// RUN: .quad \"basename@FBSD_1.1\" " > %t.s +// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t.s -o %t.o +// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t2.o +// RUN: echo "FBSD_1.0 { local: *; }; FBSD_1.1 { };" > %t2.ver +// RUN: ld.lld --shared --version-script %t2.ver %t2.o -o %t2.so +// RUN: echo "LIBPKG_1.3 { };" > %t.ver +// RUN: ld.lld --shared %t.o --version-script %t.ver %t2.so -o %t.so +// RUN: llvm-readobj --dyn-symbols -r --expand-relocs %t.so | FileCheck %s + +// Test that each relocation points to the correct version. + +// CHECK: Section ({{.*}}) .rela.dyn { +// CHECK-NEXT: Relocation { +// CHECK-NEXT: Offset: 0x2000 +// CHECK-NEXT: Type: R_X86_64_64 (1) +// CHECK-NEXT: Symbol: basename (1) +// CHECK-NEXT: Addend: 0x0 +// CHECK-NEXT: } +// CHECK-NEXT: Relocation { +// CHECK-NEXT: Offset: 0x2008 +// CHECK-NEXT: Type: R_X86_64_64 (1) +// CHECK-NEXT: Symbol: basename (2) +// CHECK-NEXT: Addend: 0x0 +// CHECK-NEXT: } +// CHECK-NEXT: Relocation { +// CHECK-NEXT: Offset: 0x2010 +// CHECK-NEXT: Type: R_X86_64_64 (1) +// CHECK-NEXT: Symbol: basename (3) +// CHECK-NEXT: Addend: 0x0 +// CHECK-NEXT: } +// CHECK-NEXT: } + + +// CHECK: DynamicSymbols [ +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: +// CHECK-NEXT: Value: +// CHECK-NEXT: Size: +// CHECK-NEXT: Binding: +// CHECK-NEXT: Type: +// CHECK-NEXT: Other: +// CHECK-NEXT: Section: +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: basename@FBSD_1.1 +// CHECK-NEXT: Value: +// CHECK-NEXT: Size: +// CHECK-NEXT: Binding: +// CHECK-NEXT: Type: +// CHECK-NEXT: Other: +// CHECK-NEXT: Section: +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: basename@FBSD_1.0 +// CHECK-NEXT: Value: +// CHECK-NEXT: Size: +// CHECK-NEXT: Binding: +// CHECK-NEXT: Type: +// CHECK-NEXT: Other: +// CHECK-NEXT: Section: +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: basename@FBSD_1.1 + + +.global "basename@FBSD_1.0" +"basename@FBSD_1.0": + +.global "basename@@FBSD_1.1" +"basename@@FBSD_1.1": Modified: vendor/lld/dist/tools/lld/CMakeLists.txt ============================================================================== --- vendor/lld/dist/tools/lld/CMakeLists.txt Mon Jan 9 21:23:46 2017 (r311825) +++ vendor/lld/dist/tools/lld/CMakeLists.txt Mon Jan 9 21:23:48 2017 (r311826) @@ -1,3 +1,7 @@ +set(LLVM_LINK_COMPONENTS + Support + ) + add_lld_tool(lld lld.cpp ) @@ -6,7 +10,6 @@ target_link_libraries(lld lldDriver lldCOFF lldELF - LLVMSupport ) install(TARGETS lld From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39370CA8225; Mon, 9 Jan 2017 21:23:56 +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 E48A81653; Mon, 9 Jan 2017 21:23:55 +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 v09LNtBu096007; Mon, 9 Jan 2017 21:23:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNt8g096006; Mon, 9 Jan 2017 21:23:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNt8g096006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311827 - vendor/lld/lld-trunk-r291476 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:56 -0000 Author: dim Date: Mon Jan 9 21:23:54 2017 New Revision: 311827 URL: https://svnweb.freebsd.org/changeset/base/311827 Log: Tag lld trunk r291476. Added: vendor/lld/lld-trunk-r291476/ - copied from r311826, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9CFFCA819C; Mon, 9 Jan 2017 21:23:47 +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 6F07D1520; Mon, 9 Jan 2017 21:23:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09LNk55095889; Mon, 9 Jan 2017 21:23:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNkSv095888; Mon, 9 Jan 2017 21:23:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNkSv095888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311825 - vendor/libc++/libc++-trunk-r291476 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:47 -0000 Author: dim Date: Mon Jan 9 21:23:46 2017 New Revision: 311825 URL: https://svnweb.freebsd.org/changeset/base/311825 Log: Tag libc++ trunk r291476. Added: vendor/libc++/libc++-trunk-r291476/ - copied from r311824, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Mon Jan 9 21:23:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65DC3CA8250; Mon, 9 Jan 2017 21:23:59 +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 3C8E816A8; Mon, 9 Jan 2017 21:23:59 +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 v09LNwMH096059; Mon, 9 Jan 2017 21:23:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LNvnT096053; Mon, 9 Jan 2017 21:23:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092123.v09LNvnT096053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311828 - in vendor/lldb/dist: packages/Python/lldbsuite/test/python_api/value/empty_class scripts source/Plugins/SymbolFile/DWARF source/Symbol X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:23:59 -0000 Author: dim Date: Mon Jan 9 21:23:57 2017 New Revision: 311828 URL: https://svnweb.freebsd.org/changeset/base/311828 Log: Vendor import of lldb trunk r291476: https://llvm.org/svn/llvm-project/lldb/trunk@291476 Added: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/main.cpp (contents, props changed) Modified: vendor/lldb/dist/scripts/CMakeLists.txt vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp vendor/lldb/dist/source/Symbol/ClangASTContext.cpp Added: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/Makefile Mon Jan 9 21:23:57 2017 (r311828) @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +CXX_SOURCES := main.cpp + +include $(LEVEL)/Makefile.rules Added: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py Mon Jan 9 21:23:57 2017 (r311828) @@ -0,0 +1,60 @@ +from __future__ import print_function + +import os +import time +import re +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class ValueAPIEmptyClassTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @add_test_categories(['pyapi']) + def test(self): + self.build() + exe = os.path.join(os.getcwd(), 'a.out') + line = line_number('main.cpp', '// Break at this line') + + # Create a target by the debugger. + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) + + # Create the breakpoint inside function 'main'. + breakpoint = target.BreakpointCreateByLocation('main.cpp', line) + self.assertTrue(breakpoint, VALID_BREAKPOINT) + + # Now launch the process, and do not stop at entry point. + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) + self.assertTrue(process, PROCESS_IS_VALID) + + # Get Frame #0. + self.assertTrue(process.GetState() == lldb.eStateStopped) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) + self.assertTrue( + thread.IsValid(), + "There should be a thread stopped due to breakpoint condition") + frame0 = thread.GetFrameAtIndex(0) + + # Verify that we can access to a frame variable with an empty class type + e = frame0.FindVariable('e') + self.assertTrue(e.IsValid(), VALID_VARIABLE) + self.DebugSBValue(e) + self.assertEqual(e.GetNumChildren(), 0) + + # Verify that we can acces to a frame variable what is a pointer to an + # empty class + ep = frame0.FindVariable('ep') + self.assertTrue(ep.IsValid(), VALID_VARIABLE) + self.DebugSBValue(ep) + + # Verify that we can dereference a pointer to an empty class + epd = ep.Dereference() + self.assertTrue(epd.IsValid(), VALID_VARIABLE) + self.DebugSBValue(epd) + self.assertEqual(epd.GetNumChildren(), 0) + Added: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/main.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/main.cpp Mon Jan 9 21:23:57 2017 (r311828) @@ -0,0 +1,16 @@ +//===-- main.cpp ------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +class Empty {}; + +int main (int argc, char const *argv[]) { + Empty e; + Empty* ep = new Empty; + return 0; // Break at this line +} Modified: vendor/lldb/dist/scripts/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/scripts/CMakeLists.txt Mon Jan 9 21:23:54 2017 (r311827) +++ vendor/lldb/dist/scripts/CMakeLists.txt Mon Jan 9 21:23:57 2017 (r311828) @@ -11,8 +11,13 @@ set(SWIG_HEADERS include(FindPythonInterp) -set(SWIG_PYTHON_DIR - ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) +if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") + set(SWIG_PYTHON_DIR + ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) +else() + set(SWIG_PYTHON_DIR ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/site-packages) +endif() + set(SWIG_INSTALL_DIR lib${LLVM_LIBDIR_SUFFIX}) # Generating the LLDB framework correctly is a bit complicated because the @@ -48,10 +53,8 @@ set_source_files_properties(${CMAKE_CURR add_custom_target(swig_wrapper ALL DEPENDS ${LLDB_WRAP_PYTHON}) -# Install the LLDB python module on all operating systems (except Windows) -if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") - install(DIRECTORY ${SWIG_PYTHON_DIR} DESTINATION ${SWIG_INSTALL_DIR}) -endif() +# Install the LLDB python module +install(DIRECTORY ${SWIG_PYTHON_DIR} DESTINATION ${SWIG_INSTALL_DIR}) # build Python modules add_subdirectory(Python/modules) Modified: vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Mon Jan 9 21:23:54 2017 (r311827) +++ vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Mon Jan 9 21:23:57 2017 (r311828) @@ -2647,7 +2647,7 @@ bool DWARFASTParserClang::ParseChildMemb // Get the parent byte size so we can verify any members will fit const uint64_t parent_byte_size = - parent_die.GetAttributeValueAsUnsigned(DW_AT_byte_size, UINT64_MAX) * 8; + parent_die.GetAttributeValueAsUnsigned(DW_AT_byte_size, UINT64_MAX); const uint64_t parent_bit_size = parent_byte_size == UINT64_MAX ? UINT64_MAX : parent_byte_size * 8; Modified: vendor/lldb/dist/source/Symbol/ClangASTContext.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/ClangASTContext.cpp Mon Jan 9 21:23:54 2017 (r311827) +++ vendor/lldb/dist/source/Symbol/ClangASTContext.cpp Mon Jan 9 21:23:57 2017 (r311828) @@ -6752,43 +6752,42 @@ CompilerType ClangASTContext::GetChildCo } break; - case clang::Type::Pointer: - if (idx_is_valid) { - CompilerType pointee_clang_type(GetPointeeType(type)); + case clang::Type::Pointer: { + CompilerType pointee_clang_type(GetPointeeType(type)); - // Don't dereference "void *" pointers - if (pointee_clang_type.IsVoidType()) - return CompilerType(); + // Don't dereference "void *" pointers + if (pointee_clang_type.IsVoidType()) + return CompilerType(); - if (transparent_pointers && pointee_clang_type.IsAggregateType()) { - child_is_deref_of_parent = false; - bool tmp_child_is_deref_of_parent = false; - return pointee_clang_type.GetChildCompilerTypeAtIndex( - exe_ctx, idx, transparent_pointers, omit_empty_base_classes, - ignore_array_bounds, child_name, child_byte_size, child_byte_offset, - child_bitfield_bit_size, child_bitfield_bit_offset, - child_is_base_class, tmp_child_is_deref_of_parent, valobj, - language_flags); - } else { - child_is_deref_of_parent = true; + if (transparent_pointers && pointee_clang_type.IsAggregateType()) { + child_is_deref_of_parent = false; + bool tmp_child_is_deref_of_parent = false; + return pointee_clang_type.GetChildCompilerTypeAtIndex( + exe_ctx, idx, transparent_pointers, omit_empty_base_classes, + ignore_array_bounds, child_name, child_byte_size, child_byte_offset, + child_bitfield_bit_size, child_bitfield_bit_offset, + child_is_base_class, tmp_child_is_deref_of_parent, valobj, + language_flags); + } else { + child_is_deref_of_parent = true; - const char *parent_name = - valobj ? valobj->GetName().GetCString() : NULL; - if (parent_name) { - child_name.assign(1, '*'); - child_name += parent_name; - } + const char *parent_name = + valobj ? valobj->GetName().GetCString() : NULL; + if (parent_name) { + child_name.assign(1, '*'); + child_name += parent_name; + } - // We have a pointer to an simple type - if (idx == 0) { - child_byte_size = pointee_clang_type.GetByteSize( - exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL); - child_byte_offset = 0; - return pointee_clang_type; - } + // We have a pointer to an simple type + if (idx == 0) { + child_byte_size = pointee_clang_type.GetByteSize( + exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL); + child_byte_offset = 0; + return pointee_clang_type; } } break; + } case clang::Type::LValueReference: case clang::Type::RValueReference: From owner-svn-src-all@freebsd.org Mon Jan 9 21:24:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 686C3CA829F; Mon, 9 Jan 2017 21:24:03 +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 1BCB3173A; Mon, 9 Jan 2017 21:24:03 +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 v09LO2YJ096111; Mon, 9 Jan 2017 21:24:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LO2eF096110; Mon, 9 Jan 2017 21:24:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092124.v09LO2eF096110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 21:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311829 - vendor/lldb/lldb-trunk-r291476 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:24:03 -0000 Author: dim Date: Mon Jan 9 21:24:02 2017 New Revision: 311829 URL: https://svnweb.freebsd.org/changeset/base/311829 Log: Tag lldb trunk r291476. Added: vendor/lldb/lldb-trunk-r291476/ - copied from r311828, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Mon Jan 9 21:46:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3B36CA8C0B; Mon, 9 Jan 2017 21:46: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 B329F1F57; Mon, 9 Jan 2017 21:46: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 v09LkOT4004497; Mon, 9 Jan 2017 21:46:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09LkOko004496; Mon, 9 Jan 2017 21:46:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701092146.v09LkOko004496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 9 Jan 2017 21:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311830 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 21:46:26 -0000 Author: adrian Date: Mon Jan 9 21:46:24 2017 New Revision: 311830 URL: https://svnweb.freebsd.org/changeset/base/311830 Log: [rsu] add support for the "green" rsu NICs. They're still a 1T2R NIC, so reuse the same rfconfig and nstream configuration. Submitted by: Idwer Vollering Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Mon Jan 9 21:24:02 2017 (r311829) +++ head/sys/dev/usb/wlan/if_rsu.c Mon Jan 9 21:46:24 2017 (r311830) @@ -523,6 +523,12 @@ rsu_attach(device_t self) sc->sc_ntxstream = 2; rft = "2T2R"; break; + case 0x3: /* "green" NIC */ + sc->sc_rftype = RTL8712_RFCONFIG_1T2R; + sc->sc_nrxstream = 2; + sc->sc_ntxstream = 1; + rft = "1T2R ('green')"; + break; default: device_printf(sc->sc_dev, "%s: unknown board type (rfconfig=0x%02x)\n", From owner-svn-src-all@freebsd.org Mon Jan 9 22:18:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C2FECA7824; Mon, 9 Jan 2017 22:18:09 +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 45D58165A; Mon, 9 Jan 2017 22:18:09 +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 v09MI8DJ017098; Mon, 9 Jan 2017 22:18:08 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09MI8Kb017097; Mon, 9 Jan 2017 22:18:08 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701092218.v09MI8Kb017097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 9 Jan 2017 22:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311831 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 22:18:09 -0000 Author: np Date: Mon Jan 9 22:18:08 2017 New Revision: 311831 URL: https://svnweb.freebsd.org/changeset/base/311831 Log: cxgbe(4): The wraparound logic in start_wrq_wr() should not get involved in work requests that end at the end of the descriptor ring, even though the pidx wraps around to 0. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Jan 9 21:46:24 2017 (r311830) +++ head/sys/dev/cxgbe/t4_sge.c Mon Jan 9 22:18:08 2017 (r311831) @@ -2298,7 +2298,7 @@ slowpath: w = &eq->desc[eq->pidx]; IDXINCR(eq->pidx, ndesc, eq->sidx); - if (__predict_false(eq->pidx < ndesc - 1)) { + if (__predict_false(cookie->pidx + ndesc > eq->sidx)) { w = &wrq->ss[0]; wrq->ss_pidx = cookie->pidx; wrq->ss_len = len16 * 16; From owner-svn-src-all@freebsd.org Mon Jan 9 22:20:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B29C8CA792E; Mon, 9 Jan 2017 22:20:10 +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 8249D1877; Mon, 9 Jan 2017 22:20:10 +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 v09MK9Se017225; Mon, 9 Jan 2017 22:20:09 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09MK9eH017224; Mon, 9 Jan 2017 22:20:09 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701092220.v09MK9eH017224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 9 Jan 2017 22:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311832 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 22:20:10 -0000 Author: np Date: Mon Jan 9 22:20:09 2017 New Revision: 311832 URL: https://svnweb.freebsd.org/changeset/base/311832 Log: cxgbe(4): Enable automatic cidx flush for all control queues. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Jan 9 22:18:08 2017 (r311831) +++ head/sys/dev/cxgbe/t4_sge.c Mon Jan 9 22:20:09 2017 (r311832) @@ -3305,12 +3305,13 @@ ctrl_eq_alloc(struct adapter *sc, struct c.cmpliqid_eqid = htonl(V_FW_EQ_CTRL_CMD_CMPLIQID(eq->iqid)); c.physeqid_pkd = htobe32(0); c.fetchszm_to_iqid = - htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | + htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | V_FW_EQ_CTRL_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) | + V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) | V_FW_EQ_CTRL_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); From owner-svn-src-all@freebsd.org Mon Jan 9 23:41:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3891CCA8EEC; Mon, 9 Jan 2017 23:41:12 +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 050751750; Mon, 9 Jan 2017 23:41:11 +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 v09NfBNa049759; Mon, 9 Jan 2017 23:41:11 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09NfBQr049758; Mon, 9 Jan 2017 23:41:11 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701092341.v09NfBQr049758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 9 Jan 2017 23:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311837 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 23:41:12 -0000 Author: sbruno Date: Mon Jan 9 23:41:10 2017 New Revision: 311837 URL: https://svnweb.freebsd.org/changeset/base/311837 Log: Remove unused mtx_held() macro. Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Jan 9 22:49:35 2017 (r311836) +++ head/sys/net/iflib.c Mon Jan 9 23:41:10 2017 (r311837) @@ -447,10 +447,6 @@ struct iflib_rxq { static int enable_msix = 1; -#define mtx_held(m) (((m)->mtx_lock & ~MTX_FLAGMASK) != (uintptr_t)0) - - - #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) From owner-svn-src-all@freebsd.org Mon Jan 9 23:42:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CB7BCA8038; Mon, 9 Jan 2017 23:42:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E728B1A98; Mon, 9 Jan 2017 23:42:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09Ng3Wk050703; Mon, 9 Jan 2017 23:42:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09Ng32n050702; Mon, 9 Jan 2017 23:42:03 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701092342.v09Ng32n050702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 9 Jan 2017 23:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311838 - head/sys/dev/rtwn/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 23:42:04 -0000 Author: avos Date: Mon Jan 9 23:42:02 2017 New Revision: 311838 URL: https://svnweb.freebsd.org/changeset/base/311838 Log: rtwn_usb(4): do not try to modify global static structure. Use a local copy for modifications instead. Tested with RTL8821AU (AP) + RTL8188EU (STA). Reported by: hselasky Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_ep.c Mon Jan 9 23:41:10 2017 (r311837) +++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Mon Jan 9 23:42:02 2017 (r311838) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include -static struct usb_config rtwn_config[RTWN_N_TRANSFER] = { +static const struct usb_config rtwn_config_common[RTWN_N_TRANSFER] = { [RTWN_BULK_RX] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, @@ -161,6 +161,7 @@ rtwn_usb_setup_queues(struct rtwn_usb_so int rtwn_usb_setup_endpoints(struct rtwn_usb_softc *uc) { + struct usb_config *rtwn_config; struct rtwn_softc *sc = &uc->uc_sc; const uint8_t iface_index = RTWN_IFACE_INDEX; struct usb_endpoint *ep, *ep_end; @@ -197,6 +198,9 @@ rtwn_usb_setup_endpoints(struct rtwn_usb return (EINVAL); } + rtwn_config = malloc(sizeof(rtwn_config_common), M_TEMP, M_WAITOK); + memcpy(rtwn_config, rtwn_config_common, sizeof(rtwn_config_common)); + /* NB: keep in sync with rtwn_dma_init(). */ rtwn_config[RTWN_BULK_TX_VO].endpoint = addr[0]; switch (uc->ntx) { @@ -224,6 +228,8 @@ rtwn_usb_setup_endpoints(struct rtwn_usb rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024; error = usbd_transfer_setup(uc->uc_udev, &iface_index, uc->uc_xfer, rtwn_config, RTWN_N_TRANSFER, uc, &sc->sc_mtx); + free(rtwn_config, M_TEMP); + if (error) { device_printf(sc->sc_dev, "could not allocate USB transfers, " "err=%s\n", usbd_errstr(error)); From owner-svn-src-all@freebsd.org Mon Jan 9 23:43:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C99BCA80E9; Mon, 9 Jan 2017 23:43:43 +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 4A7D41D9E; Mon, 9 Jan 2017 23:43:43 +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 v09Nhgd3053915; Mon, 9 Jan 2017 23:43:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09NhgEP053914; Mon, 9 Jan 2017 23:43:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701092343.v09NhgEP053914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 Jan 2017 23:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311839 - stable/11/usr.bin/kdump X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 23:43:43 -0000 Author: jhb Date: Mon Jan 9 23:43:42 2017 New Revision: 311839 URL: https://svnweb.freebsd.org/changeset/base/311839 Log: MFC 306565,306566: Use timercmp() and timersub() in kdump. 306565: Use timercmp() and timersub() in kdump. Previously, kdump used the kernel-only timervalsub() macro which required defining _KERNEL when including . Now, kdump uses the existing userland API. The timercmp() usage to check for a backwards timestamp is also clearer and simpler than the previous code which checked the result of the subtraction for a negative value. While here, take advantage of the 3-arg timersub() to store the subtraction results in a tempory timeval instead of overwriting the timestamp in the ktrace record and then having to restore it. 306566: Don't declare the 'temp' timeval as static. Modified: stable/11/usr.bin/kdump/kdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/kdump/kdump.c ============================================================================== --- stable/11/usr.bin/kdump/kdump.c Mon Jan 9 23:42:02 2017 (r311838) +++ stable/11/usr.bin/kdump/kdump.c Mon Jan 9 23:43:42 2017 (r311839) @@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _KERNEL #include -#undef _KERNEL #include #include #include @@ -564,7 +562,8 @@ void dumpheader(struct ktr_header *kth) { static char unknown[64]; - static struct timeval prevtime, prevtime_e, temp; + static struct timeval prevtime, prevtime_e; + struct timeval temp; const char *type; const char *sign; @@ -637,27 +636,23 @@ dumpheader(struct ktr_header *kth) if (timestamp & TIMESTAMP_ELAPSED) { if (prevtime_e.tv_sec == 0) prevtime_e = kth->ktr_time; - timevalsub(&kth->ktr_time, &prevtime_e); - printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, - kth->ktr_time.tv_usec); - timevaladd(&kth->ktr_time, &prevtime_e); + timersub(&kth->ktr_time, &prevtime_e, &temp); + printf("%jd.%06ld ", (intmax_t)temp.tv_sec, + temp.tv_usec); } if (timestamp & TIMESTAMP_RELATIVE) { if (prevtime.tv_sec == 0) prevtime = kth->ktr_time; - temp = kth->ktr_time; - timevalsub(&kth->ktr_time, &prevtime); - if ((intmax_t)kth->ktr_time.tv_sec < 0) { - kth->ktr_time = prevtime; - prevtime = temp; - timevalsub(&kth->ktr_time, &prevtime); + if (timercmp(&kth->ktr_time, &prevtime, <)) { + timersub(&prevtime, &kth->ktr_time, &temp); sign = "-"; } else { - prevtime = temp; + timersub(&kth->ktr_time, &prevtime, &temp); sign = ""; } - printf("%s%jd.%06ld ", sign, (intmax_t)kth->ktr_time.tv_sec, - kth->ktr_time.tv_usec); + prevtime = kth->ktr_time; + printf("%s%jd.%06ld ", sign, (intmax_t)temp.tv_sec, + temp.tv_usec); } } printf("%s ", type); From owner-svn-src-all@freebsd.org Mon Jan 9 23:45:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40920CA8180; Mon, 9 Jan 2017 23:45:41 +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 129091F39; Mon, 9 Jan 2017 23:45:41 +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 v09Nje7v054059; Mon, 9 Jan 2017 23:45:40 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09Nje3H054058; Mon, 9 Jan 2017 23:45:40 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701092345.v09Nje3H054058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 9 Jan 2017 23:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311840 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 23:45:41 -0000 Author: sbruno Date: Mon Jan 9 23:45:40 2017 New Revision: 311840 URL: https://svnweb.freebsd.org/changeset/base/311840 Log: White space cleanup from an cut-n-paste. Submitted by: mmacy@nextbsd.org Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jan 9 23:43:42 2017 (r311839) +++ head/sys/conf/files Mon Jan 9 23:45:40 2017 (r311840) @@ -3905,9 +3905,9 @@ net/if_tun.c optional tun net/if_tap.c optional tap net/if_vlan.c optional vlan net/if_vxlan.c optional vxlan inet | vxlan inet6 -net/ifdi_if.m optional ether pci -net/iflib.c optional ether pci -net/mp_ring.c optional ether +net/ifdi_if.m optional ether pci +net/iflib.c optional ether pci +net/mp_ring.c optional ether net/mppcc.c optional netgraph_mppc_compression net/mppcd.c optional netgraph_mppc_compression net/netisr.c standard From owner-svn-src-all@freebsd.org Mon Jan 9 23:51:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A00DDCA8328; Mon, 9 Jan 2017 23:51:32 +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 693B71302; Mon, 9 Jan 2017 23:51:32 +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 v09NpVpl055710; Mon, 9 Jan 2017 23:51:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09NpVoa055709; Mon, 9 Jan 2017 23:51:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701092351.v09NpVoa055709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 9 Jan 2017 23:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311841 - head/sys/fs/cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 23:51:32 -0000 Author: cem Date: Mon Jan 9 23:51:31 2017 New Revision: 311841 URL: https://svnweb.freebsd.org/changeset/base/311841 Log: cd9660: Add a prototype for cd9660_vfs_hash_cmp GCC warns (and errors, with -Werror) about it otherwise. Clang doesn't care. Introduced in r311665. Reported by: np@ Modified: head/sys/fs/cd9660/cd9660_vfsops.c Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Mon Jan 9 23:45:40 2017 (r311840) +++ head/sys/fs/cd9660/cd9660_vfsops.c Mon Jan 9 23:51:31 2017 (r311841) @@ -88,6 +88,7 @@ static struct vfsops cd9660_vfsops = { VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY); MODULE_VERSION(cd9660, 1); +static int cd9660_vfs_hash_cmp(struct vnode *vp, cd_ino_t *pino); static int iso_mountfs(struct vnode *devvp, struct mount *mp); /* From owner-svn-src-all@freebsd.org Mon Jan 9 23:56:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41EDFCA83A7; Mon, 9 Jan 2017 23:56:47 +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 05C461623; Mon, 9 Jan 2017 23:56:46 +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 v09Nuk8o058022; Mon, 9 Jan 2017 23:56:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09NuknP058021; Mon, 9 Jan 2017 23:56:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701092356.v09NuknP058021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 9 Jan 2017 23:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311842 - head/sys/fs/cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 23:56:47 -0000 Author: cem Date: Mon Jan 9 23:56:45 2017 New Revision: 311842 URL: https://svnweb.freebsd.org/changeset/base/311842 Log: cd9660: typedef cd_ino_t in preference to #define Suggested by: kib@ Modified: head/sys/fs/cd9660/iso.h Modified: head/sys/fs/cd9660/iso.h ============================================================================== --- head/sys/fs/cd9660/iso.h Mon Jan 9 23:51:31 2017 (r311841) +++ head/sys/fs/cd9660/iso.h Mon Jan 9 23:56:45 2017 (r311842) @@ -222,7 +222,7 @@ enum ISO_FTYPE { ISO_FTYPE_DEFAULT, ISO_ /* * When ino_t becomes 64-bit, we can remove this definition in favor of ino_t. */ -#define cd_ino_t uint64_t +typedef __uint64_t cd_ino_t; struct iso_mnt { uint64_t im_flags; From owner-svn-src-all@freebsd.org Tue Jan 10 00:03:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A793CA8968; Tue, 10 Jan 2017 00:03:44 +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 670051BE0; Tue, 10 Jan 2017 00:03:44 +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 v0A03hAQ061913; Tue, 10 Jan 2017 00:03:43 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A03hp5061912; Tue, 10 Jan 2017 00:03:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701100003.v0A03hp5061912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 10 Jan 2017 00:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311843 - head/sys/contrib/dev/acpica/components/tables X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 00:03:44 -0000 Author: cem Date: Tue Jan 10 00:03:43 2017 New Revision: 311843 URL: https://svnweb.freebsd.org/changeset/base/311843 Log: Adjust ACPI_EXPORT_SYMBOL for AcpiGetTableWithSize Suggested by: jbeich@ Modified: head/sys/contrib/dev/acpica/components/tables/tbxface.c Modified: head/sys/contrib/dev/acpica/components/tables/tbxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbxface.c Mon Jan 9 23:56:45 2017 (r311842) +++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Tue Jan 10 00:03:43 2017 (r311843) @@ -386,7 +386,7 @@ AcpiGetTableWithSize ( return (Status); } -ACPI_EXPORT_SYMBOL (AcpiGetTable) +ACPI_EXPORT_SYMBOL (AcpiGetTableWithSize) /******************************************************************************* From owner-svn-src-all@freebsd.org Tue Jan 10 00:04:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF30DCA89C3; Tue, 10 Jan 2017 00:04:15 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) (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 607781D5F; Tue, 10 Jan 2017 00:04:15 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf0-f65.google.com with SMTP id q89so7082389lfi.1; Mon, 09 Jan 2017 16:04:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:cc:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=NYbOCOXs0dFlQ4zdzfLIb+4RqOiUB8STOAM5cFLSSmQ=; b=VMAA4m7cpJDWKsz2opaNE4SfNlrmB1SMCCv0cPmsm+DU/6t8x55u2WCnq4YzhFmG/a LuCZ/POkyWwu/BnIBSpirr1RM2bGu9+en1xv1tXYpsw45gJv9qZVMohTU+OIsBJifmvV 3WVwgTLl1gq2CQHoi3jK7AAapsPOQ5aio+LHdnbzPiJqItUlTbDFDh7TM5jpZJYbNcrz o2xSGD2NDNRXU6VSQgNMwOHUi8V2rCD8sQk52Qxs4Gspas4i3HSp7TJChi5P9XHN2hu5 38YwUkq281hfjngGUNVNW0CDzx96L8UI1CLzD8WyR2Te+IL69aQPHkTy89OzKl1pYGNr 1jmA== X-Gm-Message-State: AIkVDXJX69HJ6WmJaOLMhHoMpkeTjBJXj7TBWYN+HhuAmHkMahrLQXa3NxN2NEu51sGd/Q== X-Received: by 10.25.40.211 with SMTP id o202mr69952lfo.183.1484006163710; Mon, 09 Jan 2017 15:56:03 -0800 (PST) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id s127sm17225lja.31.2017.01.09.15.56.02 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 09 Jan 2017 15:56:03 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Hans Petter Selasky" Subject: Re: svn commit: r311707 - in head/sys/dev/rtwn: . usb References: <201701082341.v08NfH4O046808@repo.freebsd.org> <83881095-b47e-facb-6bbe-a79f8e54209d@selasky.org> Date: Tue, 10 Jan 2017 01:56:10 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <83881095-b47e-facb-6bbe-a79f8e54209d@selasky.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 00:04:15 -0000 Mon, 09 Jan 2017 10:08:13 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Hans Petter Selasky = : Hi, The race should be fixed in r311838. > On 01/09/17 00:41, Andriy Voskoboinyk wrote: >> Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.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/rtwn/usb/rtwn_usb_ep.c Sun Jan 8 23:25:46 = >> 2017 (r311706) >> +++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan 8 23:41:17 = >> 2017 (r311707) >> @@ -63,7 +63,6 @@ static struct usb_config rtwn_config[RTW >> .type =3D UE_BULK, >> .endpoint =3D UE_ADDR_ANY, >> .direction =3D UE_DIR_IN, >> - .bufsize =3D RTWN_RXBUFSZ, >> .flags =3D { >> .pipe_bof =3D 1, >> .short_xfer_ok =3D 1 >> @@ -222,6 +221,7 @@ rtwn_usb_setup_endpoints(struct rtwn_usb >> break; >> } >> >> + rtwn_config[RTWN_BULK_RX].bufsize =3D sc->rx_dma_size + 1024; > > Hi, > > You should copy the rtwn_config to the stack/softc, and not write to t= he = > static struct, which should be made "static const" after this change! > > This might lead to a race when multiple adapters are connecting at the= = > same time! Remember USB enumeration is multithreaded. > > Else your change looks good. > > --HPS From owner-svn-src-all@freebsd.org Tue Jan 10 00:28:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEFEECA63A0; Tue, 10 Jan 2017 00:28:02 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EA341B30; Tue, 10 Jan 2017 00:28:02 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A0S1TO070436; Tue, 10 Jan 2017 00:28:01 GMT (envelope-from bms@FreeBSD.org) Received: (from bms@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A0S1ZU070435; Tue, 10 Jan 2017 00:28:01 GMT (envelope-from bms@FreeBSD.org) Message-Id: <201701100028.v0A0S1ZU070435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bms set sender to bms@FreeBSD.org using -f From: Bruce M Simpson Date: Tue, 10 Jan 2017 00:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311844 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 00:28:02 -0000 Author: bms Date: Tue Jan 10 00:28:01 2017 New Revision: 311844 URL: https://svnweb.freebsd.org/changeset/base/311844 Log: Add PID for Belkin F5U258 "Windows Easy Transfer Cable", a udbp-like device. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jan 10 00:03:43 2017 (r311843) +++ head/sys/dev/usb/usbdevs Tue Jan 10 00:28:01 2017 (r311844) @@ -1318,6 +1318,7 @@ product BELKIN RTL8188CU 0x1102 RTL8188 product BELKIN F9L1103 0x1103 F9L1103 Wireless Adapter product BELKIN RTL8192CU 0x2102 RTL8192CU Wireless Adapter product BELKIN F7D2102 0x2103 F7D2102 Wireless Adapter +product BELKIN F5U258 0x258A F5U258 Host to Host cable product BELKIN ZD1211B 0x4050 ZD1211B product BELKIN F5D5055 0x5055 F5D5055 product BELKIN F5D7050 0x7050 F5D7050 Wireless Adapter From owner-svn-src-all@freebsd.org Tue Jan 10 01:09:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69720CA6E0A; Tue, 10 Jan 2017 01:09:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F18D1DFA; Tue, 10 Jan 2017 01:09:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A19duR086543; Tue, 10 Jan 2017 01:09:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A19dTT086542; Tue, 10 Jan 2017 01:09:39 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701100109.v0A19dTT086542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 10 Jan 2017 01:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311845 - head/sys/dev/rtwn/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 01:09:40 -0000 Author: avos Date: Tue Jan 10 01:09:39 2017 New Revision: 311845 URL: https://svnweb.freebsd.org/changeset/base/311845 Log: rtwn_pci(4): fix possible race while accessing 'matched_chip' variable. Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_attach.c Tue Jan 10 00:28:01 2017 (r311844) +++ head/sys/dev/rtwn/pci/rtwn_pci_attach.c Tue Jan 10 01:09:39 2017 (r311845) @@ -94,20 +94,31 @@ static void rtwn_pci_beacon_update_end(s static void rtwn_pci_attach_methods(struct rtwn_softc *); -static int matched_chip = RTWN_CHIP_MAX_PCI; +static const struct rtwn_pci_ident * +rtwn_pci_probe_sub(device_t dev) +{ + const struct rtwn_pci_ident *ident; + int vendor_id, device_id; + + vendor_id = pci_get_vendor(dev); + device_id = pci_get_device(dev); + + for (ident = rtwn_pci_ident_table; ident->name != NULL; ident++) + if (vendor_id == ident->vendor && device_id == ident->device) + return (ident); + + return (NULL); +} static int rtwn_pci_probe(device_t dev) { const struct rtwn_pci_ident *ident; - for (ident = rtwn_pci_ident_table; ident->name != NULL; ident++) { - if (pci_get_vendor(dev) == ident->vendor && - pci_get_device(dev) == ident->device) { - matched_chip = ident->chip; - device_set_desc(dev, ident->name); - return (BUS_PROBE_DEFAULT); - } + ident = rtwn_pci_probe_sub(dev); + if (ident != NULL) { + device_set_desc(dev, ident->name); + return (BUS_PROBE_DEFAULT); } return (ENXIO); } @@ -591,13 +602,15 @@ rtwn_pci_attach_methods(struct rtwn_soft static int rtwn_pci_attach(device_t dev) { + const struct rtwn_pci_ident *ident; struct rtwn_pci_softc *pc = device_get_softc(dev); struct rtwn_softc *sc = &pc->pc_sc; struct ieee80211com *ic = &sc->sc_ic; uint32_t lcsr; int cap_off, i, error, rid; - if (matched_chip >= RTWN_CHIP_MAX_PCI) + ident = rtwn_pci_probe_sub(dev); + if (ident == NULL) return (ENXIO); /* @@ -649,8 +662,7 @@ rtwn_pci_attach(device_t dev) mtx_init(&sc->sc_mtx, ic->ic_name, MTX_NETWORK_LOCK, MTX_DEF); rtwn_pci_attach_methods(sc); - /* XXX something similar to USB_GET_DRIVER_INFO() */ - rtwn_pci_attach_private(pc, matched_chip); + rtwn_pci_attach_private(pc, ident->chip); /* Allocate Tx/Rx buffers. */ error = rtwn_pci_alloc_rx_list(sc); From owner-svn-src-all@freebsd.org Tue Jan 10 01:30:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E122DCA603C; Tue, 10 Jan 2017 01:30:42 +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 A9C531062; Tue, 10 Jan 2017 01:30:42 +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 v0A1Uf8t095212; Tue, 10 Jan 2017 01:30:41 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A1Uf9G095211; Tue, 10 Jan 2017 01:30:41 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701100130.v0A1Uf9G095211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 10 Jan 2017 01:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311846 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 01:30:43 -0000 Author: np Date: Tue Jan 10 01:30:41 2017 New Revision: 311846 URL: https://svnweb.freebsd.org/changeset/base/311846 Log: cxgbe(4): Refresh t4_msg.h, mainly for definitions related to the crypto engine. Obtained from: Chelsio Communications MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_msg.h Modified: head/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_msg.h Tue Jan 10 01:09:39 2017 (r311845) +++ head/sys/dev/cxgbe/common/t4_msg.h Tue Jan 10 01:30:41 2017 (r311846) @@ -106,6 +106,7 @@ enum { CPL_RX_FCOE_DIF = 0x4A, CPL_RX_DATA_DIF = 0x4B, CPL_ERR_NOTIFY = 0x4D, + CPL_RX_TLS_CMP = 0x4E, CPL_RDMA_READ_REQ = 0x60, CPL_RX_ISCSI_DIF = 0x60, @@ -113,6 +114,11 @@ enum { CPL_SET_LE_REQ = 0x80, CPL_PASS_OPEN_REQ6 = 0x81, CPL_ACT_OPEN_REQ6 = 0x83, + CPL_TX_TLS_PDU = 0x88, + CPL_TX_TLS_SFO = 0x89, + + CPL_TX_SEC_PDU = 0x8A, + CPL_TX_TLS_ACK = 0x8B, CPL_RDMA_TERMINATE = 0xA2, CPL_RDMA_WRITE = 0xA4, @@ -129,6 +135,7 @@ enum { CPL_TRACE_PKT = 0xB0, CPL_RX2TX_DATA = 0xB1, + CPL_TLS_DATA = 0xB1, CPL_ISCSI_DATA = 0xB2, CPL_FCOE_DATA = 0xB3, @@ -136,6 +143,7 @@ enum { CPL_FW4_PLD = 0xC1, CPL_FW4_ACK = 0xC3, CPL_SRQ_TABLE_RPL = 0xCC, + CPL_RX_PHYS_DSGL = 0xD0, CPL_FW6_MSG = 0xE0, CPL_FW6_PLD = 0xE1, @@ -200,6 +208,7 @@ enum { ULP_MODE_RDMA = 4, ULP_MODE_TCPDDP = 5, ULP_MODE_FCOE = 6, + ULP_MODE_TLS = 8, }; enum { @@ -993,6 +1002,23 @@ struct cpl_abort_req_rss { __u8 status; }; +struct cpl_abort_req_rss6 { + RSS_HDR + union opcode_tid ot; + __u32 srqidx_status; +}; + +#define S_ABORT_RSS_STATUS 0 +#define M_ABORT_RSS_STATUS 0xff +#define V_ABORT_RSS_STATUS(x) ((x) << S_ABORT_RSS_STATUS) +#define G_ABORT_RSS_STATUS(x) (((x) >> S_ABORT_RSS_STATUS) & M_ABORT_RSS_STATUS) + +#define S_ABORT_RSS_SRQIDX 8 +#define M_ABORT_RSS_SRQIDX 0xffffff +#define V_ABORT_RSS_SRQIDX(x) ((x) << S_ABORT_RSS_SRQIDX) +#define G_ABORT_RSS_SRQIDX(x) (((x) >> S_ABORT_RSS_SRQIDX) & M_ABORT_RSS_SRQIDX) + + /* cpl_abort_req status command code in case of T6, * bit[0] specifies whether to send RST (0) to remote peer or suppress it (1) * bit[1] indicates ABORT_REQ was sent after a CLOSE_CON_REQ @@ -1014,6 +1040,12 @@ struct cpl_abort_rpl_rss { __u8 status; }; +struct cpl_abort_rpl_rss6 { + RSS_HDR + union opcode_tid ot; + __u32 srqidx_status; +}; + struct cpl_abort_rpl { WR_HDR; union opcode_tid ot; @@ -2612,6 +2644,7 @@ enum { FW_TYPE_RSSCPL = 4, FW_TYPE_WRERR_RPL = 5, FW_TYPE_PI_ERR = 6, + FW_TYPE_TLS_KEY = 7, }; struct cpl_fw2_pld { @@ -2712,7 +2745,8 @@ enum { ULP_TX_SC_IMM = 0x81, ULP_TX_SC_DSGL = 0x82, ULP_TX_SC_ISGL = 0x83, - ULP_TX_SC_PICTRL = 0x84 + ULP_TX_SC_PICTRL = 0x84, + ULP_TX_SC_MEMRD = 0x86 }; #define S_ULPTX_CMD 24 @@ -2763,6 +2797,12 @@ struct ulptx_idata { #define S_ULPTX_NSGE 0 #define M_ULPTX_NSGE 0xFFFF #define V_ULPTX_NSGE(x) ((x) << S_ULPTX_NSGE) +#define G_ULPTX_NSGE(x) (((x) >> S_ULPTX_NSGE) & M_ULPTX_NSGE) + +struct ulptx_sc_memrd { + __be32 cmd_to_len; + __be32 addr; +}; struct ulp_mem_io { WR_HDR; @@ -2817,6 +2857,21 @@ struct ulp_txpkt { }; /* ulp_txpkt.cmd_dest fields */ +#define S_ULP_TXPKT_DATAMODIFY 23 +#define M_ULP_TXPKT_DATAMODIFY 0x1 +#define V_ULP_TXPKT_DATAMODIFY(x) ((x) << S_ULP_TXPKT_DATAMODIFY) +#define G_ULP_TXPKT_DATAMODIFY(x) \ + (((x) >> S_ULP_TXPKT_DATAMODIFY) & M_ULP_TXPKT_DATAMODIFY_) +#define F_ULP_TXPKT_DATAMODIFY V_ULP_TXPKT_DATAMODIFY(1U) + +#define S_ULP_TXPKT_CHANNELID 22 +#define M_ULP_TXPKT_CHANNELID 0x1 +#define V_ULP_TXPKT_CHANNELID(x) ((x) << S_ULP_TXPKT_CHANNELID) +#define G_ULP_TXPKT_CHANNELID(x) \ + (((x) >> S_ULP_TXPKT_CHANNELID) & M_ULP_TXPKT_CHANNELID) +#define F_ULP_TXPKT_CHANNELID V_ULP_TXPKT_CHANNELID(1U) + +/* ulp_txpkt.cmd_dest fields */ #define S_ULP_TXPKT_DEST 16 #define M_ULP_TXPKT_DEST 0x3 #define V_ULP_TXPKT_DEST(x) ((x) << S_ULP_TXPKT_DEST) @@ -3044,4 +3099,542 @@ struct cpl_rx_mps_pkt { #define X_CPL_RX_MPS_PKT_TYPE_QFC (1 << 2) #define X_CPL_RX_MPS_PKT_TYPE_PTP (1 << 3) +struct cpl_tx_tls_sfo { + __be32 op_to_seg_len; + __be32 pld_len; + __be64 rsvd; + __be32 seqno_numivs; + __be32 ivgen_hdrlen; + __be64 scmd1; +}; + +/* cpl_tx_tls_sfo macros */ +#define S_CPL_TX_TLS_SFO_OPCODE 24 +#define M_CPL_TX_TLS_SFO_OPCODE 0xff +#define V_CPL_TX_TLS_SFO_OPCODE(x) ((x) << S_CPL_TX_TLS_SFO_OPCODE) +#define G_CPL_TX_TLS_SFO_OPCODE(x) \ + (((x) >> S_CPL_TX_TLS_SFO_OPCODE) & M_CPL_TX_TLS_SFO_OPCODE) + +#define S_CPL_TX_TLS_SFO_DATA_TYPE 20 +#define M_CPL_TX_TLS_SFO_DATA_TYPE 0xf +#define V_CPL_TX_TLS_SFO_DATA_TYPE(x) ((x) << S_CPL_TX_TLS_SFO_DATA_TYPE) +#define G_CPL_TX_TLS_SFO_DATA_TYPE(x) \ + (((x) >> S_CPL_TX_TLS_SFO_DATA_TYPE) & M_CPL_TX_TLS_SFO_DATA_TYPE) + +#define S_CPL_TX_TLS_SFO_CPL_LEN 16 +#define M_CPL_TX_TLS_SFO_CPL_LEN 0xf +#define V_CPL_TX_TLS_SFO_CPL_LEN(x) ((x) << S_CPL_TX_TLS_SFO_CPL_LEN) +#define G_CPL_TX_TLS_SFO_CPL_LEN(x) \ + (((x) >> S_CPL_TX_TLS_SFO_CPL_LEN) & M_CPL_TX_TLS_SFO_CPL_LEN) +#define S_CPL_TX_TLS_SFO_SEG_LEN 0 +#define M_CPL_TX_TLS_SFO_SEG_LEN 0xffff +#define V_CPL_TX_TLS_SFO_SEG_LEN(x) ((x) << S_CPL_TX_TLS_SFO_SEG_LEN) +#define G_CPL_TX_TLS_SFO_SEG_LEN(x) \ + (((x) >> S_CPL_TX_TLS_SFO_SEG_LEN) & M_CPL_TX_TLS_SFO_SEG_LEN) + +struct cpl_tls_data { + RSS_HDR + __be32 op_tid; + __be32 length_pkd; + __be32 seq; + __be32 r1; +}; + +#define S_CPL_TLS_DATA_OPCODE 24 +#define M_CPL_TLS_DATA_OPCODE 0xff +#define V_CPL_TLS_DATA_OPCODE(x) ((x) << S_CPL_TLS_DATA_OPCODE) +#define G_CPL_TLS_DATA_OPCODE(x) \ + (((x) >> S_CPL_TLS_DATA_OPCODE) & M_CPL_TLS_DATA_OPCODE) + +#define S_CPL_TLS_DATA_TID 0 +#define M_CPL_TLS_DATA_TID 0xffffff +#define V_CPL_TLS_DATA_TID(x) ((x) << S_CPL_TLS_DATA_TID) +#define G_CPL_TLS_DATA_TID(x) \ + (((x) >> S_CPL_TLS_DATA_TID) & M_CPL_TLS_DATA_TID) + +#define S_CPL_TLS_DATA_LENGTH 0 +#define M_CPL_TLS_DATA_LENGTH 0xffff +#define V_CPL_TLS_DATA_LENGTH(x) ((x) << S_CPL_TLS_DATA_LENGTH) +#define G_CPL_TLS_DATA_LENGTH(x) \ + (((x) >> S_CPL_TLS_DATA_LENGTH) & M_CPL_TLS_DATA_LENGTH) + +struct cpl_rx_tls_cmp { + RSS_HDR + __be32 op_tid; + __be32 pdulength_length; + __be32 seq; + __be32 ddp_report; + __be32 r; + __be32 ddp_valid; +}; + +#define S_CPL_RX_TLS_CMP_OPCODE 24 +#define M_CPL_RX_TLS_CMP_OPCODE 0xff +#define V_CPL_RX_TLS_CMP_OPCODE(x) ((x) << S_CPL_RX_TLS_CMP_OPCODE) +#define G_CPL_RX_TLS_CMP_OPCODE(x) \ + (((x) >> S_CPL_RX_TLS_CMP_OPCODE) & M_CPL_RX_TLS_CMP_OPCODE) + +#define S_CPL_RX_TLS_CMP_TID 0 +#define M_CPL_RX_TLS_CMP_TID 0xffffff +#define V_CPL_RX_TLS_CMP_TID(x) ((x) << S_CPL_RX_TLS_CMP_TID) +#define G_CPL_RX_TLS_CMP_TID(x) \ + (((x) >> S_CPL_RX_TLS_CMP_TID) & M_CPL_RX_TLS_CMP_TID) + +#define S_CPL_RX_TLS_CMP_PDULENGTH 16 +#define M_CPL_RX_TLS_CMP_PDULENGTH 0xffff +#define V_CPL_RX_TLS_CMP_PDULENGTH(x) ((x) << S_CPL_RX_TLS_CMP_PDULENGTH) +#define G_CPL_RX_TLS_CMP_PDULENGTH(x) \ + (((x) >> S_CPL_RX_TLS_CMP_PDULENGTH) & M_CPL_RX_TLS_CMP_PDULENGTH) + +#define S_CPL_RX_TLS_CMP_LENGTH 0 +#define M_CPL_RX_TLS_CMP_LENGTH 0xffff +#define V_CPL_RX_TLS_CMP_LENGTH(x) ((x) << S_CPL_RX_TLS_CMP_LENGTH) +#define G_CPL_RX_TLS_CMP_LENGTH(x) \ + (((x) >> S_CPL_RX_TLS_CMP_LENGTH) & M_CPL_RX_TLS_CMP_LENGTH) + +#define S_SCMD_SEQ_NO_CTRL 29 +#define M_SCMD_SEQ_NO_CTRL 0x3 +#define V_SCMD_SEQ_NO_CTRL(x) ((x) << S_SCMD_SEQ_NO_CTRL) +#define G_SCMD_SEQ_NO_CTRL(x) \ + (((x) >> S_SCMD_SEQ_NO_CTRL) & M_SCMD_SEQ_NO_CTRL) + +/* StsFieldPrsnt- Status field at the end of the TLS PDU */ +#define S_SCMD_STATUS_PRESENT 28 +#define M_SCMD_STATUS_PRESENT 0x1 +#define V_SCMD_STATUS_PRESENT(x) ((x) << S_SCMD_STATUS_PRESENT) +#define G_SCMD_STATUS_PRESENT(x) \ + (((x) >> S_SCMD_STATUS_PRESENT) & M_SCMD_STATUS_PRESENT) +#define F_SCMD_STATUS_PRESENT V_SCMD_STATUS_PRESENT(1U) + +/* ProtoVersion - Protocol Version 0: 1.2, 1:1.1, 2:DTLS, 3:Generic, + * 3-15: Reserved. */ +#define S_SCMD_PROTO_VERSION 24 +#define M_SCMD_PROTO_VERSION 0xf +#define V_SCMD_PROTO_VERSION(x) ((x) << S_SCMD_PROTO_VERSION) +#define G_SCMD_PROTO_VERSION(x) \ + (((x) >> S_SCMD_PROTO_VERSION) & M_SCMD_PROTO_VERSION) + +/* EncDecCtrl - Encryption/Decryption Control. 0: Encrypt, 1: Decrypt */ +#define S_SCMD_ENC_DEC_CTRL 23 +#define M_SCMD_ENC_DEC_CTRL 0x1 +#define V_SCMD_ENC_DEC_CTRL(x) ((x) << S_SCMD_ENC_DEC_CTRL) +#define G_SCMD_ENC_DEC_CTRL(x) \ + (((x) >> S_SCMD_ENC_DEC_CTRL) & M_SCMD_ENC_DEC_CTRL) +#define F_SCMD_ENC_DEC_CTRL V_SCMD_ENC_DEC_CTRL(1U) + +/* CipherAuthSeqCtrl - Cipher Authentication Sequence Control. */ +#define S_SCMD_CIPH_AUTH_SEQ_CTRL 22 +#define M_SCMD_CIPH_AUTH_SEQ_CTRL 0x1 +#define V_SCMD_CIPH_AUTH_SEQ_CTRL(x) \ + ((x) << S_SCMD_CIPH_AUTH_SEQ_CTRL) +#define G_SCMD_CIPH_AUTH_SEQ_CTRL(x) \ + (((x) >> S_SCMD_CIPH_AUTH_SEQ_CTRL) & M_SCMD_CIPH_AUTH_SEQ_CTRL) +#define F_SCMD_CIPH_AUTH_SEQ_CTRL V_SCMD_CIPH_AUTH_SEQ_CTRL(1U) + +/* CiphMode - Cipher Mode. 0: NOP, 1:AES-CBC, 2:AES-GCM, 3:AES-CTR, + * 4:Generic-AES, 5-15: Reserved. */ +#define S_SCMD_CIPH_MODE 18 +#define M_SCMD_CIPH_MODE 0xf +#define V_SCMD_CIPH_MODE(x) ((x) << S_SCMD_CIPH_MODE) +#define G_SCMD_CIPH_MODE(x) \ + (((x) >> S_SCMD_CIPH_MODE) & M_SCMD_CIPH_MODE) + +/* AuthMode - Auth Mode. 0: NOP, 1:SHA1, 2:SHA2-224, 3:SHA2-256 + * 4-15: Reserved */ +#define S_SCMD_AUTH_MODE 14 +#define M_SCMD_AUTH_MODE 0xf +#define V_SCMD_AUTH_MODE(x) ((x) << S_SCMD_AUTH_MODE) +#define G_SCMD_AUTH_MODE(x) \ + (((x) >> S_SCMD_AUTH_MODE) & M_SCMD_AUTH_MODE) + +/* HmacCtrl - HMAC Control. 0:NOP, 1:No truncation, 2:Support HMAC Truncation + * per RFC 4366, 3:IPSec 96 bits, 4-7:Reserved + */ +#define S_SCMD_HMAC_CTRL 11 +#define M_SCMD_HMAC_CTRL 0x7 +#define V_SCMD_HMAC_CTRL(x) ((x) << S_SCMD_HMAC_CTRL) +#define G_SCMD_HMAC_CTRL(x) \ + (((x) >> S_SCMD_HMAC_CTRL) & M_SCMD_HMAC_CTRL) + +/* IvSize - IV size in units of 2 bytes */ +#define S_SCMD_IV_SIZE 7 +#define M_SCMD_IV_SIZE 0xf +#define V_SCMD_IV_SIZE(x) ((x) << S_SCMD_IV_SIZE) +#define G_SCMD_IV_SIZE(x) \ + (((x) >> S_SCMD_IV_SIZE) & M_SCMD_IV_SIZE) + +/* NumIVs - Number of IVs */ +#define S_SCMD_NUM_IVS 0 +#define M_SCMD_NUM_IVS 0x7f +#define V_SCMD_NUM_IVS(x) ((x) << S_SCMD_NUM_IVS) +#define G_SCMD_NUM_IVS(x) \ + (((x) >> S_SCMD_NUM_IVS) & M_SCMD_NUM_IVS) + +/* EnbDbgId - If this is enabled upper 20 (63:44) bits if SeqNumber + * (below) are used as Cid (connection id for debug status), these + * bits are padded to zero for forming the 64 bit + * sequence number for TLS + */ +#define S_SCMD_ENB_DBGID 31 +#define M_SCMD_ENB_DBGID 0x1 +#define V_SCMD_ENB_DBGID(x) ((x) << S_SCMD_ENB_DBGID) +#define G_SCMD_ENB_DBGID(x) \ + (((x) >> S_SCMD_ENB_DBGID) & M_SCMD_ENB_DBGID) + +/* IV generation in SW. */ +#define S_SCMD_IV_GEN_CTRL 30 +#define M_SCMD_IV_GEN_CTRL 0x1 +#define V_SCMD_IV_GEN_CTRL(x) ((x) << S_SCMD_IV_GEN_CTRL) +#define G_SCMD_IV_GEN_CTRL(x) \ + (((x) >> S_SCMD_IV_GEN_CTRL) & M_SCMD_IV_GEN_CTRL) +#define F_SCMD_IV_GEN_CTRL V_SCMD_IV_GEN_CTRL(1U) + +/* More frags */ +#define S_SCMD_MORE_FRAGS 20 +#define M_SCMD_MORE_FRAGS 0x1 +#define V_SCMD_MORE_FRAGS(x) ((x) << S_SCMD_MORE_FRAGS) +#define G_SCMD_MORE_FRAGS(x) (((x) >> S_SCMD_MORE_FRAGS) & M_SCMD_MORE_FRAGS) + +/*last frag */ +#define S_SCMD_LAST_FRAG 19 +#define M_SCMD_LAST_FRAG 0x1 +#define V_SCMD_LAST_FRAG(x) ((x) << S_SCMD_LAST_FRAG) +#define G_SCMD_LAST_FRAG(x) (((x) >> S_SCMD_LAST_FRAG) & M_SCMD_LAST_FRAG) + +/* TlsCompPdu */ +#define S_SCMD_TLS_COMPPDU 18 +#define M_SCMD_TLS_COMPPDU 0x1 +#define V_SCMD_TLS_COMPPDU(x) ((x) << S_SCMD_TLS_COMPPDU) +#define G_SCMD_TLS_COMPPDU(x) (((x) >> S_SCMD_TLS_COMPPDU) & M_SCMD_TLS_COMPPDU) + +/* KeyCntxtInline - Key context inline after the scmd OR PayloadOnly*/ +#define S_SCMD_KEY_CTX_INLINE 17 +#define M_SCMD_KEY_CTX_INLINE 0x1 +#define V_SCMD_KEY_CTX_INLINE(x) ((x) << S_SCMD_KEY_CTX_INLINE) +#define G_SCMD_KEY_CTX_INLINE(x) \ + (((x) >> S_SCMD_KEY_CTX_INLINE) & M_SCMD_KEY_CTX_INLINE) +#define F_SCMD_KEY_CTX_INLINE V_SCMD_KEY_CTX_INLINE(1U) + +/* TLSFragEnable - 0: Host created TLS PDUs, 1: TLS Framgmentation in ASIC */ +#define S_SCMD_TLS_FRAG_ENABLE 16 +#define M_SCMD_TLS_FRAG_ENABLE 0x1 +#define V_SCMD_TLS_FRAG_ENABLE(x) ((x) << S_SCMD_TLS_FRAG_ENABLE) +#define G_SCMD_TLS_FRAG_ENABLE(x) \ + (((x) >> S_SCMD_TLS_FRAG_ENABLE) & M_SCMD_TLS_FRAG_ENABLE) +#define F_SCMD_TLS_FRAG_ENABLE V_SCMD_TLS_FRAG_ENABLE(1U) + +/* MacOnly - Only send the MAC and discard PDU. This is valid for hash only + * modes, in this case TLS_TX will drop the PDU and only + * send back the MAC bytes. */ +#define S_SCMD_MAC_ONLY 15 +#define M_SCMD_MAC_ONLY 0x1 +#define V_SCMD_MAC_ONLY(x) ((x) << S_SCMD_MAC_ONLY) +#define G_SCMD_MAC_ONLY(x) \ + (((x) >> S_SCMD_MAC_ONLY) & M_SCMD_MAC_ONLY) +#define F_SCMD_MAC_ONLY V_SCMD_MAC_ONLY(1U) + +/* AadIVDrop - Drop the AAD and IV fields. Useful in protocols + * which have complex AAD and IV formations Eg:AES-CCM + */ +#define S_SCMD_AADIVDROP 14 +#define M_SCMD_AADIVDROP 0x1 +#define V_SCMD_AADIVDROP(x) ((x) << S_SCMD_AADIVDROP) +#define G_SCMD_AADIVDROP(x) \ + (((x) >> S_SCMD_AADIVDROP) & M_SCMD_AADIVDROP) +#define F_SCMD_AADIVDROP V_SCMD_AADIVDROP(1U) + +/* HdrLength - Length of all headers excluding TLS header + * present before start of crypto PDU/payload. */ +#define S_SCMD_HDR_LEN 0 +#define M_SCMD_HDR_LEN 0x3fff +#define V_SCMD_HDR_LEN(x) ((x) << S_SCMD_HDR_LEN) +#define G_SCMD_HDR_LEN(x) \ + (((x) >> S_SCMD_HDR_LEN) & M_SCMD_HDR_LEN) + +struct cpl_tx_sec_pdu { + __be32 op_ivinsrtofst; + __be32 pldlen; + __be32 aadstart_cipherstop_hi; + __be32 cipherstop_lo_authinsert; + __be32 seqno_numivs; + __be32 ivgen_hdrlen; + __be64 scmd1; +}; + +#define S_CPL_TX_SEC_PDU_OPCODE 24 +#define M_CPL_TX_SEC_PDU_OPCODE 0xff +#define V_CPL_TX_SEC_PDU_OPCODE(x) ((x) << S_CPL_TX_SEC_PDU_OPCODE) +#define G_CPL_TX_SEC_PDU_OPCODE(x) \ + (((x) >> S_CPL_TX_SEC_PDU_OPCODE) & M_CPL_TX_SEC_PDU_OPCODE) + +/* RX Channel Id */ +#define S_CPL_TX_SEC_PDU_RXCHID 22 +#define M_CPL_TX_SEC_PDU_RXCHID 0x1 +#define V_CPL_TX_SEC_PDU_RXCHID(x) ((x) << S_CPL_TX_SEC_PDU_RXCHID) +#define G_CPL_TX_SEC_PDU_RXCHID(x) \ +(((x) >> S_CPL_TX_SEC_PDU_RXCHID) & M_CPL_TX_SEC_PDU_RXCHID) +#define F_CPL_TX_SEC_PDU_RXCHID V_CPL_TX_SEC_PDU_RXCHID(1U) + +/* Ack Follows */ +#define S_CPL_TX_SEC_PDU_ACKFOLLOWS 21 +#define M_CPL_TX_SEC_PDU_ACKFOLLOWS 0x1 +#define V_CPL_TX_SEC_PDU_ACKFOLLOWS(x) ((x) << S_CPL_TX_SEC_PDU_ACKFOLLOWS) +#define G_CPL_TX_SEC_PDU_ACKFOLLOWS(x) \ +(((x) >> S_CPL_TX_SEC_PDU_ACKFOLLOWS) & M_CPL_TX_SEC_PDU_ACKFOLLOWS) +#define F_CPL_TX_SEC_PDU_ACKFOLLOWS V_CPL_TX_SEC_PDU_ACKFOLLOWS(1U) + +/* Loopback bit in cpl_tx_sec_pdu */ +#define S_CPL_TX_SEC_PDU_ULPTXLPBK 20 +#define M_CPL_TX_SEC_PDU_ULPTXLPBK 0x1 +#define V_CPL_TX_SEC_PDU_ULPTXLPBK(x) ((x) << S_CPL_TX_SEC_PDU_ULPTXLPBK) +#define G_CPL_TX_SEC_PDU_ULPTXLPBK(x) \ +(((x) >> S_CPL_TX_SEC_PDU_ULPTXLPBK) & M_CPL_TX_SEC_PDU_ULPTXLPBK) +#define F_CPL_TX_SEC_PDU_ULPTXLPBK V_CPL_TX_SEC_PDU_ULPTXLPBK(1U) + +/* Length of cpl header encapsulated */ +#define S_CPL_TX_SEC_PDU_CPLLEN 16 +#define M_CPL_TX_SEC_PDU_CPLLEN 0xf +#define V_CPL_TX_SEC_PDU_CPLLEN(x) ((x) << S_CPL_TX_SEC_PDU_CPLLEN) +#define G_CPL_TX_SEC_PDU_CPLLEN(x) \ + (((x) >> S_CPL_TX_SEC_PDU_CPLLEN) & M_CPL_TX_SEC_PDU_CPLLEN) + +/* PlaceHolder */ +#define S_CPL_TX_SEC_PDU_PLACEHOLDER 10 +#define M_CPL_TX_SEC_PDU_PLACEHOLDER 0x1 +#define V_CPL_TX_SEC_PDU_PLACEHOLDER(x) ((x) << S_CPL_TX_SEC_PDU_PLACEHOLDER) +#define G_CPL_TX_SEC_PDU_PLACEHOLDER(x) \ + (((x) >> S_CPL_TX_SEC_PDU_PLACEHOLDER) & \ + M_CPL_TX_SEC_PDU_PLACEHOLDER) + +/* IvInsrtOffset: Insertion location for IV */ +#define S_CPL_TX_SEC_PDU_IVINSRTOFST 0 +#define M_CPL_TX_SEC_PDU_IVINSRTOFST 0x3ff +#define V_CPL_TX_SEC_PDU_IVINSRTOFST(x) ((x) << S_CPL_TX_SEC_PDU_IVINSRTOFST) +#define G_CPL_TX_SEC_PDU_IVINSRTOFST(x) \ + (((x) >> S_CPL_TX_SEC_PDU_IVINSRTOFST) & \ + M_CPL_TX_SEC_PDU_IVINSRTOFST) + +/* AadStartOffset: Offset in bytes for AAD start from + * the first byte following + * the pkt headers (0-255 + * bytes) */ +#define S_CPL_TX_SEC_PDU_AADSTART 24 +#define M_CPL_TX_SEC_PDU_AADSTART 0xff +#define V_CPL_TX_SEC_PDU_AADSTART(x) ((x) << S_CPL_TX_SEC_PDU_AADSTART) +#define G_CPL_TX_SEC_PDU_AADSTART(x) \ + (((x) >> S_CPL_TX_SEC_PDU_AADSTART) & \ + M_CPL_TX_SEC_PDU_AADSTART) + +/* AadStopOffset: offset in bytes for AAD stop/end from the first byte following + * the pkt headers (0-511 bytes) */ +#define S_CPL_TX_SEC_PDU_AADSTOP 15 +#define M_CPL_TX_SEC_PDU_AADSTOP 0x1ff +#define V_CPL_TX_SEC_PDU_AADSTOP(x) ((x) << S_CPL_TX_SEC_PDU_AADSTOP) +#define G_CPL_TX_SEC_PDU_AADSTOP(x) \ + (((x) >> S_CPL_TX_SEC_PDU_AADSTOP) & M_CPL_TX_SEC_PDU_AADSTOP) + +/* CipherStartOffset: offset in bytes for encryption/decryption start from the + * first byte following the pkt headers (0-1023 + * bytes) */ +#define S_CPL_TX_SEC_PDU_CIPHERSTART 5 +#define M_CPL_TX_SEC_PDU_CIPHERSTART 0x3ff +#define V_CPL_TX_SEC_PDU_CIPHERSTART(x) ((x) << S_CPL_TX_SEC_PDU_CIPHERSTART) +#define G_CPL_TX_SEC_PDU_CIPHERSTART(x) \ + (((x) >> S_CPL_TX_SEC_PDU_CIPHERSTART) & \ + M_CPL_TX_SEC_PDU_CIPHERSTART) + +/* CipherStopOffset: offset in bytes for encryption/decryption end + * from end of the payload of this command (0-511 bytes) */ +#define S_CPL_TX_SEC_PDU_CIPHERSTOP_HI 0 +#define M_CPL_TX_SEC_PDU_CIPHERSTOP_HI 0x1f +#define V_CPL_TX_SEC_PDU_CIPHERSTOP_HI(x) \ + ((x) << S_CPL_TX_SEC_PDU_CIPHERSTOP_HI) +#define G_CPL_TX_SEC_PDU_CIPHERSTOP_HI(x) \ + (((x) >> S_CPL_TX_SEC_PDU_CIPHERSTOP_HI) & \ + M_CPL_TX_SEC_PDU_CIPHERSTOP_HI) + +#define S_CPL_TX_SEC_PDU_CIPHERSTOP_LO 28 +#define M_CPL_TX_SEC_PDU_CIPHERSTOP_LO 0xf +#define V_CPL_TX_SEC_PDU_CIPHERSTOP_LO(x) \ + ((x) << S_CPL_TX_SEC_PDU_CIPHERSTOP_LO) +#define G_CPL_TX_SEC_PDU_CIPHERSTOP_LO(x) \ + (((x) >> S_CPL_TX_SEC_PDU_CIPHERSTOP_LO) & \ + M_CPL_TX_SEC_PDU_CIPHERSTOP_LO) + +/* AuthStartOffset: offset in bytes for authentication start from + * the first byte following the pkt headers (0-1023) + * */ +#define S_CPL_TX_SEC_PDU_AUTHSTART 18 +#define M_CPL_TX_SEC_PDU_AUTHSTART 0x3ff +#define V_CPL_TX_SEC_PDU_AUTHSTART(x) ((x) << S_CPL_TX_SEC_PDU_AUTHSTART) +#define G_CPL_TX_SEC_PDU_AUTHSTART(x) \ + (((x) >> S_CPL_TX_SEC_PDU_AUTHSTART) & \ + M_CPL_TX_SEC_PDU_AUTHSTART) + +/* AuthStopOffset: offset in bytes for authentication + * end from end of the payload of this command (0-511 Bytes) */ +#define S_CPL_TX_SEC_PDU_AUTHSTOP 9 +#define M_CPL_TX_SEC_PDU_AUTHSTOP 0x1ff +#define V_CPL_TX_SEC_PDU_AUTHSTOP(x) ((x) << S_CPL_TX_SEC_PDU_AUTHSTOP) +#define G_CPL_TX_SEC_PDU_AUTHSTOP(x) \ + (((x) >> S_CPL_TX_SEC_PDU_AUTHSTOP) & \ + M_CPL_TX_SEC_PDU_AUTHSTOP) + +/* AuthInsrtOffset: offset in bytes for authentication insertion + * from end of the payload of this command (0-511 bytes) */ +#define S_CPL_TX_SEC_PDU_AUTHINSERT 0 +#define M_CPL_TX_SEC_PDU_AUTHINSERT 0x1ff +#define V_CPL_TX_SEC_PDU_AUTHINSERT(x) ((x) << S_CPL_TX_SEC_PDU_AUTHINSERT) +#define G_CPL_TX_SEC_PDU_AUTHINSERT(x) \ + (((x) >> S_CPL_TX_SEC_PDU_AUTHINSERT) & \ + M_CPL_TX_SEC_PDU_AUTHINSERT) + +struct cpl_rx_phys_dsgl { + __be32 op_to_tid; + __be32 pcirlxorder_to_noofsgentr; + struct rss_header rss_hdr_int; +}; + +#define S_CPL_RX_PHYS_DSGL_OPCODE 24 +#define M_CPL_RX_PHYS_DSGL_OPCODE 0xff +#define V_CPL_RX_PHYS_DSGL_OPCODE(x) ((x) << S_CPL_RX_PHYS_DSGL_OPCODE) +#define G_CPL_RX_PHYS_DSGL_OPCODE(x) \ + (((x) >> S_CPL_RX_PHYS_DSGL_OPCODE) & M_CPL_RX_PHYS_DSGL_OPCODE) + +#define S_CPL_RX_PHYS_DSGL_ISRDMA 23 +#define M_CPL_RX_PHYS_DSGL_ISRDMA 0x1 +#define V_CPL_RX_PHYS_DSGL_ISRDMA(x) ((x) << S_CPL_RX_PHYS_DSGL_ISRDMA) +#define G_CPL_RX_PHYS_DSGL_ISRDMA(x) \ + (((x) >> S_CPL_RX_PHYS_DSGL_ISRDMA) & M_CPL_RX_PHYS_DSGL_ISRDMA) +#define F_CPL_RX_PHYS_DSGL_ISRDMA V_CPL_RX_PHYS_DSGL_ISRDMA(1U) + +#define S_CPL_RX_PHYS_DSGL_RSVD1 20 +#define M_CPL_RX_PHYS_DSGL_RSVD1 0x7 +#define V_CPL_RX_PHYS_DSGL_RSVD1(x) ((x) << S_CPL_RX_PHYS_DSGL_RSVD1) +#define G_CPL_RX_PHYS_DSGL_RSVD1(x) \ + (((x) >> S_CPL_RX_PHYS_DSGL_RSVD1) & M_CPL_RX_PHYS_DSGL_RSVD1) + +#define S_CPL_RX_PHYS_DSGL_PCIRLXORDER 31 +#define M_CPL_RX_PHYS_DSGL_PCIRLXORDER 0x1 +#define V_CPL_RX_PHYS_DSGL_PCIRLXORDER(x) \ + ((x) << S_CPL_RX_PHYS_DSGL_PCIRLXORDER) +#define G_CPL_RX_PHYS_DSGL_PCIRLXORDER(x) \ + (((x) >> S_CPL_RX_PHYS_DSGL_PCIRLXORDER) & \ + M_CPL_RX_PHYS_DSGL_PCIRLXORDER) +#define F_CPL_RX_PHYS_DSGL_PCIRLXORDER V_CPL_RX_PHYS_DSGL_PCIRLXORDER(1U) + +#define S_CPL_RX_PHYS_DSGL_PCINOSNOOP 30 +#define M_CPL_RX_PHYS_DSGL_PCINOSNOOP 0x1 +#define V_CPL_RX_PHYS_DSGL_PCINOSNOOP(x) \ + ((x) << S_CPL_RX_PHYS_DSGL_PCINOSNOOP) +#define G_CPL_RX_PHYS_DSGL_PCINOSNOOP(x) \ + (((x) >> S_CPL_RX_PHYS_DSGL_PCINOSNOOP) & \ + M_CPL_RX_PHYS_DSGL_PCINOSNOOP) +#define F_CPL_RX_PHYS_DSGL_PCINOSNOOP V_CPL_RX_PHYS_DSGL_PCINOSNOOP(1U) + +#define S_CPL_RX_PHYS_DSGL_PCITPHNTENB 29 +#define M_CPL_RX_PHYS_DSGL_PCITPHNTENB 0x1 +#define V_CPL_RX_PHYS_DSGL_PCITPHNTENB(x) \ + ((x) << S_CPL_RX_PHYS_DSGL_PCITPHNTENB) +#define G_CPL_RX_PHYS_DSGL_PCITPHNTENB(x) \ + (((x) >> S_CPL_RX_PHYS_DSGL_PCITPHNTENB) & \ + M_CPL_RX_PHYS_DSGL_PCITPHNTENB) +#define F_CPL_RX_PHYS_DSGL_PCITPHNTENB V_CPL_RX_PHYS_DSGL_PCITPHNTENB(1U) + +#define S_CPL_RX_PHYS_DSGL_PCITPHNT 27 +#define M_CPL_RX_PHYS_DSGL_PCITPHNT 0x3 +#define V_CPL_RX_PHYS_DSGL_PCITPHNT(x) ((x) << S_CPL_RX_PHYS_DSGL_PCITPHNT) +#define G_CPL_RX_PHYS_DSGL_PCITPHNT(x) \ + (((x) >> S_CPL_RX_PHYS_DSGL_PCITPHNT) & \ + M_CPL_RX_PHYS_DSGL_PCITPHNT) + +#define S_CPL_RX_PHYS_DSGL_DCAID 16 +#define M_CPL_RX_PHYS_DSGL_DCAID 0x7ff +#define V_CPL_RX_PHYS_DSGL_DCAID(x) ((x) << S_CPL_RX_PHYS_DSGL_DCAID) +#define G_CPL_RX_PHYS_DSGL_DCAID(x) \ + (((x) >> S_CPL_RX_PHYS_DSGL_DCAID) & \ + M_CPL_RX_PHYS_DSGL_DCAID) + +#define S_CPL_RX_PHYS_DSGL_NOOFSGENTR 0 +#define M_CPL_RX_PHYS_DSGL_NOOFSGENTR 0xffff +#define V_CPL_RX_PHYS_DSGL_NOOFSGENTR(x) \ + ((x) << S_CPL_RX_PHYS_DSGL_NOOFSGENTR) +#define G_CPL_RX_PHYS_DSGL_NOOFSGENTR(x) \ + (((x) >> S_CPL_RX_PHYS_DSGL_NOOFSGENTR) & \ + M_CPL_RX_PHYS_DSGL_NOOFSGENTR) + +/* CPL_TX_TLS_ACK */ +struct cpl_tx_tls_ack { + __be32 op_to_Rsvd2; + __be32 PldLen; + __be64 Rsvd3; +}; + +#define S_CPL_TX_TLS_ACK_OPCODE 24 +#define M_CPL_TX_TLS_ACK_OPCODE 0xff +#define V_CPL_TX_TLS_ACK_OPCODE(x) ((x) << S_CPL_TX_TLS_ACK_OPCODE) +#define G_CPL_TX_TLS_ACK_OPCODE(x) \ + (((x) >> S_CPL_TX_TLS_ACK_OPCODE) & M_CPL_TX_TLS_ACK_OPCODE) + +#define S_CPL_TX_TLS_ACK_RSVD1 23 +#define M_CPL_TX_TLS_ACK_RSVD1 0x1 +#define V_CPL_TX_TLS_ACK_RSVD1(x) ((x) << S_CPL_TX_TLS_ACK_RSVD1) +#define G_CPL_TX_TLS_ACK_RSVD1(x) \ + (((x) >> S_CPL_TX_TLS_ACK_RSVD1) & M_CPL_TX_TLS_ACK_RSVD1) +#define F_CPL_TX_TLS_ACK_RSVD1 V_CPL_TX_TLS_ACK_RSVD1(1U) + +#define S_CPL_TX_TLS_ACK_RXCHID 22 +#define M_CPL_TX_TLS_ACK_RXCHID 0x1 +#define V_CPL_TX_TLS_ACK_RXCHID(x) ((x) << S_CPL_TX_TLS_ACK_RXCHID) +#define G_CPL_TX_TLS_ACK_RXCHID(x) \ + (((x) >> S_CPL_TX_TLS_ACK_RXCHID) & M_CPL_TX_TLS_ACK_RXCHID) +#define F_CPL_TX_TLS_ACK_RXCHID V_CPL_TX_TLS_ACK_RXCHID(1U) + +#define S_CPL_TX_TLS_ACK_FWMSG 21 +#define M_CPL_TX_TLS_ACK_FWMSG 0x1 +#define V_CPL_TX_TLS_ACK_FWMSG(x) ((x) << S_CPL_TX_TLS_ACK_FWMSG) +#define G_CPL_TX_TLS_ACK_FWMSG(x) \ + (((x) >> S_CPL_TX_TLS_ACK_FWMSG) & M_CPL_TX_TLS_ACK_FWMSG) +#define F_CPL_TX_TLS_ACK_FWMSG V_CPL_TX_TLS_ACK_FWMSG(1U) + +#define S_CPL_TX_TLS_ACK_ULPTXLPBK 20 +#define M_CPL_TX_TLS_ACK_ULPTXLPBK 0x1 +#define V_CPL_TX_TLS_ACK_ULPTXLPBK(x) ((x) << S_CPL_TX_TLS_ACK_ULPTXLPBK) +#define G_CPL_TX_TLS_ACK_ULPTXLPBK(x) \ + (((x) >> S_CPL_TX_TLS_ACK_ULPTXLPBK) & M_CPL_TX_TLS_ACK_ULPTXLPBK) +#define F_CPL_TX_TLS_ACK_ULPTXLPBK V_CPL_TX_TLS_ACK_ULPTXLPBK(1U) + +#define S_CPL_TX_TLS_ACK_CPLLEN 16 +#define M_CPL_TX_TLS_ACK_CPLLEN 0xf +#define V_CPL_TX_TLS_ACK_CPLLEN(x) ((x) << S_CPL_TX_TLS_ACK_CPLLEN) +#define G_CPL_TX_TLS_ACK_CPLLEN(x) \ + (((x) >> S_CPL_TX_TLS_ACK_CPLLEN) & M_CPL_TX_TLS_ACK_CPLLEN) + +#define S_CPL_TX_TLS_ACK_COMPLONERR 15 +#define M_CPL_TX_TLS_ACK_COMPLONERR 0x1 +#define V_CPL_TX_TLS_ACK_COMPLONERR(x) ((x) << S_CPL_TX_TLS_ACK_COMPLONERR) +#define G_CPL_TX_TLS_ACK_COMPLONERR(x) \ + (((x) >> S_CPL_TX_TLS_ACK_COMPLONERR) & M_CPL_TX_TLS_ACK_COMPLONERR) +#define F_CPL_TX_TLS_ACK_COMPLONERR V_CPL_TX_TLS_ACK_COMPLONERR(1U) + +#define S_CPL_TX_TLS_ACK_LCB 14 +#define M_CPL_TX_TLS_ACK_LCB 0x1 +#define V_CPL_TX_TLS_ACK_LCB(x) ((x) << S_CPL_TX_TLS_ACK_LCB) +#define G_CPL_TX_TLS_ACK_LCB(x) \ + (((x) >> S_CPL_TX_TLS_ACK_LCB) & M_CPL_TX_TLS_ACK_LCB) +#define F_CPL_TX_TLS_ACK_LCB V_CPL_TX_TLS_ACK_LCB(1U) + +#define S_CPL_TX_TLS_ACK_PHASH 13 +#define M_CPL_TX_TLS_ACK_PHASH 0x1 +#define V_CPL_TX_TLS_ACK_PHASH(x) ((x) << S_CPL_TX_TLS_ACK_PHASH) +#define G_CPL_TX_TLS_ACK_PHASH(x) \ + (((x) >> S_CPL_TX_TLS_ACK_PHASH) & M_CPL_TX_TLS_ACK_PHASH) +#define F_CPL_TX_TLS_ACK_PHASH V_CPL_TX_TLS_ACK_PHASH(1U) + +#define S_CPL_TX_TLS_ACK_RSVD2 0 +#define M_CPL_TX_TLS_ACK_RSVD2 0x1fff +#define V_CPL_TX_TLS_ACK_RSVD2(x) ((x) << S_CPL_TX_TLS_ACK_RSVD2) +#define G_CPL_TX_TLS_ACK_RSVD2(x) \ + (((x) >> S_CPL_TX_TLS_ACK_RSVD2) & M_CPL_TX_TLS_ACK_RSVD2) + #endif /* T4_MSG_H */ From owner-svn-src-all@freebsd.org Tue Jan 10 01:31:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7AC2CA62B2; Tue, 10 Jan 2017 01:31:27 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8668E13DE; Tue, 10 Jan 2017 01:31:27 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A1VQ3q096030; Tue, 10 Jan 2017 01:31:26 GMT (envelope-from bms@FreeBSD.org) Received: (from bms@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A1VQWu096029; Tue, 10 Jan 2017 01:31:26 GMT (envelope-from bms@FreeBSD.org) Message-Id: <201701100131.v0A1VQWu096029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bms set sender to bms@FreeBSD.org using -f From: Bruce M Simpson Date: Tue, 10 Jan 2017 01:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311847 - head/sys/dev/usb/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 01:31:27 -0000 Author: bms Date: Tue Jan 10 01:31:26 2017 New Revision: 311847 URL: https://svnweb.freebsd.org/changeset/base/311847 Log: Allow udbp(4) to claim Belkin "Windows Easy Transfer Cable" for Netgraph use. These have been tested back-to-back with Linux 3.x and a similar attachment at the other end; a CDC EEM-like encapsulation can be used for emulated Ethernet over udbp(4) with ng_ether. Modified: head/sys/dev/usb/misc/udbp.c Modified: head/sys/dev/usb/misc/udbp.c ============================================================================== --- head/sys/dev/usb/misc/udbp.c Tue Jan 10 01:30:41 2017 (r311846) +++ head/sys/dev/usb/misc/udbp.c Tue Jan 10 01:31:26 2017 (r311847) @@ -259,6 +259,7 @@ static driver_t udbp_driver = { }; static const STRUCT_USB_HOST_ID udbp_devs[] = { + {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U258, 0)}, {USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_TURBOCONNECT, 0)}, {USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_GADGETZERO, 0)}, {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301, 0)}, From owner-svn-src-all@freebsd.org Tue Jan 10 01:36:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26AEACA6591; Tue, 10 Jan 2017 01:36:52 +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 EA71218B2; Tue, 10 Jan 2017 01:36:51 +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 v0A1apZI098343; Tue, 10 Jan 2017 01:36:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A1aprG098342; Tue, 10 Jan 2017 01:36:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701100136.v0A1aprG098342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 10 Jan 2017 01:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311848 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 01:36:52 -0000 Author: np Date: Tue Jan 10 01:36:50 2017 New Revision: 311848 URL: https://svnweb.freebsd.org/changeset/base/311848 Log: cxgbe(4): Attach to the 2x25 debug card. This is for internal use only. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Jan 10 01:31:26 2017 (r311847) +++ head/sys/dev/cxgbe/t4_main.c Tue Jan 10 01:36:50 2017 (r311848) @@ -623,6 +623,7 @@ struct { #endif }, t6_pciids[] = { {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ + {0x6400, "Chelsio T6225-DBG"}, /* 2 x 10/25G, debug */ {0x6401, "Chelsio T6225-CR"}, /* 2 x 10/25G */ {0x6402, "Chelsio T6225-SO-CR"}, /* 2 x 10/25G, nomem */ {0x6407, "Chelsio T62100-LP-CR"}, /* 2 x 40/50/100G */ From owner-svn-src-all@freebsd.org Tue Jan 10 03:23:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8615CA8DA6; Tue, 10 Jan 2017 03:23:23 +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 B08491A58; Tue, 10 Jan 2017 03:23:23 +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 v0A3NMVE045877; Tue, 10 Jan 2017 03:23:22 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A3NMAI045868; Tue, 10 Jan 2017 03:23:22 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701100323.v0A3NMAI045868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 10 Jan 2017 03:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 03:23:24 -0000 Author: sbruno Date: Tue Jan 10 03:23:22 2017 New Revision: 311849 URL: https://svnweb.freebsd.org/changeset/base/311849 Log: Migrate e1000 to the IFLIB framework: - em(4) igb(4) and lem(4) - deprecate the igb device from kernel configurations - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko Devices tested: - 82574L - I218-LM - 82546GB - 82579LM - I350 - I217 Please report problems to freebsd-net@freebsd.org Partial review from jhb and suggestions on how to *not* brick folks who originally would have lost their igbX device. Submitted by: mmacy@nextbsd.org MFC after: 2 weeks Relnotes: yes Sponsored by: Limelight Networks and Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8299 Added: head/sys/dev/e1000/em_txrx.c (contents, props changed) head/sys/dev/e1000/igb_txrx.c (contents, props changed) Deleted: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h head/sys/modules/igb/ Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/arm64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/conf/makeLINT.mk head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/i386/conf/GENERIC head/sys/mips/conf/OCTEON1 head/sys/modules/Makefile head/sys/modules/em/Makefile head/sys/powerpc/conf/GENERIC64 Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Jan 10 01:36:50 2017 (r311848) +++ head/UPDATING Tue Jan 10 03:23:22 2017 (r311849) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 ****************************** SPECIAL WARNING: ****************************** +20170109: + The igb(4), em(4) and lem(4) ethernet drivers are now implemented via + IFLIB. If you have a custom kernel configuration that excludes em(4) + but you use igb(4), you need to re-add em(4) to your custom configuration. + 20161217: Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.9.1. Please see the 20141231 entry below for information about prerequisites Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Jan 10 01:36:50 2017 (r311848) +++ head/sys/amd64/conf/GENERIC Tue Jan 10 03:23:22 2017 (r311849) @@ -230,7 +230,6 @@ device puc # Multi I/O cards and mult device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel PRO/1000 Gigabit Ethernet Family -device igb # Intel PRO/1000 PCIE Server Gigabit Family device ix # Intel PRO/10GbE PCIE PF Ethernet device ixv # Intel PRO/10GbE PCIE VF Ethernet device ixl # Intel XL710 40Gbe PCIE Ethernet Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Jan 10 01:36:50 2017 (r311848) +++ head/sys/arm64/conf/GENERIC Tue Jan 10 03:23:22 2017 (r311849) @@ -120,7 +120,6 @@ device mii device miibus # MII bus support device awg # Allwinner EMAC Gigabit Ethernet device em # Intel PRO/1000 Gigabit Ethernet Family -device igb # Intel PRO/1000 PCIE Server Gigabit Family device ix # Intel 10Gb Ethernet Family device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device smc # SMSC LAN91C111 Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Jan 10 01:36:50 2017 (r311848) +++ head/sys/conf/NOTES Tue Jan 10 03:23:22 2017 (r311849) @@ -1972,7 +1972,6 @@ device xmphy # XaQti XMAC II # KNE110TX. # de: Digital Equipment DC21040 # em: Intel Pro/1000 Gigabit Ethernet 82542, 82543, 82544 based adapters. -# igb: Intel Pro/1000 PCI Express Gigabit Ethernet: 82575 and later adapters. # ep: 3Com 3C509, 3C529, 3C556, 3C562D, 3C563D, 3C572, 3C574X, 3C579, 3C589 # and PC Card devices using these chipsets. # ex: Intel EtherExpress Pro/10 and other i82595-based adapters, @@ -2145,7 +2144,6 @@ device cxgbe # Chelsio T4-T6 1/10/25/4 device cxgbev # Chelsio T4-T6 Virtual Functions device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet -device igb # Intel Pro/1000 PCIE Gigabit Ethernet device ixgb # Intel Pro/10Gbe PCI-X Ethernet device ix # Intel Pro/10Gbe PCIE Ethernet device ixv # Intel Pro/10Gbe PCIE Ethernet VF Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jan 10 01:36:50 2017 (r311848) +++ head/sys/conf/files Tue Jan 10 03:23:22 2017 (r311849) @@ -1572,43 +1572,43 @@ dev/eisa/eisa_if.m standard dev/eisa/eisaconf.c optional eisa dev/e1000/if_em.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/if_lem.c optional em \ +dev/e1000/em_txrx.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/if_igb.c optional igb \ +dev/e1000/igb_txrx.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_80003es2lan.c optional em | igb \ +dev/e1000/e1000_80003es2lan.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_82540.c optional em | igb \ +dev/e1000/e1000_82540.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_82541.c optional em | igb \ +dev/e1000/e1000_82541.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_82542.c optional em | igb \ +dev/e1000/e1000_82542.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_82543.c optional em | igb \ +dev/e1000/e1000_82543.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_82571.c optional em | igb \ +dev/e1000/e1000_82571.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_82575.c optional em | igb \ +dev/e1000/e1000_82575.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_ich8lan.c optional em | igb \ +dev/e1000/e1000_ich8lan.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_i210.c optional em | igb \ +dev/e1000/e1000_i210.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_api.c optional em | igb \ +dev/e1000/e1000_api.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_mac.c optional em | igb \ +dev/e1000/e1000_mac.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_manage.c optional em | igb \ +dev/e1000/e1000_manage.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_nvm.c optional em | igb \ +dev/e1000/e1000_nvm.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_phy.c optional em | igb \ +dev/e1000/e1000_phy.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_vf.c optional em | igb \ +dev/e1000/e1000_vf.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_mbx.c optional em | igb \ +dev/e1000/e1000_mbx.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/e1000_osdep.c optional em | igb \ +dev/e1000/e1000_osdep.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/et/if_et.c optional et dev/en/if_en_pci.c optional en pci Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Tue Jan 10 01:36:50 2017 (r311848) +++ head/sys/conf/makeLINT.mk Tue Jan 10 03:23:22 2017 (r311849) @@ -38,7 +38,6 @@ LINT: ${NOTES} ../../conf/makeLINT.sed echo "nodevice bxe" >> ${.TARGET}-NOIP echo "nodevice em" >> ${.TARGET}-NOIP echo "nodevice fxp" >> ${.TARGET}-NOIP - echo "nodevice igb" >> ${.TARGET}-NOIP echo "nodevice jme" >> ${.TARGET}-NOIP echo "nodevice msk" >> ${.TARGET}-NOIP echo "nodevice mxge" >> ${.TARGET}-NOIP Added: head/sys/dev/e1000/em_txrx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/e1000/em_txrx.c Tue Jan 10 03:23:22 2017 (r311849) @@ -0,0 +1,720 @@ +/* $FreeBSD$ */ +#include "if_em.h" + +#ifdef RSS +#include +#include +#endif + +#ifdef VERBOSE_DEBUG +#define DPRINTF device_printf +#else +#define DPRINTF(...) +#endif + +/********************************************************************* + * Local Function prototypes + *********************************************************************/ +static int em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_lower); +static int em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_lower); +static int em_isc_txd_encap(void *arg, if_pkt_info_t pi); +static void em_isc_txd_flush(void *arg, uint16_t txqid, uint32_t pidx); +static int em_isc_txd_credits_update(void *arg, uint16_t txqid, uint32_t cidx_init, bool clear); +static void em_isc_rxd_refill(void *arg, uint16_t rxqid, uint8_t flid __unused, + uint32_t pidx, uint64_t *paddrs, caddr_t *vaddrs __unused, uint16_t count, uint16_t buflen __unused); +static void em_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, uint32_t pidx); +static int em_isc_rxd_available(void *arg, uint16_t rxqid, uint32_t idx, + int budget); +static int em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri); + +static void lem_isc_rxd_refill(void *arg, uint16_t rxqid, uint8_t flid __unused, + uint32_t pidx, uint64_t *paddrs, caddr_t *vaddrs __unused, uint16_t count, uint16_t buflen __unused); + +static int lem_isc_rxd_available(void *arg, uint16_t rxqid, uint32_t idx, + int budget); +static int lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri); + +static void lem_receive_checksum(int status, int errors, if_rxd_info_t ri); +static void em_receive_checksum(uint32_t status, if_rxd_info_t ri); +extern int em_intr(void *arg); + +struct if_txrx em_txrx = { + em_isc_txd_encap, + em_isc_txd_flush, + em_isc_txd_credits_update, + em_isc_rxd_available, + em_isc_rxd_pkt_get, + em_isc_rxd_refill, + em_isc_rxd_flush, + em_intr +}; + +struct if_txrx lem_txrx = { + em_isc_txd_encap, + em_isc_txd_flush, + em_isc_txd_credits_update, + lem_isc_rxd_available, + lem_isc_rxd_pkt_get, + lem_isc_rxd_refill, + em_isc_rxd_flush, + em_intr +}; + +extern if_shared_ctx_t em_sctx; + +/********************************************************************** + * + * Setup work for hardware segmentation offload (TSO) on + * adapters using advanced tx descriptors + * + **********************************************************************/ +static int +em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_lower) +{ + if_softc_ctx_t scctx = adapter->shared; + struct em_tx_queue *que = &adapter->tx_queues[pi->ipi_qsidx]; + struct tx_ring *txr = &que->txr; + struct e1000_context_desc *TXD; + struct em_txbuffer *tx_buffer; + int cur, hdr_len; + + hdr_len = pi->ipi_ehdrlen + pi->ipi_ip_hlen + pi->ipi_tcp_hlen; + *txd_lower = (E1000_TXD_CMD_DEXT | /* Extended descr type */ + E1000_TXD_DTYP_D | /* Data descr type */ + E1000_TXD_CMD_TSE); /* Do TSE on this packet */ + + /* IP and/or TCP header checksum calculation and insertion. */ + *txd_upper = (E1000_TXD_POPTS_IXSM | E1000_TXD_POPTS_TXSM) << 8; + + cur = pi->ipi_pidx; + TXD = (struct e1000_context_desc *)&txr->tx_base[cur]; + tx_buffer = &txr->tx_buffers[cur]; + + /* + * Start offset for header checksum calculation. + * End offset for header checksum calculation. + * Offset of place put the checksum. + */ + TXD->lower_setup.ip_fields.ipcss = pi->ipi_ehdrlen; + TXD->lower_setup.ip_fields.ipcse = + htole16(pi->ipi_ehdrlen + pi->ipi_ip_hlen - 1); + TXD->lower_setup.ip_fields.ipcso = pi->ipi_ehdrlen + offsetof(struct ip, ip_sum); + + /* + * Start offset for payload checksum calculation. + * End offset for payload checksum calculation. + * Offset of place to put the checksum. + */ + TXD->upper_setup.tcp_fields.tucss = pi->ipi_ehdrlen + pi->ipi_ip_hlen; + TXD->upper_setup.tcp_fields.tucse = 0; + TXD->upper_setup.tcp_fields.tucso = + pi->ipi_ehdrlen + pi->ipi_ip_hlen + offsetof(struct tcphdr, th_sum); + + /* + * Payload size per packet w/o any headers. + * Length of all headers up to payload. + */ + TXD->tcp_seg_setup.fields.mss = htole16(pi->ipi_tso_segsz); + TXD->tcp_seg_setup.fields.hdr_len = hdr_len; + + TXD->cmd_and_length = htole32(adapter->txd_cmd | + E1000_TXD_CMD_DEXT | /* Extended descr */ + E1000_TXD_CMD_TSE | /* TSE context */ + E1000_TXD_CMD_IP | /* Do IP csum */ + E1000_TXD_CMD_TCP | /* Do TCP checksum */ + (pi->ipi_len - hdr_len)); /* Total len */ + tx_buffer->eop = -1; + txr->tx_tso = TRUE; + + if (++cur == scctx->isc_ntxd[0]) { + cur = 0; + } + DPRINTF(iflib_get_dev(adapter->ctx), "%s: pidx: %d cur: %d\n", __FUNCTION__, pi->ipi_pidx, cur); + return (cur); +} + +#define TSO_WORKAROUND 4 +#define DONT_FORCE_CTX 1 + + +/********************************************************************* + * The offload context is protocol specific (TCP/UDP) and thus + * only needs to be set when the protocol changes. The occasion + * of a context change can be a performance detriment, and + * might be better just disabled. The reason arises in the way + * in which the controller supports pipelined requests from the + * Tx data DMA. Up to four requests can be pipelined, and they may + * belong to the same packet or to multiple packets. However all + * requests for one packet are issued before a request is issued + * for a subsequent packet and if a request for the next packet + * requires a context change, that request will be stalled + * until the previous request completes. This means setting up + * a new context effectively disables pipelined Tx data DMA which + * in turn greatly slow down performance to send small sized + * frames. + **********************************************************************/ + +static int +em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_lower) +{ + struct e1000_context_desc *TXD = NULL; + if_softc_ctx_t scctx = adapter->shared; + struct em_tx_queue *que = &adapter->tx_queues[pi->ipi_qsidx]; + struct tx_ring *txr = &que->txr; + struct em_txbuffer *tx_buffer; + int csum_flags = pi->ipi_csum_flags; + int cur, hdr_len; + u32 cmd; + + cur = pi->ipi_pidx; + hdr_len = pi->ipi_ehdrlen + pi->ipi_ip_hlen; + cmd = adapter->txd_cmd; + + /* + * The 82574L can only remember the *last* context used + * regardless of queue that it was use for. We cannot reuse + * contexts on this hardware platform and must generate a new + * context every time. 82574L hardware spec, section 7.2.6, + * second note. + */ + if (DONT_FORCE_CTX && + adapter->tx_num_queues == 1 && + txr->csum_lhlen == pi->ipi_ehdrlen && + txr->csum_iphlen == pi->ipi_ip_hlen && + txr->csum_flags == csum_flags) { + /* + * Same csum offload context as the previous packets; + * just return. + */ + *txd_upper = txr->csum_txd_upper; + *txd_lower = txr->csum_txd_lower; + return (cur); + } + + TXD = (struct e1000_context_desc *)&txr->tx_base[cur]; + if (csum_flags & CSUM_IP) { + *txd_upper |= E1000_TXD_POPTS_IXSM << 8; + /* + * Start offset for header checksum calculation. + * End offset for header checksum calculation. + * Offset of place to put the checksum. + */ + TXD->lower_setup.ip_fields.ipcss = pi->ipi_ehdrlen; + TXD->lower_setup.ip_fields.ipcse = htole16(hdr_len); + TXD->lower_setup.ip_fields.ipcso = pi->ipi_ehdrlen + offsetof(struct ip, ip_sum); + cmd |= E1000_TXD_CMD_IP; + } + + if (csum_flags & (CSUM_TCP|CSUM_UDP)) { + uint8_t tucso; + + *txd_upper |= E1000_TXD_POPTS_TXSM << 8; + *txd_lower = E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D; + + if (csum_flags & CSUM_TCP) { + tucso = hdr_len + offsetof(struct tcphdr, th_sum); + cmd |= E1000_TXD_CMD_TCP; + } else + tucso = hdr_len + offsetof(struct udphdr, uh_sum); + TXD->upper_setup.tcp_fields.tucss = hdr_len; + TXD->upper_setup.tcp_fields.tucse = htole16(0); + TXD->upper_setup.tcp_fields.tucso = tucso; + } + + txr->csum_lhlen = pi->ipi_ehdrlen; + txr->csum_iphlen = pi->ipi_ip_hlen; + txr->csum_flags = csum_flags; + txr->csum_txd_upper = *txd_upper; + txr->csum_txd_lower = *txd_lower; + + TXD->tcp_seg_setup.data = htole32(0); + TXD->cmd_and_length = + htole32(E1000_TXD_CMD_IFCS | E1000_TXD_CMD_DEXT | cmd); + + tx_buffer = &txr->tx_buffers[cur]; + tx_buffer->eop = -1; + + if (++cur == scctx->isc_ntxd[0]) { + cur = 0; + } + DPRINTF(iflib_get_dev(adapter->ctx), "checksum_setup csum_flags=%x txd_upper=%x txd_lower=%x hdr_len=%d cmd=%x\n", + csum_flags, *txd_upper, *txd_lower, hdr_len, cmd); + return (cur); +} + +static int +em_isc_txd_encap(void *arg, if_pkt_info_t pi) +{ + struct adapter *sc = arg; + if_softc_ctx_t scctx = sc->shared; + struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx]; + struct tx_ring *txr = &que->txr; + bus_dma_segment_t *segs = pi->ipi_segs; + int nsegs = pi->ipi_nsegs; + int csum_flags = pi->ipi_csum_flags; + int i, j, first, pidx_last; + u32 txd_upper = 0, txd_lower = 0; + + struct em_txbuffer *tx_buffer; + struct e1000_tx_desc *ctxd = NULL; + bool do_tso, tso_desc; + + i = first = pi->ipi_pidx; + do_tso = (csum_flags & CSUM_TSO); + tso_desc = FALSE; + /* + * TSO Hardware workaround, if this packet is not + * TSO, and is only a single descriptor long, and + * it follows a TSO burst, then we need to add a + * sentinel descriptor to prevent premature writeback. + */ + if ((!do_tso) && (txr->tx_tso == TRUE)) { + if (nsegs == 1) + tso_desc = TRUE; + txr->tx_tso = FALSE; + } + + /* Do hardware assists */ + if (do_tso) { + i = em_tso_setup(sc, pi, &txd_upper, &txd_lower); + tso_desc = TRUE; + } else if (csum_flags & CSUM_OFFLOAD) { + i = em_transmit_checksum_setup(sc, pi, &txd_upper, &txd_lower); + } + + if (pi->ipi_mflags & M_VLANTAG) { + /* Set the vlan id. */ + txd_upper |= htole16(pi->ipi_vtag) << 16; + /* Tell hardware to add tag */ + txd_lower |= htole32(E1000_TXD_CMD_VLE); + } + + DPRINTF(iflib_get_dev(sc->ctx), "encap: set up tx: nsegs=%d first=%d i=%d\n", nsegs, first, i); + /* XXX adapter->pcix_82544 -- lem_fill_descriptors */ + + /* Set up our transmit descriptors */ + for (j = 0; j < nsegs; j++) { + bus_size_t seg_len; + bus_addr_t seg_addr; + uint32_t cmd; + + ctxd = &txr->tx_base[i]; + tx_buffer = &txr->tx_buffers[i]; + seg_addr = segs[j].ds_addr; + seg_len = segs[j].ds_len; + cmd = E1000_TXD_CMD_IFCS | sc->txd_cmd; + + /* + ** TSO Workaround: + ** If this is the last descriptor, we want to + ** split it so we have a small final sentinel + */ + if (tso_desc && (j == (nsegs - 1)) && (seg_len > 8)) { + seg_len -= TSO_WORKAROUND; + ctxd->buffer_addr = htole64(seg_addr); + ctxd->lower.data = htole32(cmd | txd_lower | seg_len); + ctxd->upper.data = htole32(txd_upper); + + if (++i == scctx->isc_ntxd[0]) + i = 0; + + /* Now make the sentinel */ + ctxd = &txr->tx_base[i]; + tx_buffer = &txr->tx_buffers[i]; + ctxd->buffer_addr = htole64(seg_addr + seg_len); + ctxd->lower.data = htole32(cmd | txd_lower | TSO_WORKAROUND); + ctxd->upper.data = htole32(txd_upper); + pidx_last = i; + if (++i == scctx->isc_ntxd[0]) + i = 0; + DPRINTF(iflib_get_dev(sc->ctx), "TSO path pidx_last=%d i=%d ntxd[0]=%d\n", pidx_last, i, scctx->isc_ntxd[0]); + } else { + ctxd->buffer_addr = htole64(seg_addr); + ctxd->lower.data = htole32(cmd | txd_lower | seg_len); + ctxd->upper.data = htole32(txd_upper); + pidx_last = i; + if (++i == scctx->isc_ntxd[0]) + i = 0; + DPRINTF(iflib_get_dev(sc->ctx), "pidx_last=%d i=%d ntxd[0]=%d\n", pidx_last, i, scctx->isc_ntxd[0]); + } + tx_buffer->eop = -1; + } + + /* + * Last Descriptor of Packet + * needs End Of Packet (EOP) + * and Report Status (RS) + */ + ctxd->lower.data |= + htole32(E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS); + + tx_buffer = &txr->tx_buffers[first]; + tx_buffer->eop = pidx_last; + DPRINTF(iflib_get_dev(sc->ctx), "tx_buffers[%d]->eop = %d ipi_new_pidx=%d\n", first, pidx_last, i); + pi->ipi_new_pidx = i; + + return (0); +} + +static void +em_isc_txd_flush(void *arg, uint16_t txqid, uint32_t pidx) +{ + struct adapter *adapter = arg; + struct em_tx_queue *que = &adapter->tx_queues[txqid]; + struct tx_ring *txr = &que->txr; + + E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), pidx); +} + +static int +em_isc_txd_credits_update(void *arg, uint16_t txqid, uint32_t cidx_init, bool clear) +{ + struct adapter *adapter = arg; + if_softc_ctx_t scctx = adapter->shared; + struct em_tx_queue *que = &adapter->tx_queues[txqid]; + struct tx_ring *txr = &que->txr; + + u32 cidx, processed = 0; + int last, done; + struct em_txbuffer *buf; + struct e1000_tx_desc *tx_desc, *eop_desc; + + cidx = cidx_init; + buf = &txr->tx_buffers[cidx]; + tx_desc = &txr->tx_base[cidx]; + last = buf->eop; + eop_desc = &txr->tx_base[last]; + + DPRINTF(iflib_get_dev(adapter->ctx), "credits_update: cidx_init=%d clear=%d last=%d\n", + cidx_init, clear, last); + /* + * What this does is get the index of the + * first descriptor AFTER the EOP of the + * first packet, that way we can do the + * simple comparison on the inner while loop. + */ + if (++last == scctx->isc_ntxd[0]) + last = 0; + done = last; + + + while (eop_desc->upper.fields.status & E1000_TXD_STAT_DD) { + /* We clean the range of the packet */ + while (cidx != done) { + if (clear) { + tx_desc->upper.data = 0; + tx_desc->lower.data = 0; + tx_desc->buffer_addr = 0; + buf->eop = -1; + } + tx_desc++; + buf++; + processed++; + + /* wrap the ring ? */ + if (++cidx == scctx->isc_ntxd[0]) { + cidx = 0; + } + buf = &txr->tx_buffers[cidx]; + tx_desc = &txr->tx_base[cidx]; + } + /* See if we can continue to the next packet */ + last = buf->eop; + if (last == -1) + break; + eop_desc = &txr->tx_base[last]; + /* Get new done point */ + if (++last == scctx->isc_ntxd[0]) + last = 0; + done = last; + } + + DPRINTF(iflib_get_dev(adapter->ctx), "Processed %d credits update\n", processed); + return(processed); +} + +static void +lem_isc_rxd_refill(void *arg, uint16_t rxqid, uint8_t flid __unused, + uint32_t pidx, uint64_t *paddrs, caddr_t *vaddrs __unused, uint16_t count, uint16_t buflen __unused) +{ + struct adapter *sc = arg; + if_softc_ctx_t scctx = sc->shared; + struct em_rx_queue *que = &sc->rx_queues[rxqid]; + struct rx_ring *rxr = &que->rxr; + struct e1000_rx_desc *rxd; + int i; + uint32_t next_pidx; + + for (i = 0, next_pidx = pidx; i < count; i++) { + rxd = (struct e1000_rx_desc *)&rxr->rx_base[next_pidx]; + rxd->buffer_addr = htole64(paddrs[i]); + /* status bits must be cleared */ + rxd->status = 0; + + if (++next_pidx == scctx->isc_nrxd[0]) + next_pidx = 0; + } +} + +static void +em_isc_rxd_refill(void *arg, uint16_t rxqid, uint8_t flid __unused, + uint32_t pidx, uint64_t *paddrs, caddr_t *vaddrs __unused, uint16_t count, uint16_t buflen __unused) +{ + struct adapter *sc = arg; + if_softc_ctx_t scctx = sc->shared; + struct em_rx_queue *que = &sc->rx_queues[rxqid]; + struct rx_ring *rxr = &que->rxr; + union e1000_rx_desc_extended *rxd; + int i; + uint32_t next_pidx; + + for (i = 0, next_pidx = pidx; i < count; i++) { + rxd = &rxr->rx_base[next_pidx]; + rxd->read.buffer_addr = htole64(paddrs[i]); + /* DD bits must be cleared */ + rxd->wb.upper.status_error = 0; + + if (++next_pidx == scctx->isc_nrxd[0]) + next_pidx = 0; + } +} + +static void +em_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, uint32_t pidx) +{ + struct adapter *sc = arg; + struct em_rx_queue *que = &sc->rx_queues[rxqid]; + struct rx_ring *rxr = &que->rxr; + + E1000_WRITE_REG(&sc->hw, E1000_RDT(rxr->me), pidx); +} + +static int +lem_isc_rxd_available(void *arg, uint16_t rxqid, uint32_t idx, int budget) +{ + struct adapter *sc = arg; + if_softc_ctx_t scctx = sc->shared; + struct em_rx_queue *que = &sc->rx_queues[rxqid]; + struct rx_ring *rxr = &que->rxr; + struct e1000_rx_desc *rxd; + u32 staterr = 0; + int cnt, i; + + for (cnt = 0, i = idx; cnt < scctx->isc_nrxd[0] && cnt <= budget;) { + rxd = (struct e1000_rx_desc *)&rxr->rx_base[i]; + staterr = rxd->status; + + if ((staterr & E1000_RXD_STAT_DD) == 0) + break; + + if (++i == scctx->isc_nrxd[0]) + i = 0; + + if (staterr & E1000_RXD_STAT_EOP) + cnt++; + } + return (cnt); +} + +static int +em_isc_rxd_available(void *arg, uint16_t rxqid, uint32_t idx, int budget) +{ + struct adapter *sc = arg; + if_softc_ctx_t scctx = sc->shared; + struct em_rx_queue *que = &sc->rx_queues[rxqid]; + struct rx_ring *rxr = &que->rxr; + union e1000_rx_desc_extended *rxd; + u32 staterr = 0; + int cnt, i; + + for (cnt = 0, i = idx; cnt < scctx->isc_nrxd[0] && cnt <= budget;) { + rxd = &rxr->rx_base[i]; + staterr = le32toh(rxd->wb.upper.status_error); + + if ((staterr & E1000_RXD_STAT_DD) == 0) + break; + + if (++i == scctx->isc_nrxd[0]) { + i = 0; + } + + if (staterr & E1000_RXD_STAT_EOP) + cnt++; + + } + return (cnt); +} + +static int +lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) +{ + struct adapter *adapter = arg; + if_softc_ctx_t scctx = adapter->shared; + struct em_rx_queue *que = &adapter->rx_queues[ri->iri_qsidx]; + struct rx_ring *rxr = &que->rxr; + struct e1000_rx_desc *rxd; + u16 len; + u32 status, errors; + bool eop; + int i, cidx; + + status = errors = i = 0; + cidx = ri->iri_cidx; + + do { + rxd = (struct e1000_rx_desc *)&rxr->rx_base[cidx]; + status = rxd->status; + errors = rxd->errors; + + /* Error Checking then decrement count */ + MPASS ((status & E1000_RXD_STAT_DD) != 0); + + len = le16toh(rxd->length); + ri->iri_len += len; + + eop = (status & E1000_RXD_STAT_EOP) != 0; + + /* Make sure bad packets are discarded */ + if (errors & E1000_RXD_ERR_FRAME_ERR_MASK) { + adapter->dropped_pkts++; + /* XXX fixup if common */ + return (EBADMSG); + } + + ri->iri_frags[i].irf_flid = 0; + ri->iri_frags[i].irf_idx = cidx; + ri->iri_frags[i].irf_len = len; + /* Zero out the receive descriptors status. */ + rxd->status = 0; + + if (++cidx == scctx->isc_nrxd[0]) + cidx = 0; + i++; + } while (!eop); + + /* XXX add a faster way to look this up */ + if (adapter->hw.mac.type >= e1000_82543 && !(status & E1000_RXD_STAT_IXSM)) + lem_receive_checksum(status, errors, ri); + + if (status & E1000_RXD_STAT_VP) { + ri->iri_vtag = le16toh(rxd->special); + ri->iri_flags |= M_VLANTAG; + } + + ri->iri_nfrags = i; + + return (0); +} + +static int +em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) +{ + struct adapter *adapter = arg; + if_softc_ctx_t scctx = adapter->shared; + struct em_rx_queue *que = &adapter->rx_queues[ri->iri_qsidx]; + struct rx_ring *rxr = &que->rxr; + union e1000_rx_desc_extended *rxd; + + u16 len; + u32 staterr = 0; + bool eop; + int i, cidx, vtag; + + i = vtag = 0; + cidx = ri->iri_cidx; + + do { + rxd = &rxr->rx_base[cidx]; + staterr = le32toh(rxd->wb.upper.status_error); + + /* Error Checking then decrement count */ + MPASS ((staterr & E1000_RXD_STAT_DD) != 0); + + len = le16toh(rxd->wb.upper.length); + ri->iri_len += len; + + eop = (staterr & E1000_RXD_STAT_EOP) != 0; + + /* Make sure bad packets are discarded */ + if (staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) { + adapter->dropped_pkts++; + return EBADMSG; + } + + ri->iri_frags[i].irf_flid = 0; + ri->iri_frags[i].irf_idx = cidx; + ri->iri_frags[i].irf_len = len; + /* Zero out the receive descriptors status. */ + rxd->wb.upper.status_error &= htole32(~0xFF); + + if (++cidx == scctx->isc_nrxd[0]) + cidx = 0; + i++; + } while (!eop); + + /* XXX add a faster way to look this up */ + if (adapter->hw.mac.type >= e1000_82543) + em_receive_checksum(staterr, ri); + + if (staterr & E1000_RXD_STAT_VP) { + vtag = le16toh(rxd->wb.upper.vlan); + } + + ri->iri_vtag = vtag; + ri->iri_nfrags = i; + if (vtag) + ri->iri_flags |= M_VLANTAG; + + return (0); +} + +/********************************************************************* + * + * Verify that the hardware indicated that the checksum is valid. + * Inform the stack about the status of checksum so that stack + * doesn't spend time verifying the checksum. + * + *********************************************************************/ +static void +lem_receive_checksum(int status, int errors, if_rxd_info_t ri) +{ + /* Did it pass? */ + if (status & E1000_RXD_STAT_IPCS && !(errors & E1000_RXD_ERR_IPE)) + ri->iri_csum_flags = (CSUM_IP_CHECKED|CSUM_IP_VALID); + + if (status & E1000_RXD_STAT_TCPCS) { + /* Did it pass? */ + if (!(errors & E1000_RXD_ERR_TCPE)) { + ri->iri_csum_flags |= + (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + ri->iri_csum_data = htons(0xffff); + } + } +} + +static void +em_receive_checksum(uint32_t status, if_rxd_info_t ri) +{ + ri->iri_csum_flags = 0; + + /* Ignore Checksum bit is set */ + if (status & E1000_RXD_STAT_IXSM) + return; + + /* If the IP checksum exists and there is no IP Checksum error */ + if ((status & (E1000_RXD_STAT_IPCS | E1000_RXDEXT_STATERR_IPE)) == + E1000_RXD_STAT_IPCS) { + ri->iri_csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); + } + + /* TCP or UDP checksum */ + if ((status & (E1000_RXD_STAT_TCPCS | E1000_RXDEXT_STATERR_TCPE)) == + E1000_RXD_STAT_TCPCS) { + ri->iri_csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + ri->iri_csum_data = htons(0xffff); + } + if (status & E1000_RXD_STAT_UDPCS) { + ri->iri_csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + ri->iri_csum_data = htons(0xffff); + } +} Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Jan 10 01:36:50 2017 (r311848) +++ head/sys/dev/e1000/if_em.c Tue Jan 10 03:23:22 2017 (r311849) @@ -1,99 +1,10 @@ -/****************************************************************************** - - Copyright (c) 2001-2015, Intel Corporation - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -******************************************************************************/ -/*$FreeBSD$*/ - -#include "opt_em.h" -#include "opt_ddb.h" -#include "opt_inet.h" -#include "opt_inet6.h" - -#ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_device_polling.h" -#endif - -#include -#include -#ifdef DDB -#include -#include -#endif -#if __FreeBSD_version >= 800000 -#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 -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "e1000_api.h" -#include "e1000_82571.h" +/* $FreeBSD$ */ #include "if_em.h" +#include +#include + +#define em_mac_min e1000_82547 +#define igb_mac_min e1000_82575 /********************************************************************* * Driver version: @@ -110,184 +21,213 @@ char em_driver_version[] = "7.6.1-k"; * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } *********************************************************************/ -static em_vendor_info_t em_vendor_info_array[] = +static pci_vendor_info_t em_vendor_info_array[] = { - /* Intel(R) PRO/1000 Network Connection */ - { 0x8086, E1000_DEV_ID_82571EB_COPPER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82571EB_FIBER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82571EB_SERDES, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82571EB_SERDES_DUAL, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82571EB_SERDES_QUAD, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82571EB_QUAD_COPPER, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82571EB_QUAD_COPPER_LP, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82571EB_QUAD_FIBER, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82571PT_QUAD_COPPER, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82572EI_COPPER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82572EI_FIBER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82572EI_SERDES, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82572EI, PCI_ANY_ID, PCI_ANY_ID, 0}, - - { 0x8086, E1000_DEV_ID_82573E, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82573E_IAMT, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82573L, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82583V, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_80003ES2LAN_COPPER_SPT, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_80003ES2LAN_SERDES_SPT, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_80003ES2LAN_COPPER_DPT, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_80003ES2LAN_SERDES_DPT, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_ICH8_IGP_M_AMT, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_ICH8_IGP_AMT, PCI_ANY_ID, PCI_ANY_ID, 0}, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 10 03:53:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4E7CA89EF; Tue, 10 Jan 2017 03:53:39 +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 494ED1DC5; Tue, 10 Jan 2017 03:53:39 +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 v0A3rcr5058378; Tue, 10 Jan 2017 03:53:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A3rcP3058377; Tue, 10 Jan 2017 03:53:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701100353.v0A3rcP3058377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 10 Jan 2017 03:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311850 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 03:53:39 -0000 Author: ian Date: Tue Jan 10 03:53:38 2017 New Revision: 311850 URL: https://svnweb.freebsd.org/changeset/base/311850 Log: Use the post-reset hook to force the controller to host mode. This will make both usb ports work on imx6 systems (the OTG port of course will only work in host mode). Modified: head/sys/dev/usb/controller/ehci_imx.c Modified: head/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_imx.c Tue Jan 10 03:23:22 2017 (r311849) +++ head/sys/dev/usb/controller/ehci_imx.c Tue Jan 10 03:53:38 2017 (r311850) @@ -157,6 +157,18 @@ struct imx_ehci_softc { struct resource *ehci_irq_res; /* EHCI core IRQ. */ }; +static void +imx_ehci_post_reset(struct ehci_softc *ehci_softc) +{ + uint32_t usbmode; + + /* Force HOST mode */ + usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); + usbmode &= ~EHCI_UM_CM; + usbmode |= EHCI_UM_CM_HOST; + EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); +} + static int imx_ehci_probe(device_t dev) { @@ -282,8 +294,13 @@ imx_ehci_attach(device_t dev) esc->sc_id_vendor = USB_VENDOR_FREESCALE; strlcpy(esc->sc_vendor, "Freescale", sizeof(esc->sc_vendor)); - /* Set flags that affect ehci_init() behavior. */ - esc->sc_flags |= EHCI_SCFLG_DONTRESET | EHCI_SCFLG_NORESTERM; + /* + * Set flags that affect ehci_init() behavior, and hook our post-reset + * code into the standard controller code. + */ + esc->sc_flags |= EHCI_SCFLG_NORESTERM; + esc->sc_vendor_post_reset = imx_ehci_post_reset; + err = ehci_init(esc); if (err != 0) { device_printf(dev, "USB init failed, usb_err_t=%d\n", From owner-svn-src-all@freebsd.org Tue Jan 10 04:17:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 537CCCA863D; Tue, 10 Jan 2017 04:17:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20A4B1A9A; Tue, 10 Jan 2017 04:17:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A4HreZ066682; Tue, 10 Jan 2017 04:17:53 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A4Hr7m066681; Tue, 10 Jan 2017 04:17:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701100417.v0A4Hr7m066681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Jan 2017 04:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311851 - head/sys/fs/cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 04:17:54 -0000 Author: mjg Date: Tue Jan 10 04:17:53 2017 New Revision: 311851 URL: https://svnweb.freebsd.org/changeset/base/311851 Log: cd9660: fix up compilation on sparc after r311665 Reported by: linimon Modified: head/sys/fs/cd9660/cd9660_vfsops.c Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Tue Jan 10 03:53:38 2017 (r311850) +++ head/sys/fs/cd9660/cd9660_vfsops.c Tue Jan 10 04:17:53 2017 (r311851) @@ -88,7 +88,7 @@ static struct vfsops cd9660_vfsops = { VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY); MODULE_VERSION(cd9660, 1); -static int cd9660_vfs_hash_cmp(struct vnode *vp, cd_ino_t *pino); +static int cd9660_vfs_hash_cmp(struct vnode *vp, void *pino); static int iso_mountfs(struct vnode *devvp, struct mount *mp); /* @@ -650,12 +650,14 @@ cd9660_vget(mp, ino, flags, vpp) static int cd9660_vfs_hash_cmp(vp, pino) struct vnode *vp; - cd_ino_t *pino; + void *pino; { struct iso_node *ip; + cd_ino_t ino; ip = VTOI(vp); - return (ip->i_number != *pino); + ino = *(cd_ino_t *)pino; + return (ip->i_number != ino); } int From owner-svn-src-all@freebsd.org Tue Jan 10 04:31:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73697CA8D5E; Tue, 10 Jan 2017 04:31:57 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43153152E; Tue, 10 Jan 2017 04:31:57 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A4VunN074444; Tue, 10 Jan 2017 04:31:56 GMT (envelope-from ler@FreeBSD.org) Received: (from ler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A4Vufl074443; Tue, 10 Jan 2017 04:31:56 GMT (envelope-from ler@FreeBSD.org) Message-Id: <201701100431.v0A4Vufl074443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ler set sender to ler@FreeBSD.org using -f From: Larry Rosenman Date: Tue, 10 Jan 2017 04:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311852 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 04:31:57 -0000 Author: ler (ports committer) Date: Tue Jan 10 04:31:56 2017 New Revision: 311852 URL: https://svnweb.freebsd.org/changeset/base/311852 Log: Add myself to committers-ports.dot Approved by: adamw (mentor) Differential Revision: https://reviews.freebsd.org/D9117 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Jan 10 04:17:53 2017 (r311851) +++ head/share/misc/committers-ports.dot Tue Jan 10 04:31:56 2017 (r311852) @@ -144,6 +144,7 @@ laszlof [label="Frank Laszlo\nlaszlof@Fr lawrance [label="Sam Lawrance\nlawrance@FreeBSD.org\n2005/04/11\n2007/02/21"] lbr [label="Lars Balker Rasmussen\nlbr@FreeBSD.org\n2006/04/30"] leeym [label="Yen-Ming Lee\nleeym@FreeBSD.org\n2002/08/14"] +ler [label="Larry Rosenman\nler@FreeBSD.org\n2017/01/09"] lev [label="Lev Serebryakov\nlev@FreeBSD.org\n2003/06/17"] lifanov [label="Nikolai Lifanov\nlifanov@FreeBSD.org\n2016/12/11"] linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2003/10/23"] @@ -252,6 +253,7 @@ znerd [label="Ernst de Haan\nznerd@FreeB adamw -> ahze adamw -> jylefort +adamw -> ler adamw -> mezz adamw -> pav adamw -> woodsb02 @@ -554,6 +556,7 @@ rene -> bar rene -> cmt rene -> crees rene -> jgh +rene -> ler rene -> olivierd rm -> koobs From owner-svn-src-all@freebsd.org Tue Jan 10 04:50:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D70E5CA85BA; Tue, 10 Jan 2017 04:50:00 +0000 (UTC) (envelope-from adamw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A74131D92; Tue, 10 Jan 2017 04:50:00 +0000 (UTC) (envelope-from adamw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A4nxwN078897; Tue, 10 Jan 2017 04:49:59 GMT (envelope-from adamw@FreeBSD.org) Received: (from adamw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A4nxVO078896; Tue, 10 Jan 2017 04:49:59 GMT (envelope-from adamw@FreeBSD.org) Message-Id: <201701100449.v0A4nxVO078896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adamw set sender to adamw@FreeBSD.org using -f From: Adam Weinberger Date: Tue, 10 Jan 2017 04:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311853 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 04:50:00 -0000 Author: adamw (ports committer) Date: Tue Jan 10 04:49:59 2017 New Revision: 311853 URL: https://svnweb.freebsd.org/changeset/base/311853 Log: As much as I've enjoyed being listed as emeritus for the last 10+ years, it's probably time to admit that I am an active committer. Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Jan 10 04:31:56 2017 (r311852) +++ head/share/misc/committers-ports.dot Tue Jan 10 04:49:59 2017 (r311853) @@ -29,7 +29,6 @@ node [color=grey62, style=filled, bgcolo # Alumni go here.. Try to keep things sorted. -adamw [label="Adam Weinberger\nadamw@FreeBSD.org\n2002/10/16\n2006/09/25"] asami [label="Satoshi Asami\nasami@FreeBSD.org\n1994/11/18\n2001/09/11"] billf [label="Bill Fumerola\nbillf@FreeBSD.org\n1998/11/11\n2006/12/14"] jmallett [label="Juli Mallett\njmallett@FreeBSD.org\n2003/01/16\n2006/08/10"] @@ -43,6 +42,7 @@ node [color=lightblue2, style=filled, bg ache [label="Andrey Chernov\nache@FreeBSD.org\n1994/11/15"] acm [label="Jose Alonso Cardenas Marquez\nacm@FreeBSD.org\n2006/07/18"] +adamw [label="Adam Weinberger\nadamw@FreeBSD.org\n2002/10/16"] ahze [label="Michael Johnson\nahze@FreeBSD.org\n2004/10/29"] ak [label="Alex Kozlov\nak@FreeBSD.org\n2012/02/29"] ale [label="Alex Dupre\nale@FreeBSD.org\n2004/01/12"] From owner-svn-src-all@freebsd.org Tue Jan 10 04:50:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61391CA867A; Tue, 10 Jan 2017 04:50:28 +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 3ABF91F1E; Tue, 10 Jan 2017 04:50:28 +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 v0A4oRjG078984; Tue, 10 Jan 2017 04:50:27 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A4oR2T078980; Tue, 10 Jan 2017 04:50:27 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701100450.v0A4oR2T078980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 10 Jan 2017 04:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311854 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 04:50:28 -0000 Author: sbruno Date: Tue Jan 10 04:50:26 2017 New Revision: 311854 URL: https://svnweb.freebsd.org/changeset/base/311854 Log: Add copywrite notices, 2-clause BSD. Reported by: jmallett Modified: head/sys/dev/e1000/em_txrx.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/e1000/igb_txrx.c Modified: head/sys/dev/e1000/em_txrx.c ============================================================================== --- head/sys/dev/e1000/em_txrx.c Tue Jan 10 04:49:59 2017 (r311853) +++ head/sys/dev/e1000/em_txrx.c Tue Jan 10 04:50:26 2017 (r311854) @@ -1,3 +1,29 @@ +/*- + * Copyright (c) 2016 Matt Macy + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + /* $FreeBSD$ */ #include "if_em.h" Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Jan 10 04:49:59 2017 (r311853) +++ head/sys/dev/e1000/if_em.c Tue Jan 10 04:50:26 2017 (r311854) @@ -1,3 +1,29 @@ +/*- + * Copyright (c) 2016 Matt Macy + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + /* $FreeBSD$ */ #include "if_em.h" #include Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Tue Jan 10 04:49:59 2017 (r311853) +++ head/sys/dev/e1000/if_em.h Tue Jan 10 04:50:26 2017 (r311854) @@ -1,3 +1,29 @@ +/*- + * Copyright (c) 2016 Matt Macy + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + /*$FreeBSD$*/ #include "opt_em.h" #include "opt_ddb.h" Modified: head/sys/dev/e1000/igb_txrx.c ============================================================================== --- head/sys/dev/e1000/igb_txrx.c Tue Jan 10 04:49:59 2017 (r311853) +++ head/sys/dev/e1000/igb_txrx.c Tue Jan 10 04:50:26 2017 (r311854) @@ -1,3 +1,29 @@ +/*- + * Copyright (c) 2016 Matt Macy + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + /* $FreeBSD$ */ #include "if_em.h" From owner-svn-src-all@freebsd.org Tue Jan 10 05:30:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0388BCA8955; Tue, 10 Jan 2017 05:30:17 +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 BFE4E145D; Tue, 10 Jan 2017 05:30:16 +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 v0A5UGJu094899; Tue, 10 Jan 2017 05:30:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A5UF3H094897; Tue, 10 Jan 2017 05:30:15 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701100530.v0A5UF3H094897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 10 Jan 2017 05:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311855 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 05:30:17 -0000 Author: adrian Date: Tue Jan 10 05:30:15 2017 New Revision: 311855 URL: https://svnweb.freebsd.org/changeset/base/311855 Log: [net80211] create a helper function to calculate the station facing VHT capabilities. This is needed for two reasons: * Drivers will need to know what the negotiated set of VHT capabilities and rates are in order to configure (and reconfigure for opmode/chanwidth changes) how to speak to a given peer; and * Because some vendors are "special", we should be careful in what we announce to them during peer association. This isn't the complete solution, as I still need to make sure that when sending out probe requests before we know what we want, we don't limit the capabilities being announced. This is important for IBSS/mesh work later on as probe request/response exchanges are the first hint at what a peer supports. I'll look at adding that to the API soon. Modified: head/sys/net80211/ieee80211_vht.c head/sys/net80211/ieee80211_vht.h Modified: head/sys/net80211/ieee80211_vht.c ============================================================================== --- head/sys/net80211/ieee80211_vht.c Tue Jan 10 04:50:26 2017 (r311854) +++ head/sys/net80211/ieee80211_vht.c Tue Jan 10 05:30:15 2017 (r311855) @@ -71,6 +71,15 @@ __FBSDID("$FreeBSD$"); } while (0) /* + * Immediate TODO: + * + * + handle WLAN_ACTION_VHT_OPMODE_NOTIF and other VHT action frames + * + ensure vhtinfo/vhtcap parameters correctly use the negotiated + * capabilities and ratesets + * + group ID management operation + */ + +/* * XXX TODO: handle WLAN_ACTION_VHT_OPMODE_NOTIF * * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further details. @@ -153,9 +162,9 @@ ieee80211_vht_announce(struct ieee80211c /* Channel width */ ic_printf(ic, "[VHT] Channel Widths: 20MHz, 40MHz, 80MHz"); - if (ic->ic_vhtcaps & IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) + if (MS(ic->ic_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == 2) printf(" 80+80MHz"); - if (ic->ic_vhtcaps & IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ) + if (MS(ic->ic_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) >= 1) printf(" 160MHz"); printf("\n"); @@ -280,38 +289,357 @@ ieee80211_vht_node_leave(struct ieee8021 "%s: called", __func__); } -uint8_t * -ieee80211_add_vhtcap(uint8_t *frm, struct ieee80211_node *ni) +/* + * Calculate the VHTCAP IE for a given node. + * + * This includes calculating the capability intersection based on the + * current operating mode and intersection of the TX/RX MCS maps. + * + * The standard only makes it clear about MCS rate negotiation + * and MCS basic rates (which must be a subset of the general + * negotiated rates). It doesn't make it clear that the AP should + * figure out the minimum functional overlap with the STA and + * support that. + * + * Note: this is in host order, not in 802.11 endian order. + * + * TODO: ensure I re-read 9.7.11 Rate Selection for VHT STAs. + * + * TODO: investigate what we should negotiate for MU-MIMO beamforming + * options. + * + * opmode is '1' for "vhtcap as if I'm a STA", 0 otherwise. + */ +void +ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, + struct ieee80211_ie_vhtcap *vhtcap, int opmode) { - uint32_t cap; + struct ieee80211vap *vap = ni->ni_vap; +// struct ieee80211com *ic = vap->iv_ic; + uint32_t val, val1, val2; + uint32_t new_vhtcap; + int i; - memset(frm, '\0', sizeof(struct ieee80211_ie_vhtcap)); + vhtcap->ie = IEEE80211_ELEMID_VHT_CAP; + vhtcap->len = sizeof(struct ieee80211_ie_vhtcap) - 2; - frm[0] = IEEE80211_ELEMID_VHT_CAP; - frm[1] = sizeof(struct ieee80211_ie_vhtcap) - 2; - frm += 2; + /* + * Capabilities - it depends on whether we are a station + * or not. + */ + new_vhtcap = 0; /* - * For now, don't do any configuration. - * Just populate the node configuration. - * We can worry about making it configurable later. + * Station - use our desired configuration based on + * local config, local device bits and the already-learnt + * vhtcap/vhtinfo IE in the node. */ - cap = ni->ni_vhtcap; + /* Limit MPDU size to the smaller of the two */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_MAX_MPDU_MASK); + if (opmode == 1) { + val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_MAX_MPDU_MASK); + } + val = MIN(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_MAX_MPDU_MASK); + + /* Limit supp channel config */ + val2 = val1 = MS(vap->iv_vhtcaps, + IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK); + if (opmode == 1) { + val2 = MS(ni->ni_vhtcap, + IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK); + } + if ((val2 == 2) && + ((vap->iv_flags_vht & IEEE80211_FVHT_USEVHT80P80) == 0)) + val2 = 1; + if ((val2 == 1) && + ((vap->iv_flags_vht & IEEE80211_FVHT_USEVHT160) == 0)) + val2 = 0; + val = MIN(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK); + + /* RX LDPC */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_RXLDPC); + if (opmode == 1) { + val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_RXLDPC); + } + val = MIN(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_RXLDPC); + + /* Short-GI 80 */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_SHORT_GI_80); + if (opmode == 1) { + val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_SHORT_GI_80); + } + val = MIN(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_SHORT_GI_80); + + /* Short-GI 160 */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_SHORT_GI_160); + if (opmode == 1) { + val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_SHORT_GI_160); + } + val = MIN(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_SHORT_GI_160); + + /* + * STBC is slightly more complicated. + * + * In non-STA mode, we just announce our capabilities and that + * is that. + * + * In STA mode, we should calculate our capabilities based on + * local capabilities /and/ what the remote says. So: + * + * + Only TX STBC if we support it and the remote supports RX STBC; + * + Only announce RX STBC if we support it and the remote supports + * TX STBC; + * + RX STBC should be the minimum of local and remote RX STBC; + */ + + /* TX STBC */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_TXSTBC); + if (opmode == 1) { + /* STA mode - enable it only if node RXSTBC is non-zero */ + val2 = !! MS(ni->ni_vhtcap, IEEE80211_VHTCAP_RXSTBC_MASK); + } + val = MIN(val1, val2); + /* XXX For now, use the 11n config flag */ + if ((vap->iv_flags_ht & IEEE80211_FHT_STBC_TX) == 0) + val = 0; + new_vhtcap |= SM(val, IEEE80211_VHTCAP_TXSTBC); + + /* RX STBC1..4 */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_RXSTBC_MASK); + if (opmode == 1) { + /* STA mode - enable it only if node TXSTBC is non-zero */ + val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_TXSTBC); + } + val = MIN(val1, val2); + /* XXX For now, use the 11n config flag */ + if ((vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) == 0) + val = 0; + new_vhtcap |= SM(val, IEEE80211_VHTCAP_RXSTBC_MASK); + + /* + * Finally - if RXSTBC is 0, then don't enable TXSTBC. + * Strictly speaking a device can TXSTBC and not RXSTBC, but + * it would be silly. + */ + if (val == 0) + new_vhtcap &= ~IEEE80211_VHTCAP_TXSTBC; + + /* + * Some of these fields require other fields to exist. + * So before using it, the parent field needs to be checked + * otherwise the overridden value may be wrong. + * + * For example, if SU beamformee is set to 0, then BF STS + * needs to be 0. + */ + + /* SU Beamformer capable */ + val2 = val1 = MS(vap->iv_vhtcaps, + IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE); + if (opmode == 1) { + val2 = MS(ni->ni_vhtcap, + IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE); + } + val = MIN(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE); + + /* SU Beamformee capable */ + val2 = val1 = MS(vap->iv_vhtcaps, + IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE); + if (opmode == 1) { + val2 = MS(ni->ni_vhtcap, + IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE); + } + val = MIN(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE); + + /* Beamformee STS capability - only if SU beamformee capable */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK); + if (opmode == 1) { + val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK); + } + val = MIN(val1, val2); + if ((new_vhtcap & IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE) == 0) + val = 0; + new_vhtcap |= SM(val, IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK); + + /* Sounding dimensions - only if SU beamformer capable */ + val2 = val1 = MS(vap->iv_vhtcaps, + IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK); + if (opmode == 1) + val2 = MS(ni->ni_vhtcap, + IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK); + val = MIN(val1, val2); + if ((new_vhtcap & IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE) == 0) + val = 0; + new_vhtcap |= SM(val, IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK); /* - * XXX TODO: any capability changes required by - * configuration. + * MU Beamformer capable - only if SU BFF capable, MU BFF capable + * and STA (not AP) */ + val2 = val1 = MS(vap->iv_vhtcaps, + IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE); + if (opmode == 1) + val2 = MS(ni->ni_vhtcap, + IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE); + val = MIN(val1, val2); + if ((new_vhtcap & IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE) == 0) + val = 0; + if (opmode != 1) /* Only enable for STA mode */ + val = 0; + new_vhtcap |= SM(val, IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE); + + /* + * MU Beamformee capable - only if SU BFE capable, MU BFE capable + * and AP (not STA) + */ + val2 = val1 = MS(vap->iv_vhtcaps, + IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE); + if (opmode == 1) + val2 = MS(ni->ni_vhtcap, + IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE); + val = MIN(val1, val2); + if ((new_vhtcap & IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE) == 0) + val = 0; + if (opmode != 0) /* Only enable for AP mode */ + val = 0; + new_vhtcap |= SM(val, IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE); + + /* VHT TXOP PS */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_VHT_TXOP_PS); + if (opmode == 1) + val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_VHT_TXOP_PS); + val = MIN(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_VHT_TXOP_PS); + + /* HTC_VHT */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_HTC_VHT); + if (opmode == 1) + val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_HTC_VHT); + val = MIN(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_HTC_VHT); + + /* A-MPDU length max */ + /* XXX TODO: we need a userland config knob for this */ + val2 = val1 = MS(vap->iv_vhtcaps, + IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK); + if (opmode == 1) + val2 = MS(ni->ni_vhtcap, + IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK); + val = MIN(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK); + + /* + * Link adaptation is only valid if HTC-VHT capable is 1. + * Otherwise, always set it to 0. + */ + val2 = val1 = MS(vap->iv_vhtcaps, + IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK); + if (opmode == 1) + val2 = MS(ni->ni_vhtcap, + IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK); + val = MIN(val1, val2); + if ((new_vhtcap & IEEE80211_VHTCAP_HTC_VHT) == 0) + val = 0; + new_vhtcap |= SM(val, IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK); + + /* + * The following two options are 0 if the pattern may change, 1 if it + * does not change. So, downgrade to the higher value. + */ + + /* RX antenna pattern */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_RX_ANTENNA_PATTERN); + if (opmode == 1) + val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_RX_ANTENNA_PATTERN); + val = MAX(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_RX_ANTENNA_PATTERN); + + /* TX antenna pattern */ + val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_TX_ANTENNA_PATTERN); + if (opmode == 1) + val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_TX_ANTENNA_PATTERN); + val = MAX(val1, val2); + new_vhtcap |= SM(val, IEEE80211_VHTCAP_TX_ANTENNA_PATTERN); + + /* + * MCS set - again, we announce what we want to use + * based on configuration, device capabilities and + * already-learnt vhtcap/vhtinfo IE information. + */ + + /* MCS set - start with whatever the device supports */ + vhtcap->supp_mcs.rx_mcs_map = vap->iv_vht_mcsinfo.rx_mcs_map; + vhtcap->supp_mcs.rx_highest = 0; + vhtcap->supp_mcs.tx_mcs_map = vap->iv_vht_mcsinfo.tx_mcs_map; + vhtcap->supp_mcs.tx_highest = 0; + + vhtcap->vht_cap_info = new_vhtcap; + + /* + * Now, if we're a STA, mask off whatever the AP doesn't support. + * Ie, we continue to state we can receive whatever we can do, + * but we only announce that we will transmit rates that meet + * the AP requirement. + * + * Note: 0 - MCS0..7; 1 - MCS0..8; 2 - MCS0..9; 3 = not supported. + * We can't just use MIN() because '3' means "no", so special case it. + */ + if (opmode) { + for (i = 0; i < 8; i++) { + val1 = (vhtcap->supp_mcs.tx_mcs_map >> (i*2)) & 0x3; + val2 = (ni->ni_vht_mcsinfo.tx_mcs_map >> (i*2)) & 0x3; + val = MIN(val1, val2); + if (val1 == 3 || val2 == 3) + val = 3; + vhtcap->supp_mcs.tx_mcs_map &= ~(0x3 << (i*2)); + vhtcap->supp_mcs.tx_mcs_map |= (val << (i*2)); + } + } +} + +/* + * Add a VHTCAP field. + * + * If in station mode, we announce what we would like our + * desired configuration to be. + * + * Else, we announce our capabilities based on our current + * configuration. + */ +uint8_t * +ieee80211_add_vhtcap(uint8_t *frm, struct ieee80211_node *ni) +{ + struct ieee80211_ie_vhtcap vhtcap; + int opmode; + + opmode = 0; + if (ni->ni_vap->iv_opmode == IEEE80211_M_STA) + opmode = 1; + + ieee80211_vht_get_vhtcap_ie(ni, &vhtcap, opmode); + + memset(frm, '\0', sizeof(struct ieee80211_ie_vhtcap)); + + frm[0] = IEEE80211_ELEMID_VHT_CAP; + frm[1] = sizeof(struct ieee80211_ie_vhtcap) - 2; + frm += 2; /* 32-bit VHT capability */ - ADDWORD(frm, cap); + ADDWORD(frm, vhtcap.vht_cap_info); /* suppmcs */ - ADDSHORT(frm, ni->ni_vht_mcsinfo.rx_mcs_map); - ADDSHORT(frm, ni->ni_vht_mcsinfo.rx_highest); - ADDSHORT(frm, ni->ni_vht_mcsinfo.tx_mcs_map); - ADDSHORT(frm, ni->ni_vht_mcsinfo.tx_highest); + ADDSHORT(frm, vhtcap.supp_mcs.rx_mcs_map); + ADDSHORT(frm, vhtcap.supp_mcs.rx_highest); + ADDSHORT(frm, vhtcap.supp_mcs.tx_mcs_map); + ADDSHORT(frm, vhtcap.supp_mcs.tx_highest); return (frm); } @@ -370,17 +698,6 @@ ieee80211_add_vhtinfo(uint8_t *frm, stru frm[1] = sizeof(struct ieee80211_ie_vht_operation) - 2; frm += 2; - /* - * XXX if it's a station, then see if we have a node - * channel or ANYC. If it's ANYC then assume we're - * scanning, and announce our capabilities. - * - * This should set the "20/40/80/160MHz wide config"; - * the 80/80 or 160MHz wide config is done in VHTCAP. - * - * Other modes - just limit it to the channel. - */ - /* 8-bit chanwidth */ *frm++ = ieee80211_vht_get_chwidth_ie(ni->ni_chan); @@ -475,3 +792,19 @@ ieee80211_vht_adjust_channel(struct ieee #endif return (chan); } + +/* + * Calculate the VHT operation IE for a given node. + * + * This includes calculating the suitable channel width/parameters + * and basic MCS set. + * + * TODO: ensure I read 9.7.11 Rate Selection for VHT STAs. + * TODO: ensure I read 10.39.7 - BSS Basic VHT-MCS and NSS set operation. + */ +void +ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni, + struct ieee80211_ie_vht_operation *vhtop, int opmode) +{ + printf("%s: called; TODO!\n", __func__); +} Modified: head/sys/net80211/ieee80211_vht.h ============================================================================== --- head/sys/net80211/ieee80211_vht.h Tue Jan 10 04:50:26 2017 (r311854) +++ head/sys/net80211/ieee80211_vht.h Tue Jan 10 05:30:15 2017 (r311855) @@ -60,4 +60,9 @@ struct ieee80211_channel * ieee80211_vht_adjust_channel(struct ieee80211com *, struct ieee80211_channel *, int); +void ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, + struct ieee80211_ie_vhtcap *, int); +void ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni, + struct ieee80211_ie_vht_operation *, int); + #endif /* _NET80211_IEEE80211_VHT_H_ */ From owner-svn-src-all@freebsd.org Tue Jan 10 05:32:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5D71CA8B67; Tue, 10 Jan 2017 05:32:03 +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 8F7BC1869; Tue, 10 Jan 2017 05:32:03 +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 v0A5W2Xd098665; Tue, 10 Jan 2017 05:32:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A5W2cH098664; Tue, 10 Jan 2017 05:32:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701100532.v0A5W2cH098664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 10 Jan 2017 05:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311856 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 05:32:03 -0000 Author: adrian Date: Tue Jan 10 05:32:02 2017 New Revision: 311856 URL: https://svnweb.freebsd.org/changeset/base/311856 Log: [net80211] add VHT EDCA parameters for WME/QoS mode. Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Tue Jan 10 05:30:15 2017 (r311855) +++ head/sys/net80211/ieee80211_proto.c Tue Jan 10 05:32:02 2017 (r311856) @@ -842,6 +842,9 @@ setbasicrates(struct ieee80211_rateset * [IEEE80211_MODE_11NA] = { 3, { 12, 24, 48 } }, /* NB: mixed b/g */ [IEEE80211_MODE_11NG] = { 4, { 2, 4, 11, 22 } }, + /* NB: mixed b/g */ + [IEEE80211_MODE_VHT_2GHZ] = { 4, { 2, 4, 11, 22 } }, + [IEEE80211_MODE_VHT_5GHZ] = { 3, { 12, 24, 48 } }, }; int i, j; @@ -906,6 +909,8 @@ static const struct phyParamType phyPara [IEEE80211_MODE_QUARTER]= { 3, 4, 6, 0, 0 }, [IEEE80211_MODE_11NA] = { 3, 4, 6, 0, 0 }, [IEEE80211_MODE_11NG] = { 3, 4, 6, 0, 0 }, + [IEEE80211_MODE_VHT_2GHZ] = { 3, 4, 6, 0, 0 }, + [IEEE80211_MODE_VHT_5GHZ] = { 3, 4, 6, 0, 0 }, }; static const struct phyParamType phyParamForAC_BK[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_AUTO] = { 7, 4, 10, 0, 0 }, @@ -920,6 +925,8 @@ static const struct phyParamType phyPara [IEEE80211_MODE_QUARTER]= { 7, 4, 10, 0, 0 }, [IEEE80211_MODE_11NA] = { 7, 4, 10, 0, 0 }, [IEEE80211_MODE_11NG] = { 7, 4, 10, 0, 0 }, + [IEEE80211_MODE_VHT_2GHZ] = { 7, 4, 10, 0, 0 }, + [IEEE80211_MODE_VHT_5GHZ] = { 7, 4, 10, 0, 0 }, }; static const struct phyParamType phyParamForAC_VI[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_AUTO] = { 1, 3, 4, 94, 0 }, @@ -934,6 +941,8 @@ static const struct phyParamType phyPara [IEEE80211_MODE_QUARTER]= { 1, 3, 4, 94, 0 }, [IEEE80211_MODE_11NA] = { 1, 3, 4, 94, 0 }, [IEEE80211_MODE_11NG] = { 1, 3, 4, 94, 0 }, + [IEEE80211_MODE_VHT_2GHZ] = { 1, 3, 4, 94, 0 }, + [IEEE80211_MODE_VHT_5GHZ] = { 1, 3, 4, 94, 0 }, }; static const struct phyParamType phyParamForAC_VO[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_AUTO] = { 1, 2, 3, 47, 0 }, @@ -948,6 +957,8 @@ static const struct phyParamType phyPara [IEEE80211_MODE_QUARTER]= { 1, 2, 3, 47, 0 }, [IEEE80211_MODE_11NA] = { 1, 2, 3, 47, 0 }, [IEEE80211_MODE_11NG] = { 1, 2, 3, 47, 0 }, + [IEEE80211_MODE_VHT_2GHZ] = { 1, 2, 3, 47, 0 }, + [IEEE80211_MODE_VHT_5GHZ] = { 1, 2, 3, 47, 0 }, }; static const struct phyParamType bssPhyParamForAC_BE[IEEE80211_MODE_MAX] = { @@ -1123,6 +1134,8 @@ ieee80211_wme_updateparams_locked(struct [IEEE80211_MODE_QUARTER] = { 2, 4, 10, 64, 0 }, [IEEE80211_MODE_11NA] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/ [IEEE80211_MODE_11NG] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/ + [IEEE80211_MODE_VHT_2GHZ] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/ + [IEEE80211_MODE_VHT_5GHZ] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/ }; struct ieee80211com *ic = vap->iv_ic; struct ieee80211_wme_state *wme = &ic->ic_wme; @@ -1243,6 +1256,8 @@ ieee80211_wme_updateparams_locked(struct [IEEE80211_MODE_QUARTER] = 3, [IEEE80211_MODE_11NA] = 3, [IEEE80211_MODE_11NG] = 3, + [IEEE80211_MODE_VHT_2GHZ] = 3, + [IEEE80211_MODE_VHT_5GHZ] = 3, }; chanp = &wme->wme_chanParams.cap_wmeParams[WME_AC_BE]; bssp = &wme->wme_bssChanParams.cap_wmeParams[WME_AC_BE]; From owner-svn-src-all@freebsd.org Tue Jan 10 05:32:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3564CA8BC7; Tue, 10 Jan 2017 05:32:31 +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 902AA1A40; Tue, 10 Jan 2017 05:32:31 +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 v0A5WU6J098726; Tue, 10 Jan 2017 05:32:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A5WU7a098725; Tue, 10 Jan 2017 05:32:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701100532.v0A5WU7a098725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 10 Jan 2017 05:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311857 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 05:32:31 -0000 Author: adrian Date: Tue Jan 10 05:32:30 2017 New Revision: 311857 URL: https://svnweb.freebsd.org/changeset/base/311857 Log: [net80211] add CHAN_VHT2G/CHAN_VHT5G macros. Modified: head/sys/net80211/_ieee80211.h Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Tue Jan 10 05:32:02 2017 (r311856) +++ head/sys/net80211/_ieee80211.h Tue Jan 10 05:32:30 2017 (r311857) @@ -313,6 +313,12 @@ struct ieee80211_channel { #define IEEE80211_IS_CHAN_VHT(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0) +#define IEEE80211_IS_CHAN_VHT_2GHZ(_c) \ + (IEEE80211_IS_CHAN_2GHZ(_c) && \ + ((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0) +#define IEEE80211_IS_CHAN_VHT_5GHZ(_c) \ + (IEEE80211_IS_CHAN_5GHZ(_c) && \ + ((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0) #define IEEE80211_IS_CHAN_VHT20(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_VHT20) != 0) #define IEEE80211_IS_CHAN_VHT40(_c) \ From owner-svn-src-all@freebsd.org Tue Jan 10 05:33:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCE75CA8C89; Tue, 10 Jan 2017 05:33:35 +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 B76C31BF9; Tue, 10 Jan 2017 05:33:35 +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 v0A5XYFQ098821; Tue, 10 Jan 2017 05:33:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A5XYEj098820; Tue, 10 Jan 2017 05:33:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701100533.v0A5XYEj098820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 10 Jan 2017 05:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311858 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 05:33:36 -0000 Author: adrian Date: Tue Jan 10 05:33:34 2017 New Revision: 311858 URL: https://svnweb.freebsd.org/changeset/base/311858 Log: [net80211] add missing VHTCAP declaration changes. These are required for the recent ieee80211_vht.[ch] changes - they make things start to work with MS() / SM() macros. Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Tue Jan 10 05:32:30 2017 (r311857) +++ head/sys/net80211/ieee80211.h Tue Jan 10 05:33:34 2017 (r311858) @@ -798,37 +798,73 @@ struct ieee80211_ie_vht_operation { #define IEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991 0x00000001 #define IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 0x00000002 #define IEEE80211_VHTCAP_MAX_MPDU_MASK 0x00000003 -#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 -#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 +#define IEEE80211_VHTCAP_MAX_MPDU_MASK_S 0 + #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK 0x0000000C +#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S 2 +#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_NONE 0 +#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ 1 +#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ 2 +#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_RESERVED 3 + #define IEEE80211_VHTCAP_RXLDPC 0x00000010 +#define IEEE80211_VHTCAP_RXLDPC_S 4 + #define IEEE80211_VHTCAP_SHORT_GI_80 0x00000020 +#define IEEE80211_VHTCAP_SHORT_GI_80_S 5 + #define IEEE80211_VHTCAP_SHORT_GI_160 0x00000040 +#define IEEE80211_VHTCAP_SHORT_GI_160_S 6 + #define IEEE80211_VHTCAP_TXSTBC 0x00000080 +#define IEEE80211_VHTCAP_TXSTBC_S 7 + #define IEEE80211_VHTCAP_RXSTBC_1 0x00000100 #define IEEE80211_VHTCAP_RXSTBC_2 0x00000200 #define IEEE80211_VHTCAP_RXSTBC_3 0x00000300 #define IEEE80211_VHTCAP_RXSTBC_4 0x00000400 #define IEEE80211_VHTCAP_RXSTBC_MASK 0x00000700 +#define IEEE80211_VHTCAP_RXSTBC_MASK_S 8 + #define IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE 0x00000800 +#define IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE_S 11 + #define IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE 0x00001000 +#define IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE_S 12 + #define IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT 13 #define IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK \ (7 << IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT) +#define IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK_S 13 + #define IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT 16 #define IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK \ (7 << IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT) +#define IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK_S 16 + #define IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE 0x00080000 +#define IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE_S 19 #define IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE 0x00100000 +#define IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE_S 20 #define IEEE80211_VHTCAP_VHT_TXOP_PS 0x00200000 +#define IEEE80211_VHTCAP_VHT_TXOP_PS_S 21 #define IEEE80211_VHTCAP_HTC_VHT 0x00400000 +#define IEEE80211_VHTCAP_HTC_VHT_S 22 + #define IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23 #define IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \ (7 << IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT) +#define IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK_S 23 + +#define IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK 0x0c000000 #define IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000 #define IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 +#define IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK_S 26 + #define IEEE80211_VHTCAP_RX_ANTENNA_PATTERN 0x10000000 +#define IEEE80211_VHTCAP_RX_ANTENNA_PATTERN_S 28 #define IEEE80211_VHTCAP_TX_ANTENNA_PATTERN 0x20000000 +#define IEEE80211_VHTCAP_TX_ANTENNA_PATTERN_S 29 /* * XXX TODO: add the rest of the bits From owner-svn-src-all@freebsd.org Tue Jan 10 05:37:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB61ACA8E39; Tue, 10 Jan 2017 05:37:54 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 880C61EF1; Tue, 10 Jan 2017 05:37:54 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A5briv099102; Tue, 10 Jan 2017 05:37:53 GMT (envelope-from ler@FreeBSD.org) Received: (from ler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A5brp5099101; Tue, 10 Jan 2017 05:37:53 GMT (envelope-from ler@FreeBSD.org) Message-Id: <201701100537.v0A5brp5099101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ler set sender to ler@FreeBSD.org using -f From: Larry Rosenman Date: Tue, 10 Jan 2017 05:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311859 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 05:37:54 -0000 Author: ler (ports committer) Date: Tue Jan 10 05:37:53 2017 New Revision: 311859 URL: https://svnweb.freebsd.org/changeset/base/311859 Log: Add my birthday to calendar.freebsd Approved by: adamw (Mentor) Differential Revision: https://reviews.freebsd.org/D9119 Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Jan 10 05:33:34 2017 (r311858) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Jan 10 05:37:53 2017 (r311859) @@ -310,6 +310,7 @@ 09/20 Kevin Lo born in Taipei, Taiwan, Republic of China, 1972 09/21 Gleb Kurtsou born in Minsk, Belarus, 1984 09/22 Bryan Drewery born in San Diego, California, United States, 1984 +09/24 Larry Rosenman born in Queens, New York, United States, 1957 09/27 Neil Blakey-Milner born in Port Elizabeth, South Africa, 1978 09/27 Renato Botelho born in Araras, Sao Paulo, Brazil, 1979 09/28 Greg Lehey born in Melbourne, Victoria, Australia, 1948 From owner-svn-src-all@freebsd.org Tue Jan 10 07:21:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E5D8CA8A03; Tue, 10 Jan 2017 07:21:08 +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 5114E19BC; Tue, 10 Jan 2017 07:21:08 +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 v0A7L7fE039128; Tue, 10 Jan 2017 07:21:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A7L7ip039127; Tue, 10 Jan 2017 07:21:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701100721.v0A7L7ip039127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 10 Jan 2017 07:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311860 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 07:21:08 -0000 Author: adrian Date: Tue Jan 10 07:21:07 2017 New Revision: 311860 URL: https://svnweb.freebsd.org/changeset/base/311860 Log: [net80211] add VHT action frame placeholders for when it's time to implement. Modified: head/sys/net80211/ieee80211_vht.c Modified: head/sys/net80211/ieee80211_vht.c ============================================================================== --- head/sys/net80211/ieee80211_vht.c Tue Jan 10 05:37:53 2017 (r311859) +++ head/sys/net80211/ieee80211_vht.c Tue Jan 10 07:21:07 2017 (r311860) @@ -85,9 +85,49 @@ __FBSDID("$FreeBSD$"); * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further details. */ +static int +vht_recv_action_placeholder(struct ieee80211_node *ni, + const struct ieee80211_frame *wh, + const uint8_t *frm, const uint8_t *efrm) +{ + + ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x", + __func__, + wh->i_fc[0], + wh->i_fc[1]); + + return (0); +} + +static int +vht_send_action_placeholder(struct ieee80211_node *ni, + int category, int action, void *arg0) +{ + + ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d", + __func__, + category, + action); + return (EINVAL); +} + static void ieee80211_vht_init(void) { + + ieee80211_recv_action_register(IEEE80211_ACTION_CAT_VHT, + WLAN_ACTION_VHT_COMPRESSED_BF, vht_recv_action_placeholder); + ieee80211_recv_action_register(IEEE80211_ACTION_CAT_VHT, + WLAN_ACTION_VHT_GROUPID_MGMT, vht_recv_action_placeholder); + ieee80211_recv_action_register(IEEE80211_ACTION_CAT_VHT, + WLAN_ACTION_VHT_OPMODE_NOTIF, vht_recv_action_placeholder); + + ieee80211_send_action_register(IEEE80211_ACTION_CAT_VHT, + WLAN_ACTION_VHT_COMPRESSED_BF, vht_send_action_placeholder); + ieee80211_send_action_register(IEEE80211_ACTION_CAT_VHT, + WLAN_ACTION_VHT_GROUPID_MGMT, vht_send_action_placeholder); + ieee80211_send_action_register(IEEE80211_ACTION_CAT_VHT, + WLAN_ACTION_VHT_OPMODE_NOTIF, vht_send_action_placeholder); } SYSINIT(wlan_vht, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_vht_init, NULL); From owner-svn-src-all@freebsd.org Tue Jan 10 07:24:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F69CCA8BC8; Tue, 10 Jan 2017 07:24:30 +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 0EE661D77; Tue, 10 Jan 2017 07:24:29 +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 v0A7OTe9042969; Tue, 10 Jan 2017 07:24:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A7OTQB042968; Tue, 10 Jan 2017 07:24:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701100724.v0A7OTQB042968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 10 Jan 2017 07:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311861 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 07:24:30 -0000 Author: adrian Date: Tue Jan 10 07:24:29 2017 New Revision: 311861 URL: https://svnweb.freebsd.org/changeset/base/311861 Log: [net80211] Add default parameters for 11ac. I doubt TDMA code will ever work for 11ac, but you never know, someone may one day make it happen. Modified: head/sys/net80211/ieee80211_tdma.c Modified: head/sys/net80211/ieee80211_tdma.c ============================================================================== --- head/sys/net80211/ieee80211_tdma.c Tue Jan 10 07:21:07 2017 (r311860) +++ head/sys/net80211/ieee80211_tdma.c Tue Jan 10 07:24:29 2017 (r311861) @@ -176,6 +176,8 @@ ieee80211_tdma_vattach(struct ieee80211v settxparms(vap, IEEE80211_MODE_11NG, TDMA_TXRATE_11NG_DEFAULT); settxparms(vap, IEEE80211_MODE_HALF, TDMA_TXRATE_HALF_DEFAULT); settxparms(vap, IEEE80211_MODE_QUARTER, TDMA_TXRATE_QUARTER_DEFAULT); + settxparms(vap, IEEE80211_MODE_VHT_2GHZ, TDMA_TXRATE_11NG_DEFAULT); + settxparms(vap, IEEE80211_MODE_VHT_5GHZ, TDMA_TXRATE_11NA_DEFAULT); setackpolicy(vap->iv_ic, 1); /* disable ACK's */ From owner-svn-src-all@freebsd.org Tue Jan 10 07:50:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 487DBCA923A; Tue, 10 Jan 2017 07:50:22 +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 0AACA17E0; Tue, 10 Jan 2017 07:50:21 +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 v0A7oLWL051093; Tue, 10 Jan 2017 07:50:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A7oL4J051092; Tue, 10 Jan 2017 07:50:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701100750.v0A7oL4J051092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 10 Jan 2017 07:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311862 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 07:50:22 -0000 Author: adrian Date: Tue Jan 10 07:50:21 2017 New Revision: 311862 URL: https://svnweb.freebsd.org/changeset/base/311862 Log: [net80211] add VHT mediatype initialisation and update helper functions. Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Jan 10 07:24:29 2017 (r311861) +++ head/sys/net80211/ieee80211.c Tue Jan 10 07:50:21 2017 (r311862) @@ -70,6 +70,8 @@ const char *ieee80211_phymode_name[IEEE8 [IEEE80211_MODE_QUARTER] = "quarter", [IEEE80211_MODE_11NA] = "11na", [IEEE80211_MODE_11NG] = "11ng", + [IEEE80211_MODE_VHT_2GHZ] = "11acg", + [IEEE80211_MODE_VHT_5GHZ] = "11ac", }; /* map ieee80211_opmode to the corresponding capability bit */ const int ieee80211_opcap[IEEE80211_OPMODE_MAX] = { @@ -181,6 +183,10 @@ ieee80211_chan_init(struct ieee80211com setbit(ic->ic_modecaps, IEEE80211_MODE_11NA); if (IEEE80211_IS_CHAN_HTG(c)) setbit(ic->ic_modecaps, IEEE80211_MODE_11NG); + if (IEEE80211_IS_CHAN_VHTA(c)) + setbit(ic->ic_modecaps, IEEE80211_MODE_VHT_5GHZ); + if (IEEE80211_IS_CHAN_VHTG(c)) + setbit(ic->ic_modecaps, IEEE80211_MODE_VHT_2GHZ); } /* initialize candidate channels to all available */ memcpy(ic->ic_chan_active, ic->ic_chan_avail, @@ -208,6 +214,8 @@ ieee80211_chan_init(struct ieee80211com DEFAULTRATES(IEEE80211_MODE_QUARTER, ieee80211_rateset_quarter); DEFAULTRATES(IEEE80211_MODE_11NA, ieee80211_rateset_11a); DEFAULTRATES(IEEE80211_MODE_11NG, ieee80211_rateset_11g); + DEFAULTRATES(IEEE80211_MODE_VHT_2GHZ, ieee80211_rateset_11g); + DEFAULTRATES(IEEE80211_MODE_VHT_5GHZ, ieee80211_rateset_11a); /* * Setup required information to fill the mcsset field, if driver did @@ -1492,6 +1500,8 @@ addmedia(struct ifmedia *media, int caps [IEEE80211_MODE_QUARTER] = IFM_IEEE80211_11A, /* XXX */ [IEEE80211_MODE_11NA] = IFM_IEEE80211_11NA, [IEEE80211_MODE_11NG] = IFM_IEEE80211_11NG, + [IEEE80211_MODE_VHT_2GHZ] = IFM_IEEE80211_VHT2G, + [IEEE80211_MODE_VHT_5GHZ] = IFM_IEEE80211_VHT5G, }; u_int mopt; @@ -1604,6 +1614,19 @@ ieee80211_media_setup(struct ieee80211co if (rate > maxrate) maxrate = rate; } + + /* + * Add VHT media. + */ + for (; mode <= IEEE80211_MODE_VHT_5GHZ; mode++) { + if (isclr(ic->ic_modecaps, mode)) + continue; + addmedia(media, caps, addsta, mode, IFM_AUTO); + addmedia(media, caps, addsta, mode, IFM_IEEE80211_VHT); + + /* XXX TODO: VHT maxrate */ + } + return maxrate; } @@ -1883,7 +1906,11 @@ enum ieee80211_phymode ieee80211_chan2mode(const struct ieee80211_channel *chan) { - if (IEEE80211_IS_CHAN_HTA(chan)) + if (IEEE80211_IS_CHAN_VHT_2GHZ(chan)) + return IEEE80211_MODE_VHT_2GHZ; + else if (IEEE80211_IS_CHAN_VHT_5GHZ(chan)) + return IEEE80211_MODE_VHT_5GHZ; + else if (IEEE80211_IS_CHAN_HTA(chan)) return IEEE80211_MODE_11NA; else if (IEEE80211_IS_CHAN_HTG(chan)) return IEEE80211_MODE_11NG; From owner-svn-src-all@freebsd.org Tue Jan 10 07:56:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8D43CA9468; Tue, 10 Jan 2017 07:56:58 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 DV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAED31C9B; Tue, 10 Jan 2017 07:56:58 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.ut.rhv.delphij.net (unknown [IPv6:2601:646:8882:752a:e0b9:c9ec:8d0c:8aeb]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 4D67F1C3F1; Mon, 9 Jan 2017 23:56:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1484035018; x=1484049418; bh=j8nOq8/Tab3liniIlW+0kkocCMB3foWzwhjQx9DBaX0=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=XL4u0/9aRxnF8wd5nJEeL1imMCTdaC5VdbGy2pi0Wv9LDX8RNXTi/cffiX39zyjtp FnIrRR3ee66D+dQTLXLvWc6BinjnjZwSq0H8oxtodzc2YqzOz83R1upzNF6gwrukOX 0ckpBYBOun5qMCvi4IpanNTW+A5THIT891m/CXwM= Subject: Re: svn commit: r311585 - in head: crypto/openssh secure/usr.sbin/sshd To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201701070808.v0788aEi064973@repo.freebsd.org> Cc: d@delphij.net, des@freebsd.org From: Xin Li Message-ID: Date: Mon, 9 Jan 2017 23:56:57 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <201701070808.v0788aEi064973@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LlFPvvv0bgv2COB0vIOLCNP8IjPOkfqDX" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 07:56:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LlFPvvv0bgv2COB0vIOLCNP8IjPOkfqDX Content-Type: multipart/mixed; boundary="A36V9bNgWLMlOjJTeLTQW4FSB7sDNGiEB"; protected-headers="v1" From: Xin Li To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: d@delphij.net, des@freebsd.org Message-ID: Subject: Re: svn commit: r311585 - in head: crypto/openssh secure/usr.sbin/sshd References: <201701070808.v0788aEi064973@repo.freebsd.org> In-Reply-To: <201701070808.v0788aEi064973@repo.freebsd.org> --A36V9bNgWLMlOjJTeLTQW4FSB7sDNGiEB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 1/7/17 00:08, Ngie Cooper wrote: > Author: ngie > Date: Sat Jan 7 08:08:35 2017 > New Revision: 311585 > URL: https://svnweb.freebsd.org/changeset/base/311585 >=20 > Log: > Conditionalize building libwrap support into sshd > =20 > Only build libwrap support into sshd if MK_TCP_WRAPPERS !=3D no > =20 > This will unbreak the build if libwrap has been removed from the syst= em > =20 > MFC after: 2 weeks > PR: 210141 > Submitted by: kpect@protonmail.com > Differential Revision: D9049 I didn't see this approved by maintainer, did you ping him? [delphij@saturn] /usr/src> grep ssh MAINTAINERS openssh des Pre-commit review requested. (Not that the change itself is bad, though, but it's important to keep everyone on the same page). > Modified: > head/crypto/openssh/config.h > head/secure/usr.sbin/sshd/Makefile >=20 > Modified: head/crypto/openssh/config.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/crypto/openssh/config.h Sat Jan 7 07:54:23 2017 (r311584) > +++ head/crypto/openssh/config.h Sat Jan 7 08:08:35 2017 (r311585) > @@ -1408,7 +1408,7 @@ > /* #undef LASTLOG_WRITE_PUTUTXLINE */ > =20 > /* Define if you want TCP Wrappers support */ > -#define LIBWRAP 1 > +/* #undef LIBWRAP */ > =20 > /* Define to whatever link() returns for "not supported" if it doesn't= return > EOPNOTSUPP. */ >=20 > Modified: head/secure/usr.sbin/sshd/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/secure/usr.sbin/sshd/Makefile Sat Jan 7 07:54:23 2017 (r31158= 4) > +++ head/secure/usr.sbin/sshd/Makefile Sat Jan 7 08:08:35 2017 (r31158= 5) > @@ -27,7 +27,7 @@ CFLAGS+=3D-I${SSHDIR} -include ssh_namespa > SRCS+=3D ssh_namespace.h > =20 > # pam should always happen before ssh here for static linking > -LIBADD=3D pam ssh util wrap > +LIBADD=3D pam ssh util > =20 > .if ${MK_LDNS} !=3D "no" > CFLAGS+=3D -DHAVE_LDNS=3D1 > @@ -53,6 +53,11 @@ SRCS+=3D krb5_config.h > LIBADD+=3D gssapi_krb5 gssapi krb5 > .endif > =20 > +.if ${MK_TCP_WRAPPERS} !=3D "no" > +CFLAGS+=3D -DLIBWRAP > +LIBADD+=3D wrap > +.endif > + > LIBADD+=3D crypto > =20 > .if defined(LOCALBASE) >=20 --A36V9bNgWLMlOjJTeLTQW4FSB7sDNGiEB-- --LlFPvvv0bgv2COB0vIOLCNP8IjPOkfqDX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJYdJPJAAoJEJW2GBstM+nsJcIP/0aKl6wpYN7XQDfqY6N5fAhP nRGFmBtLlLid4DXX684FlQYTO5aIQhM4W+2X/lcJ8lktI/f2rr3/T4uRUYVgUo5/ eLt28vphZSRtVWKqaJes4RvubFK3JTqDpygmQ0ZDzr645MacCh3tsIjnvGsdPHq+ 9EBCbUrIadXjgEjNJ6yngZneRellxwAVAmw8T4TI+BATjraKimuaEgl7TkVSuA+4 jAfid0onhxbdxoY46x27MMGCqxHZO/PKwhEubxSHfpuJ1sexxfGamKD6Gy8nC82L /s6aQmmpz2e17CovHVJD2JoU2RBOMIWErxedESDhXz5gxvGNnb86xW6+AL3wc9ew WmxiaQQrF7i8u0F/9OyXsyvctIAleGJ98/lRc6inrHTARlgmmDw48ZeIn5PtLW72 IXubwqfKcbUObUpb/44dYtvvHbCiKTrNBtsgBBXfRYh8mK50LEB1aJlA/h4rCA5h iu734p3e79hMABXM+9ywadhLBgHGZGGZ0fhwArok7axCEuuimITa/RCnzGlGLRnD thVRbrPMTppW0LeFMZsUJKyfVpN94ZivKpEFR77ux+cIUxvEAC7oVUcbVBimtYxA qdE87+Dr+h/y0BrdhBAznMxzyL8hozTlTsVJMfbDO/xsFs/zoGBLUVF3CY4nwvkE EbQVGJYeVcnfu5AyiqXC =Ffbq -----END PGP SIGNATURE----- --LlFPvvv0bgv2COB0vIOLCNP8IjPOkfqDX-- From owner-svn-src-all@freebsd.org Tue Jan 10 07:58:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00374CA9509; Tue, 10 Jan 2017 07:58:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::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 C1F531E2A; Tue, 10 Jan 2017 07:58:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id y143so22391855pfb.0; Mon, 09 Jan 2017 23:58:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=/BJqKDsd9x9nKubbGuyrHeQlKQVzFGgnxPpExF4ohzU=; b=CpF8EOBEjf+a1nzIfQwTV15OD9FnvEq5Ol9OGdc1RkKdG4+1UbMrDFb0KzlRdQRuim h4O+iadfTf0u1hVrLt52tHMFzS9gZfWvGVCj3Tbfrm6gHpnsIIX672Vrna1Ilrw5fHnE zMxX0GZ9ODlbt9lINrGRX0SF0AgkwCjnCtt2mxHG24OM4A2sQ+s1gWrCDsPEqSsAnr4w neJCNQJV1VGrGAq7lvluVbwbBg1S6QaDZVrtW6VI/Xm2kDMEA4SyLusgogx86gOpN+cX h9keqE+najs7ai5CLcqaMZqFVYv47NaJ1N78N3YOn5im2recCZgSiXGKPan+/fF0tymu GGUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=/BJqKDsd9x9nKubbGuyrHeQlKQVzFGgnxPpExF4ohzU=; b=EfXYsWPxRF68tYFvzowliJgXY5YityVAPmFNozrcuw1vgsFzY+r7uxHKf4F/goJZat 5vAkcly6l2ENzdaW11S1pJawNRtIpvh9tO1+xGBOJIqfG1Mu3EAsOkQhWiyMVg0yxQog tSMn7daxR7eCdjYyGw3S300L1XCoFxnH6LOCke2Qa6620NVDiJRUyJiPRl+Rv0tDsTsG 22yxuE3PMkALP0SnXrxdMM+94JmNqjbzjLKyNMGON+Yd6uRblNiBEjNeMBavT+L5SW8T uViCzFNerWn+IXv7QhaNE4ZWOc4TssfgX+kzXvNNVhCgg7UmrkM7BYavB426GlfYb8cJ KweQ== X-Gm-Message-State: AIkVDXJUeuTvf2UJGvr4FdhzXHepWjaICdbTWP/ADA/O1VqE2ZkK7tlHxfgaZXx9QeTCUQ== X-Received: by 10.84.204.8 with SMTP id a8mr3101161ple.172.1484035137388; Mon, 09 Jan 2017 23:58:57 -0800 (PST) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id n84sm2971684pfk.25.2017.01.09.23.58.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jan 2017 23:58:56 -0800 (PST) From: "Ngie Cooper (yaneurabeya)" Message-Id: <18D51B59-6985-49FA-83E6-225B560053B5@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r311585 - in head: crypto/openssh secure/usr.sbin/sshd Date: Mon, 9 Jan 2017 23:58:55 -0800 In-Reply-To: Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, d@delphij.net, des@freebsd.org To: Xin Li References: <201701070808.v0788aEi064973@repo.freebsd.org> X-Mailer: Apple Mail (2.3259) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 07:58:58 -0000 > On Jan 9, 2017, at 11:56 PM, Xin Li wrote: >=20 >=20 > On 1/7/17 00:08, Ngie Cooper wrote: >> Author: ngie >> Date: Sat Jan 7 08:08:35 2017 >> New Revision: 311585 >> URL: https://svnweb.freebsd.org/changeset/base/311585 >>=20 >> Log: >> Conditionalize building libwrap support into sshd >>=20 >> Only build libwrap support into sshd if MK_TCP_WRAPPERS !=3D no >>=20 >> This will unbreak the build if libwrap has been removed from the = system >>=20 >> MFC after: 2 weeks >> PR: 210141 >> Submitted by: kpect@protonmail.com >> Differential Revision: D9049 >=20 > I didn't see this approved by maintainer, did you ping him? >=20 > [delphij@saturn] /usr/src> grep ssh MAINTAINERS > openssh des Pre-commit review requested. >=20 > (Not that the change itself is bad, though, but it's important to keep > everyone on the same page). I waited 3 days for a reply on the review: = https://reviews.freebsd.org/D9049 . = Admittedly, it was a bit short of a timeout. -Ngie= From owner-svn-src-all@freebsd.org Tue Jan 10 08:08:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12AC1CA98E4; Tue, 10 Jan 2017 08:08:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C83C313AA; Tue, 10 Jan 2017 08:08:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A88ok4059166; Tue, 10 Jan 2017 08:08:50 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A88nx1059163; Tue, 10 Jan 2017 08:08:49 GMT (envelope-from des@FreeBSD.org) Message-Id: <201701100808.v0A88nx1059163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 10 Jan 2017 08:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311863 - stable/10/lib/libfetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 08:08:51 -0000 Author: des Date: Tue Jan 10 08:08:49 2017 New Revision: 311863 URL: https://svnweb.freebsd.org/changeset/base/311863 Log: MFH (r267371, r297754, r299520): nits and style Modified: stable/10/lib/libfetch/fetch.3 stable/10/lib/libfetch/ftp.c stable/10/lib/libfetch/http.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/fetch.3 ============================================================================== --- stable/10/lib/libfetch/fetch.3 Tue Jan 10 07:50:21 2017 (r311862) +++ stable/10/lib/libfetch/fetch.3 Tue Jan 10 08:08:49 2017 (r311863) @@ -783,27 +783,27 @@ library first appeared in The .Nm fetch library was mostly written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org with numerous suggestions and contributions from -.An Jordan K. Hubbard Aq jkh@FreeBSD.org , -.An Eugene Skepner Aq eu@qub.com , -.An Hajimu Umemoto Aq ume@FreeBSD.org , -.An Henry Whincup Aq henry@techiebod.com , -.An Jukka A. Ukkonen Aq jau@iki.fi , -.An Jean-Fran\(,cois Dockes Aq jf@dockes.org , -.An Michael Gmelin Aq freebsd@grem.de +.An Jordan K. Hubbard Aq Mt jkh@FreeBSD.org , +.An Eugene Skepner Aq Mt eu@qub.com , +.An Hajimu Umemoto Aq Mt ume@FreeBSD.org , +.An Henry Whincup Aq Mt henry@techiebod.com , +.An Jukka A. Ukkonen Aq Mt jau@iki.fi , +.An Jean-Fran\(,cois Dockes Aq Mt jf@dockes.org , +.An Michael Gmelin Aq Mt freebsd@grem.de and others. It replaces the older .Nm ftpio library written by -.An Poul-Henning Kamp Aq phk@FreeBSD.org +.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org and -.An Jordan K. Hubbard Aq jkh@FreeBSD.org . +.An Jordan K. Hubbard Aq Mt jkh@FreeBSD.org . .Pp This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org and -.An Michael Gmelin Aq freebsd@grem.de . +.An Michael Gmelin Aq Mt freebsd@grem.de . .Sh BUGS Some parts of the library are not yet implemented. The most notable Modified: stable/10/lib/libfetch/ftp.c ============================================================================== --- stable/10/lib/libfetch/ftp.c Tue Jan 10 07:50:21 2017 (r311862) +++ stable/10/lib/libfetch/ftp.c Tue Jan 10 08:08:49 2017 (r311863) @@ -929,7 +929,7 @@ ftp_authenticate(conn_t *conn, struct ur if (*pwd == '\0') pwd = getenv("FTP_PASSWORD"); if (pwd == NULL || *pwd == '\0') { - if ((logname = getlogin()) == 0) + if ((logname = getlogin()) == NULL) logname = FTP_ANONYMOUS_USER; if ((len = snprintf(pbuf, MAXLOGNAME + 1, "%s@", logname)) < 0) len = 0; Modified: stable/10/lib/libfetch/http.c ============================================================================== --- stable/10/lib/libfetch/http.c Tue Jan 10 07:50:21 2017 (r311862) +++ stable/10/lib/libfetch/http.c Tue Jan 10 08:08:49 2017 (r311863) @@ -875,7 +875,7 @@ http_parse_mtime(const char *p, time_t * char locale[64], *r; struct tm tm; - strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); + strlcpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); setlocale(LC_TIME, "C"); r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm); /* From owner-svn-src-all@freebsd.org Tue Jan 10 08:12:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EC1FCA9AB0; Tue, 10 Jan 2017 08:12:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B0D4186B; Tue, 10 Jan 2017 08:12:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A8CuR9063079; Tue, 10 Jan 2017 08:12:56 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A8CutO063078; Tue, 10 Jan 2017 08:12:56 GMT (envelope-from des@FreeBSD.org) Message-Id: <201701100812.v0A8CutO063078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 10 Jan 2017 08:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311864 - stable/10/lib/libfetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 08:12:57 -0000 Author: des Date: Tue Jan 10 08:12:56 2017 New Revision: 311864 URL: https://svnweb.freebsd.org/changeset/base/311864 Log: MFH (r301027): fix 307 / 308 redirects MFH (r310823): fix multi-line CONNECT responses PR: 112515 173451 194483 209546 Modified: stable/10/lib/libfetch/http.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/http.c ============================================================================== --- stable/10/lib/libfetch/http.c Tue Jan 10 08:08:49 2017 (r311863) +++ stable/10/lib/libfetch/http.c Tue Jan 10 08:12:56 2017 (r311864) @@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$"); #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \ || (xyz) == HTTP_MOVED_TEMP \ || (xyz) == HTTP_TEMP_REDIRECT \ + || (xyz) == HTTP_PERM_REDIRECT \ || (xyz) == HTTP_USE_PROXY \ || (xyz) == HTTP_SEE_OTHER) @@ -1431,7 +1432,7 @@ http_connect(struct url *URL, struct url default: /* ignore */ ; } - } while (h < hdr_end); + } while (h > hdr_end); } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, URL, verbose) == -1) { @@ -1767,6 +1768,8 @@ http_request_body(struct url *URL, const break; case HTTP_MOVED_PERM: case HTTP_MOVED_TEMP: + case HTTP_TEMP_REDIRECT: + case HTTP_PERM_REDIRECT: case HTTP_SEE_OTHER: case HTTP_USE_PROXY: /* From owner-svn-src-all@freebsd.org Tue Jan 10 08:23:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7422CA9D13; Tue, 10 Jan 2017 08:23:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D90B1D94; Tue, 10 Jan 2017 08:23:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A8N6dH067023; Tue, 10 Jan 2017 08:23:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A8N6u3067021; Tue, 10 Jan 2017 08:23:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701100823.v0A8N6u3067021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 08:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311865 - stable/11/usr.sbin/ctld X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 08:23:07 -0000 Author: mav Date: Tue Jan 10 08:23:06 2017 New Revision: 311865 URL: https://svnweb.freebsd.org/changeset/base/311865 Log: MFC r310633: Add MAX_LUNS overflow safety checks. While this MAX_LUNS limitation is too synthetic and should be removed, it is better to enforce it while it is here. Modified: stable/11/usr.sbin/ctld/parse.y stable/11/usr.sbin/ctld/uclparse.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/ctld/parse.y ============================================================================== --- stable/11/usr.sbin/ctld/parse.y Tue Jan 10 08:12:56 2017 (r311864) +++ stable/11/usr.sbin/ctld/parse.y Tue Jan 10 08:23:06 2017 (r311865) @@ -821,6 +821,11 @@ lun_number: STR free($1); return (1); } + if (tmp >= MAX_LUNS) { + yyerror("LU number is too big"); + free($1); + return (1); + } ret = asprintf(&name, "%s,lun,%ju", target->t_name, tmp); if (ret <= 0) @@ -845,6 +850,11 @@ target_lun_ref: LUN STR STR return (1); } free($2); + if (tmp >= MAX_LUNS) { + yyerror("LU number is too big"); + free($3); + return (1); + } lun = lun_find(conf, $3); free($3); Modified: stable/11/usr.sbin/ctld/uclparse.c ============================================================================== --- stable/11/usr.sbin/ctld/uclparse.c Tue Jan 10 08:12:56 2017 (r311864) +++ stable/11/usr.sbin/ctld/uclparse.c Tue Jan 10 08:23:06 2017 (r311865) @@ -183,18 +183,25 @@ static int uclparse_target_lun(struct target *target, const ucl_object_t *obj) { struct lun *lun; + uint64_t tmp; if (obj->type == UCL_INT) { char *name; - asprintf(&name, "%s,lun,%ju", target->t_name, - ucl_object_toint(obj)); + tmp = ucl_object_toint(obj); + if (tmp >= MAX_LUNS) { + log_warnx("LU number %ju in target \"%s\" is too big", + tmp, target->t_name); + return (1); + } + + asprintf(&name, "%s,lun,%ju", target->t_name, tmp); lun = lun_new(conf, name); if (lun == NULL) return (1); lun_set_scsiname(lun, name); - target->t_luns[ucl_object_toint(obj)] = lun; + target->t_luns[tmp] = lun; return (0); } @@ -207,6 +214,12 @@ uclparse_target_lun(struct target *targe "\"number\" integer property", target->t_name); return (1); } + tmp = ucl_object_toint(num); + if (tmp >= MAX_LUNS) { + log_warnx("LU number %ju in target \"%s\" is too big", + tmp, target->t_name); + return (1); + } if (name == NULL || name->type != UCL_STRING) { log_warnx("lun section in target \"%s\" is missing " @@ -218,7 +231,7 @@ uclparse_target_lun(struct target *targe if (lun == NULL) return (1); - target->t_luns[ucl_object_toint(num)] = lun; + target->t_luns[tmp] = lun; } return (0); From owner-svn-src-all@freebsd.org Tue Jan 10 08:25:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49D3ECA9E26; Tue, 10 Jan 2017 08:25:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 161D71F4C; Tue, 10 Jan 2017 08:25:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A8P3YK067149; Tue, 10 Jan 2017 08:25:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A8P38T067148; Tue, 10 Jan 2017 08:25:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701100825.v0A8P38T067148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 08:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311866 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 08:25:04 -0000 Author: mav Date: Tue Jan 10 08:25:03 2017 New Revision: 311866 URL: https://svnweb.freebsd.org/changeset/base/311866 Log: MFC r310633: Add MAX_LUNS overflow safety checks. While this MAX_LUNS limitation is too synthetic and should be removed, it is better to enforce it while it is here. Modified: stable/10/usr.sbin/ctld/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Tue Jan 10 08:23:06 2017 (r311865) +++ stable/10/usr.sbin/ctld/parse.y Tue Jan 10 08:25:03 2017 (r311866) @@ -808,6 +808,11 @@ lun_number: STR free($1); return (1); } + if (tmp >= MAX_LUNS) { + yyerror("LU number is too big"); + free($1); + return (1); + } ret = asprintf(&name, "%s,lun,%ju", target->t_name, tmp); if (ret <= 0) @@ -832,6 +837,11 @@ target_lun_ref: LUN STR STR return (1); } free($2); + if (tmp >= MAX_LUNS) { + yyerror("LU number is too big"); + free($3); + return (1); + } lun = lun_find(conf, $3); free($3); From owner-svn-src-all@freebsd.org Tue Jan 10 10:02:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E0C3CA8A6B; Tue, 10 Jan 2017 10:02: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 1AC34137D; Tue, 10 Jan 2017 10:02:45 +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 v0AA2iMP007801; Tue, 10 Jan 2017 10:02:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AA2iML007800; Tue, 10 Jan 2017 10:02:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701101002.v0AA2iML007800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Jan 2017 10:02:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311867 - vendor/NetBSD/tests/dist/lib/libc/gen X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 10:02:45 -0000 Author: ngie Date: Tue Jan 10 10:02:44 2017 New Revision: 311867 URL: https://svnweb.freebsd.org/changeset/base/311867 Log: t_raise: import a minor grammar error fix to diff reduce with NetBSD Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_raise.c Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_raise.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_raise.c Tue Jan 10 08:25:03 2017 (r311866) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_raise.c Tue Jan 10 10:02:44 2017 (r311867) @@ -1,4 +1,4 @@ -/* $NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $ */ +/* $NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $"); +__RCSID("$NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $"); #include @@ -176,7 +176,7 @@ ATF_TC_BODY(raise_stress, tc) (void)raise(SIGUSR1); if (count != maxiter) - atf_tc_fail("not all signals were catched"); + atf_tc_fail("not all signals were caught"); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Tue Jan 10 10:06:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 211EECA8CE3; Tue, 10 Jan 2017 10:06:17 +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 E45B317C7; Tue, 10 Jan 2017 10:06:16 +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 v0AA6GK4007973; Tue, 10 Jan 2017 10:06:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AA6GO8007972; Tue, 10 Jan 2017 10:06:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701101006.v0AA6GO8007972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Jan 2017 10:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311868 - vendor/NetBSD/tests/dist/lib/libc/ttyio X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 10:06:17 -0000 Author: ngie Date: Tue Jan 10 10:06:15 2017 New Revision: 311868 URL: https://svnweb.freebsd.org/changeset/base/311868 Log: Import lib/libc/ttyio/t_ttyio.c,1.3 Modified: vendor/NetBSD/tests/dist/lib/libc/ttyio/t_ttyio.c Modified: vendor/NetBSD/tests/dist/lib/libc/ttyio/t_ttyio.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/ttyio/t_ttyio.c Tue Jan 10 10:02:44 2017 (r311867) +++ vendor/NetBSD/tests/dist/lib/libc/ttyio/t_ttyio.c Tue Jan 10 10:06:15 2017 (r311868) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $ */ +/* $NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $ */ /* * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $"); +__RCSID("$NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $"); #include #include @@ -150,8 +150,9 @@ ATF_TC_BODY(ioctl, tc) /* wait for last child */ sa.sa_handler = SIG_DFL; REQUIRE_ERRNO(sigaction(SIGCHLD, &sa, NULL), -1); - (void) wait(NULL); + (void)wait(NULL); + (void)close(s); ATF_REQUIRE_EQ(rc, 0); } From owner-svn-src-all@freebsd.org Tue Jan 10 10:12:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B4ECA8FB6; Tue, 10 Jan 2017 10:12:37 +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 60DBB1E27; Tue, 10 Jan 2017 10:12:37 +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 v0AACaOE011817; Tue, 10 Jan 2017 10:12:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AACaUd011816; Tue, 10 Jan 2017 10:12:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701101012.v0AACaUd011816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Jan 2017 10:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311870 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 10:12:37 -0000 Author: ngie Date: Tue Jan 10 10:12:36 2017 New Revision: 311870 URL: https://svnweb.freebsd.org/changeset/base/311870 Log: Merge the grammar fix for lib/libc/gen/raise_test:raise_stress MFC after: 3 days Modified: head/contrib/netbsd-tests/lib/libc/gen/t_raise.c Directory Properties: head/contrib/netbsd-tests/ (props changed) Modified: head/contrib/netbsd-tests/lib/libc/gen/t_raise.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_raise.c Tue Jan 10 10:09:12 2017 (r311869) +++ head/contrib/netbsd-tests/lib/libc/gen/t_raise.c Tue Jan 10 10:12:36 2017 (r311870) @@ -1,4 +1,4 @@ -/* $NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $ */ +/* $NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $"); +__RCSID("$NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $"); #include @@ -180,7 +180,7 @@ ATF_TC_BODY(raise_stress, tc) (void)raise(SIGUSR1); if (count != maxiter) - atf_tc_fail("not all signals were catched"); + atf_tc_fail("not all signals were caught"); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Tue Jan 10 10:17:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DF7BCA915A; Tue, 10 Jan 2017 10:17: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 4E09B10F0; Tue, 10 Jan 2017 10:17: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 v0AAGx5q012048; Tue, 10 Jan 2017 10:16:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AAGxxI012047; Tue, 10 Jan 2017 10:16:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701101016.v0AAGxxI012047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Jan 2017 10:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311871 - head/contrib/netbsd-tests/lib/libc/ttyio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 10:17:00 -0000 Author: ngie Date: Tue Jan 10 10:16:59 2017 New Revision: 311871 URL: https://svnweb.freebsd.org/changeset/base/311871 Log: Merge ^/vendor/NetBSD/tests/dist@r311868 This is the vendor accepted version of ^/head@r311245 MFC after: 3 days Modified: head/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Directory Properties: head/contrib/netbsd-tests/ (props changed) Modified: head/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Tue Jan 10 10:12:36 2017 (r311870) +++ head/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Tue Jan 10 10:16:59 2017 (r311871) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $ */ +/* $NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $ */ /* * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $"); +__RCSID("$NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $"); #include #include @@ -150,11 +150,9 @@ ATF_TC_BODY(ioctl, tc) /* wait for last child */ sa.sa_handler = SIG_DFL; REQUIRE_ERRNO(sigaction(SIGCHLD, &sa, NULL), -1); - (void) wait(NULL); + (void)wait(NULL); -#ifdef __FreeBSD__ (void)close(s); -#endif ATF_REQUIRE_EQ(rc, 0); } From owner-svn-src-all@freebsd.org Tue Jan 10 10:20:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19A79CA930D; Tue, 10 Jan 2017 10:20:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D504715D1; Tue, 10 Jan 2017 10:20:45 +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 D94F61FE1B5; Tue, 10 Jan 2017 11:20:15 +0100 (CET) Subject: Re: svn commit: r311707 - in head/sys/dev/rtwn: . usb To: Andriy Voskoboinyk References: <201701082341.v08NfH4O046808@repo.freebsd.org> <83881095-b47e-facb-6bbe-a79f8e54209d@selasky.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Tue, 10 Jan 2017 11:20:05 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 10:20:46 -0000 On 01/10/17 00:56, Andriy Voskoboinyk wrote: > Mon, 09 Jan 2017 10:08:13 +0200 було напиÑано Hans Petter Selasky > : > > Hi, > > The race should be fixed in r311838. > Perfect :-) --HPS From owner-svn-src-all@freebsd.org Tue Jan 10 10:27:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE6B9CA94FB; Tue, 10 Jan 2017 10:27:10 +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 734401A78; Tue, 10 Jan 2017 10:27:10 +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 v0AAR9oH016164; Tue, 10 Jan 2017 10:27:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AAR9UI016163; Tue, 10 Jan 2017 10:27:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701101027.v0AAR9UI016163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Jan 2017 10:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311872 - head/contrib/netbsd-tests/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 10:27:10 -0000 Author: ngie Date: Tue Jan 10 10:27:09 2017 New Revision: 311872 URL: https://svnweb.freebsd.org/changeset/base/311872 Log: Diff reduce with upstream by removing signal.h #include MFC after: 3 days Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Tue Jan 10 10:16:59 2017 (r311871) +++ head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Tue Jan 10 10:27:09 2017 (r311872) @@ -36,10 +36,6 @@ #include #include -#ifndef __NetBSD__ -#include -#endif - ATF_TC(snprintf_c99); ATF_TC_HEAD(snprintf_c99, tc) { From owner-svn-src-all@freebsd.org Tue Jan 10 10:33:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 489A7CA9A28; Tue, 10 Jan 2017 10:33:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F26E812CD; Tue, 10 Jan 2017 10:33:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AAXbpJ020129; Tue, 10 Jan 2017 10:33:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AAXb90020128; Tue, 10 Jan 2017 10:33:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701101033.v0AAXb90020128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 10:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311873 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 10:33:38 -0000 Author: mav Date: Tue Jan 10 10:33:36 2017 New Revision: 311873 URL: https://svnweb.freebsd.org/changeset/base/311873 Log: Fix malloc(M_WAITOK) under mutex, introduced at r311787. MFC after: 13 days Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Jan 10 10:27:09 2017 (r311872) +++ head/sys/cam/ctl/ctl.c Tue Jan 10 10:33:36 2017 (r311873) @@ -4593,6 +4593,8 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft printf("ctl: requested LUN ID %d is already " "in use\n", be_lun->req_lun_id); } +fail: + free(lun->lun_devid, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); be_lun->lun_config_status(be_lun->be_lun, @@ -4605,14 +4607,11 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft if (lun_number == -1) { mtx_unlock(&ctl_softc->ctl_lock); printf("ctl: can't allocate LUN, out of LUNs\n"); - if (lun->flags & CTL_LUN_MALLOCED) - free(lun, M_CTL); - be_lun->lun_config_status(be_lun->be_lun, - CTL_LUN_CONFIG_FAILURE); - return (ENOSPC); + goto fail; } } ctl_set_mask(ctl_softc->ctl_lun_mask, lun_number); + mtx_unlock(&ctl_softc->ctl_lock); mtx_init(&lun->lun_lock, "CTL LUN", NULL, MTX_DEF); lun->lun = lun_number; @@ -4664,22 +4663,6 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft ctl_init_page_index(lun); ctl_init_log_page_index(lun); - /* - * Now, before we insert this lun on the lun list, set the lun - * inventory changed UA for all other luns. - */ - STAILQ_FOREACH(nlun, &ctl_softc->lun_list, links) { - mtx_lock(&nlun->lun_lock); - ctl_est_ua_all(nlun, -1, CTL_UA_LUN_CHANGE); - mtx_unlock(&nlun->lun_lock); - } - - STAILQ_INSERT_TAIL(&ctl_softc->lun_list, lun, links); - - ctl_softc->ctl_luns[lun_number] = lun; - - ctl_softc->num_luns++; - /* Setup statistics gathering */ #ifdef CTL_LEGACY_STATS lun->legacy_stats.device_type = be_lun->lun_type; @@ -4692,6 +4675,19 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft #endif /* CTL_LEGACY_STATS */ lun->stats.item = lun_number; + /* + * Now, before we insert this lun on the lun list, set the lun + * inventory changed UA for all other luns. + */ + mtx_lock(&ctl_softc->ctl_lock); + STAILQ_FOREACH(nlun, &ctl_softc->lun_list, links) { + mtx_lock(&nlun->lun_lock); + ctl_est_ua_all(nlun, -1, CTL_UA_LUN_CHANGE); + mtx_unlock(&nlun->lun_lock); + } + STAILQ_INSERT_TAIL(&ctl_softc->lun_list, lun, links); + ctl_softc->ctl_luns[lun_number] = lun; + ctl_softc->num_luns++; mtx_unlock(&ctl_softc->ctl_lock); lun->be_lun->lun_config_status(lun->be_lun->be_lun, CTL_LUN_CONFIG_OK); From owner-svn-src-all@freebsd.org Tue Jan 10 10:56:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BDB5CA8139; Tue, 10 Jan 2017 10:56:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DCE41FBB; Tue, 10 Jan 2017 10:56:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AAuXSD028224; Tue, 10 Jan 2017 10:56:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AAuXb7028222; Tue, 10 Jan 2017 10:56:33 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201701101056.v0AAuXb7028222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 10 Jan 2017 10:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311874 - in head/sys: conf dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 10:56:34 -0000 Author: andrew Date: Tue Jan 10 10:56:33 2017 New Revision: 311874 URL: https://svnweb.freebsd.org/changeset/base/311874 Log: Add an ACPI attachment to the existing ahci_generic driver. This is used in some arm64 hardware, for example the AMD Opteron A1100. Reviewed by: mav Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8852 Modified: head/sys/conf/files.arm64 head/sys/dev/ahci/ahci_generic.c Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Jan 10 10:33:36 2017 (r311873) +++ head/sys/conf/files.arm64 Tue Jan 10 10:56:33 2017 (r311874) @@ -145,7 +145,7 @@ armv8_crypto_wrap.o optional armv8crypt crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/acpica/acpi_if.m optional acpi -dev/ahci/ahci_generic.c optional ahci fdt +dev/ahci/ahci_generic.c optional ahci dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/hwpmc/hwpmc_arm64.c optional hwpmc dev/hwpmc/hwpmc_arm64_md.c optional hwpmc Modified: head/sys/dev/ahci/ahci_generic.c ============================================================================== --- head/sys/dev/ahci/ahci_generic.c Tue Jan 10 10:33:36 2017 (r311873) +++ head/sys/dev/ahci/ahci_generic.c Tue Jan 10 10:56:33 2017 (r311874) @@ -27,6 +27,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" +#include "opt_platform.h" + #include #include #include @@ -44,6 +47,15 @@ __FBSDID("$FreeBSD$"); #include +#ifdef DEV_ACPI +#include +#include + +#include +#include +#endif + +#ifdef FDT #include #include @@ -54,14 +66,7 @@ static struct ofw_compat_data compat_dat }; static int -ahci_gen_ctlr_reset(device_t dev) -{ - - return ahci_ctlr_reset(dev); -} - -static int -ahci_probe(device_t dev) +ahci_fdt_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) @@ -73,6 +78,34 @@ ahci_probe(device_t dev) device_set_desc_copy(dev, "AHCI SATA controller"); return (BUS_PROBE_DEFAULT); } +#endif + +#ifdef DEV_ACPI +static int +ahci_acpi_probe(device_t dev) +{ + ACPI_HANDLE h; + + if ((h = acpi_get_handle(dev)) == NULL) + return (ENXIO); + + if (pci_get_class(dev) == PCIC_STORAGE && + pci_get_subclass(dev) == PCIS_STORAGE_SATA && + pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0) { + device_set_desc_copy(dev, "AHCI SATA controller"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} +#endif + +static int +ahci_gen_ctlr_reset(device_t dev) +{ + + return ahci_ctlr_reset(dev); +} static int ahci_gen_attach(device_t dev) @@ -109,9 +142,34 @@ ahci_gen_detach(device_t dev) return (0); } -static devclass_t ahci_gen_devclass; -static device_method_t ahci_methods[] = { - DEVMETHOD(device_probe, ahci_probe), +#ifdef FDT +static devclass_t ahci_gen_fdt_devclass; +static device_method_t ahci_fdt_methods[] = { + DEVMETHOD(device_probe, ahci_fdt_probe), + DEVMETHOD(device_attach, ahci_gen_attach), + DEVMETHOD(device_detach, ahci_gen_detach), + DEVMETHOD(bus_print_child, ahci_print_child), + DEVMETHOD(bus_alloc_resource, ahci_alloc_resource), + DEVMETHOD(bus_release_resource, ahci_release_resource), + DEVMETHOD(bus_setup_intr, ahci_setup_intr), + DEVMETHOD(bus_teardown_intr,ahci_teardown_intr), + DEVMETHOD(bus_child_location_str, ahci_child_location_str), + DEVMETHOD(bus_get_dma_tag, ahci_get_dma_tag), + DEVMETHOD_END +}; +static driver_t ahci_fdt_driver = { + "ahci", + ahci_fdt_methods, + sizeof(struct ahci_controller) +}; +DRIVER_MODULE(ahci_fdt, simplebus, ahci_fdt_driver, ahci_gen_fdt_devclass, + NULL, NULL); +#endif + +#ifdef DEV_ACPI +static devclass_t ahci_gen_acpi_devclass; +static device_method_t ahci_acpi_methods[] = { + DEVMETHOD(device_probe, ahci_acpi_probe), DEVMETHOD(device_attach, ahci_gen_attach), DEVMETHOD(device_detach, ahci_gen_detach), DEVMETHOD(bus_print_child, ahci_print_child), @@ -123,9 +181,11 @@ static device_method_t ahci_methods[] = DEVMETHOD(bus_get_dma_tag, ahci_get_dma_tag), DEVMETHOD_END }; -static driver_t ahci_driver = { +static driver_t ahci_acpi_driver = { "ahci", - ahci_methods, + ahci_acpi_methods, sizeof(struct ahci_controller) }; -DRIVER_MODULE(ahci, simplebus, ahci_driver, ahci_gen_devclass, NULL, NULL); +DRIVER_MODULE(ahci_acpi, acpi, ahci_acpi_driver, ahci_gen_acpi_devclass, + NULL, NULL); +#endif From owner-svn-src-all@freebsd.org Tue Jan 10 13:36:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5838ACA9923; Tue, 10 Jan 2017 13:36:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 278731CD3; Tue, 10 Jan 2017 13:36:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0ADaXNN093922; Tue, 10 Jan 2017 13:36:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0ADaXIv093921; Tue, 10 Jan 2017 13:36:33 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201701101336.v0ADaXIv093921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 10 Jan 2017 13:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311875 - head/sys/modules/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 13:36:34 -0000 Author: andrew Date: Tue Jan 10 13:36:33 2017 New Revision: 311875 URL: https://svnweb.freebsd.org/changeset/base/311875 Log: Add acpi_if.h to SRCS so we have it when building ahci_generic.c with ACPI. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/ahci/Makefile Modified: head/sys/modules/ahci/Makefile ============================================================================== --- head/sys/modules/ahci/Makefile Tue Jan 10 10:56:33 2017 (r311874) +++ head/sys/modules/ahci/Makefile Tue Jan 10 13:36:33 2017 (r311875) @@ -6,7 +6,7 @@ KMOD= ahci SRCS= ahci.c ahci_pci.c ahciem.c ahci.h device_if.h bus_if.h pci_if.h opt_cam.h .if ${MACHINE_CPUARCH} == "aarch64" -SRCS+= ahci_generic.c ofw_bus_if.h +SRCS+= ahci_generic.c acpi_if.h ofw_bus_if.h .endif .include From owner-svn-src-all@freebsd.org Tue Jan 10 13:58:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E972BCA8035; Tue, 10 Jan 2017 13:58:48 +0000 (UTC) (envelope-from kamikaze@bsdforen.de) Received: from bsdforen.de (bsdforen.de [82.193.243.115]) by mx1.freebsd.org (Postfix) with ESMTP id B51B01952; Tue, 10 Jan 2017 13:58:48 +0000 (UTC) (envelope-from kamikaze@bsdforen.de) Received: from localhost (iz-aix-213a.HS-Karlsruhe.DE [193.196.64.213]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by bsdforen.de (Postfix) with ESMTPSA id 9784291233; Tue, 10 Jan 2017 14:58:39 +0100 (CET) Message-ID: <1484056720.86242.8.camel@bsdforen.de> Subject: Re: svn commit: r310025 - head/libexec/rtld-elf From: Dominic Fandrey To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 10 Jan 2017 14:58:40 +0100 In-Reply-To: <201612131805.uBDI5EDm054866@repo.freebsd.org> References: <201612131805.uBDI5EDm054866@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 13:58:49 -0000 On Tue, 2016-12-13 at 18:05 +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Dec 13 18:05:14 2016 > New Revision: 310025 > URL: https://svnweb.freebsd.org/changeset/base/310025 > > Log: >   Take write lock for rtld_bind before modifying obj_list in dl_iterate_phdr(). This commit causes a regression in C++, where an exception smashes the sigprocmask, causing all signal handling to fail. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215826 Look at #2 for a demonstration. Regards kami -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? From owner-svn-src-all@freebsd.org Tue Jan 10 14:40:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA8F1CA96E5; Tue, 10 Jan 2017 14:40:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 780B71690; Tue, 10 Jan 2017 14:40:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AEeUAu018246; Tue, 10 Jan 2017 14:40:30 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AEeUBW018245; Tue, 10 Jan 2017 14:40:30 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201701101440.v0AEeUBW018245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 10 Jan 2017 14:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311876 - head/usr.sbin/crunch/crunchide X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 14:40:32 -0000 Author: bz Date: Tue Jan 10 14:40:30 2017 New Revision: 311876 URL: https://svnweb.freebsd.org/changeset/base/311876 Log: Teach crunchide about EM_S390 to make bootstrapping from future releases easier unless someone will fix the PR properly. MFC after: 3 days PR: 215940 Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- head/usr.sbin/crunch/crunchide/exec_elf32.c Tue Jan 10 13:36:33 2017 (r311875) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Tue Jan 10 14:40:30 2017 (r311876) @@ -191,6 +191,7 @@ ELFNAMEEND(check)(int fd, const char *fn #define EM_RISCV 243 #endif case EM_RISCV: break; + case EM_S390: break; case EM_SPARCV9: break; case EM_X86_64: break; /* ELFDEFNNAME(MACHDEP_ID_CASES) */ From owner-svn-src-all@freebsd.org Tue Jan 10 16:25:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 864D5CA9516; Tue, 10 Jan 2017 16:25:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55694112C; Tue, 10 Jan 2017 16:25:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AGPdpB063783; Tue, 10 Jan 2017 16:25:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AGPdkW063782; Tue, 10 Jan 2017 16:25:39 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701101625.v0AGPdkW063782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 Jan 2017 16:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311877 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 16:25:40 -0000 Author: arybchik Date: Tue Jan 10 16:25:39 2017 New Revision: 311877 URL: https://svnweb.freebsd.org/changeset/base/311877 Log: sfxge(4): avoid unnecessary mbuf data prefetch Unnecessary prefetch just loads HW prefetcher and displaces other cache entries (which could be really useful). If we parse mbuf for TSO early and use firmware-assisted TSO, we do not expect mbuf data access when we compose firmware-assisted TSO (v1 or v2) option descriptors. If packet header needs to be linearized or finally FATSO cannot be used because of, for example, too big header, we do not care about a bit more performance degradation because of prefetch absence (it is better to optimize more common case). Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D9120 Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Tue Jan 10 14:40:30 2017 (r311876) +++ head/sys/dev/sfxge/sfxge_tx.c Tue Jan 10 16:25:39 2017 (r311877) @@ -363,8 +363,22 @@ static int sfxge_tx_queue_mbuf(struct sf KASSERT(!txq->blocked, ("txq->blocked")); +#if SFXGE_TX_PARSE_EARLY + /* + * If software TSO is used, we still need to copy packet header, + * even if we have already parsed it early before enqueue. + */ + if ((mbuf->m_pkthdr.csum_flags & CSUM_TSO) && + (txq->tso_fw_assisted == 0)) + prefetch_read_many(mbuf->m_data); +#else + /* + * Prefetch packet header since we need to parse it and extract + * IP ID, TCP sequence number and flags. + */ if (mbuf->m_pkthdr.csum_flags & CSUM_TSO) prefetch_read_many(mbuf->m_data); +#endif if (__predict_false(txq->init_state != SFXGE_TXQ_STARTED)) { rc = EINTR; From owner-svn-src-all@freebsd.org Tue Jan 10 16:30:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03143CA96EF; Tue, 10 Jan 2017 16:30:58 +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 D42BE15B6; Tue, 10 Jan 2017 16:30:57 +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 v0AGUv9N064676; Tue, 10 Jan 2017 16:30:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AGUuT7064674; Tue, 10 Jan 2017 16:30:56 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201701101630.v0AGUuT7064674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 10 Jan 2017 16:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311878 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 16:30:58 -0000 Author: ae Date: Tue Jan 10 16:30:56 2017 New Revision: 311878 URL: https://svnweb.freebsd.org/changeset/base/311878 Log: MFC r310258: ip[6]_tryforward does inbound and outbound packet firewall processing. This can lead to change of mbuf pointer (packet filter could do m_pullup(), NAT, etc). Also in case of change of destination address, tryforward can decide that packet should be handled by local system. In this case modified mbuf can be returned to the ip[6]_input(). To handle this correctly, check M_FASTFWD_OURS flag after return from ip[6]_tryforward. And if it is present, update variables that depend from mbuf pointer and skip another inbound firewall processing. Modified: stable/11/sys/netinet/ip_input.c stable/11/sys/netinet6/ip6_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_input.c ============================================================================== --- stable/11/sys/netinet/ip_input.c Tue Jan 10 16:25:39 2017 (r311877) +++ stable/11/sys/netinet/ip_input.c Tue Jan 10 16:30:56 2017 (r311878) @@ -550,24 +550,35 @@ tooshort: m_adj(m, ip_len - m->m_pkthdr.len); } - /* Try to forward the packet, but if we fail continue */ + /* + * Try to forward the packet, but if we fail continue. + * ip_tryforward() does inbound and outbound packet firewall + * processing. If firewall has decided that destination becomes + * our local address, it sets M_FASTFWD_OURS flag. In this + * case skip another inbound firewall processing and update + * ip pointer. + */ + if (V_ipforwarding != 0 #ifdef IPSEC - /* For now we do not handle IPSEC in tryforward. */ - if (!key_havesp(IPSEC_DIR_INBOUND) && !key_havesp(IPSEC_DIR_OUTBOUND) && - (V_ipforwarding == 1)) - if (ip_tryforward(m) == NULL) + && !key_havesp(IPSEC_DIR_INBOUND) + && !key_havesp(IPSEC_DIR_OUTBOUND) +#endif + ) { + if ((m = ip_tryforward(m)) == NULL) return; + if (m->m_flags & M_FASTFWD_OURS) { + m->m_flags &= ~M_FASTFWD_OURS; + ip = mtod(m, struct ip *); + goto ours; + } + } +#ifdef IPSEC /* * Bypass packet filtering for packets previously handled by IPsec. */ if (ip_ipsec_filtertunnel(m)) goto passin; -#else - if (V_ipforwarding == 1) - if (ip_tryforward(m) == NULL) - return; -#endif /* IPSEC */ - +#endif /* * Run through list of hooks for input packets. * Modified: stable/11/sys/netinet6/ip6_input.c ============================================================================== --- stable/11/sys/netinet6/ip6_input.c Tue Jan 10 16:25:39 2017 (r311877) +++ stable/11/sys/netinet6/ip6_input.c Tue Jan 10 16:30:56 2017 (r311878) @@ -731,23 +731,36 @@ ip6_input(struct mbuf *m) goto bad; } #endif - /* Try to forward the packet, but if we fail continue */ + /* + * Try to forward the packet, but if we fail continue. + * ip6_tryforward() does inbound and outbound packet firewall + * processing. If firewall has decided that destination becomes + * our local address, it sets M_FASTFWD_OURS flag. In this + * case skip another inbound firewall processing and update + * ip6 pointer. + */ + if (V_ip6_forwarding != 0 #ifdef IPSEC - if (V_ip6_forwarding != 0 && !key_havesp(IPSEC_DIR_INBOUND) && - !key_havesp(IPSEC_DIR_OUTBOUND)) - if (ip6_tryforward(m) == NULL) + && !key_havesp(IPSEC_DIR_INBOUND) + && !key_havesp(IPSEC_DIR_OUTBOUND) +#endif + ) { + if ((m = ip6_tryforward(m)) == NULL) return; + if (m->m_flags & M_FASTFWD_OURS) { + m->m_flags &= ~M_FASTFWD_OURS; + ours = 1; + ip6 = mtod(m, struct ip6_hdr *); + goto hbhcheck; + } + } +#ifdef IPSEC /* * Bypass packet filtering for packets previously handled by IPsec. */ if (ip6_ipsec_filtertunnel(m)) goto passin; -#else - if (V_ip6_forwarding != 0) - if (ip6_tryforward(m) == NULL) - return; -#endif /* IPSEC */ - +#endif /* * Run through list of hooks for input packets. * @@ -755,12 +768,12 @@ ip6_input(struct mbuf *m) * (e.g. by NAT rewriting). When this happens, * tell ip6_forward to do the right thing. */ - odst = ip6->ip6_dst; /* Jump over all PFIL processing if hooks are not active. */ if (!PFIL_HOOKED(&V_inet6_pfil_hook)) goto passin; + odst = ip6->ip6_dst; if (pfil_run_hooks(&V_inet6_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN, NULL)) return; From owner-svn-src-all@freebsd.org Tue Jan 10 17:05:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4528CA98FD; Tue, 10 Jan 2017 17:05:35 +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 B3B2D1D41; Tue, 10 Jan 2017 17:05:35 +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 v0AH5Y07079709; Tue, 10 Jan 2017 17:05:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AH5YbM079708; Tue, 10 Jan 2017 17:05:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701101705.v0AH5YbM079708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Jan 2017 17:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311879 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 17:05:36 -0000 Author: kib Date: Tue Jan 10 17:05:34 2017 New Revision: 311879 URL: https://svnweb.freebsd.org/changeset/base/311879 Log: Use ANSI C definitions, update comment. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld_lock.c Modified: head/libexec/rtld-elf/rtld_lock.c ============================================================================== --- head/libexec/rtld-elf/rtld_lock.c Tue Jan 10 16:30:56 2017 (r311878) +++ head/libexec/rtld-elf/rtld_lock.c Tue Jan 10 17:05:34 2017 (r311879) @@ -38,8 +38,8 @@ * In this algorithm the lock is a single word. Its low-order bit is * set when a writer holds the lock. The remaining high-order bits * contain a count of readers desiring the lock. The algorithm requires - * atomic "compare_and_store" and "add" operations, which we implement - * using assembly language sequences in "rtld_start.S". + * atomic "compare_and_store" and "add" operations, which we take + * from machine/atomic.h. */ #include @@ -67,7 +67,7 @@ static sigset_t fullsigmask, oldsigmask; static int thread_flag; static void * -def_lock_create() +def_lock_create(void) { void *base; char *p; @@ -269,7 +269,7 @@ lock_restart_for_upgrade(RtldLockState * } void -lockdflt_init() +lockdflt_init(void) { int i; From owner-svn-src-all@freebsd.org Tue Jan 10 17:23:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBD46CA9F6B for ; Tue, 10 Jan 2017 17:23:39 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::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 921C81839 for ; Tue, 10 Jan 2017 17:23:39 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x22b.google.com with SMTP id 11so83070515qkl.3 for ; Tue, 10 Jan 2017 09:23:39 -0800 (PST) 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=KBIV9LRzDgXih2u6Rq9FxkQWKd/XNh1z07OrKxB7/wk=; b=bh0RRVJ32F8gnjpK8dXWUyY4cNinxM+N0V/joO/FqXgIgxhzbqCW+tmFUdChCGLdhN +mxGPTgK7govEVo5SZrQ3WfbhdgqE1qxVbZQNQA5dbJ5LKd/MnBKarIkkLn2+OZB5Z2k bl1++HpM4rLgnbD+SL4ohv7elHylKEHVGDX2JB2frxfDhpaSFFTFX4ZHoZwTG1qiADwS t4UAvW54IT7uy94t5Wpv4b2ErrpeitQdWXPgz5JCLZjFxcpA9m7JXQtLaQ/G4ev/kzSY 9iwrc7Q9B9Uksp1vwhiRKXvOPkqhVnin7dXKORL7aFR/NX4LP8bAoKeX9BhZ9PzvZIE+ liog== 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=KBIV9LRzDgXih2u6Rq9FxkQWKd/XNh1z07OrKxB7/wk=; b=jx+LFWPI2sLyu6hu3AndZCpjFpJkVNB9TAJ+t92YH0zuz+UYTy0FXtGTPJuSVlIwCo 4nk6nEwlj1J04pt5YSUy9KWug3YhrlJrQSMdRJxqqlHphoe8UfhieCpgxw+0h4LZ4AVu J73YmgrifgjfdthqMa3Pz31l8kbOc6dGum96bIARak3kICIrMdDV/bOL42+JflL502oc WqZB/d+JIKGrDXCslvkyXcifp6e8KN3nO1+Ai03FbNdyrMijLKxCVrso+VZMNHxLf+r8 wIpg7+dxnXubo6cOWIH+VhT64Y3EI2krH/08FJBnKoC5ZX8s32O6TKCQtFX0KK4XaIco ZDKA== X-Gm-Message-State: AIkVDXKt6DpTll+KHlHK6rvLq2/uT6sD77+7W14NYppjG/waaSiSmEFDPcaBqZmlFu8s6MhI X-Received: by 10.55.38.200 with SMTP id m69mr4361022qkm.100.1484069018666; Tue, 10 Jan 2017 09:23:38 -0800 (PST) Received: from mutt-hardenedbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id d67sm1884223qkg.17.2017.01.10.09.23.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Jan 2017 09:23:37 -0800 (PST) Date: Tue, 10 Jan 2017 12:23:36 -0500 From: Shawn Webb To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311860 - head/sys/net80211 Message-ID: <20170110172336.phqcy57zszifujaj@mutt-hardenedbsd> References: <201701100721.v0A7L7ip039127@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="clqiuqvuihafj6vh" Content-Disposition: inline In-Reply-To: <201701100721.v0A7L7ip039127@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20161126 (1.7.1) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 17:23:40 -0000 --clqiuqvuihafj6vh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 10, 2017 at 07:21:07AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Tue Jan 10 07:21:07 2017 > New Revision: 311860 > URL: https://svnweb.freebsd.org/changeset/base/311860 >=20 > Log: > [net80211] add VHT action frame placeholders for when it's time to impl= ement. >=20 > Modified: > head/sys/net80211/ieee80211_vht.c >=20 > Modified: head/sys/net80211/ieee80211_vht.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/net80211/ieee80211_vht.c Tue Jan 10 05:37:53 2017 (r311859) > +++ head/sys/net80211/ieee80211_vht.c Tue Jan 10 07:21:07 2017 (r311860) > @@ -85,9 +85,49 @@ __FBSDID("$FreeBSD$"); > * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further deta= ils. > */ > =20 > +static int > +vht_recv_action_placeholder(struct ieee80211_node *ni, > + const struct ieee80211_frame *wh, > + const uint8_t *frm, const uint8_t *efrm) > +{ > + > + ieee80211_note(ni->ni_vap, "%s: called; fc=3D0x%.2x/0x%.2x", > + __func__, > + wh->i_fc[0], > + wh->i_fc[1]); > + > + return (0); > +} > + > +static int > +vht_send_action_placeholder(struct ieee80211_node *ni, > + int category, int action, void *arg0) > +{ > + > + ieee80211_note(ni->ni_vap, "%s: called; category=3D%d, action=3D%d", > + __func__, > + category, > + action); > + return (EINVAL); > +} > + This broke the build for kernel configurations that don't have the IEEE80211_DEBUG option set. ieee80211_note is only a valid function when IEEE80211_DEBUG is defined. 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 --clqiuqvuihafj6vh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlh1GJgACgkQaoRlj1JF bu4kVA/8D5yu2GTLmnntoRnrZjc8GKFK8Jzoph6DakrCTdE1m2/pHv7E12tHtEN6 13Aj5J73qUZqRB70ukB2MSbbLnFNE017fFOu0gV8UIZbkopzTVx7hOzKbVt1BB2T z4mz2Fn2V3cvx9DqeKsluM0JOh94uddL63SaTZb6vlFCGPHWtXuZRfkU8Q4T7KlU 52IAwywTFls50idCdYnD1GIZ/hWAnhPhqCA0rdi5EE+BSq/+XrdSbDnyJQosXO+7 IhF0fnh+CuTXOBnzpsiX3EtMa+q3jJB76DGmiXe80qQ2Av78XwhDOYyQJdZx0EHC WOlqk4tlQ7TRDjY3WJXhWrCyZzWCyTdeBVuc1+Ujlw9OinOpHn7FH9aZ85EihjoZ 6qKNg8SRP+v0wugfd/W6wn5cu8BJgNzObbsMxEfXj+jDe9hu8KJYO8X+Ea7GjAvO fSEYZGmO2OfucLm/3pfmsaAe9zoaDCl+ZACq3grmRFC2AQhYsUIE6NPjuZXt1b1x IfFq2A8CUIniImp4c9IJur92wvr7bT+LPYYm44Z7JAaTTJWviuz6fb2RDBiHfnBF His7QrsA5jRAO3PMgkUveTZWPq9M0oTM+XuVmfR3G1hdFwzmvmjyJ3aRXfFv1Cwc z4jpwd2ryuF7YI7Rte6L38JqvIefhWWwNMctzFgH6up3ssxlV24= =7MVb -----END PGP SIGNATURE----- --clqiuqvuihafj6vh-- From owner-svn-src-all@freebsd.org Tue Jan 10 18:39:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 673B0CA877C; Tue, 10 Jan 2017 18:39:55 +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 1DF0F1330; Tue, 10 Jan 2017 18:39:55 +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 v0AIdsCj018855; Tue, 10 Jan 2017 18:39:54 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AIdss9018853; Tue, 10 Jan 2017 18:39:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701101839.v0AIdss9018853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 10 Jan 2017 18:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311880 - in head/sys/dev: cxgb/ulp/iw_cxgb cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 18:39:55 -0000 Author: np Date: Tue Jan 10 18:39:53 2017 New Revision: 311880 URL: https://svnweb.freebsd.org/changeset/base/311880 Log: The iw_cxgb and iw_cxgbe drivers should not use a FreeBSD device_t where a linuxkpi style device is expected. If OFED/linuxkpi actually starts using this field then we'll have to figure out whether to create fake devices for these drivers or have linuxkpi deal with NULL device. This mismatch was first reported as part of D6585. Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c head/sys/dev/cxgbe/iw_cxgbe/provider.c Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Tue Jan 10 17:05:34 2017 (r311879) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Tue Jan 10 18:39:53 2017 (r311880) @@ -1094,7 +1094,7 @@ int iwch_register_device(struct iwch_dev memcpy(dev->ibdev.node_desc, IWCH_NODE_DESC, sizeof(IWCH_NODE_DESC)); dev->ibdev.phys_port_cnt = sc->params.nports; dev->ibdev.num_comp_vectors = 1; - dev->ibdev.dma_device = dev->rdev.adap->dev; + dev->ibdev.dma_device = NULL; dev->ibdev.query_device = iwch_query_device; dev->ibdev.query_port = iwch_query_port; dev->ibdev.modify_port = iwch_modify_port; Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/provider.c Tue Jan 10 17:05:34 2017 (r311879) +++ head/sys/dev/cxgbe/iw_cxgbe/provider.c Tue Jan 10 18:39:53 2017 (r311880) @@ -429,7 +429,7 @@ c4iw_register_device(struct c4iw_dev *de strlcpy(ibdev->node_desc, C4IW_NODE_DESC, sizeof(ibdev->node_desc)); ibdev->phys_port_cnt = sc->params.nports; ibdev->num_comp_vectors = 1; - ibdev->dma_device = sc->dev; + ibdev->dma_device = NULL; ibdev->query_device = c4iw_query_device; ibdev->query_port = c4iw_query_port; ibdev->modify_port = c4iw_modify_port; From owner-svn-src-all@freebsd.org Tue Jan 10 18:46:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CC28CA8BFA; Tue, 10 Jan 2017 18:46:41 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B4D21DEF; Tue, 10 Jan 2017 18:46:41 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AIkere022684; Tue, 10 Jan 2017 18:46:40 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AIkea4022683; Tue, 10 Jan 2017 18:46:40 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201701101846.v0AIkea4022683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 10 Jan 2017 18:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311881 - head/sys/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 18:46:41 -0000 Author: lwhsu (ports committer) Date: Tue Jan 10 18:46:40 2017 New Revision: 311881 URL: https://svnweb.freebsd.org/changeset/base/311881 Log: Replace using of objdump with elfdump In-tree objdump is too old to dump new ELF headers. But for example if we use: `make CROSS_TOOLCHAIN=riscv64-gcc TARGET_ARCH=riscv64` and do not specify CROSS_BINUTILS_PREFIX in env, embed_mfs.sh cannot find the correct objdump. This patch just replaces using of objdump with elfdump to collect needed information. Later we may also put an ELFDUMP in CROSSENV and use it in embed_mfs.sh . Reviewed by: emaste, br MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9062 Modified: head/sys/tools/embed_mfs.sh Modified: head/sys/tools/embed_mfs.sh ============================================================================== --- head/sys/tools/embed_mfs.sh Tue Jan 10 18:39:53 2017 (r311880) +++ head/sys/tools/embed_mfs.sh Tue Jan 10 18:46:40 2017 (r311881) @@ -36,12 +36,12 @@ mfs_size=`stat -f '%z' $2 2> /dev/null` # If we can't determine MFS image size - bail. [ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1 -sec_info=`${CROSS_BINUTILS_PREFIX}objdump -h $1 2> /dev/null | grep " oldmfs "` +sec_info=`elfdump -c $1 2> /dev/null | grep -A 5 -E "sh_name: oldmfs$"` # If we can't find the mfs section within the given kernel - bail. [ -z "${sec_info}" ] && echo "Can't locate mfs section within kernel" && exit 1 -sec_size=`echo ${sec_info} | awk '{printf("%d", "0x" $3)}' 2> /dev/null` -sec_start=`echo ${sec_info} | awk '{printf("%d", "0x" $6)}' 2> /dev/null` +sec_size=`echo "${sec_info}" | awk '/sh_size/ {print $2}' 2> /dev/null` +sec_start=`echo "${sec_info}" | awk '/sh_offset/ {print $2}' 2> /dev/null` # If the mfs section size is smaller than the mfs image - bail. [ ${sec_size} -lt ${mfs_size} ] && echo "MFS image too large" && exit 1 From owner-svn-src-all@freebsd.org Tue Jan 10 19:15:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40E10CA9A85; Tue, 10 Jan 2017 19:15:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 127EA16CE; Tue, 10 Jan 2017 19:15:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AJF7fB036031; Tue, 10 Jan 2017 19:15:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AJF7MJ036030; Tue, 10 Jan 2017 19:15:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701101915.v0AJF7MJ036030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 19:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311882 - stable/11/sys/dev/ahci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 19:15:08 -0000 Author: mav Date: Tue Jan 10 19:15:07 2017 New Revision: 311882 URL: https://svnweb.freebsd.org/changeset/base/311882 Log: MFC r309251: Process port interrupt even is PxIS register is zero. ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside seems sometimes forgeting to set bits in PxIS, causing command timeouts. Removal of this check fixes the issue by the theoretical cost of slightly higher CPU usage in some odd cases, but this is what Linux does too. Modified: stable/11/sys/dev/ahci/ahci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ahci/ahci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci.c Tue Jan 10 18:46:40 2017 (r311881) +++ stable/11/sys/dev/ahci/ahci.c Tue Jan 10 19:15:07 2017 (r311882) @@ -1169,8 +1169,6 @@ ahci_ch_intr(void *arg) /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); - if (istatus == 0) - return; mtx_lock(&ch->mtx); ahci_ch_intr_main(ch, istatus); @@ -1187,8 +1185,6 @@ ahci_ch_intr_direct(void *arg) /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); - if (istatus == 0) - return; mtx_lock(&ch->mtx); ch->batch = 1; From owner-svn-src-all@freebsd.org Tue Jan 10 19:15:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8B06CA9B1F; Tue, 10 Jan 2017 19:15:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87316185C; Tue, 10 Jan 2017 19:15:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AJFb5Z036104; Tue, 10 Jan 2017 19:15:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AJFbrD036103; Tue, 10 Jan 2017 19:15:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701101915.v0AJFbrD036103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 19:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311883 - stable/10/sys/dev/ahci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 19:15:38 -0000 Author: mav Date: Tue Jan 10 19:15:37 2017 New Revision: 311883 URL: https://svnweb.freebsd.org/changeset/base/311883 Log: MFC r309251: Process port interrupt even is PxIS register is zero. ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside seems sometimes forgeting to set bits in PxIS, causing command timeouts. Removal of this check fixes the issue by the theoretical cost of slightly higher CPU usage in some odd cases, but this is what Linux does too. Modified: stable/10/sys/dev/ahci/ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Tue Jan 10 19:15:07 2017 (r311882) +++ stable/10/sys/dev/ahci/ahci.c Tue Jan 10 19:15:37 2017 (r311883) @@ -1122,8 +1122,6 @@ ahci_ch_intr(void *arg) /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); - if (istatus == 0) - return; mtx_lock(&ch->mtx); ahci_ch_intr_main(ch, istatus); @@ -1140,8 +1138,6 @@ ahci_ch_intr_direct(void *arg) /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); - if (istatus == 0) - return; mtx_lock(&ch->mtx); ch->batch = 1; From owner-svn-src-all@freebsd.org Tue Jan 10 19:16:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C60E1CA9BE3; Tue, 10 Jan 2017 19:16:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9608F19E6; Tue, 10 Jan 2017 19:16:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AJGHlj036186; Tue, 10 Jan 2017 19:16:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AJGHbP036185; Tue, 10 Jan 2017 19:16:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701101916.v0AJGHbP036185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 19:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311884 - stable/11/sys/dev/ahci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 19:16:18 -0000 Author: mav Date: Tue Jan 10 19:16:17 2017 New Revision: 311884 URL: https://svnweb.freebsd.org/changeset/base/311884 Log: MFC r309252: Add more ASMedia PCI IDs from different sources. Exact device names are not clear, but its better then nothing at all. Modified: stable/11/sys/dev/ahci/ahci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci_pci.c Tue Jan 10 19:15:37 2017 (r311883) +++ stable/11/sys/dev/ahci/ahci_pci.c Tue Jan 10 19:16:17 2017 (r311884) @@ -73,8 +73,15 @@ static const struct { {0x78021022, 0x00, "AMD Hudson-2", 0}, {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, - {0x06111b21, 0x00, "ASMedia ASM2106", 0}, - {0x06121b21, 0x00, "ASMedia ASM1061", 0}, + {0x06011b21, 0x00, "ASMedia ASM1060", 0}, + {0x06021b21, 0x00, "ASMedia ASM1060", 0}, + {0x06111b21, 0x00, "ASMedia ASM1061", 0}, + {0x06121b21, 0x00, "ASMedia ASM1062", 0}, + {0x06201b21, 0x00, "ASMedia ASM106x", 0}, + {0x06211b21, 0x00, "ASMedia ASM106x", 0}, + {0x06221b21, 0x00, "ASMedia ASM106x", 0}, + {0x06241b21, 0x00, "ASMedia ASM106x", 0}, + {0x06251b21, 0x00, "ASMedia ASM106x", 0}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, {0x26818086, 0x00, "Intel ESB2", 0}, From owner-svn-src-all@freebsd.org Tue Jan 10 19:16:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 343C8CA9C59; Tue, 10 Jan 2017 19:16:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0603B1B66; Tue, 10 Jan 2017 19:16:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AJGoQi036257; Tue, 10 Jan 2017 19:16:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AJGoxM036256; Tue, 10 Jan 2017 19:16:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701101916.v0AJGoxM036256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 19:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311885 - stable/10/sys/dev/ahci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 19:16:51 -0000 Author: mav Date: Tue Jan 10 19:16:50 2017 New Revision: 311885 URL: https://svnweb.freebsd.org/changeset/base/311885 Log: MFC r309252: Add more ASMedia PCI IDs from different sources. Exact device names are not clear, but its better then nothing at all. Modified: stable/10/sys/dev/ahci/ahci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci_pci.c Tue Jan 10 19:16:17 2017 (r311884) +++ stable/10/sys/dev/ahci/ahci_pci.c Tue Jan 10 19:16:50 2017 (r311885) @@ -73,8 +73,15 @@ static const struct { {0x78021022, 0x00, "AMD Hudson-2", 0}, {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, - {0x06111b21, 0x00, "ASMedia ASM2106", 0}, - {0x06121b21, 0x00, "ASMedia ASM1061", 0}, + {0x06011b21, 0x00, "ASMedia ASM1060", 0}, + {0x06021b21, 0x00, "ASMedia ASM1060", 0}, + {0x06111b21, 0x00, "ASMedia ASM1061", 0}, + {0x06121b21, 0x00, "ASMedia ASM1062", 0}, + {0x06201b21, 0x00, "ASMedia ASM106x", 0}, + {0x06211b21, 0x00, "ASMedia ASM106x", 0}, + {0x06221b21, 0x00, "ASMedia ASM106x", 0}, + {0x06241b21, 0x00, "ASMedia ASM106x", 0}, + {0x06251b21, 0x00, "ASMedia ASM106x", 0}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, {0x26818086, 0x00, "Intel ESB2", 0}, From owner-svn-src-all@freebsd.org Tue Jan 10 19:26:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D883DCAA245; Tue, 10 Jan 2017 19:26:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B08B712AB; Tue, 10 Jan 2017 19:26:56 +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 v0AJQtlB040416; Tue, 10 Jan 2017 19:26:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AJQtND040415; Tue, 10 Jan 2017 19:26:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701101926.v0AJQtND040415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Jan 2017 19:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311886 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 19:26:56 -0000 Author: kib Date: Tue Jan 10 19:26:55 2017 New Revision: 311886 URL: https://svnweb.freebsd.org/changeset/base/311886 Log: Fix acquisition of nested write compat rtld locks. Obtaining compat rtld lock in write mode sets process signal mask to block all signals. Previous mask is stored in the global variable oldsigmask. If a lock is write-locked while another lock is already write-locked, oldsigmask is overwritten by the total mask and on the last unlock, all signals except traps appear to be blocked. Fix this by counting the write-lock nested level, and only storing to oldsigmask/restoring from it at the outermost level. Masking signals disables involuntary preemption for libc_r, and there could be no voluntary context switches in the locked code (dl_iterate_phdr(3) keeps a lock around user callback, but it was added long after libc_r was renounced). Due to this, remembering the level in the global variable after the lock is obtained should be safe, because no two libc_r threads can acquire different write locks in parallel. PR: 215826 Reported by: kami Tested by: yamagi@yamagi.org (previous version) To be reviewed by: kan Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld_lock.c Modified: head/libexec/rtld-elf/rtld_lock.c ============================================================================== --- head/libexec/rtld-elf/rtld_lock.c Tue Jan 10 19:16:50 2017 (r311885) +++ head/libexec/rtld-elf/rtld_lock.c Tue Jan 10 19:26:55 2017 (r311886) @@ -64,7 +64,7 @@ typedef struct Struct_Lock { } Lock; static sigset_t fullsigmask, oldsigmask; -static int thread_flag; +static int thread_flag, wnested; static void * def_lock_create(void) @@ -117,29 +117,34 @@ def_rlock_acquire(void *lock) static void def_wlock_acquire(void *lock) { - Lock *l = (Lock *)lock; - sigset_t tmp_oldsigmask; + Lock *l; + sigset_t tmp_oldsigmask; - for ( ; ; ) { - sigprocmask(SIG_BLOCK, &fullsigmask, &tmp_oldsigmask); - if (atomic_cmpset_acq_int(&l->lock, 0, WAFLAG)) - break; - sigprocmask(SIG_SETMASK, &tmp_oldsigmask, NULL); - } - oldsigmask = tmp_oldsigmask; + l = (Lock *)lock; + for (;;) { + sigprocmask(SIG_BLOCK, &fullsigmask, &tmp_oldsigmask); + if (atomic_cmpset_acq_int(&l->lock, 0, WAFLAG)) + break; + sigprocmask(SIG_SETMASK, &tmp_oldsigmask, NULL); + } + if (atomic_fetchadd_int(&wnested, 1) == 0) + oldsigmask = tmp_oldsigmask; } static void def_lock_release(void *lock) { - Lock *l = (Lock *)lock; + Lock *l; - if ((l->lock & WAFLAG) == 0) - atomic_add_rel_int(&l->lock, -RC_INCR); - else { - atomic_add_rel_int(&l->lock, -WAFLAG); - sigprocmask(SIG_SETMASK, &oldsigmask, NULL); - } + l = (Lock *)lock; + if ((l->lock & WAFLAG) == 0) + atomic_add_rel_int(&l->lock, -RC_INCR); + else { + assert(wnested > 0); + atomic_add_rel_int(&l->lock, -WAFLAG); + if (atomic_fetchadd_int(&wnested, -1) == 1) + sigprocmask(SIG_SETMASK, &oldsigmask, NULL); + } } static int @@ -373,12 +378,12 @@ _rtld_atfork_pre(int *locks) return; /* - * Warning: this does not work with the rtld compat locks - * above, since the thread signal mask is corrupted (set to - * all signals blocked) if two locks are taken in write mode. - * The caller of the _rtld_atfork_pre() must provide the - * working implementation of the locks, and libthr locks are - * fine. + * Warning: this did not worked well with the rtld compat + * locks above, when the thread signal mask was corrupted (set + * to all signals blocked) if two locks were taken + * simultaneously in the write mode. The caller of the + * _rtld_atfork_pre() must provide the working implementation + * of the locks anyway, and libthr locks are fine. */ wlock_acquire(rtld_phdr_lock, &ls[0]); wlock_acquire(rtld_bind_lock, &ls[1]); From owner-svn-src-all@freebsd.org Tue Jan 10 19:28:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B015CAA318; Tue, 10 Jan 2017 19:28:41 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A63E1527; Tue, 10 Jan 2017 19:28:41 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AJSe4l040526; Tue, 10 Jan 2017 19:28:40 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AJSeqN040525; Tue, 10 Jan 2017 19:28:40 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201701101928.v0AJSeqN040525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Tue, 10 Jan 2017 19:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311887 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 19:28:41 -0000 Author: pluknet Date: Tue Jan 10 19:28:40 2017 New Revision: 311887 URL: https://svnweb.freebsd.org/changeset/base/311887 Log: Fix build without IEEE80211_DEBUG. Reported by: many Modified: head/sys/net80211/ieee80211_vht.c Modified: head/sys/net80211/ieee80211_vht.c ============================================================================== --- head/sys/net80211/ieee80211_vht.c Tue Jan 10 19:26:55 2017 (r311886) +++ head/sys/net80211/ieee80211_vht.c Tue Jan 10 19:28:40 2017 (r311887) @@ -91,11 +91,12 @@ vht_recv_action_placeholder(struct ieee8 const uint8_t *frm, const uint8_t *efrm) { +#ifdef IEEE80211_DEBUG ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x", __func__, wh->i_fc[0], wh->i_fc[1]); - +#endif return (0); } @@ -104,10 +105,12 @@ vht_send_action_placeholder(struct ieee8 int category, int action, void *arg0) { +#ifdef IEEE80211_DEBUG ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d", __func__, category, action); +#endif return (EINVAL); } From owner-svn-src-all@freebsd.org Tue Jan 10 20:08:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 580FECA997C; Tue, 10 Jan 2017 20:08:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A0D814DA; Tue, 10 Jan 2017 20:08:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AK8LdN057020; Tue, 10 Jan 2017 20:08:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AK8Lh8057019; Tue, 10 Jan 2017 20:08:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201701102008.v0AK8Lh8057019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 10 Jan 2017 20:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311888 - head/sys/boot/efi/loader/arch/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:08:22 -0000 Author: gonzo Date: Tue Jan 10 20:08:21 2017 New Revision: 311888 URL: https://svnweb.freebsd.org/changeset/base/311888 Log: [efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start __bss_end should not be included in .bss zeroing code. Otherwise first 4 bytes of the section that follows .bss (in loader's case it's .sdata) are overwritten by zero. Reviewed by: andrew MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9108 Modified: head/sys/boot/efi/loader/arch/arm/start.S Modified: head/sys/boot/efi/loader/arch/arm/start.S ============================================================================== --- head/sys/boot/efi/loader/arch/arm/start.S Tue Jan 10 19:28:40 2017 (r311887) +++ head/sys/boot/efi/loader/arch/arm/start.S Tue Jan 10 20:08:21 2017 (r311888) @@ -161,7 +161,7 @@ _start: mov r2, #0 1: cmp r0, r1 - bgt 2f + bge 2f str r2, [r0], #4 b 1b 2: From owner-svn-src-all@freebsd.org Tue Jan 10 20:09:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EA51CA9A3D; Tue, 10 Jan 2017 20:09:36 +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 205ED16A2; Tue, 10 Jan 2017 20:09:36 +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 v0AK9ZLf057099; Tue, 10 Jan 2017 20:09:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AK9ZrK057098; Tue, 10 Jan 2017 20:09:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701102009.v0AK9ZrK057098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 Jan 2017 20:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311889 - stable/11/usr.bin/truss X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:09:36 -0000 Author: jhb Date: Tue Jan 10 20:09:35 2017 New Revision: 311889 URL: https://svnweb.freebsd.org/changeset/base/311889 Log: MFC 307060: Fix printf format warning. Modified: stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Tue Jan 10 20:08:21 2017 (r311888) +++ stable/11/usr.bin/truss/syscalls.c Tue Jan 10 20:09:35 2017 (r311889) @@ -1924,9 +1924,9 @@ print_arg(struct syscall_args *sc, unsig cloudabi_filestat_t fsb; if (get_struct(pid, (void *)args[sc->offset], &fsb, sizeof(fsb)) != -1) - fprintf(fp, "{ %s, %lu }", + fprintf(fp, "{ %s, %ju }", xlookup(cloudabi_filetype, fsb.st_filetype), - fsb.st_size); + (uintmax_t)fsb.st_size); else fprintf(fp, "0x%lx", args[sc->offset]); break; From owner-svn-src-all@freebsd.org Tue Jan 10 20:12:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 826F4CA9D99; Tue, 10 Jan 2017 20:12:08 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 529431B6C; Tue, 10 Jan 2017 20:12:08 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AKC7MA059368; Tue, 10 Jan 2017 20:12:07 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AKC7IP059367; Tue, 10 Jan 2017 20:12:07 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201701102012.v0AKC7IP059367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 10 Jan 2017 20:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311890 - head/sys/boot/efi/loader/arch/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:12:08 -0000 Author: gonzo Date: Tue Jan 10 20:12:07 2017 New Revision: 311890 URL: https://svnweb.freebsd.org/changeset/base/311890 Log: [efi] Fix .rel.data.* being erroneously merged into .data on ARM Fix section pattern code to exclude .rel.data.* sections from being merged into .data. Otherwise relocations in those sections are lost in final binary Reviewed by: andrew MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9108 Modified: head/sys/boot/efi/loader/arch/arm/ldscript.arm Modified: head/sys/boot/efi/loader/arch/arm/ldscript.arm ============================================================================== --- head/sys/boot/efi/loader/arch/arm/ldscript.arm Tue Jan 10 20:09:35 2017 (r311889) +++ head/sys/boot/efi/loader/arch/arm/ldscript.arm Tue Jan 10 20:12:07 2017 (r311890) @@ -18,7 +18,7 @@ SECTIONS . = ALIGN(16); .data : { - *(.data *.data.*) + *(.data .data.*) *(.gnu.linkonce.d*) *(.rodata) *(.rodata.*) From owner-svn-src-all@freebsd.org Tue Jan 10 20:15:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CCE8CA9EDD; Tue, 10 Jan 2017 20:15:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF791E21; Tue, 10 Jan 2017 20:15:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AKFOYQ060915; Tue, 10 Jan 2017 20:15:24 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AKFOa3060914; Tue, 10 Jan 2017 20:15:24 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201701102015.v0AKFOa3060914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 10 Jan 2017 20:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311891 - head/sys/boot/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:15:25 -0000 Author: gonzo Date: Tue Jan 10 20:15:24 2017 New Revision: 311891 URL: https://svnweb.freebsd.org/changeset/base/311891 Log: [efi] Build EFI bits with -fPIC on ARM clang 3.9.0 without -fPIC generates absolute jump table for switch/case statement which trips boot1.efi and loader.efi on ARM platform. Reviewed by: andrew MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9108 Modified: head/sys/boot/efi/Makefile.inc Modified: head/sys/boot/efi/Makefile.inc ============================================================================== --- head/sys/boot/efi/Makefile.inc Tue Jan 10 20:12:07 2017 (r311890) +++ head/sys/boot/efi/Makefile.inc Tue Jan 10 20:15:24 2017 (r311891) @@ -23,4 +23,8 @@ CFLAGS+= -fshort-wchar CFLAGS+= -fPIC .endif +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -fPIC +.endif + .include "../Makefile.inc" From owner-svn-src-all@freebsd.org Tue Jan 10 20:16:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F91ECA9F7D; Tue, 10 Jan 2017 20:16:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E44391FC6; Tue, 10 Jan 2017 20:16:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AKGHq6060992; Tue, 10 Jan 2017 20:16:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AKGHTv060991; Tue, 10 Jan 2017 20:16:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701102016.v0AKGHTv060991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 20:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311892 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:16:18 -0000 Author: mav Date: Tue Jan 10 20:16:16 2017 New Revision: 311892 URL: https://svnweb.freebsd.org/changeset/base/311892 Log: Do not wait for HA thread shutdown if scheduler is stopped. This wait loop made system hang on panic instead of reboot. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_ha.c Modified: head/sys/cam/ctl/ctl_ha.c ============================================================================== --- head/sys/cam/ctl/ctl_ha.c Tue Jan 10 20:15:24 2017 (r311891) +++ head/sys/cam/ctl/ctl_ha.c Tue Jan 10 20:16:16 2017 (r311892) @@ -1001,7 +1001,7 @@ ctl_ha_msg_shutdown(struct ctl_softc *ct softc->ha_shutdown = 1; softc->ha_wakeup = 1; wakeup(&softc->ha_wakeup); - while (softc->ha_shutdown < 2) { + while (softc->ha_shutdown < 2 && !SCHEDULER_STOPPED()) { msleep(&softc->ha_wakeup, &softc->ha_lock, 0, "shutdown", hz); } From owner-svn-src-all@freebsd.org Tue Jan 10 20:35:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C51DCAAB4A; Tue, 10 Jan 2017 20:35:10 +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 395531DBD; Tue, 10 Jan 2017 20:35:10 +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 v0AKZ9rc068995; Tue, 10 Jan 2017 20:35:09 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AKZ9B7068992; Tue, 10 Jan 2017 20:35:09 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701102035.v0AKZ9B7068992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 10 Jan 2017 20:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311893 - in head: . tests/sys/geom/class/gate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:35:10 -0000 Author: asomers Date: Tue Jan 10 20:35:09 2017 New Revision: 311893 URL: https://svnweb.freebsd.org/changeset/base/311893 Log: ATFify the geom gate tests. This ensures their cleanup routines will be run even if they should timeout. tests/sys/geom/class/gate/ggate_test.sh tests/sys/geom/class/gate/Makefile Add an ATF test with three testcases, one for each TAP test. Use ATF-style cleanup functions, and convert sleeps to polling loops. ObsoleteFiles.inc tests/sys/geom/class/gate/conf.sh tests/sys/geom/class/gate/1_test.sh tests/sys/geom/class/gate/2_test.sh tests/sys/geom/class/gate/3_test.sh Delete TAP test files Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8891 Added: head/tests/sys/geom/class/gate/ggate_test.sh (contents, props changed) Deleted: head/tests/sys/geom/class/gate/1_test.sh head/tests/sys/geom/class/gate/2_test.sh head/tests/sys/geom/class/gate/3_test.sh head/tests/sys/geom/class/gate/conf.sh Modified: head/ObsoleteFiles.inc head/tests/sys/geom/class/gate/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jan 10 20:16:16 2017 (r311892) +++ head/ObsoleteFiles.inc Tue Jan 10 20:35:09 2017 (r311893) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20170110: Four files from ggate tests consolidated into one +OLD_FILES+=usr/tests/sys/geom/class/gate/1_test +OLD_FILES+=usr/tests/sys/geom/class/gate/2_test +OLD_FILES+=usr/tests/sys/geom/class/gate/3_test +OLD_FILES+=usr/tests/sys/geom/class/gate/conf.sh # 20170103: libbsnmptools.so made into an INTERNALLIB OLD_FILES+=usr/lib/libbsnmptools.a OLD_FILES+=usr/lib/libbsnmptools_p.a Modified: head/tests/sys/geom/class/gate/Makefile ============================================================================== --- head/tests/sys/geom/class/gate/Makefile Tue Jan 10 20:16:16 2017 (r311892) +++ head/tests/sys/geom/class/gate/Makefile Tue Jan 10 20:35:09 2017 (r311893) @@ -4,14 +4,6 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} -TAP_TESTS_SH+= 1_test -TAP_TESTS_SH+= 2_test -TAP_TESTS_SH+= 3_test - -${PACKAGE}FILES+= conf.sh - -.for t in ${TAP_TESTS_SH} -TEST_METADATA.$t+= required_user="root" -.endfor +ATF_TESTS_SH+= ggate_test .include Added: head/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/gate/ggate_test.sh Tue Jan 10 20:35:09 2017 (r311893) @@ -0,0 +1,193 @@ +# $FreeBSD$ + +PIDFILE=ggated.pid +PLAINFILES=plainfiles +PORT=33080 +CONF=gg.exports +RETRIES=16 + +atf_test_case ggated cleanup +ggated_head() +{ + atf_set "descr" "ggated can proxy geoms" + atf_set "require.progs" "ggatec ggated" + atf_set "require.user" "root" + atf_set "timeout" 60 +} + +ggated_body() +{ + us=$(alloc_ggate_dev) + work=$(alloc_md) + src=$(alloc_md) + + dd if=/dev/random of=/dev/$work bs=1m count=1 conv=notrunc + dd if=/dev/random of=/dev/$src bs=1m count=1 conv=notrunc + + echo $CONF >> $PLAINFILES + echo "127.0.0.1 RW /dev/$work" > $CONF + + atf_check ggated -p $PORT -F $PIDFILE $CONF + for try in `jot $RETRIES`; do + ggatec create -p $PORT -u $us 127.0.0.1 /dev/$work && break + # wait for ggated to be ready + sleep 0.25 + done + if [ "$try" -eq "$RETRIES" ]; then + atf_fail "ggatec create failed" + fi + + for try in `jot $RETRIES`; do + dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=notrunc\ + && break + # Wait for /dev/ggate${us} to be ready + sleep 0.25 + done + if [ "$try" -eq "$RETRIES" ]; then + atf_fail "dd failed; /dev/ggate${us} isn't working" + fi + + checksum /dev/$src /dev/$work +} + +ggated_cleanup() +{ + common_cleanup +} + +atf_test_case ggatel_file cleanup +ggatel_file_head() +{ + atf_set "descr" "ggatel can proxy files" + atf_set "require.progs" "ggatel" + atf_set "require.user" "root" + atf_set "timeout" 15 +} + +ggatel_file_body() +{ + us=$(alloc_ggate_dev) + + echo src work >> ${PLAINFILES} + dd if=/dev/random of=work bs=1m count=1 + dd if=/dev/random of=src bs=1m count=1 + + atf_check ggatel create -u $us work + + dd if=src of=/dev/ggate${us} bs=1m count=1 conv=notrunc + + checksum src work +} + +ggatel_file_cleanup() +{ + common_cleanup +} + +atf_test_case ggatel_md cleanup +ggatel_md_head() +{ + atf_set "descr" "ggatel can proxy files" + atf_set "require.progs" "ggatel" + atf_set "require.user" "root" + atf_set "timeout" 15 +} + +ggatel_md_body() +{ + us=$(alloc_ggate_dev) + work=$(alloc_md) + src=$(alloc_md) + + dd if=/dev/random of=$work bs=1m count=1 conv=notrunc + dd if=/dev/random of=$src bs=1m count=1 conv=notrunc + + atf_check ggatel create -u $us /dev/$work + + dd if=/dev/$src of=/dev/ggate${us} bs=1m count=1 conv=notrunc + + checksum /dev/$src /dev/$work +} + +ggatel_md_cleanup() +{ + common_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case ggated + atf_add_test_case ggatel_file + atf_add_test_case ggatel_md +} + +alloc_ggate_dev() +{ + local us + + us=0 + while [ -c /dev/ggate${us} ]; do + : $(( us += 1 )) + done + echo ${us} > ggate.devs + echo ${us} +} + +alloc_md() +{ + local md + + md=$(mdconfig -a -t malloc -s 1M) || \ + atf_fail "failed to allocate md device" + echo ${md} >> md.devs + echo ${md} +} + +checksum() +{ + local src work + src=$1 + work=$2 + + src_checksum=$(md5 -q $src) + work_checksum=$(md5 -q $work) + + if [ "$work_checksum" != "$src_checksum" ]; then + atf_fail "work md5 checksum didn't match" + fi + + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + atf_fail "ggate md5 checksum didn't match" + fi +} + +common_cleanup() +{ + if [ -f "ggate.devs" ]; then + while read test_ggate; do + ggatec destroy -f -u $test_ggate >/dev/null + done < ggate.devs + rm ggate.devs + fi + + if [ -f "$PIDFILE" ]; then + pkill -F "$PIDFILE" + rm $PIDFILE + fi + + if [ -f "PLAINFILES" ]; then + while read f; do + rm -f ${f} + done < ${PLAINFILES} + rm ${PLAINFILES} + fi + + if [ -f "md.devs" ]; then + while read test_md; do + mdconfig -d -u $test_md 2>/dev/null + done < md.devs + rm md.devs + fi + true +} From owner-svn-src-all@freebsd.org Tue Jan 10 20:37:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A1CBCAAD2F; Tue, 10 Jan 2017 20:37:46 +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 EDE791F95; Tue, 10 Jan 2017 20:37:45 +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 v0AKbjWQ069137; Tue, 10 Jan 2017 20:37:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AKbj8f069136; Tue, 10 Jan 2017 20:37:45 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701102037.v0AKbj8f069136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 10 Jan 2017 20:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311894 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:37:46 -0000 Author: asomers Date: Tue Jan 10 20:37:44 2017 New Revision: 311894 URL: https://svnweb.freebsd.org/changeset/base/311894 Log: Fix typo from change 310985 in ObsoleteFiles.inc MFC after: 16 days X-MFC-With: 310803 Sponsored by: Spectra Logic Corp Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jan 10 20:35:09 2017 (r311893) +++ head/ObsoleteFiles.inc Tue Jan 10 20:37:44 2017 (r311894) @@ -53,8 +53,8 @@ OLD_FILES+=usr/share/man/man3/sysdecode_ # 20161230: libarchive ACL pax test renamed to test_acl_pax_posix1e.tar.uu OLD_FILES+=usr/tests/lib/libarchive/test_acl_pax.tar.uu # 20161229: Three files from gnop tests consolidated into one -OLD_FILES+=usr/tests/sys/geom/class/nop/1_test.sh -OLD_FILES+=usr/tests/sys/geom/class/nop/2_test.sh +OLD_FILES+=usr/tests/sys/geom/class/nop/1_test +OLD_FILES+=usr/tests/sys/geom/class/nop/2_test OLD_FILES+=usr/tests/sys/geom/class/nop/conf.sh # 20161217: new clang import which bumps version from 3.9.0 to 3.9.1. OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/allocator_interface.h From owner-svn-src-all@freebsd.org Tue Jan 10 20:43:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09E8FCA9126; Tue, 10 Jan 2017 20:43:34 +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 CF34B14D2; Tue, 10 Jan 2017 20:43:33 +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 v0AKhXQx073174; Tue, 10 Jan 2017 20:43:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AKhWuv073169; Tue, 10 Jan 2017 20:43:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701102043.v0AKhWuv073169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 10 Jan 2017 20:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311895 - in head: etc/mtree usr.bin/tail usr.bin/tail/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:43:34 -0000 Author: asomers Date: Tue Jan 10 20:43:32 2017 New Revision: 311895 URL: https://svnweb.freebsd.org/changeset/base/311895 Log: Fix memory leaks during "tail -r" of an irregular file * Rewrite r_buf to use standard tail queues instead of a hand-rolled circular linked list. Free dynamic allocations when done. * Remove an optimization for the case where the file is a multiple of 128KB in size and there is a scarcity of memory. * Add ATF tests for "tail -r" and its variants. Reported by: Valgrind Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9067 Added: head/usr.bin/tail/tests/ head/usr.bin/tail/tests/Makefile (contents, props changed) head/usr.bin/tail/tests/tail_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/tail/Makefile head/usr.bin/tail/reverse.c Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Jan 10 20:37:44 2017 (r311894) +++ head/etc/mtree/BSD.tests.dist Tue Jan 10 20:43:32 2017 (r311895) @@ -644,6 +644,8 @@ .. soelim .. + tail + .. tar .. timeout Modified: head/usr.bin/tail/Makefile ============================================================================== --- head/usr.bin/tail/Makefile Tue Jan 10 20:37:44 2017 (r311894) +++ head/usr.bin/tail/Makefile Tue Jan 10 20:43:32 2017 (r311895) @@ -1,7 +1,13 @@ # $FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +.include + PROG= tail SRCS= forward.c misc.c read.c reverse.c tail.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/tail/reverse.c ============================================================================== --- head/usr.bin/tail/reverse.c Tue Jan 10 20:37:44 2017 (r311894) +++ head/usr.bin/tail/reverse.c Tue Jan 10 20:43:32 2017 (r311895) @@ -40,6 +40,7 @@ static char sccsid[] = "@(#)reverse.c 8. __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -169,12 +170,12 @@ r_reg(FILE *fp, const char *fn, enum STY ierr(fn); } -typedef struct bf { - struct bf *next; - struct bf *prev; - int len; - char *l; -} BF; +static const size_t bsz = 128 * 1024; +typedef struct bfelem { + TAILQ_ENTRY(bfelem) entries; + size_t len; + char l[bsz]; +} bfelem_t; /* * r_buf -- display a non-regular file in reverse order by line. @@ -189,64 +190,42 @@ typedef struct bf { static void r_buf(FILE *fp, const char *fn) { - BF *mark, *tl, *tr; - int ch, len, llen; + struct bfelem *tl, *temp, *first = NULL; + size_t len, llen; char *p; - off_t enomem; + off_t enomem = 0; + TAILQ_HEAD(bfhead, bfelem) head; - tl = NULL; -#define BSZ (128 * 1024) - for (mark = NULL, enomem = 0;;) { + TAILQ_INIT(&head); + + while (!feof(fp)) { /* * Allocate a new block and link it into place in a doubly * linked list. If out of memory, toss the LRU block and * keep going. */ - if (enomem || (tl = malloc(sizeof(BF))) == NULL || - (tl->l = malloc(BSZ)) == NULL) { - if (!mark) + while ((tl = malloc(sizeof(bfelem_t))) == NULL) { + first = TAILQ_FIRST(&head); + if (TAILQ_EMPTY(&head)) err(1, "malloc"); - if (enomem) - tl = tl->next; - else { - if (tl) - free(tl); - tl = mark; - } - enomem += tl->len; - } else if (mark) { - tl->next = mark; - tl->prev = mark->prev; - mark->prev->next = tl; - mark->prev = tl; - } else { - mark = tl; - mark->next = mark->prev = mark; + enomem += first->len; + TAILQ_REMOVE(&head, first, entries); + free(first); } + TAILQ_INSERT_TAIL(&head, tl, entries); /* Fill the block with input data. */ - for (p = tl->l, len = 0; - len < BSZ && (ch = getc(fp)) != EOF; ++len) - *p++ = ch; - - if (ferror(fp)) { - ierr(fn); - return; - } - - /* - * If no input data for this block and we tossed some data, - * recover it. - */ - if (!len && enomem) { - enomem -= tl->len; - tl = tl->prev; - break; + len = 0; + while ((!feof(fp)) && len < bsz) { + p = tl->l + len; + len += fread(p, 1, bsz - len, fp); + if (ferror(fp)) { + ierr(fn); + return; + } } tl->len = len; - if (ch == EOF) - break; } if (enomem) { @@ -255,37 +234,44 @@ r_buf(FILE *fp, const char *fn) } /* - * Step through the blocks in the reverse order read. The last char - * is special, ignore whether newline or not. + * Now print the lines in reverse order + * Outline: + * Scan backward for "\n", + * print forward to the end of the buffers + * free any buffers that start after the "\n" just found + * Loop */ - for (mark = tl;;) { - for (p = tl->l + (len = tl->len) - 1, llen = 0; len--; - --p, ++llen) - if (*p == '\n') { - if (llen) { + tl = TAILQ_LAST(&head, bfhead); + first = TAILQ_FIRST(&head); + while (tl != NULL) { + for (p = tl->l + tl->len - 1, llen = 0; p >= tl->l; + --p, ++llen) { + int start = (tl == first && p == tl->l); + + if ((*p == '\n') || start) { + struct bfelem *tr; + + if (start && len) + WR(p, llen + 1); + else if (llen) WR(p + 1, llen); - llen = 0; - } - if (tl == mark) - continue; - for (tr = tl->next; tr->len; tr = tr->next) { - WR(tr->l, tr->len); - tr->len = 0; - if (tr == mark) - break; + tr = TAILQ_NEXT(tl, entries); + llen = 0; + if (tr != NULL) { + TAILQ_FOREACH_FROM_SAFE(tr, &head, + entries, temp) { + if (tr->len) + WR(&tr->l, tr->len); + TAILQ_REMOVE(&head, tr, + entries); + free(tr); + } } } + } tl->len = llen; - if ((tl = tl->prev) == mark) - break; - } - tl = tl->next; - if (tl->len) { - WR(tl->l, tl->len); - tl->len = 0; - } - while ((tl = tl->next)->len) { - WR(tl->l, tl->len); - tl->len = 0; + tl = TAILQ_PREV(tl, bfhead, entries); } + TAILQ_REMOVE(&head, first, entries); + free(first); } Added: head/usr.bin/tail/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/tail/tests/Makefile Tue Jan 10 20:43:32 2017 (r311895) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH= tail_test + +.include Added: head/usr.bin/tail/tests/tail_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/tail/tests/tail_test.sh Tue Jan 10 20:43:32 2017 (r311895) @@ -0,0 +1,233 @@ +# Copyright (c) 2016 Alan Somers +# 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 empty_r +empty_r_head() +{ + atf_set "descr" "Reverse an empty file" +} +empty_r_body() +{ + touch infile expectfile + tail -r infile > outfile + tail -r < infile > outpipe + atf_check cmp expectfile outfile + atf_check cmp expectfile outpipe +} + +atf_test_case file_r +file_r_head() +{ + atf_set "descr" "Reverse a file" +} +file_r_body() +{ + cat > infile < expectfile << HERE +This is the third line +This is the second line +This is the first line +HERE + tail -r infile > outfile + tail -r < infile > outpipe + atf_check cmp expectfile outfile + atf_check cmp expectfile outpipe +} + +atf_test_case file_rn2 +file_rn2_head() +{ + atf_set "descr" "Reverse the last two lines of a file" +} +file_rn2_body() +{ + cat > infile < expectfile << HERE +This is the third line +This is the second line +HERE + tail -rn2 infile > outfile + tail -rn2 < infile > outpipe + atf_check cmp expectfile outfile + atf_check cmp expectfile outpipe +} + +atf_test_case file_rc28 +file_rc28_head() +{ + atf_set "descr" "Reverse a file and display the last 28 characters" +} +file_rc28_body() +{ + cat > infile < expectfile << HERE +This is the third line +line +HERE + tail -rc28 infile > outfile + tail -rc28 < infile > outpipe + atf_check cmp expectfile outfile + atf_check cmp expectfile outpipe +} + +atf_test_case longfile_r +longfile_r_head() +{ + atf_set "descr" "Reverse a long file" +} +longfile_r_body() +{ + jot -w "%0511d" 1030 0 > infile + jot -w "%0511d" 1030 1029 0 -1 > expectfile + tail -r infile > outfile + tail -r < infile > outpipe + atf_check cmp expectfile outfile + atf_check cmp expectfile outpipe +} + +atf_test_case longfile_r_enomem +longfile_r_enomem_head() +{ + atf_set "descr" "Reverse a file that's too long to store in RAM" +} +longfile_r_enomem_body() +{ + # When we reverse a file that's too long for RAM, tail should drop the + # first part and just print what it can. We'll check that the last + # part is ok + { + ulimit -v 32768 || atf_skip "Can't adjust ulimit" + jot -w "%01023d" 32768 0 | tail -r > outfile ; + } + if [ "$?" -ne 1 ]; then + atf_skip "Didn't get ENOMEM. Adjust test parameters" + fi + # We don't know how much of the input we dropped. So just check that + # the first ten lines of tail's output are the same as the last ten of + # the input + jot -w "%01023d" 10 32767 0 -1 > expectfile + head -n 10 outfile > outtrunc + diff expectfile outtrunc + atf_check cmp expectfile outtrunc +} + +atf_test_case longfile_r_longlines +longfile_r_longlines_head() +{ + atf_set "descr" "Reverse a long file with extremely long lines" +} +longfile_r_longlines_body() +{ + jot -s " " -w "%07d" 18000 0 > infile + jot -s " " -w "%07d" 18000 18000 >> infile + jot -s " " -w "%07d" 18000 36000 >> infile + jot -s " " -w "%07d" 18000 36000 > expectfile + jot -s " " -w "%07d" 18000 18000 >> expectfile + jot -s " " -w "%07d" 18000 0 >> expectfile + tail -r infile > outfile + tail -r < infile > outpipe + atf_check cmp expectfile outfile + atf_check cmp expectfile outpipe +} + +atf_test_case longfile_rc135782 +longfile_rc135782_head() +{ + atf_set "descr" "Reverse a long file and print the last 135,782 bytes" +} +longfile_rc135782_body() +{ + jot -w "%063d" 9000 0 > infile + jot -w "%063d" 2121 8999 0 -1 > expectfile + echo "0000000000000000000000000000000006878" >> expectfile + tail -rc135782 infile > outfile + tail -rc135782 < infile > outpipe + atf_check cmp expectfile outfile + atf_check cmp expectfile outpipe +} + +atf_test_case longfile_rc145782_longlines +longfile_rc145782_longlines_head() +{ + atf_set "descr" "Reverse a long file with extremely long lines and print the last 145,782 bytes" +} +longfile_rc145782_longlines_body() +{ + jot -s " " -w "%07d" 18000 0 > infile + jot -s " " -w "%07d" 18000 18000 >> infile + jot -s " " -w "%07d" 18000 36000 >> infile + jot -s " " -w "%07d" 18000 36000 > expectfile + echo -n "35777 " >> expectfile + jot -s " " -w "%07d" 222 35778 >> expectfile + tail -rc145782 infile > outfile + tail -rc145782 < infile > outpipe + atf_check cmp expectfile outfile + atf_check cmp expectfile outpipe +} + +atf_test_case longfile_rn2500 +longfile_rn2500_head() +{ + atf_set "descr" "Reverse a long file and print the last 2,500 lines" +} +longfile_rn2500_body() +{ + jot -w "%063d" 9000 0 > infile + jot -w "%063d" 2500 8999 0 -1 > expectfile + tail -rn2500 infile > outfile + tail -rn2500 < infile > outpipe + atf_check cmp expectfile outfile + atf_check cmp expectfile outpipe +} + + +atf_init_test_cases() +{ + atf_add_test_case empty_r + atf_add_test_case file_r + atf_add_test_case file_rc28 + atf_add_test_case file_rn2 + # The longfile tests are designed to exercise behavior in r_buf(), + # which operates on 128KB blocks + atf_add_test_case longfile_r + atf_add_test_case longfile_r_enomem + atf_add_test_case longfile_r_longlines + atf_add_test_case longfile_rc135782 + atf_add_test_case longfile_rc145782_longlines + atf_add_test_case longfile_rn2500 +} From owner-svn-src-all@freebsd.org Tue Jan 10 20:44:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04CE0CA91C1; Tue, 10 Jan 2017 20:44:33 +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 CB21E1687; Tue, 10 Jan 2017 20:44:32 +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 v0AKiWxT073267; Tue, 10 Jan 2017 20:44:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AKiWl9073266; Tue, 10 Jan 2017 20:44:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701102044.v0AKiWl9073266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 10 Jan 2017 20:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311896 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:44:33 -0000 Author: pfg Date: Tue Jan 10 20:44:31 2017 New Revision: 311896 URL: https://svnweb.freebsd.org/changeset/base/311896 Log: Remove unused __gnu_inline() attribute. This was meant to be used by a future FORTIFY_SOURCE implementation. Probably for good, FORTIFY_SOURCE and this particular GCCism were never well supported by clang or other compilers. Furthermore, the technology has long since been replaced by either static checkers, sanitizers, or even just the strong stack protector that was enabled by default. Drop __gnu_inline to avoid cluttering the headers. MFC after: 5 days Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Tue Jan 10 20:43:32 2017 (r311895) +++ head/sys/sys/cdefs.h Tue Jan 10 20:44:31 2017 (r311896) @@ -543,22 +543,6 @@ __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) #endif -/* - * FORTIFY_SOURCE, and perhaps other compiler-specific features, require - * the use of non-standard inlining. In general we should try to avoid - * using these but GCC-compatible compilers tend to support the extensions - * well enough to use them in limited cases. - */ -#if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__) -#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__) -#define __gnu_inline __attribute__((__gnu_inline__, __artificial__)) -#else -#define __gnu_inline __attribute__((__gnu_inline__)) -#endif /* artificial */ -#else -#define __gnu_inline -#endif - /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ defined(__GNUC__) && !defined(__INTEL_COMPILER) From owner-svn-src-all@freebsd.org Tue Jan 10 20:52:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F442CA9567; Tue, 10 Jan 2017 20:52:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 351E610D9; Tue, 10 Jan 2017 20:52:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AKqiTw077568; Tue, 10 Jan 2017 20:52:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AKqikj077567; Tue, 10 Jan 2017 20:52:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701102052.v0AKqikj077567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 20:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311897 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:52:45 -0000 Author: mav Date: Tue Jan 10 20:52:44 2017 New Revision: 311897 URL: https://svnweb.freebsd.org/changeset/base/311897 Log: Add checks for received mode page length. If our buffer is too small, we may receive part of the page, and should not try read/write past the end of the buffer. Reported by: Coverity CID: 1368374, 1368375 MFC after: 1 week Modified: head/sbin/camcontrol/modeedit.c Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Tue Jan 10 20:44:31 2017 (r311896) +++ head/sbin/camcontrol/modeedit.c Tue Jan 10 20:52:44 2017 (r311897) @@ -557,7 +557,7 @@ editlist_populate(struct cam_device *dev struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int len; + size_t len; STAILQ_INIT(&editlist); @@ -575,6 +575,7 @@ editlist_populate(struct cam_device *dev mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Decode the value data, creating edit_entries for each value. */ buff_decode_visit(mode_pars, len, format, editentry_create, 0); @@ -594,7 +595,7 @@ editlist_save(struct cam_device *device, struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int len, hlen; + size_t len, hlen; /* Make sure that something changed before continuing. */ if (! editlist_changed) @@ -617,6 +618,7 @@ editlist_save(struct cam_device *device, mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Encode the value data to be passed back to the device. */ buff_encode_visit(mode_pars, len, format, editentry_save, 0); @@ -814,7 +816,7 @@ modepage_dump(struct cam_device *device, struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int indx, len; + size_t indx, len; mode_sense(device, dbd, pc, page, subpage, retries, timeout, data, sizeof(data)); @@ -829,6 +831,7 @@ modepage_dump(struct cam_device *device, mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Print the raw mode page data with newlines each 8 bytes. */ for (indx = 0; indx < len; indx++) { From owner-svn-src-all@freebsd.org Tue Jan 10 21:10:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D59B3CA9D99; Tue, 10 Jan 2017 21:10:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4F971A9E; Tue, 10 Jan 2017 21:10:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0ALAKiv082228; Tue, 10 Jan 2017 21:10:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0ALAKQw082227; Tue, 10 Jan 2017 21:10:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701102110.v0ALAKQw082227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Jan 2017 21:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311898 - head/sys/sparc64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 21:10:21 -0000 Author: mjg Date: Tue Jan 10 21:10:20 2017 New Revision: 311898 URL: https://svnweb.freebsd.org/changeset/base/311898 Log: sparc64: add atomic_fcmpset Tested on hardware provided by feld. Reviewed by: marius Modified: head/sys/sparc64/include/atomic.h Modified: head/sys/sparc64/include/atomic.h ============================================================================== --- head/sys/sparc64/include/atomic.h Tue Jan 10 20:52:44 2017 (r311897) +++ head/sys/sparc64/include/atomic.h Tue Jan 10 21:10:20 2017 (r311898) @@ -219,6 +219,40 @@ atomic_cmpset_rel_ ## name(volatile ptyp return (((vtype)atomic_cas_rel((p), (e), (s), sz)) == (e)); \ } \ \ +static __inline int \ +atomic_fcmpset_ ## name(volatile ptype p, vtype *ep, vtype s) \ +{ \ + vtype t; \ + \ + t = (vtype)atomic_cas((p), (*ep), (s), sz); \ + if (t == (*ep)) \ + return (1); \ + *ep = t; \ + return (0); \ +} \ +static __inline int \ +atomic_fcmpset_acq_ ## name(volatile ptype p, vtype *ep, vtype s) \ +{ \ + vtype t; \ + \ + t = (vtype)atomic_cas_acq((p), (*ep), (s), sz); \ + if (t == (*ep)) \ + return (1); \ + *ep = t; \ + return (0); \ +} \ +static __inline int \ +atomic_fcmpset_rel_ ## name(volatile ptype p, vtype *ep, vtype s) \ +{ \ + vtype t; \ + \ + t = (vtype)atomic_cas_rel((p), (*ep), (s), sz); \ + if (t == (*ep)) \ + return (1); \ + *ep = t; \ + return (0); \ +} \ + \ static __inline vtype \ atomic_load_ ## name(volatile ptype p) \ { \ From owner-svn-src-all@freebsd.org Tue Jan 10 21:18:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A721BCAA514; Tue, 10 Jan 2017 21:18:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 579B6133B; Tue, 10 Jan 2017 21:18:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0ALIagr086603; Tue, 10 Jan 2017 21:18:36 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0ALIXiT086569; Tue, 10 Jan 2017 21:18:33 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201701102118.v0ALIXiT086569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 10 Jan 2017 21:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311899 - in vendor/libarchive/dist: . libarchive libarchive/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 21:18:37 -0000 Author: mm Date: Tue Jan 10 21:18:32 2017 New Revision: 311899 URL: https://svnweb.freebsd.org/changeset/base/311899 Log: Update vendor/libarchive to git 22f2d190639e6bd496a3b82f70c01fba0d38b40a Vendor changes: #691: Support for SCHILY.xattr extended attributes #854: Spelling fixes Multiple fixes in ACL code: - prefer acl_set_fd_np() to acl_set_fd() - if acl_set_fd_np() fails, do no fallback to acl_set_file() - do not warn if trying to write ACLs to a filesystem without ACL support - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs Added: vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.tar.uu Modified: vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/libarchive/archive_acl.c vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_disk_windows.c vendor/libarchive/dist/libarchive/archive_read_support_filter_lz4.c vendor/libarchive/dist/libarchive/archive_read_support_filter_lzop.c vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_string.c vendor/libarchive/dist/libarchive/archive_string.h vendor/libarchive/dist/libarchive/archive_string_composition.h vendor/libarchive/dist/libarchive/archive_write.c vendor/libarchive/dist/libarchive/archive_write_add_filter_xz.c vendor/libarchive/dist/libarchive/archive_write_disk_acl.c vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c vendor/libarchive/dist/libarchive/archive_write_set_format_zip.c vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/test_archive_read_add_passphrase.c vendor/libarchive/dist/libarchive/test/test_compat_uudecode.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_afio.c vendor/libarchive/dist/libarchive/test/test_read_format_zip_traditional_encryption_data.c vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes.c vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes_large.c vendor/libarchive/dist/libarchive/test/test_sparse_basic.c vendor/libarchive/dist/libarchive/xxhash.c Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/Makefile.am Tue Jan 10 21:18:32 2017 (r311899) @@ -497,6 +497,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_format_zip_winzip_aes_large.c \ libarchive/test/test_read_format_zip_zip64.c \ libarchive/test/test_read_large.c \ + libarchive/test/test_read_pax_schily_xattr.c \ libarchive/test/test_read_pax_truncated.c \ libarchive/test/test_read_position.c \ libarchive/test/test_read_set_format.c \ Modified: vendor/libarchive/dist/libarchive/archive_acl.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_acl.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_acl.c Tue Jan 10 21:18:32 2017 (r311899) @@ -786,7 +786,8 @@ append_entry_w(wchar_t **wp, const wchar } else if (tag == ARCHIVE_ENTRY_ACL_USER || tag == ARCHIVE_ENTRY_ACL_GROUP) { append_id_w(wp, id); - id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) + id = -1; } /* Solaris style has no second colon after other and mask */ if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0) @@ -1042,7 +1043,8 @@ append_entry(char **p, const char *prefi } else if (tag == ARCHIVE_ENTRY_ACL_USER || tag == ARCHIVE_ENTRY_ACL_GROUP) { append_id(p, id); - id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) + id = -1; } /* Solaris style has no second colon after other and mask */ if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0) @@ -1328,6 +1330,7 @@ archive_acl_from_text_w(struct archive_a tag == ARCHIVE_ENTRY_ACL_GROUP) { n = 1; name = field[1]; + isint_w(name.start, name.end, &id); } else n = 0; @@ -1799,6 +1802,7 @@ archive_acl_from_text_l(struct archive_a tag == ARCHIVE_ENTRY_ACL_GROUP) { n = 1; name = field[1]; + isint(name.start, name.end, &id); } else n = 0; Modified: vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c Tue Jan 10 21:18:32 2017 (r311899) @@ -526,6 +526,11 @@ setup_acls(struct archive_read_disk *a, /* Only directories can have default ACLs. */ if (S_ISDIR(archive_entry_mode(entry))) { +#if HAVE_ACL_GET_FD_NP + if (*fd >= 0) + acl = acl_get_fd_np(*fd, ACL_TYPE_DEFAULT); + else +#endif acl = acl_get_file(accpath, ACL_TYPE_DEFAULT); if (acl != NULL) { r = translate_acl(a, entry, acl, @@ -581,7 +586,10 @@ static struct { {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT}, - {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY} + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}, + {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED} }; #endif static int Modified: vendor/libarchive/dist/libarchive/archive_read_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Tue Jan 10 21:18:32 2017 (r311899) @@ -675,7 +675,7 @@ setup_suitable_read_buffer(struct archiv asize = cf->min_xfer_size; /* Increase a buffer size up to 64K bytes in - * a proper incremant size. */ + * a proper increment size. */ while (asize < 1024*64) asize += incr; /* Take a margin to adjust to the filesystem @@ -1656,7 +1656,7 @@ setup_current_filesystem(struct archive_ archive_set_error(&a->archive, errno, "statvfs failed"); return (ARCHIVE_FAILED); } else if (xr == 1) { - /* Usuall come here unless NetBSD supports _PC_REC_XFER_ALIGN + /* Usually come here unless NetBSD supports _PC_REC_XFER_ALIGN * for pathconf() function. */ t->current_filesystem->xfer_align = sfs.f_frsize; t->current_filesystem->max_xfer_size = -1; @@ -1944,7 +1944,7 @@ setup_current_filesystem(struct archive_ if (nm == -1) # endif /* _PC_NAME_MAX */ /* - * Some sysmtes (HP-UX or others?) incorrectly defined + * Some systems (HP-UX or others?) incorrectly defined * NAME_MAX macro to be a smaller value. */ # if defined(NAME_MAX) && NAME_MAX >= 255 Modified: vendor/libarchive/dist/libarchive/archive_read_disk_windows.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_windows.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_disk_windows.c Tue Jan 10 21:18:32 2017 (r311899) @@ -1401,7 +1401,7 @@ close_and_restore_time(HANDLE h, struct if (h == INVALID_HANDLE_VALUE && AE_IFLNK == rt->filetype) return (0); - /* Close a file descritor. + /* Close a file descriptor. * It will not be used for SetFileTime() because it has been opened * by a read only mode. */ Modified: vendor/libarchive/dist/libarchive/archive_read_support_filter_lz4.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_filter_lz4.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_support_filter_lz4.c Tue Jan 10 21:18:32 2017 (r311899) @@ -180,7 +180,7 @@ lz4_reader_bid(struct archive_read_filte return (0); bits_checked += 8; BD = buffer[5]; - /* A block maximum size shuld be more than 3. */ + /* A block maximum size should be more than 3. */ if (((BD & 0x70) >> 4) < 4) return (0); /* Reserved bits must be "0". */ @@ -417,7 +417,7 @@ lz4_filter_read_descriptor(struct archiv /* Reserved bits must be zero. */ if (bd & 0x8f) goto malformed_error; - /* Get a maxinum block size. */ + /* Get a maximum block size. */ switch (read_buf[1] >> 4) { case 4: /* 64 KB */ state->flags.block_maximum_size = 64 * 1024; @@ -627,7 +627,7 @@ lz4_filter_read_default_stream(struct ar if (state->stage == SELECT_STREAM) { state->stage = READ_DEFAULT_STREAM; - /* First, read a desciprtor. */ + /* First, read a descriptor. */ if((ret = lz4_filter_read_descriptor(self)) != ARCHIVE_OK) return (ret); state->stage = READ_DEFAULT_BLOCK; Modified: vendor/libarchive/dist/libarchive/archive_read_support_filter_lzop.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_filter_lzop.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_support_filter_lzop.c Tue Jan 10 21:18:32 2017 (r311899) @@ -436,7 +436,7 @@ lzop_filter_read(struct archive_read_fil } /* - * Drive lzo uncompresison. + * Drive lzo uncompression. */ out_size = (lzo_uint)state->uncompressed_size; r = lzo1x_decompress_safe(b, (lzo_uint)state->compressed_size, Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Tue Jan 10 21:18:32 2017 (r311899) @@ -552,7 +552,7 @@ skip_sfx(struct archive_read *a, ssize_t /* * If bytes_avail > SFX_MIN_ADDR we do not have to call * __archive_read_seek() at this time since we have - * alredy had enough data. + * already had enough data. */ if (bytes_avail > SFX_MIN_ADDR) __archive_read_consume(a, SFX_MIN_ADDR); @@ -760,7 +760,7 @@ archive_read_format_7zip_read_header(str symsize += size; } if (symsize == 0) { - /* If there is no synname, handle it as a regular + /* If there is no symname, handle it as a regular * file. */ zip_entry->mode &= ~AE_IFMT; zip_entry->mode |= AE_IFREG; @@ -3288,7 +3288,7 @@ read_stream(struct archive_read *a, cons return (r); /* - * Skip the bytes we alrady has skipped in skip_stream(). + * Skip the bytes we already has skipped in skip_stream(). */ while (skip_bytes) { ssize_t skipped; @@ -3506,7 +3506,7 @@ setup_decode_folder(struct archive_read return (ARCHIVE_FATAL); } - /* Allocate memory for the decorded data of a sub + /* Allocate memory for the decoded data of a sub * stream. */ b[i] = malloc((size_t)zip->folder_outbytes_remaining); if (b[i] == NULL) { @@ -3591,7 +3591,7 @@ skip_stream(struct archive_read *a, size if (zip->folder_index == 0) { /* * Optimization for a list mode. - * Avoid unncecessary decoding operations. + * Avoid unnecessary decoding operations. */ zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes += skip_bytes; Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Tue Jan 10 21:18:32 2017 (r311899) @@ -322,7 +322,7 @@ struct iso9660 { struct archive_string pathname; char seenRockridge; /* Set true if RR extensions are used. */ - char seenSUSP; /* Set true if SUSP is beging used. */ + char seenSUSP; /* Set true if SUSP is being used. */ char seenJoliet; unsigned char suspOffset; Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c Tue Jan 10 21:18:32 2017 (r311899) @@ -1711,7 +1711,7 @@ lha_crc16(uint16_t crc, const void *pp, */ for (;len >= 8; len -= 8) { /* This if statement expects compiler optimization will - * remove the stament which will not be executed. */ + * remove the statement which will not be executed. */ #undef bswap16 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c Tue Jan 10 21:18:32 2017 (r311899) @@ -906,7 +906,7 @@ archive_read_format_rar_read_header(stru sizeof(rar->reserved2)); } - /* Main header is password encrytped, so we cannot read any + /* Main header is password encrypted, so we cannot read any file names or any other info about files from the header. */ if (rar->main_flags & MHD_PASSWORD) { Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Tue Jan 10 21:18:32 2017 (r311899) @@ -204,13 +204,14 @@ static int archive_read_format_tar_read_ struct archive_entry *); static int checksum(struct archive_read *, const void *); static int pax_attribute(struct archive_read *, struct tar *, - struct archive_entry *, const char *key, const char *value); + struct archive_entry *, const char *key, const char *value, + size_t value_length); static int pax_attribute_acl(struct archive_read *, struct tar *, struct archive_entry *, const char *, int); static int pax_attribute_xattr(struct archive_entry *, const char *, const char *); static int pax_header(struct archive_read *, struct tar *, - struct archive_entry *, char *attr); + struct archive_entry *, struct archive_string *); static void pax_time(const char *, int64_t *sec, long *nanos); static ssize_t readline(struct archive_read *, struct tar *, const char **, ssize_t limit, size_t *); @@ -1483,7 +1484,7 @@ header_pax_extensions(struct archive_rea * and then skip any fields in the standard header that were * defined in the pax header. */ - err2 = pax_header(a, tar, entry, tar->pax_header.s); + err2 = pax_header(a, tar, entry, &tar->pax_header); err = err_combine(err, err2); tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining); return (err); @@ -1564,16 +1565,17 @@ header_ustar(struct archive_read *a, str */ static int pax_header(struct archive_read *a, struct tar *tar, - struct archive_entry *entry, char *attr) + struct archive_entry *entry, struct archive_string *in_as) { - size_t attr_length, l, line_length; + size_t attr_length, l, line_length, value_length; char *p; char *key, *value; struct archive_string *as; struct archive_string_conv *sconv; int err, err2; + char *attr = in_as->s; - attr_length = strlen(attr); + attr_length = in_as->length; tar->pax_hdrcharset_binary = 0; archive_string_empty(&(tar->entry_gname)); archive_string_empty(&(tar->entry_linkpath)); @@ -1638,11 +1640,13 @@ pax_header(struct archive_read *a, struc } *p = '\0'; - /* Identify null-terminated 'value' portion. */ value = p + 1; + /* Some values may be binary data */ + value_length = attr + line_length - 1 - value; + /* Identify this attribute and set it in the entry. */ - err2 = pax_attribute(a, tar, entry, key, value); + err2 = pax_attribute(a, tar, entry, key, value, value_length); if (err2 == ARCHIVE_FATAL) return (err2); err = err_combine(err, err2); @@ -1764,6 +1768,20 @@ pax_attribute_xattr(struct archive_entry } static int +pax_attribute_schily_xattr(struct archive_entry *entry, + const char *name, const char *value, size_t value_length) +{ + if (strlen(name) < 14 || (memcmp(name, "SCHILY.xattr.", 13)) != 0) + return 1; + + name += 13; + + archive_entry_xattr_add_entry(entry, name, value, value_length); + + return 0; +} + +static int pax_attribute_acl(struct archive_read *a, struct tar *tar, struct archive_entry *entry, const char *value, int type) { @@ -1824,7 +1842,7 @@ pax_attribute_acl(struct archive_read *a */ static int pax_attribute(struct archive_read *a, struct tar *tar, - struct archive_entry *entry, const char *key, const char *value) + struct archive_entry *entry, const char *key, const char *value, size_t value_length) { int64_t s; long n; @@ -1959,6 +1977,9 @@ pax_attribute(struct archive_read *a, st } else if (strcmp(key, "SCHILY.realsize") == 0) { tar->realsize = tar_atol10(value, strlen(value)); archive_entry_set_size(entry, tar->realsize); + } else if (strncmp(key, "SCHILY.xattr.", 13) == 0) { + pax_attribute_schily_xattr(entry, key, value, + value_length); } else if (strcmp(key, "SUN.holesdata") == 0) { /* A Solaris extension for sparse. */ r = solaris_sparse_parse(a, tar, entry, value); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c Tue Jan 10 21:18:32 2017 (r311899) @@ -88,7 +88,7 @@ typedef enum { WT_RVIS, /* conversion, unsupported */ WT_CONV, - /* continutation, unsupported at the moment */ + /* continuation, unsupported at the moment */ WT_CONT, /* invalid type */ LAST_WT @@ -562,7 +562,7 @@ xstrpisotime(const char *s, char **endpt goto out; } - /* massage TM to fulfill some of POSIX' contraints */ + /* massage TM to fulfill some of POSIX' constraints */ tm.tm_year -= 1900; tm.tm_mon--; Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Tue Jan 10 21:18:32 2017 (r311899) @@ -199,7 +199,7 @@ struct zip { struct trad_enc_ctx tctx; char tctx_valid; - /* WinZip AES decyption. */ + /* WinZip AES decryption. */ /* Contexts used for AES decryption. */ archive_crypto_ctx cctx; char cctx_valid; @@ -242,7 +242,7 @@ trad_enc_update_keys(struct trad_enc_ctx } static uint8_t -trad_enc_decypt_byte(struct trad_enc_ctx *ctx) +trad_enc_decrypt_byte(struct trad_enc_ctx *ctx) { unsigned temp = ctx->keys[2] | 2; return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff; @@ -257,7 +257,7 @@ trad_enc_decrypt_update(struct trad_enc_ max = (unsigned)((in_len < out_len)? in_len: out_len); for (i = 0; i < max; i++) { - uint8_t t = in[i] ^ trad_enc_decypt_byte(ctx); + uint8_t t = in[i] ^ trad_enc_decrypt_byte(ctx); out[i] = t; trad_enc_update_keys(ctx, t); } @@ -710,7 +710,7 @@ process_extra(struct archive_read *a, co break; } case 0x9901: - /* WinZIp AES extra data field. */ + /* WinZip AES extra data field. */ if (p[offset + 2] == 'A' && p[offset + 3] == 'E') { /* Vendor version. */ zip_entry->aes_extra.vendor = @@ -1518,7 +1518,7 @@ read_decryption_header(struct archive_re case 0x6720:/* Blowfish */ case 0x6721:/* Twofish */ case 0x6801:/* RC4 */ - /* Suuported encryption algorithm. */ + /* Supported encryption algorithm. */ break; default: archive_set_error(&a->archive, @@ -1627,7 +1627,7 @@ read_decryption_header(struct archive_re __archive_read_consume(a, 4); /*return (ARCHIVE_OK); - * This is not fully implemnted yet.*/ + * This is not fully implemented yet.*/ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Encrypted file is unsupported"); return (ARCHIVE_FAILED); @@ -1709,7 +1709,7 @@ init_traditional_PKWARE_decryption(struc } /* - * Initialize ctx for Traditional PKWARE Decyption. + * Initialize ctx for Traditional PKWARE Decryption. */ r = trad_enc_init(&zip->tctx, passphrase, strlen(passphrase), p, ENC_HEADER_SIZE, &crcchk); Modified: vendor/libarchive/dist/libarchive/archive_string.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_string.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_string.c Tue Jan 10 21:18:32 2017 (r311899) @@ -219,6 +219,12 @@ archive_wstring_append(struct archive_ws return (as); } +struct archive_string * +archive_array_append(struct archive_string *as, const char *p, size_t s) +{ + return archive_string_append(as, p, s); +} + void archive_string_concat(struct archive_string *dest, struct archive_string *src) { @@ -597,7 +603,7 @@ archive_wstring_append_from_mbs(struct a wcs = dest->s + dest->length; /* * We cannot use mbsrtowcs/mbstowcs here because those may convert - * extra MBS when strlen(p) > len and one wide character consis of + * extra MBS when strlen(p) > len and one wide character consists of * multi bytes. */ while (*mbs && mbs_length > 0) { @@ -1248,7 +1254,7 @@ create_sconv_object(const char *fc, cons sc->cd = iconv_open(tc, fc); if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) { /* - * Unfortunaly, all of iconv implements do support + * Unfortunately, all of iconv implements do support * "CP932" character-set, so we should use "SJIS" * instead if iconv_open failed. */ @@ -1261,7 +1267,7 @@ create_sconv_object(const char *fc, cons /* * archive_mstring on Windows directly convert multi-bytes * into archive_wstring in order not to depend on locale - * so that you can do a I18N programing. This will be + * so that you can do a I18N programming. This will be * used only in archive_mstring_copy_mbs_len_l so far. */ if (flag & SCONV_FROM_CHARSET) { @@ -1726,7 +1732,7 @@ archive_string_conversion_from_charset(s * in tar or zip files. But mbstowcs/wcstombs(CRT) usually use CP_ACP * unless you use setlocale(LC_ALL, ".OCP")(specify CP_OEMCP). * So we should make a string conversion between CP_ACP and CP_OEMCP - * for compatibillty. + * for compatibility. */ #if defined(_WIN32) && !defined(__CYGWIN__) struct archive_string_conv * @@ -2220,7 +2226,7 @@ best_effort_strncat_in_locale(struct arc /* * If a character is ASCII, this just copies it. If not, this - * assigns '?' charater instead but in UTF-8 locale this assigns + * assigns '?' character instead but in UTF-8 locale this assigns * byte sequence 0xEF 0xBD 0xBD, which are code point U+FFFD, * a Replacement Character in Unicode. */ @@ -2554,7 +2560,7 @@ utf16_to_unicode(uint32_t *pwc, const ch /* * Surrogate pair values(0xd800 through 0xdfff) are only - * used by UTF-16, so, after above culculation, the code + * used by UTF-16, so, after above calculation, the code * must not be surrogate values, and Unicode has no codes * larger than 0x10ffff. Thus, those are not legal Unicode * values. @@ -2903,7 +2909,7 @@ get_nfc(uint32_t uc, uint32_t uc2) /* * Normalize UTF-8/UTF-16BE characters to Form C and copy the result. * - * TODO: Convert composition exclusions,which are never converted + * TODO: Convert composition exclusions, which are never converted * from NFC,NFD,NFKC and NFKD, to Form C. */ static int @@ -3437,7 +3443,7 @@ strncat_from_utf8_libarchive2(struct arc } /* - * As libarchie 2.x, translates the UTF-8 characters into + * As libarchive 2.x, translates the UTF-8 characters into * wide-characters in the assumption that WCS is Unicode. */ if (n < 0) { @@ -3947,7 +3953,7 @@ archive_mstring_get_mbs_l(struct archive #if defined(_WIN32) && !defined(__CYGWIN__) /* - * Internationalization programing on Windows must use Wide + * Internationalization programming on Windows must use Wide * characters because Windows platform cannot make locale UTF-8. */ if (sc != NULL && (aes->aes_set & AES_SET_WCS) != 0) { @@ -4079,7 +4085,7 @@ archive_mstring_copy_mbs_len_l(struct ar archive_string_empty(&(aes->aes_utf8)); #if defined(_WIN32) && !defined(__CYGWIN__) /* - * Internationalization programing on Windows must use Wide + * Internationalization programming on Windows must use Wide * characters because Windows platform cannot make locale UTF-8. */ if (sc == NULL) { Modified: vendor/libarchive/dist/libarchive/archive_string.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_string.h Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_string.h Tue Jan 10 21:18:32 2017 (r311899) @@ -81,6 +81,10 @@ archive_strappend_char(struct archive_st struct archive_wstring * archive_wstrappend_wchar(struct archive_wstring *, wchar_t); +/* Append a raw array to an archive_string, resizing as necessary */ +struct archive_string * +archive_array_append(struct archive_string *, const char *, size_t); + /* Convert a Unicode string to current locale and append the result. */ /* Returns -1 if conversion fails. */ int Modified: vendor/libarchive/dist/libarchive/archive_string_composition.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_string_composition.h Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_string_composition.h Tue Jan 10 21:18:32 2017 (r311899) @@ -1009,7 +1009,7 @@ static const char u_decomposable_blocks[ (((uc) > 0x1D244)?0:\ ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F]) -/* The table of the value of Canonical Cimbining Class */ +/* The table of the value of Canonical Combining Class */ static const unsigned char ccc_val[][16] = { /* idx=0: XXXX0 - XXXXF */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, Modified: vendor/libarchive/dist/libarchive/archive_write.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_write.c Tue Jan 10 21:18:32 2017 (r311899) @@ -231,7 +231,7 @@ __archive_write_filter(struct archive_wr if (length == 0) return(ARCHIVE_OK); if (f->write == NULL) - /* If unset, a fatal error has already ocuured, so this filter + /* If unset, a fatal error has already occurred, so this filter * didn't open. We cannot write anything. */ return(ARCHIVE_FATAL); r = (f->write)(f, buff, length); Modified: vendor/libarchive/dist/libarchive/archive_write_add_filter_xz.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_add_filter_xz.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_write_add_filter_xz.c Tue Jan 10 21:18:32 2017 (r311899) @@ -233,7 +233,7 @@ archive_compressor_xz_init_stream(struct if (f->code == ARCHIVE_FILTER_XZ) { #ifdef HAVE_LZMA_STREAM_ENCODER_MT if (data->threads != 1) { - bzero(&mt_options, sizeof(mt_options)); + memset(&mt_options, 0, sizeof(mt_options)); mt_options.threads = data->threads; mt_options.timeout = 300; mt_options.filters = data->lzmafilters; Modified: vendor/libarchive/dist/libarchive/archive_write_disk_acl.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk_acl.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_write_disk_acl.c Tue Jan 10 21:18:32 2017 (r311899) @@ -124,7 +124,10 @@ static struct { {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT}, - {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY} + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}, + {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED} }; #endif @@ -292,29 +295,41 @@ set_acl(struct archive *a, int fd, const } /* Try restoring the ACL through 'fd' if we can. */ -#if HAVE_ACL_SET_FD - if (fd >= 0 && acl_type == ACL_TYPE_ACCESS && acl_set_fd(fd, acl) == 0) - ret = ARCHIVE_OK; - else -#else +#if HAVE_ACL_SET_FD_NP || HAVE_ACL_SET_FD #if HAVE_ACL_SET_FD_NP - if (fd >= 0 && acl_set_fd_np(fd, acl, acl_type) == 0) - ret = ARCHIVE_OK; - else -#endif -#endif + if (fd >= 0) { + if (acl_set_fd_np(fd, acl, acl_type) == 0) +#else /* HAVE_ACL_SET_FD */ + if (fd >= 0 && acl_type == ACL_TYPE_ACCESS) { + if (acl_set_fd(fd, acl) == 0) +#endif + ret = ARCHIVE_OK; + else { + if (errno == EOPNOTSUPP) { + /* Filesystem doesn't support ACLs */ + ret = ARCHIVE_OK; + } else { + archive_set_error(a, errno, + "Failed to set %s acl on fd", tname); + } + } + } else +#endif /* HAVE_ACL_SET_FD_NP || HAVE_ACL_SET_FD */ #if HAVE_ACL_SET_LINK_NP - if (acl_set_link_np(name, acl_type, acl) != 0) { - archive_set_error(a, errno, "Failed to set %s acl", tname); - ret = ARCHIVE_WARN; - } + if (acl_set_link_np(name, acl_type, acl) != 0) { #else /* TODO: Skip this if 'name' is a symlink. */ if (acl_set_file(name, acl_type, acl) != 0) { - archive_set_error(a, errno, "Failed to set %s acl", tname); - ret = ARCHIVE_WARN; - } #endif + if (errno == EOPNOTSUPP) { + /* Filesystem doesn't support ACLs */ + ret = ARCHIVE_OK; + } else { + archive_set_error(a, errno, "Failed to set %s acl", + tname); + ret = ARCHIVE_WARN; + } + } exit_free: acl_free(acl); return (ret); Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c Tue Jan 10 21:18:32 2017 (r311899) @@ -1358,7 +1358,7 @@ make_header(struct archive_write *a, uin if (r < 0) return (r); - /* Write Nume size. */ + /* Write Name size. */ r = enc_uint64(a, zip->total_bytes_entry_name+1); if (r < 0) return (r); Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c Tue Jan 10 21:18:32 2017 (r311899) @@ -62,10 +62,17 @@ struct pax { struct sparse_block *sparse_tail; struct archive_string_conv *sconv_utf8; int opt_binary; + + unsigned flags; +#define WRITE_SCHILY_XATTR (1 << 0) +#define WRITE_LIBARCHIVE_XATTR (1 << 1) }; static void add_pax_attr(struct archive_string *, const char *key, const char *value); +static void add_pax_attr_binary(struct archive_string *, + const char *key, + const char *value, size_t value_len); static void add_pax_attr_int(struct archive_string *, const char *key, int64_t value); static void add_pax_attr_time(struct archive_string *, @@ -136,6 +143,8 @@ archive_write_set_format_pax(struct arch "Can't allocate pax data"); return (ARCHIVE_FATAL); } + pax->flags = WRITE_LIBARCHIVE_XATTR | WRITE_SCHILY_XATTR; + a->format_data = pax; a->format_name = "pax"; a->format_options = archive_write_pax_options; @@ -275,6 +284,17 @@ add_pax_attr_int(struct archive_string * static void add_pax_attr(struct archive_string *as, const char *key, const char *value) { + add_pax_attr_binary(as, key, value, strlen(value)); +} + +/* + * Add a key/value attribute to the pax header. This function handles + * binary values. + */ +static void +add_pax_attr_binary(struct archive_string *as, const char *key, + const char *value, size_t value_len) +{ int digits, i, len, next_ten; char tmp[1 + 3 * sizeof(int)]; /* < 3 base-10 digits per byte */ @@ -282,7 +302,7 @@ add_pax_attr(struct archive_string *as, * PAX attributes have the following layout: * <=> */ - len = 1 + (int)strlen(key) + 1 + (int)strlen(value) + 1; + len = 1 + (int)strlen(key) + 1 + (int)value_len + 1; /* * The field includes the length of the field, so @@ -313,21 +333,47 @@ add_pax_attr(struct archive_string *as, archive_strappend_char(as, ' '); archive_strcat(as, key); archive_strappend_char(as, '='); - archive_strcat(as, value); + archive_array_append(as, value, value_len); archive_strappend_char(as, '\n'); } +static void +archive_write_pax_header_xattr(struct pax *pax, const char *encoded_name, + const void *value, size_t value_len) +{ + struct archive_string s; + char *encoded_value; + + if (pax->flags & WRITE_LIBARCHIVE_XATTR) { + encoded_value = base64_encode((const char *)value, value_len); + + if (encoded_name != NULL && encoded_value != NULL) { + archive_string_init(&s); + archive_strcpy(&s, "LIBARCHIVE.xattr."); + archive_strcat(&s, encoded_name); + add_pax_attr(&(pax->pax_header), s.s, encoded_value); + archive_string_free(&s); + } + free(encoded_value); + } + if (pax->flags & WRITE_SCHILY_XATTR) { + archive_string_init(&s); + archive_strcpy(&s, "SCHILY.xattr."); + archive_strcat(&s, encoded_name); + add_pax_attr_binary(&(pax->pax_header), s.s, value, value_len); + archive_string_free(&s); + } +} + static int archive_write_pax_header_xattrs(struct archive_write *a, struct pax *pax, struct archive_entry *entry) { - struct archive_string s; int i = archive_entry_xattr_reset(entry); while (i--) { const char *name; const void *value; - char *encoded_value; char *url_encoded_name = NULL, *encoded_name = NULL; size_t size; int r; @@ -348,16 +394,9 @@ archive_write_pax_header_xattrs(struct a } } - encoded_value = base64_encode((const char *)value, size); + archive_write_pax_header_xattr(pax, encoded_name, + value, size); - if (encoded_name != NULL && encoded_value != NULL) { - archive_string_init(&s); - archive_strcpy(&s, "LIBARCHIVE.xattr."); - archive_strcat(&s, encoded_name); - add_pax_attr(&(pax->pax_header), s.s, encoded_value); - archive_string_free(&s); - } - free(encoded_value); } return (ARCHIVE_OK); } Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c Tue Jan 10 21:18:32 2017 (r311899) @@ -2913,7 +2913,7 @@ compression_init_encoder_xz(struct archi *strm = lzma_init_data; #ifdef HAVE_LZMA_STREAM_ENCODER_MT if (threads > 1) { - bzero(&mt_options, sizeof(mt_options)); + memset(&mt_options, 0, sizeof(mt_options)); mt_options.threads = threads; mt_options.timeout = 300; mt_options.filters = lzmafilters; Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_zip.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_zip.c Tue Jan 10 21:18:32 2017 (r311899) @@ -878,7 +878,7 @@ archive_write_zip_header(struct archive_ || zip->entry_encryption == ENCRYPTION_WINZIP_AES256)) { memcpy(e, "\001\231\007\000\001\000AE", 8); - /* AES vendoer version AE-2 does not store a CRC. + /* AES vendor version AE-2 does not store a CRC. * WinZip 11 uses AE-1, which does store the CRC, * but it does not store the CRC when the file size * is less than 20 bytes. So we simulate what @@ -1013,7 +1013,7 @@ archive_write_zip_data(struct archive_wr if (zip->entry_flags & ZIP_ENTRY_FLAG_ENCRYPTED) { switch (zip->entry_encryption) { case ENCRYPTION_TRADITIONAL: - /* Initialize traditoinal PKWARE encryption context. */ + /* Initialize traditional PKWARE encryption context. */ if (!zip->tctx_valid) { ret = init_traditional_pkware_encryption(a); if (ret != ARCHIVE_OK) @@ -1499,7 +1499,7 @@ trad_enc_update_keys(struct trad_enc_ctx } static uint8_t -trad_enc_decypt_byte(struct trad_enc_ctx *ctx) +trad_enc_decrypt_byte(struct trad_enc_ctx *ctx) { unsigned temp = ctx->keys[2] | 2; return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff; @@ -1515,7 +1515,7 @@ trad_enc_encrypt_update(struct trad_enc_ for (i = 0; i < max; i++) { uint8_t t = in[i]; - out[i] = t ^ trad_enc_decypt_byte(ctx); + out[i] = t ^ trad_enc_decrypt_byte(ctx); trad_enc_update_keys(ctx, t); } return i; @@ -1626,7 +1626,7 @@ init_winzip_aes_encryption(struct archiv return (ARCHIVE_FAILED); } - /* Set a passowrd verification value after the 'salt'. */ + /* Set a password verification value after the 'salt'. */ salt[salt_len] = derived_key[key_len * 2]; salt[salt_len + 1] = derived_key[key_len * 2 + 1]; Modified: vendor/libarchive/dist/libarchive/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/libarchive/test/CMakeLists.txt Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/test/CMakeLists.txt Tue Jan 10 21:18:32 2017 (r311899) @@ -183,6 +183,7 @@ IF(ENABLE_TEST) test_read_format_zip_winzip_aes_large.c test_read_format_zip_zip64.c test_read_large.c + test_read_pax_schily_xattr.c test_read_pax_truncated.c test_read_position.c test_read_set_format.c Modified: vendor/libarchive/dist/libarchive/test/test_archive_read_add_passphrase.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_archive_read_add_passphrase.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/test/test_archive_read_add_passphrase.c Tue Jan 10 21:18:32 2017 (r311899) @@ -191,7 +191,7 @@ DEFINE_TEST(test_archive_read_add_passph /* Fist call, we should get "passCallBack" as a passphrase. */ assertEqualString("passCallBack", __archive_read_next_passphrase(ar)); __archive_read_reset_passphrase(ar); - /* After reset passphrase, we should get "passCallBack"passphrase. */ + /* After reset passphrase, we should get "passCallBack" passphrase. */ assertEqualString("passCallBack", __archive_read_next_passphrase(ar)); /* Second call, we should get NULL which means all the passphrases * are passed already. */ Modified: vendor/libarchive/dist/libarchive/test/test_compat_uudecode.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_compat_uudecode.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/test/test_compat_uudecode.c Tue Jan 10 21:18:32 2017 (r311899) @@ -40,7 +40,7 @@ static char archive_data[] = { }; /* - * Compatibility: uudecode command ignores junk data placed ater the "end" + * Compatibility: uudecode command ignores junk data placed after the "end" * marker. */ DEFINE_TEST(test_compat_uudecode) Modified: vendor/libarchive/dist/libarchive/test/test_read_format_cpio_afio.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_cpio_afio.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/test/test_read_format_cpio_afio.c Tue Jan 10 21:18:32 2017 (r311899) @@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$"); /* -ecute the following to rebuild the data for this program: +execute the following to rebuild the data for this program: tail -n +33 test_read_format_cpio_afio.c | /bin/sh # How to make a sample data. Modified: vendor/libarchive/dist/libarchive/test/test_read_format_zip_traditional_encryption_data.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_zip_traditional_encryption_data.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/test/test_read_format_zip_traditional_encryption_data.c Tue Jan 10 21:18:32 2017 (r311899) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_read_format_zip_traditional_encryption_data) { - /* This file is password protected (Traditional PKWARE Enctypted). + /* This file is password protected (Traditional PKWARE Encrypted). The headers are NOT encrypted. Password is "12345678". */ const char *refname = "test_read_format_zip_traditional_encryption_data.zip"; @@ -36,7 +36,7 @@ DEFINE_TEST(test_read_format_zip_traditi struct archive *a; char buff[512]; - /* Check if running system has cryptographic functionarity. */ + /* Check if running system has cryptographic functionality. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); Modified: vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes.c Tue Jan 10 21:18:32 2017 (r311899) @@ -33,7 +33,7 @@ test_winzip_aes(const char *refname, int struct archive *a; char buff[512]; - /* Check if running system has cryptographic functionarity. */ + /* Check if running system has cryptographic functionality. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); Modified: vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes_large.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes_large.c Tue Jan 10 21:10:20 2017 (r311898) +++ vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes_large.c Tue Jan 10 21:18:32 2017 (r311899) @@ -34,7 +34,7 @@ DEFINE_TEST(test_read_format_zip_winzip_ char buff[512]; - /* Check if running system has cryptographic functionarity. */ + /* Check if running system has cryptographic functionality. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); Added: vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.c Tue Jan 10 21:18:32 2017 (r311899) @@ -0,0 +1,70 @@ +/*- + * Copyright (c) 2016 IBM Corporation + * Copyright (c) 2003-2007 Tim Kientzle + * + * 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(S) ``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(S) 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 test case's code has been derived from test_entry.c + */ +#include "test.h" + +DEFINE_TEST(test_schily_xattr_pax) +{ + struct archive *a; + struct archive_entry *ae; + const char *refname = "test_read_pax_schily_xattr.tar"; + const char *xname; /* For xattr tests. */ + const void *xval; /* For xattr tests. */ + size_t xsize; /* For xattr tests. */ + const char *string, *array; + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + + extract_reference_file(refname); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, refname, 10240)); + + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(2, archive_entry_xattr_count(ae)); + assertEqualInt(2, archive_entry_xattr_reset(ae)); + + assertEqualInt(0, archive_entry_xattr_next(ae, &xname, &xval, &xsize)); + assertEqualString(xname, "security.selinux"); + string = "system_u:object_r:unlabeled_t:s0"; + assertEqualString(xval, string); + /* the xattr's value also contains the terminating \0 */ + assertEqualInt((int)xsize, strlen(string) + 1); + + assertEqualInt(0, archive_entry_xattr_next(ae, &xname, &xval, &xsize)); + assertEqualString(xname, "security.ima"); + assertEqualInt((int)xsize, 265); + /* we only compare the first 12 bytes */ + array = "\x03\x02\x04\xb0\xe9\xd6\x79\x01\x00\x2b\xad\x1e"; + assertEqualMem(xval, array, 12); + + /* Close the archive. */ + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 10 21:21:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35D19CAA7C8; Tue, 10 Jan 2017 21:21:01 +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 06328163D; Tue, 10 Jan 2017 21:21:00 +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 v0ALL0LW087509; Tue, 10 Jan 2017 21:21:00 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0ALL0xp087505; Tue, 10 Jan 2017 21:21:00 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701102121.v0ALL0xp087505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 10 Jan 2017 21:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311900 - head/sys/modules/em X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 21:21:01 -0000 Author: sbruno Date: Tue Jan 10 21:21:00 2017 New Revision: 311900 URL: https://svnweb.freebsd.org/changeset/base/311900 Log: Set CFLAGS correctly for sys/modules/em Unbreak gcc sparc64 builds (or any gcc build that uses em(4)). Reported by: lidl@freebsd.org Modified: head/sys/modules/em/Makefile Modified: head/sys/modules/em/Makefile ============================================================================== --- head/sys/modules/em/Makefile Tue Jan 10 21:18:32 2017 (r311899) +++ head/sys/modules/em/Makefile Tue Jan 10 21:21:00 2017 (r311900) @@ -17,7 +17,7 @@ PCIE_SHARED = e1000_80003es2lan.c e1000_ LEGACY_SHARED = e1000_82540.c e1000_82542.c e1000_82541.c e1000_82543.c -CFLAGS += -I${.CURDIR}/../../../dev/e1000 +CFLAGS += -I${.CURDIR}/../../dev/e1000 # DEVICE_POLLING for a non-interrupt-driven method #CFLAGS += -DDEVICE_POLLING From owner-svn-src-all@freebsd.org Tue Jan 10 21:41:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18997CA9608; Tue, 10 Jan 2017 21:41:30 +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 DA5E1160B; Tue, 10 Jan 2017 21:41:29 +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 v0ALfThg095224; Tue, 10 Jan 2017 21:41:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0ALfTqW095223; Tue, 10 Jan 2017 21:41:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701102141.v0ALfTqW095223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Jan 2017 21:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311901 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 21:41:30 -0000 Author: markj Date: Tue Jan 10 21:41:28 2017 New Revision: 311901 URL: https://svnweb.freebsd.org/changeset/base/311901 Log: Do not set BIO_DONE if the BIO specifies a completion handler. biowait() will otherwise race with completions of such BIOs. In-tree code only calls biowait() on BIOs that do not specify a handler, so this change should not have any functional impact. Reviewed by: mav MFC after: 1 month Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9070 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Jan 10 21:21:00 2017 (r311900) +++ head/sys/kern/vfs_bio.c Tue Jan 10 21:41:28 2017 (r311901) @@ -3905,10 +3905,8 @@ biodone(struct bio *bp) bp->bio_flags |= BIO_DONE; wakeup(bp); mtx_unlock(mtxp); - } else { - bp->bio_flags |= BIO_DONE; + } else done(bp); - } } /* From owner-svn-src-all@freebsd.org Tue Jan 10 21:52:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7ED7CA9D74; Tue, 10 Jan 2017 21:52:49 +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 9500F1E84; Tue, 10 Jan 2017 21:52:49 +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 v0ALqmUa002932; Tue, 10 Jan 2017 21:52:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0ALqmSR002930; Tue, 10 Jan 2017 21:52:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701102152.v0ALqmSR002930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Jan 2017 21:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311902 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 21:52:49 -0000 Author: markj Date: Tue Jan 10 21:52:48 2017 New Revision: 311902 URL: https://svnweb.freebsd.org/changeset/base/311902 Log: Coalesce TLB shootdowns of global PTEs in pmap_advise() on x86. We would previously invalidate such entries individually, resulting in more IPIs than necessary. Reviewed by: alc, kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D9094 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Jan 10 21:41:28 2017 (r311901) +++ head/sys/amd64/amd64/pmap.c Tue Jan 10 21:52:48 2017 (r311902) @@ -6010,7 +6010,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva pdp_entry_t *pdpe; pd_entry_t oldpde, *pde; pt_entry_t *pte, PG_A, PG_G, PG_M, PG_RW, PG_V; - vm_offset_t va_next; + vm_offset_t va, va_next; vm_page_t m; boolean_t anychanged; @@ -6090,11 +6090,11 @@ pmap_advise(pmap_t pmap, vm_offset_t sva } if (va_next > eva) va_next = eva; + va = va_next; for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, sva += PAGE_SIZE) { - if ((*pte & (PG_MANAGED | PG_V)) != (PG_MANAGED | - PG_V)) - continue; + if ((*pte & (PG_MANAGED | PG_V)) != (PG_MANAGED | PG_V)) + goto maybe_invlrng; else if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { if (advice == MADV_DONTNEED) { /* @@ -6109,12 +6109,22 @@ pmap_advise(pmap_t pmap, vm_offset_t sva } else if ((*pte & PG_A) != 0) atomic_clear_long(pte, PG_A); else - continue; - if ((*pte & PG_G) != 0) - pmap_invalidate_page(pmap, sva); - else + goto maybe_invlrng; + + if ((*pte & PG_G) != 0) { + if (va == va_next) + va = sva; + } else anychanged = TRUE; + continue; +maybe_invlrng: + if (va != va_next) { + pmap_invalidate_range(pmap, va, sva); + va = va_next; + } } + if (va != va_next) + pmap_invalidate_range(pmap, va, sva); } if (anychanged) pmap_invalidate_all(pmap); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Jan 10 21:41:28 2017 (r311901) +++ head/sys/i386/i386/pmap.c Tue Jan 10 21:52:48 2017 (r311902) @@ -4905,7 +4905,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva { pd_entry_t oldpde, *pde; pt_entry_t *pte; - vm_offset_t pdnxt; + vm_offset_t va, pdnxt; vm_page_t m; boolean_t anychanged, pv_lists_locked; @@ -4966,11 +4966,11 @@ resume: } if (pdnxt > eva) pdnxt = eva; + va = pdnxt; for (pte = pmap_pte_quick(pmap, sva); sva != pdnxt; pte++, sva += PAGE_SIZE) { - if ((*pte & (PG_MANAGED | PG_V)) != (PG_MANAGED | - PG_V)) - continue; + if ((*pte & (PG_MANAGED | PG_V)) != (PG_MANAGED | PG_V)) + goto maybe_invlrng; else if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { if (advice == MADV_DONTNEED) { /* @@ -4985,12 +4985,21 @@ resume: } else if ((*pte & PG_A) != 0) atomic_clear_int((u_int *)pte, PG_A); else - continue; - if ((*pte & PG_G) != 0) - pmap_invalidate_page(pmap, sva); - else + goto maybe_invlrng; + if ((*pte & PG_G) != 0) { + if (va == pdnxt) + va = sva; + } else anychanged = TRUE; + continue; +maybe_invlrng: + if (va != pdnxt) { + pmap_invalidate_range(pmap, va, sva); + va = pdnxt; + } } + if (va != pdnxt) + pmap_invalidate_range(pmap, va, sva); } if (anychanged) pmap_invalidate_all(pmap); From owner-svn-src-all@freebsd.org Tue Jan 10 21:59:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72147CAA068; Tue, 10 Jan 2017 21:59:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C245110A; Tue, 10 Jan 2017 21:59:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0ALxc2A003397; Tue, 10 Jan 2017 21:59:38 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0ALxZmc003365; Tue, 10 Jan 2017 21:59:35 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201701102159.v0ALxZmc003365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 10 Jan 2017 21:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311903 - in head/contrib/libarchive/libarchive: . test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 21:59:39 -0000 Author: mm Date: Tue Jan 10 21:59:35 2017 New Revision: 311903 URL: https://svnweb.freebsd.org/changeset/base/311903 Log: MFV r311899: Sync libarchive with vendor. Vendor bugfixes: #691: Support for SCHILY.xattr extended attributes #854: Spelling fixes Multiple fixes in ACL code: - prefer acl_set_fd_np() to acl_set_fd() - if acl_set_fd_np() fails, do no fallback to acl_set_file() - do not warn if trying to write ACLs to a filesystem without ACL support - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs MFC after: 1 week X-MFC with: r310866 Added: head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c - copied unchanged from r311899, vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.c head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu - copied unchanged from r311899, vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.tar.uu Modified: head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c head/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c head/contrib/libarchive/libarchive/archive_read_support_format_lha.c head/contrib/libarchive/libarchive/archive_read_support_format_rar.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_warc.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_string.c head/contrib/libarchive/libarchive/archive_string.h head/contrib/libarchive/libarchive/archive_string_composition.h head/contrib/libarchive/libarchive/archive_write.c head/contrib/libarchive/libarchive/archive_write_add_filter_xz.c head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/archive_write_set_format_xar.c head/contrib/libarchive/libarchive/archive_write_set_format_zip.c head/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c head/contrib/libarchive/libarchive/test/test_compat_uudecode.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c head/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c head/contrib/libarchive/libarchive/test/test_sparse_basic.c head/contrib/libarchive/libarchive/xxhash.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_acl.c Tue Jan 10 21:59:35 2017 (r311903) @@ -786,7 +786,8 @@ append_entry_w(wchar_t **wp, const wchar } else if (tag == ARCHIVE_ENTRY_ACL_USER || tag == ARCHIVE_ENTRY_ACL_GROUP) { append_id_w(wp, id); - id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) + id = -1; } /* Solaris style has no second colon after other and mask */ if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0) @@ -1042,7 +1043,8 @@ append_entry(char **p, const char *prefi } else if (tag == ARCHIVE_ENTRY_ACL_USER || tag == ARCHIVE_ENTRY_ACL_GROUP) { append_id(p, id); - id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) + id = -1; } /* Solaris style has no second colon after other and mask */ if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0) @@ -1328,6 +1330,7 @@ archive_acl_from_text_w(struct archive_a tag == ARCHIVE_ENTRY_ACL_GROUP) { n = 1; name = field[1]; + isint_w(name.start, name.end, &id); } else n = 0; @@ -1799,6 +1802,7 @@ archive_acl_from_text_l(struct archive_a tag == ARCHIVE_ENTRY_ACL_GROUP) { n = 1; name = field[1]; + isint(name.start, name.end, &id); } else n = 0; Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Jan 10 21:59:35 2017 (r311903) @@ -526,6 +526,11 @@ setup_acls(struct archive_read_disk *a, /* Only directories can have default ACLs. */ if (S_ISDIR(archive_entry_mode(entry))) { +#if HAVE_ACL_GET_FD_NP + if (*fd >= 0) + acl = acl_get_fd_np(*fd, ACL_TYPE_DEFAULT); + else +#endif acl = acl_get_file(accpath, ACL_TYPE_DEFAULT); if (acl != NULL) { r = translate_acl(a, entry, acl, @@ -581,7 +586,10 @@ static struct { {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT}, - {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY} + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}, + {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED} }; #endif static int Modified: head/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue Jan 10 21:59:35 2017 (r311903) @@ -675,7 +675,7 @@ setup_suitable_read_buffer(struct archiv asize = cf->min_xfer_size; /* Increase a buffer size up to 64K bytes in - * a proper incremant size. */ + * a proper increment size. */ while (asize < 1024*64) asize += incr; /* Take a margin to adjust to the filesystem @@ -1656,7 +1656,7 @@ setup_current_filesystem(struct archive_ archive_set_error(&a->archive, errno, "statvfs failed"); return (ARCHIVE_FAILED); } else if (xr == 1) { - /* Usuall come here unless NetBSD supports _PC_REC_XFER_ALIGN + /* Usually come here unless NetBSD supports _PC_REC_XFER_ALIGN * for pathconf() function. */ t->current_filesystem->xfer_align = sfs.f_frsize; t->current_filesystem->max_xfer_size = -1; @@ -1944,7 +1944,7 @@ setup_current_filesystem(struct archive_ if (nm == -1) # endif /* _PC_NAME_MAX */ /* - * Some sysmtes (HP-UX or others?) incorrectly defined + * Some systems (HP-UX or others?) incorrectly defined * NAME_MAX macro to be a smaller value. */ # if defined(NAME_MAX) && NAME_MAX >= 255 Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Tue Jan 10 21:59:35 2017 (r311903) @@ -180,7 +180,7 @@ lz4_reader_bid(struct archive_read_filte return (0); bits_checked += 8; BD = buffer[5]; - /* A block maximum size shuld be more than 3. */ + /* A block maximum size should be more than 3. */ if (((BD & 0x70) >> 4) < 4) return (0); /* Reserved bits must be "0". */ @@ -417,7 +417,7 @@ lz4_filter_read_descriptor(struct archiv /* Reserved bits must be zero. */ if (bd & 0x8f) goto malformed_error; - /* Get a maxinum block size. */ + /* Get a maximum block size. */ switch (read_buf[1] >> 4) { case 4: /* 64 KB */ state->flags.block_maximum_size = 64 * 1024; @@ -627,7 +627,7 @@ lz4_filter_read_default_stream(struct ar if (state->stage == SELECT_STREAM) { state->stage = READ_DEFAULT_STREAM; - /* First, read a desciprtor. */ + /* First, read a descriptor. */ if((ret = lz4_filter_read_descriptor(self)) != ARCHIVE_OK) return (ret); state->stage = READ_DEFAULT_BLOCK; Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c Tue Jan 10 21:59:35 2017 (r311903) @@ -436,7 +436,7 @@ lzop_filter_read(struct archive_read_fil } /* - * Drive lzo uncompresison. + * Drive lzo uncompression. */ out_size = (lzo_uint)state->uncompressed_size; r = lzo1x_decompress_safe(b, (lzo_uint)state->compressed_size, Modified: head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c Tue Jan 10 21:59:35 2017 (r311903) @@ -552,7 +552,7 @@ skip_sfx(struct archive_read *a, ssize_t /* * If bytes_avail > SFX_MIN_ADDR we do not have to call * __archive_read_seek() at this time since we have - * alredy had enough data. + * already had enough data. */ if (bytes_avail > SFX_MIN_ADDR) __archive_read_consume(a, SFX_MIN_ADDR); @@ -760,7 +760,7 @@ archive_read_format_7zip_read_header(str symsize += size; } if (symsize == 0) { - /* If there is no synname, handle it as a regular + /* If there is no symname, handle it as a regular * file. */ zip_entry->mode &= ~AE_IFMT; zip_entry->mode |= AE_IFREG; @@ -3288,7 +3288,7 @@ read_stream(struct archive_read *a, cons return (r); /* - * Skip the bytes we alrady has skipped in skip_stream(). + * Skip the bytes we already has skipped in skip_stream(). */ while (skip_bytes) { ssize_t skipped; @@ -3506,7 +3506,7 @@ setup_decode_folder(struct archive_read return (ARCHIVE_FATAL); } - /* Allocate memory for the decorded data of a sub + /* Allocate memory for the decoded data of a sub * stream. */ b[i] = malloc((size_t)zip->folder_outbytes_remaining); if (b[i] == NULL) { @@ -3591,7 +3591,7 @@ skip_stream(struct archive_read *a, size if (zip->folder_index == 0) { /* * Optimization for a list mode. - * Avoid unncecessary decoding operations. + * Avoid unnecessary decoding operations. */ zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes += skip_bytes; Modified: head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Tue Jan 10 21:59:35 2017 (r311903) @@ -322,7 +322,7 @@ struct iso9660 { struct archive_string pathname; char seenRockridge; /* Set true if RR extensions are used. */ - char seenSUSP; /* Set true if SUSP is beging used. */ + char seenSUSP; /* Set true if SUSP is being used. */ char seenJoliet; unsigned char suspOffset; Modified: head/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Tue Jan 10 21:59:35 2017 (r311903) @@ -1711,7 +1711,7 @@ lha_crc16(uint16_t crc, const void *pp, */ for (;len >= 8; len -= 8) { /* This if statement expects compiler optimization will - * remove the stament which will not be executed. */ + * remove the statement which will not be executed. */ #undef bswap16 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue Jan 10 21:59:35 2017 (r311903) @@ -906,7 +906,7 @@ archive_read_format_rar_read_header(stru sizeof(rar->reserved2)); } - /* Main header is password encrytped, so we cannot read any + /* Main header is password encrypted, so we cannot read any file names or any other info about files from the header. */ if (rar->main_flags & MHD_PASSWORD) { Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Tue Jan 10 21:59:35 2017 (r311903) @@ -204,13 +204,14 @@ static int archive_read_format_tar_read_ struct archive_entry *); static int checksum(struct archive_read *, const void *); static int pax_attribute(struct archive_read *, struct tar *, - struct archive_entry *, const char *key, const char *value); + struct archive_entry *, const char *key, const char *value, + size_t value_length); static int pax_attribute_acl(struct archive_read *, struct tar *, struct archive_entry *, const char *, int); static int pax_attribute_xattr(struct archive_entry *, const char *, const char *); static int pax_header(struct archive_read *, struct tar *, - struct archive_entry *, char *attr); + struct archive_entry *, struct archive_string *); static void pax_time(const char *, int64_t *sec, long *nanos); static ssize_t readline(struct archive_read *, struct tar *, const char **, ssize_t limit, size_t *); @@ -1483,7 +1484,7 @@ header_pax_extensions(struct archive_rea * and then skip any fields in the standard header that were * defined in the pax header. */ - err2 = pax_header(a, tar, entry, tar->pax_header.s); + err2 = pax_header(a, tar, entry, &tar->pax_header); err = err_combine(err, err2); tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining); return (err); @@ -1564,16 +1565,17 @@ header_ustar(struct archive_read *a, str */ static int pax_header(struct archive_read *a, struct tar *tar, - struct archive_entry *entry, char *attr) + struct archive_entry *entry, struct archive_string *in_as) { - size_t attr_length, l, line_length; + size_t attr_length, l, line_length, value_length; char *p; char *key, *value; struct archive_string *as; struct archive_string_conv *sconv; int err, err2; + char *attr = in_as->s; - attr_length = strlen(attr); + attr_length = in_as->length; tar->pax_hdrcharset_binary = 0; archive_string_empty(&(tar->entry_gname)); archive_string_empty(&(tar->entry_linkpath)); @@ -1638,11 +1640,13 @@ pax_header(struct archive_read *a, struc } *p = '\0'; - /* Identify null-terminated 'value' portion. */ value = p + 1; + /* Some values may be binary data */ + value_length = attr + line_length - 1 - value; + /* Identify this attribute and set it in the entry. */ - err2 = pax_attribute(a, tar, entry, key, value); + err2 = pax_attribute(a, tar, entry, key, value, value_length); if (err2 == ARCHIVE_FATAL) return (err2); err = err_combine(err, err2); @@ -1764,6 +1768,20 @@ pax_attribute_xattr(struct archive_entry } static int +pax_attribute_schily_xattr(struct archive_entry *entry, + const char *name, const char *value, size_t value_length) +{ + if (strlen(name) < 14 || (memcmp(name, "SCHILY.xattr.", 13)) != 0) + return 1; + + name += 13; + + archive_entry_xattr_add_entry(entry, name, value, value_length); + + return 0; +} + +static int pax_attribute_acl(struct archive_read *a, struct tar *tar, struct archive_entry *entry, const char *value, int type) { @@ -1824,7 +1842,7 @@ pax_attribute_acl(struct archive_read *a */ static int pax_attribute(struct archive_read *a, struct tar *tar, - struct archive_entry *entry, const char *key, const char *value) + struct archive_entry *entry, const char *key, const char *value, size_t value_length) { int64_t s; long n; @@ -1961,6 +1979,9 @@ pax_attribute(struct archive_read *a, st } else if (strcmp(key, "SCHILY.realsize") == 0) { tar->realsize = tar_atol10(value, strlen(value)); archive_entry_set_size(entry, tar->realsize); + } else if (strncmp(key, "SCHILY.xattr.", 13) == 0) { + pax_attribute_schily_xattr(entry, key, value, + value_length); } else if (strcmp(key, "SUN.holesdata") == 0) { /* A Solaris extension for sparse. */ r = solaris_sparse_parse(a, tar, entry, value); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_warc.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_warc.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_support_format_warc.c Tue Jan 10 21:59:35 2017 (r311903) @@ -88,7 +88,7 @@ typedef enum { WT_RVIS, /* conversion, unsupported */ WT_CONV, - /* continutation, unsupported at the moment */ + /* continuation, unsupported at the moment */ WT_CONT, /* invalid type */ LAST_WT @@ -562,7 +562,7 @@ xstrpisotime(const char *s, char **endpt goto out; } - /* massage TM to fulfill some of POSIX' contraints */ + /* massage TM to fulfill some of POSIX' constraints */ tm.tm_year -= 1900; tm.tm_mon--; Modified: head/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Tue Jan 10 21:59:35 2017 (r311903) @@ -199,7 +199,7 @@ struct zip { struct trad_enc_ctx tctx; char tctx_valid; - /* WinZip AES decyption. */ + /* WinZip AES decryption. */ /* Contexts used for AES decryption. */ archive_crypto_ctx cctx; char cctx_valid; @@ -242,7 +242,7 @@ trad_enc_update_keys(struct trad_enc_ctx } static uint8_t -trad_enc_decypt_byte(struct trad_enc_ctx *ctx) +trad_enc_decrypt_byte(struct trad_enc_ctx *ctx) { unsigned temp = ctx->keys[2] | 2; return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff; @@ -257,7 +257,7 @@ trad_enc_decrypt_update(struct trad_enc_ max = (unsigned)((in_len < out_len)? in_len: out_len); for (i = 0; i < max; i++) { - uint8_t t = in[i] ^ trad_enc_decypt_byte(ctx); + uint8_t t = in[i] ^ trad_enc_decrypt_byte(ctx); out[i] = t; trad_enc_update_keys(ctx, t); } @@ -710,7 +710,7 @@ process_extra(struct archive_read *a, co break; } case 0x9901: - /* WinZIp AES extra data field. */ + /* WinZip AES extra data field. */ if (p[offset + 2] == 'A' && p[offset + 3] == 'E') { /* Vendor version. */ zip_entry->aes_extra.vendor = @@ -1518,7 +1518,7 @@ read_decryption_header(struct archive_re case 0x6720:/* Blowfish */ case 0x6721:/* Twofish */ case 0x6801:/* RC4 */ - /* Suuported encryption algorithm. */ + /* Supported encryption algorithm. */ break; default: archive_set_error(&a->archive, @@ -1627,7 +1627,7 @@ read_decryption_header(struct archive_re __archive_read_consume(a, 4); /*return (ARCHIVE_OK); - * This is not fully implemnted yet.*/ + * This is not fully implemented yet.*/ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Encrypted file is unsupported"); return (ARCHIVE_FAILED); @@ -1709,7 +1709,7 @@ init_traditional_PKWARE_decryption(struc } /* - * Initialize ctx for Traditional PKWARE Decyption. + * Initialize ctx for Traditional PKWARE Decryption. */ r = trad_enc_init(&zip->tctx, passphrase, strlen(passphrase), p, ENC_HEADER_SIZE, &crcchk); Modified: head/contrib/libarchive/libarchive/archive_string.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_string.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_string.c Tue Jan 10 21:59:35 2017 (r311903) @@ -219,6 +219,12 @@ archive_wstring_append(struct archive_ws return (as); } +struct archive_string * +archive_array_append(struct archive_string *as, const char *p, size_t s) +{ + return archive_string_append(as, p, s); +} + void archive_string_concat(struct archive_string *dest, struct archive_string *src) { @@ -597,7 +603,7 @@ archive_wstring_append_from_mbs(struct a wcs = dest->s + dest->length; /* * We cannot use mbsrtowcs/mbstowcs here because those may convert - * extra MBS when strlen(p) > len and one wide character consis of + * extra MBS when strlen(p) > len and one wide character consists of * multi bytes. */ while (*mbs && mbs_length > 0) { @@ -1248,7 +1254,7 @@ create_sconv_object(const char *fc, cons sc->cd = iconv_open(tc, fc); if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) { /* - * Unfortunaly, all of iconv implements do support + * Unfortunately, all of iconv implements do support * "CP932" character-set, so we should use "SJIS" * instead if iconv_open failed. */ @@ -1261,7 +1267,7 @@ create_sconv_object(const char *fc, cons /* * archive_mstring on Windows directly convert multi-bytes * into archive_wstring in order not to depend on locale - * so that you can do a I18N programing. This will be + * so that you can do a I18N programming. This will be * used only in archive_mstring_copy_mbs_len_l so far. */ if (flag & SCONV_FROM_CHARSET) { @@ -1726,7 +1732,7 @@ archive_string_conversion_from_charset(s * in tar or zip files. But mbstowcs/wcstombs(CRT) usually use CP_ACP * unless you use setlocale(LC_ALL, ".OCP")(specify CP_OEMCP). * So we should make a string conversion between CP_ACP and CP_OEMCP - * for compatibillty. + * for compatibility. */ #if defined(_WIN32) && !defined(__CYGWIN__) struct archive_string_conv * @@ -2220,7 +2226,7 @@ best_effort_strncat_in_locale(struct arc /* * If a character is ASCII, this just copies it. If not, this - * assigns '?' charater instead but in UTF-8 locale this assigns + * assigns '?' character instead but in UTF-8 locale this assigns * byte sequence 0xEF 0xBD 0xBD, which are code point U+FFFD, * a Replacement Character in Unicode. */ @@ -2554,7 +2560,7 @@ utf16_to_unicode(uint32_t *pwc, const ch /* * Surrogate pair values(0xd800 through 0xdfff) are only - * used by UTF-16, so, after above culculation, the code + * used by UTF-16, so, after above calculation, the code * must not be surrogate values, and Unicode has no codes * larger than 0x10ffff. Thus, those are not legal Unicode * values. @@ -2903,7 +2909,7 @@ get_nfc(uint32_t uc, uint32_t uc2) /* * Normalize UTF-8/UTF-16BE characters to Form C and copy the result. * - * TODO: Convert composition exclusions,which are never converted + * TODO: Convert composition exclusions, which are never converted * from NFC,NFD,NFKC and NFKD, to Form C. */ static int @@ -3437,7 +3443,7 @@ strncat_from_utf8_libarchive2(struct arc } /* - * As libarchie 2.x, translates the UTF-8 characters into + * As libarchive 2.x, translates the UTF-8 characters into * wide-characters in the assumption that WCS is Unicode. */ if (n < 0) { @@ -3947,7 +3953,7 @@ archive_mstring_get_mbs_l(struct archive #if defined(_WIN32) && !defined(__CYGWIN__) /* - * Internationalization programing on Windows must use Wide + * Internationalization programming on Windows must use Wide * characters because Windows platform cannot make locale UTF-8. */ if (sc != NULL && (aes->aes_set & AES_SET_WCS) != 0) { @@ -4079,7 +4085,7 @@ archive_mstring_copy_mbs_len_l(struct ar archive_string_empty(&(aes->aes_utf8)); #if defined(_WIN32) && !defined(__CYGWIN__) /* - * Internationalization programing on Windows must use Wide + * Internationalization programming on Windows must use Wide * characters because Windows platform cannot make locale UTF-8. */ if (sc == NULL) { Modified: head/contrib/libarchive/libarchive/archive_string.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_string.h Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_string.h Tue Jan 10 21:59:35 2017 (r311903) @@ -81,6 +81,10 @@ archive_strappend_char(struct archive_st struct archive_wstring * archive_wstrappend_wchar(struct archive_wstring *, wchar_t); +/* Append a raw array to an archive_string, resizing as necessary */ +struct archive_string * +archive_array_append(struct archive_string *, const char *, size_t); + /* Convert a Unicode string to current locale and append the result. */ /* Returns -1 if conversion fails. */ int Modified: head/contrib/libarchive/libarchive/archive_string_composition.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_string_composition.h Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_string_composition.h Tue Jan 10 21:59:35 2017 (r311903) @@ -1009,7 +1009,7 @@ static const char u_decomposable_blocks[ (((uc) > 0x1D244)?0:\ ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F]) -/* The table of the value of Canonical Cimbining Class */ +/* The table of the value of Canonical Combining Class */ static const unsigned char ccc_val[][16] = { /* idx=0: XXXX0 - XXXXF */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, Modified: head/contrib/libarchive/libarchive/archive_write.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_write.c Tue Jan 10 21:59:35 2017 (r311903) @@ -231,7 +231,7 @@ __archive_write_filter(struct archive_wr if (length == 0) return(ARCHIVE_OK); if (f->write == NULL) - /* If unset, a fatal error has already ocuured, so this filter + /* If unset, a fatal error has already occurred, so this filter * didn't open. We cannot write anything. */ return(ARCHIVE_FATAL); r = (f->write)(f, buff, length); Modified: head/contrib/libarchive/libarchive/archive_write_add_filter_xz.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_add_filter_xz.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_write_add_filter_xz.c Tue Jan 10 21:59:35 2017 (r311903) @@ -233,7 +233,7 @@ archive_compressor_xz_init_stream(struct if (f->code == ARCHIVE_FILTER_XZ) { #ifdef HAVE_LZMA_STREAM_ENCODER_MT if (data->threads != 1) { - bzero(&mt_options, sizeof(mt_options)); + memset(&mt_options, 0, sizeof(mt_options)); mt_options.threads = data->threads; mt_options.timeout = 300; mt_options.filters = data->lzmafilters; Modified: head/contrib/libarchive/libarchive/archive_write_disk_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_acl.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_write_disk_acl.c Tue Jan 10 21:59:35 2017 (r311903) @@ -124,7 +124,10 @@ static struct { {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT}, - {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY} + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}, + {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED} }; #endif @@ -292,29 +295,41 @@ set_acl(struct archive *a, int fd, const } /* Try restoring the ACL through 'fd' if we can. */ -#if HAVE_ACL_SET_FD - if (fd >= 0 && acl_type == ACL_TYPE_ACCESS && acl_set_fd(fd, acl) == 0) - ret = ARCHIVE_OK; - else -#else +#if HAVE_ACL_SET_FD_NP || HAVE_ACL_SET_FD #if HAVE_ACL_SET_FD_NP - if (fd >= 0 && acl_set_fd_np(fd, acl, acl_type) == 0) - ret = ARCHIVE_OK; - else -#endif -#endif + if (fd >= 0) { + if (acl_set_fd_np(fd, acl, acl_type) == 0) +#else /* HAVE_ACL_SET_FD */ + if (fd >= 0 && acl_type == ACL_TYPE_ACCESS) { + if (acl_set_fd(fd, acl) == 0) +#endif + ret = ARCHIVE_OK; + else { + if (errno == EOPNOTSUPP) { + /* Filesystem doesn't support ACLs */ + ret = ARCHIVE_OK; + } else { + archive_set_error(a, errno, + "Failed to set %s acl on fd", tname); + } + } + } else +#endif /* HAVE_ACL_SET_FD_NP || HAVE_ACL_SET_FD */ #if HAVE_ACL_SET_LINK_NP - if (acl_set_link_np(name, acl_type, acl) != 0) { - archive_set_error(a, errno, "Failed to set %s acl", tname); - ret = ARCHIVE_WARN; - } + if (acl_set_link_np(name, acl_type, acl) != 0) { #else /* TODO: Skip this if 'name' is a symlink. */ if (acl_set_file(name, acl_type, acl) != 0) { - archive_set_error(a, errno, "Failed to set %s acl", tname); - ret = ARCHIVE_WARN; - } #endif + if (errno == EOPNOTSUPP) { + /* Filesystem doesn't support ACLs */ + ret = ARCHIVE_OK; + } else { + archive_set_error(a, errno, "Failed to set %s acl", + tname); + ret = ARCHIVE_WARN; + } + } exit_free: acl_free(acl); return (ret); Modified: head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c Tue Jan 10 21:59:35 2017 (r311903) @@ -1358,7 +1358,7 @@ make_header(struct archive_write *a, uin if (r < 0) return (r); - /* Write Nume size. */ + /* Write Name size. */ r = enc_uint64(a, zip->total_bytes_entry_name+1); if (r < 0) return (r); Modified: head/contrib/libarchive/libarchive/archive_write_set_format_pax.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_pax.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_write_set_format_pax.c Tue Jan 10 21:59:35 2017 (r311903) @@ -62,10 +62,17 @@ struct pax { struct sparse_block *sparse_tail; struct archive_string_conv *sconv_utf8; int opt_binary; + + unsigned flags; +#define WRITE_SCHILY_XATTR (1 << 0) +#define WRITE_LIBARCHIVE_XATTR (1 << 1) }; static void add_pax_attr(struct archive_string *, const char *key, const char *value); +static void add_pax_attr_binary(struct archive_string *, + const char *key, + const char *value, size_t value_len); static void add_pax_attr_int(struct archive_string *, const char *key, int64_t value); static void add_pax_attr_time(struct archive_string *, @@ -136,6 +143,8 @@ archive_write_set_format_pax(struct arch "Can't allocate pax data"); return (ARCHIVE_FATAL); } + pax->flags = WRITE_LIBARCHIVE_XATTR | WRITE_SCHILY_XATTR; + a->format_data = pax; a->format_name = "pax"; a->format_options = archive_write_pax_options; @@ -275,6 +284,17 @@ add_pax_attr_int(struct archive_string * static void add_pax_attr(struct archive_string *as, const char *key, const char *value) { + add_pax_attr_binary(as, key, value, strlen(value)); +} + +/* + * Add a key/value attribute to the pax header. This function handles + * binary values. + */ +static void +add_pax_attr_binary(struct archive_string *as, const char *key, + const char *value, size_t value_len) +{ int digits, i, len, next_ten; char tmp[1 + 3 * sizeof(int)]; /* < 3 base-10 digits per byte */ @@ -282,7 +302,7 @@ add_pax_attr(struct archive_string *as, * PAX attributes have the following layout: * <=> */ - len = 1 + (int)strlen(key) + 1 + (int)strlen(value) + 1; + len = 1 + (int)strlen(key) + 1 + (int)value_len + 1; /* * The field includes the length of the field, so @@ -313,21 +333,47 @@ add_pax_attr(struct archive_string *as, archive_strappend_char(as, ' '); archive_strcat(as, key); archive_strappend_char(as, '='); - archive_strcat(as, value); + archive_array_append(as, value, value_len); archive_strappend_char(as, '\n'); } +static void +archive_write_pax_header_xattr(struct pax *pax, const char *encoded_name, + const void *value, size_t value_len) +{ + struct archive_string s; + char *encoded_value; + + if (pax->flags & WRITE_LIBARCHIVE_XATTR) { + encoded_value = base64_encode((const char *)value, value_len); + + if (encoded_name != NULL && encoded_value != NULL) { + archive_string_init(&s); + archive_strcpy(&s, "LIBARCHIVE.xattr."); + archive_strcat(&s, encoded_name); + add_pax_attr(&(pax->pax_header), s.s, encoded_value); + archive_string_free(&s); + } + free(encoded_value); + } + if (pax->flags & WRITE_SCHILY_XATTR) { + archive_string_init(&s); + archive_strcpy(&s, "SCHILY.xattr."); + archive_strcat(&s, encoded_name); + add_pax_attr_binary(&(pax->pax_header), s.s, value, value_len); + archive_string_free(&s); + } +} + static int archive_write_pax_header_xattrs(struct archive_write *a, struct pax *pax, struct archive_entry *entry) { - struct archive_string s; int i = archive_entry_xattr_reset(entry); while (i--) { const char *name; const void *value; - char *encoded_value; char *url_encoded_name = NULL, *encoded_name = NULL; size_t size; int r; @@ -348,16 +394,9 @@ archive_write_pax_header_xattrs(struct a } } - encoded_value = base64_encode((const char *)value, size); + archive_write_pax_header_xattr(pax, encoded_name, + value, size); - if (encoded_name != NULL && encoded_value != NULL) { - archive_string_init(&s); - archive_strcpy(&s, "LIBARCHIVE.xattr."); - archive_strcat(&s, encoded_name); - add_pax_attr(&(pax->pax_header), s.s, encoded_value); - archive_string_free(&s); - } - free(encoded_value); } return (ARCHIVE_OK); } Modified: head/contrib/libarchive/libarchive/archive_write_set_format_xar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_xar.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_write_set_format_xar.c Tue Jan 10 21:59:35 2017 (r311903) @@ -2913,7 +2913,7 @@ compression_init_encoder_xz(struct archi *strm = lzma_init_data; #ifdef HAVE_LZMA_STREAM_ENCODER_MT if (threads > 1) { - bzero(&mt_options, sizeof(mt_options)); + memset(&mt_options, 0, sizeof(mt_options)); mt_options.threads = threads; mt_options.timeout = 300; mt_options.filters = lzmafilters; Modified: head/contrib/libarchive/libarchive/archive_write_set_format_zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_zip.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/archive_write_set_format_zip.c Tue Jan 10 21:59:35 2017 (r311903) @@ -878,7 +878,7 @@ archive_write_zip_header(struct archive_ || zip->entry_encryption == ENCRYPTION_WINZIP_AES256)) { memcpy(e, "\001\231\007\000\001\000AE", 8); - /* AES vendoer version AE-2 does not store a CRC. + /* AES vendor version AE-2 does not store a CRC. * WinZip 11 uses AE-1, which does store the CRC, * but it does not store the CRC when the file size * is less than 20 bytes. So we simulate what @@ -1013,7 +1013,7 @@ archive_write_zip_data(struct archive_wr if (zip->entry_flags & ZIP_ENTRY_FLAG_ENCRYPTED) { switch (zip->entry_encryption) { case ENCRYPTION_TRADITIONAL: - /* Initialize traditoinal PKWARE encryption context. */ + /* Initialize traditional PKWARE encryption context. */ if (!zip->tctx_valid) { ret = init_traditional_pkware_encryption(a); if (ret != ARCHIVE_OK) @@ -1499,7 +1499,7 @@ trad_enc_update_keys(struct trad_enc_ctx } static uint8_t -trad_enc_decypt_byte(struct trad_enc_ctx *ctx) +trad_enc_decrypt_byte(struct trad_enc_ctx *ctx) { unsigned temp = ctx->keys[2] | 2; return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff; @@ -1515,7 +1515,7 @@ trad_enc_encrypt_update(struct trad_enc_ for (i = 0; i < max; i++) { uint8_t t = in[i]; - out[i] = t ^ trad_enc_decypt_byte(ctx); + out[i] = t ^ trad_enc_decrypt_byte(ctx); trad_enc_update_keys(ctx, t); } return i; @@ -1626,7 +1626,7 @@ init_winzip_aes_encryption(struct archiv return (ARCHIVE_FAILED); } - /* Set a passowrd verification value after the 'salt'. */ + /* Set a password verification value after the 'salt'. */ salt[salt_len] = derived_key[key_len * 2]; salt[salt_len + 1] = derived_key[key_len * 2 + 1]; Modified: head/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c Tue Jan 10 21:59:35 2017 (r311903) @@ -191,7 +191,7 @@ DEFINE_TEST(test_archive_read_add_passph /* Fist call, we should get "passCallBack" as a passphrase. */ assertEqualString("passCallBack", __archive_read_next_passphrase(ar)); __archive_read_reset_passphrase(ar); - /* After reset passphrase, we should get "passCallBack"passphrase. */ + /* After reset passphrase, we should get "passCallBack" passphrase. */ assertEqualString("passCallBack", __archive_read_next_passphrase(ar)); /* Second call, we should get NULL which means all the passphrases * are passed already. */ Modified: head/contrib/libarchive/libarchive/test/test_compat_uudecode.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_compat_uudecode.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/test/test_compat_uudecode.c Tue Jan 10 21:59:35 2017 (r311903) @@ -40,7 +40,7 @@ static char archive_data[] = { }; /* - * Compatibility: uudecode command ignores junk data placed ater the "end" + * Compatibility: uudecode command ignores junk data placed after the "end" * marker. */ DEFINE_TEST(test_compat_uudecode) Modified: head/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c Tue Jan 10 21:59:35 2017 (r311903) @@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$"); /* -ecute the following to rebuild the data for this program: +execute the following to rebuild the data for this program: tail -n +33 test_read_format_cpio_afio.c | /bin/sh # How to make a sample data. Modified: head/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c Tue Jan 10 21:59:35 2017 (r311903) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_read_format_zip_traditional_encryption_data) { - /* This file is password protected (Traditional PKWARE Enctypted). + /* This file is password protected (Traditional PKWARE Encrypted). The headers are NOT encrypted. Password is "12345678". */ const char *refname = "test_read_format_zip_traditional_encryption_data.zip"; @@ -36,7 +36,7 @@ DEFINE_TEST(test_read_format_zip_traditi struct archive *a; char buff[512]; - /* Check if running system has cryptographic functionarity. */ + /* Check if running system has cryptographic functionality. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); Modified: head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c Tue Jan 10 21:59:35 2017 (r311903) @@ -33,7 +33,7 @@ test_winzip_aes(const char *refname, int struct archive *a; char buff[512]; - /* Check if running system has cryptographic functionarity. */ + /* Check if running system has cryptographic functionality. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); Modified: head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c Tue Jan 10 21:52:48 2017 (r311902) +++ head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c Tue Jan 10 21:59:35 2017 (r311903) @@ -34,7 +34,7 @@ DEFINE_TEST(test_read_format_zip_winzip_ char buff[512]; - /* Check if running system has cryptographic functionarity. */ + /* Check if running system has cryptographic functionality. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); Copied: head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c (from r311899, vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c Tue Jan 10 21:59:35 2017 (r311903, copy of r311899, vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.c) @@ -0,0 +1,70 @@ +/*- + * Copyright (c) 2016 IBM Corporation + * Copyright (c) 2003-2007 Tim Kientzle + * + * 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(S) ``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(S) 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 test case's code has been derived from test_entry.c + */ +#include "test.h" + +DEFINE_TEST(test_schily_xattr_pax) +{ + struct archive *a; + struct archive_entry *ae; + const char *refname = "test_read_pax_schily_xattr.tar"; + const char *xname; /* For xattr tests. */ + const void *xval; /* For xattr tests. */ + size_t xsize; /* For xattr tests. */ + const char *string, *array; + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + + extract_reference_file(refname); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, refname, 10240)); + + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(2, archive_entry_xattr_count(ae)); + assertEqualInt(2, archive_entry_xattr_reset(ae)); + + assertEqualInt(0, archive_entry_xattr_next(ae, &xname, &xval, &xsize)); + assertEqualString(xname, "security.selinux"); + string = "system_u:object_r:unlabeled_t:s0"; + assertEqualString(xval, string); + /* the xattr's value also contains the terminating \0 */ + assertEqualInt((int)xsize, strlen(string) + 1); + + assertEqualInt(0, archive_entry_xattr_next(ae, &xname, &xval, &xsize)); + assertEqualString(xname, "security.ima"); + assertEqualInt((int)xsize, 265); + /* we only compare the first 12 bytes */ + array = "\x03\x02\x04\xb0\xe9\xd6\x79\x01\x00\x2b\xad\x1e"; + assertEqualMem(xval, array, 12); + + /* Close the archive. */ + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} Copied: head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu (from r311899, vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.tar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu Tue Jan 10 21:59:35 2017 (r311903, copy of r311899, vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.tar.uu) @@ -0,0 +1,231 @@ +begin 644 test_schily_xattr_pax.tar +M+B]087A(96%D97)S+C$U,C4O8V]N9F9I;&5S```````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````#`P,#`V-#0`,#`P,#`P,``P,#`P,#`P`#`P,#`P,#`P-C0W +M`#$R-S$R,C$P-3`V`#`Q,C4V-@`@>``````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````!UW6X5O?Y6: +M9^':P2MZR[4)$@W?)B6GX0U@<,0M%6YNMO%OG+IS%/.< +M,"A(N&S.F9]=!*5=\).X."2$GUGJ,0C:@+G#$M_E8UQP,LU-G(8IKW^K^<8* +M*3_.N0'%8.^$8S$`D9XOF+DK<<)U34U'_"O5/22YS96QI;G5X +M/7-Y Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9068BCAA230; Tue, 10 Jan 2017 22:00:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id 003441301; Tue, 10 Jan 2017 22:00:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include To: John Baldwin , "Conrad E. Meyer" References: <201701080626.v086QXDx022252@repo.freebsd.org> <7685799.RHuinLcsJW@ralph.baldwin.cx> <53d948ef-9e7e-422f-aead-39437abc8352@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jung-uk Kim Message-ID: <0e8abb94-160a-7ca2-1c67-3d3ef8fa522e@FreeBSD.org> Date: Tue, 10 Jan 2017 17:00:49 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <53d948ef-9e7e-422f-aead-39437abc8352@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 22:00:50 -0000 On 01/09/2017 13:01, Jung-uk Kim wrote: > On 01/09/2017 12:08, John Baldwin wrote: >> On Sunday, January 08, 2017 06:26:33 AM Conrad E. Meyer wrote: >>> Author: cem >>> Date: Sun Jan 8 06:26:33 2017 >>> New Revision: 311667 >>> URL: https://svnweb.freebsd.org/changeset/base/311667 >>> >>> Log: >>> Add some additional ACPI methods for DRM >>> >>> Add AcpiGetDataFull and AcpiGetTableWithSize. >>> >>> Submitted by: Matt Macy >> >> Have these been submitted upstream? The Intel folks are generally quite >> responsive on freebsd-acpi@FreeBSD.org and this codebase is actively >> maintained externally. > > Please submit upstream first. > > https://github.com/acpica/acpica Since nobody responded, I just googled about it. It seems these two functions, AcpiGetDataFull() (aka. acpi_get_data_full() in Linux) and AcpiGetTableWithSize() (aka. acpi_get_table_with_size() in Linux), were only added in linux-pm tree and we only need them for "Graphics" repository. - AcpiGetDataFull() This function is only called by acpi_get_device_data(), which is, in turn, only called by acpi_bus_get_device() with *NULL* callback. Therefore, I don't see any reason to pollute contrib code for this. - AcpiGetTableWithSize() This API is now deprecated by the upstream: http://marc.info/?l=linux-acpi&m=148169906815835 http://marc.info/?l=linux-acpi&m=148169907615836 http://marc.info/?l=linux-acpi&m=148169908115837 http://marc.info/?l=linux-acpi&m=148169908615838 http://marc.info/?l=linux-acpi&m=148169909215840 The code changes were committed to both ACPICA: https://github.com/acpica/acpica/commit/cac67909 and committed to linux-pm tree: https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit?id=6b11d1d677132816252004426ef220ccd3c92d2f This means it will be removed from future Linux kernel. Therefore, we should NOT implement the deprecated API. Please back out r311667 and r311843 and let me know if you need any help in resolving this matter. Jung-uk Kim From owner-svn-src-all@freebsd.org Tue Jan 10 22:01:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B9D8CAA2CA; Tue, 10 Jan 2017 22:01:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1BA0170B; Tue, 10 Jan 2017 22:01:38 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AM1cD5004247; Tue, 10 Jan 2017 22:01:38 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AM1cUX004246; Tue, 10 Jan 2017 22:01:38 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201701102201.v0AM1cUX004246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 10 Jan 2017 22:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311904 - head/lib/libarchive/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 22:01:39 -0000 Author: mm Date: Tue Jan 10 22:01:37 2017 New Revision: 311904 URL: https://svnweb.freebsd.org/changeset/base/311904 Log: Build libarchive tests missing in r311899 MFC after: 1 week X-MFC with: r311899 Modified: head/lib/libarchive/tests/Makefile Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Tue Jan 10 21:59:35 2017 (r311903) +++ head/lib/libarchive/tests/Makefile Tue Jan 10 22:01:37 2017 (r311904) @@ -196,6 +196,7 @@ TESTS_SRCS= \ test_read_format_zip_winzip_aes_large.c \ test_read_format_zip_zip64.c \ test_read_large.c \ + test_read_pax_schily_xattr.c \ test_read_pax_truncated.c \ test_read_position.c \ test_read_set_format.c \ @@ -549,6 +550,7 @@ ${PACKAGE}FILES+= test_read_large_splitt ${PACKAGE}FILES+= test_read_large_splitted_rar_ac.uu ${PACKAGE}FILES+= test_read_large_splitted_rar_ad.uu ${PACKAGE}FILES+= test_read_large_splitted_rar_ae.uu +${PACKAGE}FILES+= test_read_pax_schily_xattr.tar.uu ${PACKAGE}FILES+= test_read_splitted_rar_aa.uu ${PACKAGE}FILES+= test_read_splitted_rar_ab.uu ${PACKAGE}FILES+= test_read_splitted_rar_ac.uu From owner-svn-src-all@freebsd.org Tue Jan 10 23:14:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C995CCA97A5; Tue, 10 Jan 2017 23:14:13 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FBF5101C; Tue, 10 Jan 2017 23:14:13 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x242.google.com with SMTP id r144so24393337wme.0; Tue, 10 Jan 2017 15:14:13 -0800 (PST) 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=UpNuHVgeqMsT2Mq8GPzbfer4xL7RvC7CMabmXaXLgSU=; b=TU+icee8yK5Hw4dybjdgR1ebvS3ZVuu27NtbAwchHYw3lwHN4IeTwuaqDzIro8YSMx UKV9XGjEjuTnTHUITapw1HCunOmlRm49i5839M7k858FOgbclW0efyuT/OZYBHEgFFaR zkeM/sm8NLlTkp6/M5LaX3pvCwORImEbJDfIp/XKmB6HOMr+i9HkfOyjI4YXEVaS50ER mvXMXB1IVWm0PI6N7FbjXkL9i2VqrDhkDhA5npbHgh2d2HM0DjVZsTeEsqI9hfCauWgG D3osjhOgyNiKVpZ5k7E7Mo9BN7e35y0WLxDxKnSJdS4qkfh/UcXE2rLOpQ1r0IZL//AR jABQ== 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=UpNuHVgeqMsT2Mq8GPzbfer4xL7RvC7CMabmXaXLgSU=; b=IDuTmtYFgldBkAx7HvOfAIZfS3lZE1bTs2ngmZt2QArFuwcOvJEvrHchafFkkpcrMv ywvl87dGlRessWTAoir1arACr6kji4h6JKkTx2iOwyZhOGc4wC17uOTJ6uBjwn+AU50b epbF17vs1wVC7HCPjmytPwq6D6Bmqvdxa6qi2hkwStg9VYONl7i035tU6GklvRzWsaxW nSZxvrRPVYPB57tb92oAlw2Ein4ptDKsR2lDjQ4HV4EhN8hJEK/GDG7QHvjDLOMkbV8W ue6dpR7A1070EOIgbWu45NqQ3tuS/cTA9UHQ5tlOP7y+gvhCsQexvxEHEgI2l0kQ7S6i tJGQ== X-Gm-Message-State: AIkVDXJn1LSoovZzxfFod5mZLKWGSl1kLUJnPJaxKZNzZL/tB6C6ym06lNCO8iinc9nNejmXPr/m+8gtZBTg8g== X-Received: by 10.28.139.131 with SMTP id n125mr1208353wmd.116.1484090051387; Tue, 10 Jan 2017 15:14:11 -0800 (PST) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.194.82.162 with HTTP; Tue, 10 Jan 2017 15:14:10 -0800 (PST) In-Reply-To: <20170110172336.phqcy57zszifujaj@mutt-hardenedbsd> References: <201701100721.v0A7L7ip039127@repo.freebsd.org> <20170110172336.phqcy57zszifujaj@mutt-hardenedbsd> From: Adrian Chadd Date: Tue, 10 Jan 2017 15:14:10 -0800 X-Google-Sender-Auth: Rq0o6j5g0NsNXFtyZWQjtO3qJ8I Message-ID: Subject: Re: svn commit: r311860 - head/sys/net80211 To: Shawn Webb Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 23:14:13 -0000 Yeah, oops! Thanks for getting it fixed! -adrian On 10 January 2017 at 09:23, Shawn Webb wrote: > On Tue, Jan 10, 2017 at 07:21:07AM +0000, Adrian Chadd wrote: >> Author: adrian >> Date: Tue Jan 10 07:21:07 2017 >> New Revision: 311860 >> URL: https://svnweb.freebsd.org/changeset/base/311860 >> >> Log: >> [net80211] add VHT action frame placeholders for when it's time to implement. >> >> Modified: >> head/sys/net80211/ieee80211_vht.c >> >> Modified: head/sys/net80211/ieee80211_vht.c >> ============================================================================== >> --- head/sys/net80211/ieee80211_vht.c Tue Jan 10 05:37:53 2017 (r311859) >> +++ head/sys/net80211/ieee80211_vht.c Tue Jan 10 07:21:07 2017 (r311860) >> @@ -85,9 +85,49 @@ __FBSDID("$FreeBSD$"); >> * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further details. >> */ >> >> +static int >> +vht_recv_action_placeholder(struct ieee80211_node *ni, >> + const struct ieee80211_frame *wh, >> + const uint8_t *frm, const uint8_t *efrm) >> +{ >> + >> + ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x", >> + __func__, >> + wh->i_fc[0], >> + wh->i_fc[1]); >> + >> + return (0); >> +} >> + >> +static int >> +vht_send_action_placeholder(struct ieee80211_node *ni, >> + int category, int action, void *arg0) >> +{ >> + >> + ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d", >> + __func__, >> + category, >> + action); >> + return (EINVAL); >> +} >> + > > This broke the build for kernel configurations that don't have the > IEEE80211_DEBUG option set. ieee80211_note is only a valid function when > IEEE80211_DEBUG is defined. > > Thanks, > > -- > Shawn Webb > Cofounder and Security Engineer > HardenedBSD > > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE From owner-svn-src-all@freebsd.org Tue Jan 10 23:15:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8849DCA984F; Tue, 10 Jan 2017 23:15:03 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (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 1FBEB119D; Tue, 10 Jan 2017 23:15:03 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id l2so33299470wml.2; Tue, 10 Jan 2017 15:15:03 -0800 (PST) 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=vimiJXlCgOgHqAbNQMlndjXnk8Mhdkn0XIze0+ulatg=; b=r1GCWGuOAVw0ALaw59txCBykrSXILDxOPp6EDE1rP3JzyzTj4X4qEDoBNObMPER1px Vm1ae5HtEdVuB+TzZ0tMXWImrZCHj5oDyyRsPUTtA6DYCDgr6qLuaDHP0DOBIZ2uK609 F5B1NZ/NKsXXKro+EIDJWDULRuKzNuJDp7k6cag+cHalb7qAtq03FIwLrrJpBynBN5BY ix5peVhDfv4XmU59hGF9gAbW6nGmoWibvpOJsL1ORFrwRofVJ5VEvqUPMLPE/DTi4LY0 6KXFzzTZujPdO2VAcxupQeNOUeocZg3KLaDNshaz4R7pe1ZY7KdMFULRGzkjB1ABVgWp giuw== 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=vimiJXlCgOgHqAbNQMlndjXnk8Mhdkn0XIze0+ulatg=; b=pLS6BR7WRtt1zTPkTBa9cHfR/mxcOFbLPzO5qtLNaRK7Qf3uav1GUuM4jVTZXQx844 4E2wP8wRlaMpThCm3ymEbiEnob/tv+2E3dmW6z7U4viTna1phF3XAjxLvEltTlhgq5Wu hT9BcSjaT/jVkd5dqbYO2VNHghXnpOScvkvLDDivlQR9PE6M/aMN4MEssQwhVowtJSnu mTJaE8HrOfIJjmvzbtXlFDUeHdl+Y0DA/f5l5kuzECmtSz3ITFH7XpnlrMvEld8LMKWg +MUzzMcfATocKzxwGZLpVMp1OfMZ/rh1T2ntGf97tSkVFm/m6HCA+JmuGIL6lZ8RClLe 4DaA== X-Gm-Message-State: AIkVDXIMKCk4PiUAJviBj++vTmgGORAm45USdbAKRno1T//w1pCe9LEgOOgHDSMaYKpxKxq8uKKCEUmndwQGFg== X-Received: by 10.28.100.132 with SMTP id y126mr3110320wmb.116.1484090100987; Tue, 10 Jan 2017 15:15:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.82.162 with HTTP; Tue, 10 Jan 2017 15:14:59 -0800 (PST) In-Reply-To: <201701101928.v0AJSeqN040525@repo.freebsd.org> References: <201701101928.v0AJSeqN040525@repo.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jan 2017 15:14:59 -0800 Message-ID: Subject: Re: svn commit: r311887 - head/sys/net80211 To: Sergey Kandaurov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 23:15:03 -0000 Thanks! (I should make a debug vap printf that doesn't include the MAC/node requirements so this stuff is easier..) -adrian On 10 January 2017 at 11:28, Sergey Kandaurov wrote: > Author: pluknet > Date: Tue Jan 10 19:28:40 2017 > New Revision: 311887 > URL: https://svnweb.freebsd.org/changeset/base/311887 > > Log: > Fix build without IEEE80211_DEBUG. > > Reported by: many > > Modified: > head/sys/net80211/ieee80211_vht.c > > Modified: head/sys/net80211/ieee80211_vht.c > ============================================================================== > --- head/sys/net80211/ieee80211_vht.c Tue Jan 10 19:26:55 2017 (r311886) > +++ head/sys/net80211/ieee80211_vht.c Tue Jan 10 19:28:40 2017 (r311887) > @@ -91,11 +91,12 @@ vht_recv_action_placeholder(struct ieee8 > const uint8_t *frm, const uint8_t *efrm) > { > > +#ifdef IEEE80211_DEBUG > ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x", > __func__, > wh->i_fc[0], > wh->i_fc[1]); > - > +#endif > return (0); > } > > @@ -104,10 +105,12 @@ vht_send_action_placeholder(struct ieee8 > int category, int action, void *arg0) > { > > +#ifdef IEEE80211_DEBUG > ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d", > __func__, > category, > action); > +#endif > return (EINVAL); > } > > From owner-svn-src-all@freebsd.org Tue Jan 10 23:17:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B23F6CA9A26; Tue, 10 Jan 2017 23:17:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x235.google.com (mail-qt0-x235.google.com [IPv6:2607:f8b0:400d:c0d::235]) (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 6F8191487; Tue, 10 Jan 2017 23:17:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x235.google.com with SMTP id v23so180416273qtb.0; Tue, 10 Jan 2017 15:17:28 -0800 (PST) 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=+vmPkFbmtzTTaUIsk/jGlyevV57EAey3u3aemUgLM94=; b=JTKQOlrUx0Fh5zFiHrWPX6Iftbj4nzJye/SbrDp+C2I4plPg11ghGwEx/3+evfZDk0 F2FwdeZKsnDWtNFZGcitR+o9/32yNmYAJTTuCUbwjkrQBdDE8oJbamFhv39ISkhJouOL Lmo2T85wFxOhtOL3SZVzPxOx/+2UadQd2XY+hrg0zCe9zvs357tZJ8eusDsc+4LvrZWh OgykdVcgKZYsQB593mPMlkngkXYBExAj0Wt6zAWgaCtQJUlxLbdvdODmTIw4hmq7ICQ5 rwzSOHG9TefMNv4Eo/6wi+N5J4O704Ffrx1r9OoilyjuvE8HxSiTcbm1Q3Hs1GBn7PO1 k/3w== 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=+vmPkFbmtzTTaUIsk/jGlyevV57EAey3u3aemUgLM94=; b=f8pYy6NKsytO2H+E67nrF/yHyMnlLc6uILCufNBM4BU5jlH1zGeNDxgr2BkoEST3Ca 4GsszLljJsvWc/gKodcuIbyhDlegIKfSpdXsw7GmXxKqTS0VMKnieyMSZZDzOpO0+QXH OETkaB7gCrJMAIl7DdKgO5Xu3zmUVSiibImvECT6Vj04QVAsInw8vGquKb6Tm57EHg1X tfIq5ZLEC15HzPzOTemjaXmfDyWXpKWDF/Cuik99w0T5PCWZsj0Vfop7cRmG7Yzdq6go VPRv6sY9o3qOjyPBAsFgYIz0byheus0BZ9Hym8goGtbOL2VtVfWOLlRkFaaAEkQ4QutL +Hdw== X-Gm-Message-State: AIkVDXI83BUTsvjC5Hk2azW3pGHqD5ux1h2SHiv6E4vaXYOgrhc+k9RawyGl3G3RLJtoR/qurchcO10bk/Lumw== X-Received: by 10.200.42.179 with SMTP id b48mr5492581qta.246.1484090247503; Tue, 10 Jan 2017 15:17:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.83.133 with HTTP; Tue, 10 Jan 2017 15:17:27 -0800 (PST) In-Reply-To: <201701101928.v0AJSeqN040525@repo.freebsd.org> References: <201701101928.v0AJSeqN040525@repo.freebsd.org> From: Ngie Cooper Date: Tue, 10 Jan 2017 15:17:27 -0800 Message-ID: Subject: Re: svn commit: r311887 - head/sys/net80211 To: Sergey Kandaurov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 23:17:28 -0000 On Tue, Jan 10, 2017 at 11:28 AM, Sergey Kandaurov wrote: > Author: pluknet > Date: Tue Jan 10 19:28:40 2017 > New Revision: 311887 > URL: https://svnweb.freebsd.org/changeset/base/311887 > > Log: > Fix build without IEEE80211_DEBUG. This may fix clang builds, but I anticipate gcc failures now because the parameters are unused. I think stub functions/macros should be added to workaround this issue. Thanks, -Ngie From owner-svn-src-all@freebsd.org Tue Jan 10 23:20:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5105CA9BCA; Tue, 10 Jan 2017 23:20:04 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wj0-x233.google.com (mail-wj0-x233.google.com [IPv6:2a00:1450:400c:c01::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 55035165B; Tue, 10 Jan 2017 23:20:04 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wj0-x233.google.com with SMTP id i20so90996234wjn.2; Tue, 10 Jan 2017 15:20:04 -0800 (PST) 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=SgG38Mv0giydJoJ0lAcqEkzmrR1tzNAxo3Cr+eUSA4E=; b=iwwFdibWDTVCnRq5QAHfTBANJe2bQHmYrp12qSiES2oBNmxZRYPGHugKGnCMN2v5yl yD0jW4RoYXVzGZs0GQJ8U5dPkG6diwcM8ReKlUb5945SSd88CQP4qPBSNfjbmEVq+1Im nkNs5qoXzLnA9KcOm02OsKnGUuLoe8kmMPWxMb8xH7XDgXQ/MfRhvnydZIFSpeYPblV2 UM3P6NKBhf20G/CSNwf6FqrkkvsAnTilUNAkKo5xv3mYGlX37L9oIS755gFViOMmBfCI lzHPG5CMUp+VWvPSalF8swffUq2NUrErt2aXS8AayyuHDjITB3SOUkfc6NjI2EimFMKZ 5UwQ== 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=SgG38Mv0giydJoJ0lAcqEkzmrR1tzNAxo3Cr+eUSA4E=; b=ZFrXYKqqnWRpECxMUECn3tLNAIc5m/GpmohPSWWvMzC9UTQB7anSptklG1LC+rpTSN 8JTleSWKg5csBhISZT26VZkrTXFrk0Lo+tF0g+wWo7Jai/1wRilPu/QF/r1T2G8xdtY9 Z7kSMcA5cxer+naMxEE884ZdPjiSD3+H4l+61Jm67TJE+9vp3Pf2NKAbTveADyXrf90x s5Lucy7yeuDN3//zm4tyQqKEtVO8RO/LI81ylCmWPM/NH1RaDl+0Guii/Ee2d75/U48F 5esyCV5amYmW5dxWMmkghE/DsYc9IPsb+B5VYTTwcgH799xOv5MDamzFMvxHeGNZJYZ9 IDmQ== X-Gm-Message-State: AIkVDXIKaHeCaCmFkO+VeZFy68+uC0MPLuT/svnsfNRqxMMYaOUGFWks3K+HfhvoIv4LxF9HEOZA7YNaCaa+0Q== X-Received: by 10.194.67.67 with SMTP id l3mr3414194wjt.151.1484090402796; Tue, 10 Jan 2017 15:20:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.82.162 with HTTP; Tue, 10 Jan 2017 15:20:01 -0800 (PST) In-Reply-To: References: <201701101928.v0AJSeqN040525@repo.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jan 2017 15:20:01 -0800 Message-ID: Subject: Re: svn commit: r311887 - head/sys/net80211 To: Ngie Cooper Cc: Sergey Kandaurov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 23:20:04 -0000 Yeah, give me a little while. I'm knee deep in water. -a On 10 January 2017 at 15:17, Ngie Cooper wrote: > On Tue, Jan 10, 2017 at 11:28 AM, Sergey Kandaurov wrote: >> Author: pluknet >> Date: Tue Jan 10 19:28:40 2017 >> New Revision: 311887 >> URL: https://svnweb.freebsd.org/changeset/base/311887 >> >> Log: >> Fix build without IEEE80211_DEBUG. > > This may fix clang builds, but I anticipate gcc failures now because > the parameters are unused. > > I think stub functions/macros should be added to workaround this issue. > > Thanks, > -Ngie > From owner-svn-src-all@freebsd.org Wed Jan 11 00:02:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF457CAAA08; Wed, 11 Jan 2017 00:02:52 +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 BC43919D8; Wed, 11 Jan 2017 00:02:52 +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 v0B02pcI056941; Wed, 11 Jan 2017 00:02:51 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B02pBP056938; Wed, 11 Jan 2017 00:02:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701110002.v0B02pBP056938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Jan 2017 00:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311906 - in head/sys/contrib/dev/acpica: components/namespace components/tables include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 00:02:53 -0000 Author: cem Date: Wed Jan 11 00:02:51 2017 New Revision: 311906 URL: https://svnweb.freebsd.org/changeset/base/311906 Log: Revert r311843, r311667 As jkim@ points out, it isn't needed. Modified: head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/include/acpixf.h Modified: head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c Tue Jan 10 22:13:44 2017 (r311905) +++ head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c Wed Jan 11 00:02:51 2017 (r311906) @@ -1022,25 +1022,23 @@ ACPI_EXPORT_SYMBOL (AcpiDetachData) /******************************************************************************* * - * FUNCTION: AcpiGetDataFull + * FUNCTION: AcpiGetData * * PARAMETERS: ObjHandle - Namespace node - * Handle - Handler used in call to attach_data + * Handler - Handler used in call to AttachData * Data - Where the data is returned - * Callback - function to execute before returning * * RETURN: Status * - * DESCRIPTION: Retrieve data that was previously attached to a namespace node - * and execute a callback before returning. + * DESCRIPTION: Retrieve data that was previously attached to a namespace node. * ******************************************************************************/ + ACPI_STATUS -AcpiGetDataFull ( +AcpiGetData ( ACPI_HANDLE ObjHandle, ACPI_OBJECT_HANDLER Handler, - void **Data, - void (*Callback)(void *)) + void **Data) { ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; @@ -1071,34 +1069,10 @@ AcpiGetDataFull ( } Status = AcpiNsGetAttachedData (Node, Handler, Data); - if (ACPI_SUCCESS(Status) && Callback) { - Callback(*Data); - } + UnlockAndExit: (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); return (Status); } -ACPI_EXPORT_SYMBOL (AcpiGetDataFull) -/******************************************************************************* - * - * FUNCTION: AcpiGetData - * - * PARAMETERS: ObjHandle - Namespace node - * Handler - Handler used in call to AttachData - * Data - Where the data is returned - * - * RETURN: Status - * - * DESCRIPTION: Retrieve data that was previously attached to a namespace node. - * - ******************************************************************************/ -ACPI_STATUS -AcpiGetData ( - ACPI_HANDLE ObjHandle, - ACPI_OBJECT_HANDLER Handler, - void **Data) -{ - return (AcpiGetDataFull(ObjHandle, Handler, Data, NULL)); -} ACPI_EXPORT_SYMBOL (AcpiGetData) Modified: head/sys/contrib/dev/acpica/components/tables/tbxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbxface.c Tue Jan 10 22:13:44 2017 (r311905) +++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Wed Jan 11 00:02:51 2017 (r311906) @@ -314,12 +314,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) /******************************************************************************* * - * FUNCTION: AcpiGetTableWithSize + * FUNCTION: AcpiGetTable * * PARAMETERS: Signature - ACPI signature of needed table * Instance - Which instance (for SSDTs) * OutTable - Where the pointer to the table is returned - * TblSize - Size of the table * * RETURN: Status and pointer to the requested table * @@ -334,11 +333,10 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) ******************************************************************************/ ACPI_STATUS -AcpiGetTableWithSize ( +AcpiGetTable ( char *Signature, UINT32 Instance, - ACPI_TABLE_HEADER **OutTable, - ACPI_SIZE *TblSize) + ACPI_TABLE_HEADER **OutTable) { UINT32 i; UINT32 j; @@ -386,7 +384,7 @@ AcpiGetTableWithSize ( return (Status); } -ACPI_EXPORT_SYMBOL (AcpiGetTableWithSize) +ACPI_EXPORT_SYMBOL (AcpiGetTable) /******************************************************************************* @@ -436,36 +434,8 @@ AcpiPutTable ( (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_VOID; } -ACPI_EXPORT_SYMBOL (AcpiPutTable) - - -/******************************************************************************* - * - * FUNCTION: AcpiGetTable - * - * PARAMETERS: Signature - ACPI signature of needed table - * Instance - Which instance (for SSDTs) - * OutTable - Where the pointer to the table is returned - * - * RETURN: Status and pointer to the requested table - * - * DESCRIPTION: Finds and verifies an ACPI table. Table must be in the - * RSDT/XSDT. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiGetTable ( - char *Signature, - UINT32 Instance, - ACPI_TABLE_HEADER **OutTable) -{ - ACPI_SIZE Size; - - return (AcpiGetTableWithSize(Signature, Instance, OutTable, &Size)); -} -ACPI_EXPORT_SYMBOL (AcpiGetTable) +ACPI_EXPORT_SYMBOL (AcpiPutTable) /******************************************************************************* Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Tue Jan 10 22:13:44 2017 (r311905) +++ head/sys/contrib/dev/acpica/include/acpixf.h Wed Jan 11 00:02:51 2017 (r311906) @@ -586,14 +586,6 @@ AcpiGetTableHeader ( ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS -AcpiGetTableWithSize ( - ACPI_STRING Signature, - UINT32 Instance, - ACPI_TABLE_HEADER **OutTable, - ACPI_SIZE *TblSize)) - -ACPI_EXTERNAL_RETURN_STATUS ( -ACPI_STATUS AcpiGetTable ( ACPI_STRING Signature, UINT32 Instance, @@ -680,14 +672,6 @@ AcpiGetData ( ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS -AcpiGetDataFull ( - ACPI_HANDLE Object, - ACPI_OBJECT_HANDLER Handler, - void **Data, - void (*Callback)(void *))) - -ACPI_EXTERNAL_RETURN_STATUS ( -ACPI_STATUS AcpiDebugTrace ( const char *Name, UINT32 DebugLevel, From owner-svn-src-all@freebsd.org Wed Jan 11 00:14:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45CF2CAAF0C; Wed, 11 Jan 2017 00:14:48 +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 153B51036; Wed, 11 Jan 2017 00:14:48 +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 v0B0El7e061199; Wed, 11 Jan 2017 00:14:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B0ElS9061198; Wed, 11 Jan 2017 00:14:47 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701110014.v0B0ElS9061198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 11 Jan 2017 00:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311907 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 00:14:48 -0000 Author: ian Date: Wed Jan 11 00:14:47 2017 New Revision: 311907 URL: https://svnweb.freebsd.org/changeset/base/311907 Log: Follow r311103: add "pool" to the keywords that rc.d/ntpdate examines to find a server address in ntp.conf. Submitted by: Ronald Klop Pointy hat to: ian Modified: head/etc/rc.d/ntpdate Modified: head/etc/rc.d/ntpdate ============================================================================== --- head/etc/rc.d/ntpdate Wed Jan 11 00:02:51 2017 (r311906) +++ head/etc/rc.d/ntpdate Wed Jan 11 00:14:47 2017 (r311907) @@ -20,7 +20,7 @@ ntpdate_start() if [ -z "$ntpdate_hosts" -a -f "$ntpdate_config" ]; then ntpdate_hosts=`awk ' /^server[ \t]*127.127/ {next} - /^(server|peer)/ { + /^(server|peer|pool)/ { if ($2 ~/^-/) {print $3} else {print $2}} ' < "$ntpdate_config"` From owner-svn-src-all@freebsd.org Wed Jan 11 00:50:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94885CA8180; Wed, 11 Jan 2017 00:50: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 4A461110C; Wed, 11 Jan 2017 00:50: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 v0B0oJeT073743; Wed, 11 Jan 2017 00:50:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B0oJaA073742; Wed, 11 Jan 2017 00:50:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701110050.v0B0oJaA073742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Jan 2017 00:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311908 - stable/11/sys/boot/i386/btx/btxldr X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 00:50:20 -0000 Author: emaste Date: Wed Jan 11 00:50:19 2017 New Revision: 311908 URL: https://svnweb.freebsd.org/changeset/base/311908 Log: MFC r310702: btxldr: process all PT_LOAD segments, not just the first two With default settings GNU ld generates two PT_LOADs for loader.sym while LLD generates three, because it creates a rodata segment. Previously btxldr terminated phdr processing after two PT_LOADs. Remove the early termination to process all PT_LOADs. Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/boot/i386/btx/btxldr/btxldr.S Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- stable/11/sys/boot/i386/btx/btxldr/btxldr.S Wed Jan 11 00:14:47 2017 (r311907) +++ stable/11/sys/boot/i386/btx/btxldr/btxldr.S Wed Jan 11 00:50:19 2017 (r311908) @@ -198,7 +198,6 @@ start.3: call putstr # message movl $m_segs,%esi # Format string #endif - movl $0x2,%edi # Segment count movl 0x1c(%ebx),%edx # Get e_phoff addl %ebx,%edx # To pointer movzwl 0x2c(%ebx),%ecx # Get e_phnum @@ -216,8 +215,7 @@ start.4: cmpl $0x1,(%edx) # Is p_type P call putstr # End message #endif pushl %esi # Save - pushl %edi # working - pushl %ecx # registers + pushl %ecx # working registers movl 0x4(%edx),%esi # Get p_offset addl %ebx,%esi # as pointer movl 0x8(%edx),%edi # Get p_vaddr @@ -232,13 +230,9 @@ start.4: cmpl $0x1,(%edx) # Is p_type P rep # zero stosb # them start.5: popl %ecx # Restore - popl %edi # working popl %esi # registers - decl %edi # Segments to do - je start.7 # If none start.6: addl $0x20,%edx # To next entry loop start.4 # Till done -start.7: #ifdef BTXLDR_VERBOSE movl $m_done,%esi # Display done call putstr # message From owner-svn-src-all@freebsd.org Wed Jan 11 01:15:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65790CA72BF; Wed, 11 Jan 2017 01:15:56 +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 340E21FB7; Wed, 11 Jan 2017 01:15:56 +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 v0B1Ftp9085607; Wed, 11 Jan 2017 01:15:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B1FtwP085606; Wed, 11 Jan 2017 01:15:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701110115.v0B1FtwP085606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Jan 2017 01:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311909 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 01:15:56 -0000 Author: markj Date: Wed Jan 11 01:15:55 2017 New Revision: 311909 URL: https://svnweb.freebsd.org/changeset/base/311909 Log: Ignore LC_SLEEPABLE when testing whether a mutex is adaptive. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Jan 11 00:50:19 2017 (r311908) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Jan 11 01:15:55 2017 (r311909) @@ -4356,9 +4356,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } l.lx = dtrace_loadptr((uintptr_t)&tupregs[0].dttk_value); - /* XXX - should be only LC_SLEEPABLE? */ - regs[rd] = (LOCK_CLASS(l.li)->lc_flags & - (LC_SLEEPLOCK | LC_SLEEPABLE)) != 0; + regs[rd] = (LOCK_CLASS(l.li)->lc_flags & LC_SLEEPLOCK) != 0; break; case DIF_SUBR_MUTEX_TYPE_SPIN: From owner-svn-src-all@freebsd.org Wed Jan 11 01:18:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2902CA744F; Wed, 11 Jan 2017 01:18:07 +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 8379311B3; Wed, 11 Jan 2017 01:18:07 +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 v0B1I61B085731; Wed, 11 Jan 2017 01:18:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B1I6HL085730; Wed, 11 Jan 2017 01:18:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701110118.v0B1I6HL085730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Jan 2017 01:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311910 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 01:18:07 -0000 Author: markj Date: Wed Jan 11 01:18:06 2017 New Revision: 311910 URL: https://svnweb.freebsd.org/changeset/base/311910 Log: Have DTrace handle faults when dereferencing a lock object pointer. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Jan 11 01:15:55 2017 (r311909) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Jan 11 01:18:06 2017 (r311910) @@ -4335,7 +4335,9 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } l.lx = dtrace_loadptr((uintptr_t)&tupregs[0].dttk_value); + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, &lowner); + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_SUBR_MUTEX_OWNER: @@ -4345,7 +4347,9 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } l.lx = dtrace_loadptr((uintptr_t)&tupregs[0].dttk_value); + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); LOCK_CLASS(l.li)->lc_owner(l.li, &lowner); + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); regs[rd] = (uintptr_t)lowner; break; @@ -4356,7 +4360,9 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } l.lx = dtrace_loadptr((uintptr_t)&tupregs[0].dttk_value); + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); regs[rd] = (LOCK_CLASS(l.li)->lc_flags & LC_SLEEPLOCK) != 0; + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_SUBR_MUTEX_TYPE_SPIN: @@ -4366,7 +4372,9 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } l.lx = dtrace_loadptr((uintptr_t)&tupregs[0].dttk_value); + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); regs[rd] = (LOCK_CLASS(l.li)->lc_flags & LC_SPINLOCK) != 0; + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_SUBR_RW_READ_HELD: @@ -4377,8 +4385,10 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } l.lx = dtrace_loadptr((uintptr_t)&tupregs[0].dttk_value); + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, &lowner) && lowner == NULL; + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_SUBR_RW_WRITE_HELD: @@ -4389,8 +4399,10 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } l.lx = dtrace_loadptr(tupregs[0].dttk_value); + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, &lowner) && lowner != NULL; + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_SUBR_RW_ISWRITER: @@ -4401,7 +4413,9 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } l.lx = dtrace_loadptr(tupregs[0].dttk_value); + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); LOCK_CLASS(l.li)->lc_owner(l.li, &lowner); + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); regs[rd] = (lowner == curthread); break; #endif /* illumos */ From owner-svn-src-all@freebsd.org Wed Jan 11 01:53:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC8E6CA95ED; Wed, 11 Jan 2017 01:53:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C614C18A9; Wed, 11 Jan 2017 01:53:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0B1rs0v002131; Wed, 11 Jan 2017 01:53:54 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B1rsws002127; Wed, 11 Jan 2017 01:53:54 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201701110153.v0B1rsws002127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 11 Jan 2017 01:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311911 - in head/sys: conf dev/sdhci modules modules/sdhci_acpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 01:53:56 -0000 Author: gonzo Date: Wed Jan 11 01:53:54 2017 New Revision: 311911 URL: https://svnweb.freebsd.org/changeset/base/311911 Log: [sdhci] Add ACPI platform support for SDHCI driver - Create ACPI version of SDHCI attach/detach/accessors logic. Some platforms (e.g. BayTrail-based Minnowboard) expose SDHCI devices via ACPI, not PCI - Add sdchi_acpi kernel module Reviewed by: ian, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9112 Added: head/sys/dev/sdhci/sdhci_acpi.c (contents, props changed) head/sys/modules/sdhci_acpi/ head/sys/modules/sdhci_acpi/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 11 01:18:06 2017 (r311910) +++ head/sys/conf/files Wed Jan 11 01:53:54 2017 (r311911) @@ -2826,6 +2826,7 @@ dev/scc/scc_dev_z8530.c optional scc dev/sdhci/sdhci.c optional sdhci dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio dev/sdhci/sdhci_if.m optional sdhci +dev/sdhci/sdhci_acpi.c optional sdhci acpi dev/sdhci/sdhci_pci.c optional sdhci pci dev/sf/if_sf.c optional sf pci dev/sge/if_sge.c optional sge pci Added: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdhci/sdhci_acpi.c Wed Jan 11 01:53:54 2017 (r311911) @@ -0,0 +1,370 @@ +/*- + * Copyright (c) 2017 Oleksandr Tymoshenko + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "sdhci.h" +#include "mmcbr_if.h" +#include "sdhci_if.h" + +static const struct sdhci_acpi_device { + const char* hid; + int uid; + const char *desc; + u_int quirks; +} sdhci_acpi_devices[] = { + { "80860F14", 1, "Intel Bay Trail eMMC 4.5 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { "80860F16", 0, "Intel Bay Trail SD Host Controller", + 0 }, + { NULL, 0, NULL, 0} +}; + +static char *sdhci_ids[] = { + "80860F14", + "80860F16", + NULL +}; + +struct sdhci_acpi_softc { + u_int quirks; /* Chip specific quirks */ + struct resource *irq_res; /* IRQ resource */ + void *intrhand; /* Interrupt handle */ + + struct sdhci_slot slot; + struct resource *mem_res; /* Memory resource */ +}; + +static void sdhci_acpi_intr(void *arg); +static int sdhci_acpi_detach(device_t dev); + +static uint8_t +sdhci_acpi_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + + bus_barrier(sc->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return bus_read_1(sc->mem_res, off); +} + +static void +sdhci_acpi_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint8_t val) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + + bus_barrier(sc->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + bus_write_1(sc->mem_res, off, val); +} + +static uint16_t +sdhci_acpi_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + + bus_barrier(sc->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return bus_read_2(sc->mem_res, off); +} + +static void +sdhci_acpi_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_t val) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + + bus_barrier(sc->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + bus_write_2(sc->mem_res, off, val); +} + +static uint32_t +sdhci_acpi_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + + bus_barrier(sc->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return bus_read_4(sc->mem_res, off); +} + +static void +sdhci_acpi_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint32_t val) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + + bus_barrier(sc->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + bus_write_4(sc->mem_res, off, val); +} + +static void +sdhci_acpi_read_multi_4(device_t dev, struct sdhci_slot *slot, + bus_size_t off, uint32_t *data, bus_size_t count) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + + bus_read_multi_stream_4(sc->mem_res, off, data, count); +} + +static void +sdhci_acpi_write_multi_4(device_t dev, struct sdhci_slot *slot, + bus_size_t off, uint32_t *data, bus_size_t count) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + + bus_write_multi_stream_4(sc->mem_res, off, data, count); +} + +static const struct sdhci_acpi_device * +sdhci_acpi_find_device(device_t dev) +{ + const char *hid; + int i, uid; + ACPI_HANDLE handle; + ACPI_STATUS status; + + hid = ACPI_ID_PROBE(device_get_parent(dev), dev, sdhci_ids); + if (hid == NULL) + return (NULL); + + handle = acpi_get_handle(dev); + status = acpi_GetInteger(handle, "_UID", &uid); + if (ACPI_FAILURE(status)) + uid = 0; + + for (i = 0; sdhci_acpi_devices[i].hid != NULL; i++) { + if (strcmp(sdhci_acpi_devices[i].hid, hid) != 0) + continue; + if ((sdhci_acpi_devices[i].uid != 0) && + (sdhci_acpi_devices[i].uid != uid)) + continue; + return &sdhci_acpi_devices[i]; + } + + return (NULL); +} + +static int +sdhci_acpi_probe(device_t dev) +{ + const struct sdhci_acpi_device *acpi_dev; + + acpi_dev = sdhci_acpi_find_device(dev); + if (acpi_dev == NULL) + return (ENXIO); + + device_set_desc(dev, acpi_dev->desc); + + return (BUS_PROBE_DEFAULT); +} + +static int +sdhci_acpi_attach(device_t dev) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + int rid, err; + const struct sdhci_acpi_device *acpi_dev; + + acpi_dev = sdhci_acpi_find_device(dev); + if (acpi_dev == NULL) + return (ENXIO); + + sc->quirks = acpi_dev->quirks; + + /* Allocate IRQ. */ + rid = 0; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->irq_res == NULL) { + device_printf(dev, "can't allocate IRQ\n"); + return (ENOMEM); + } + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "can't allocate memory resource for slot\n"); + sdhci_acpi_detach(dev); + return (ENOMEM); + } + + sc->slot.quirks = sc->quirks; + + err = sdhci_init_slot(dev, &sc->slot, 0); + if (err) { + device_printf(dev, "failed to init slot\n"); + sdhci_acpi_detach(dev); + return (err); + } + + /* Activate the interrupt */ + err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, sdhci_acpi_intr, sc, &sc->intrhand); + if (err) { + device_printf(dev, "can't setup IRQ\n"); + sdhci_acpi_detach(dev); + return (err); + } + + /* Process cards detection. */ + sdhci_start_slot(&sc->slot); + + return (0); +} + +static int +sdhci_acpi_detach(device_t dev) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + + if (sc->intrhand) + bus_teardown_intr(dev, sc->irq_res, sc->intrhand); + if (sc->irq_res) + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(sc->irq_res), sc->irq_res); + + if (sc->mem_res) { + sdhci_cleanup_slot(&sc->slot); + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->mem_res), sc->mem_res); + } + + return (0); +} + +static int +sdhci_acpi_shutdown(device_t dev) +{ + + return (0); +} + +static int +sdhci_acpi_suspend(device_t dev) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + int err; + + err = bus_generic_suspend(dev); + if (err) + return (err); + sdhci_generic_suspend(&sc->slot); + return (0); +} + +static int +sdhci_acpi_resume(device_t dev) +{ + struct sdhci_acpi_softc *sc = device_get_softc(dev); + int err; + + sdhci_generic_resume(&sc->slot); + err = bus_generic_resume(dev); + if (err) + return (err); + return (0); +} + +static void +sdhci_acpi_intr(void *arg) +{ + struct sdhci_acpi_softc *sc = (struct sdhci_acpi_softc *)arg; + + sdhci_generic_intr(&sc->slot); +} + +static device_method_t sdhci_methods[] = { + /* device_if */ + DEVMETHOD(device_probe, sdhci_acpi_probe), + DEVMETHOD(device_attach, sdhci_acpi_attach), + DEVMETHOD(device_detach, sdhci_acpi_detach), + DEVMETHOD(device_shutdown, sdhci_acpi_shutdown), + DEVMETHOD(device_suspend, sdhci_acpi_suspend), + DEVMETHOD(device_resume, sdhci_acpi_resume), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), + DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), + + /* mmcbr_if */ + DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro), + DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), + DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + + /* SDHCI registers accessors */ + DEVMETHOD(sdhci_read_1, sdhci_acpi_read_1), + DEVMETHOD(sdhci_read_2, sdhci_acpi_read_2), + DEVMETHOD(sdhci_read_4, sdhci_acpi_read_4), + DEVMETHOD(sdhci_read_multi_4, sdhci_acpi_read_multi_4), + DEVMETHOD(sdhci_write_1, sdhci_acpi_write_1), + DEVMETHOD(sdhci_write_2, sdhci_acpi_write_2), + DEVMETHOD(sdhci_write_4, sdhci_acpi_write_4), + DEVMETHOD(sdhci_write_multi_4, sdhci_acpi_write_multi_4), + + DEVMETHOD_END +}; + +static driver_t sdhci_acpi_driver = { + "sdhci_acpi", + sdhci_methods, + sizeof(struct sdhci_acpi_softc), +}; +static devclass_t sdhci_acpi_devclass; + +DRIVER_MODULE(sdhci_acpi, acpi, sdhci_acpi_driver, sdhci_acpi_devclass, NULL, + NULL); +MODULE_DEPEND(sdhci_acpi, sdhci, 1, 1, 1); +DRIVER_MODULE(mmc, sdhci_acpi, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_acpi, mmc, 1, 1, 1); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Jan 11 01:18:06 2017 (r311910) +++ head/sys/modules/Makefile Wed Jan 11 01:53:54 2017 (r311911) @@ -332,6 +332,7 @@ SUBDIR= \ scc \ ${_scsi_low} \ sdhci \ + ${_sdhci_acpi} \ sdhci_pci \ sem \ send \ @@ -665,6 +666,7 @@ _padlock_rng= padlock_rng _rdrand_rng= rdrand_rng .endif _s3= s3 +_sdhci_acpi= sdhci_acpi _tpm= tpm _twa= twa _vesa= vesa Added: head/sys/modules/sdhci_acpi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/sdhci_acpi/Makefile Wed Jan 11 01:53:54 2017 (r311911) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/sdhci + +KMOD= sdhci_acpi +SRCS= sdhci_acpi.c sdhci.h sdhci_if.h device_if.h bus_if.h pci_if.h mmcbr_if.h + +.include From owner-svn-src-all@freebsd.org Wed Jan 11 02:21:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 488E5CAA3FC; Wed, 11 Jan 2017 02:21:36 +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 14F911575; Wed, 11 Jan 2017 02:21:36 +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 v0B2LZ1v010287; Wed, 11 Jan 2017 02:21:35 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B2LZCV010286; Wed, 11 Jan 2017 02:21:35 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201701110221.v0B2LZCV010286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 11 Jan 2017 02:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311912 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 02:21:36 -0000 Author: jhibbits Date: Wed Jan 11 02:21:34 2017 New Revision: 311912 URL: https://svnweb.freebsd.org/changeset/base/311912 Log: Force all TOC references in asm to include '@toc' This reportedly fixes one problem with booting a clang kernel. PR: kern/215819 Submitted by: Mark Millard MFC after: 2 weeks Modified: head/sys/powerpc/include/asm.h Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Wed Jan 11 01:53:54 2017 (r311911) +++ head/sys/powerpc/include/asm.h Wed Jan 11 02:21:34 2017 (r311912) @@ -89,10 +89,11 @@ name: #ifdef __powerpc64__ -#define TOC_REF(name) __CONCAT(.L,name) +#define TOC_NAME_FOR_REF(name) __CONCAT(.L,name) +#define TOC_REF(name) TOC_NAME_FOR_REF(name)@toc #define TOC_ENTRY(name) \ .section ".toc","aw"; \ - TOC_REF(name): \ + TOC_NAME_FOR_REF(name): \ .tc name[TC],name #endif From owner-svn-src-all@freebsd.org Wed Jan 11 05:42:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E30FCAA457; Wed, 11 Jan 2017 05:42:08 +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 17B09125B; Wed, 11 Jan 2017 05:42:08 +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 v0B5g7YV094799; Wed, 11 Jan 2017 05:42:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B5g7IG094796; Wed, 11 Jan 2017 05:42:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701110542.v0B5g7IG094796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 11 Jan 2017 05:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311913 - vendor-crypto/openssh/dist X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 05:42:08 -0000 Author: delphij Date: Wed Jan 11 05:42:06 2017 New Revision: 311913 URL: https://svnweb.freebsd.org/changeset/base/311913 Log: Apply upstream fix for CVE-2016-10009 and CVE-2016-10010: add a whitelist of paths from which ssh-agent will load (via ssh-pkcs11-helper) a PKCS#11 module; ok markus@ disable Unix-domain socket forwarding when privsep is disabled (Note that this is a backport of upstream fixes, and this commit is mainly to ease future imports). Obtained from: OpenBSD Modified: vendor-crypto/openssh/dist/serverloop.c vendor-crypto/openssh/dist/ssh-agent.1 vendor-crypto/openssh/dist/ssh-agent.c Modified: vendor-crypto/openssh/dist/serverloop.c ============================================================================== --- vendor-crypto/openssh/dist/serverloop.c Wed Jan 11 02:21:34 2017 (r311912) +++ vendor-crypto/openssh/dist/serverloop.c Wed Jan 11 05:42:06 2017 (r311913) @@ -995,7 +995,7 @@ server_request_direct_streamlocal(void) /* XXX fine grained permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_LOCAL) != 0 && - !no_port_forwarding_flag) { + !no_port_forwarding_flag && use_privsep) { c = channel_connect_to_path(target, "direct-streamlocal@openssh.com", "direct-streamlocal"); } else { @@ -1279,7 +1279,7 @@ server_input_global_request(int type, u_ /* check permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_REMOTE) == 0 - || no_port_forwarding_flag) { + || no_port_forwarding_flag || !use_privsep) { success = 0; packet_send_debug("Server has disabled port forwarding."); } else { Modified: vendor-crypto/openssh/dist/ssh-agent.1 ============================================================================== --- vendor-crypto/openssh/dist/ssh-agent.1 Wed Jan 11 02:21:34 2017 (r311912) +++ vendor-crypto/openssh/dist/ssh-agent.1 Wed Jan 11 05:42:06 2017 (r311913) @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-agent.1,v 1.62 2015/11/15 23:54:15 jmc Exp $ +.\" $OpenBSD: ssh-agent.1,v 1.63 2016/11/30 03:07:37 djm Exp $ .\" .\" Author: Tatu Ylonen .\" Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -47,6 +47,7 @@ .Op Fl a Ar bind_address .Op Fl E Ar fingerprint_hash .Op Fl t Ar life +.Op Fl P Ar pkcs11_whitelist .Op Ar command Op Ar arg ... .Nm ssh-agent .Op Fl c | s @@ -121,6 +122,18 @@ The default is Kill the current agent (given by the .Ev SSH_AGENT_PID environment variable). +.It Fl P +Specify a pattern-list of acceptable paths for PKCS#11 shared libraries +that may be added using the +.Fl s +option to +.Xr ssh-add 1 . +The default is to allow loading PKCS#11 libraries from +.Dq /usr/lib/*,/usr/local/lib/* . +PKCS#11 libraries that do not match the whitelist will be refused. +See PATTERNS in +.Xr ssh_config 5 +for a description of pattern-list syntax. .It Fl s Generate Bourne shell commands on .Dv stdout . Modified: vendor-crypto/openssh/dist/ssh-agent.c ============================================================================== --- vendor-crypto/openssh/dist/ssh-agent.c Wed Jan 11 02:21:34 2017 (r311912) +++ vendor-crypto/openssh/dist/ssh-agent.c Wed Jan 11 05:42:06 2017 (r311913) @@ -83,11 +83,16 @@ #include "misc.h" #include "digest.h" #include "ssherr.h" +#include "match.h" #ifdef ENABLE_PKCS11 #include "ssh-pkcs11.h" #endif +#ifndef DEFAULT_PKCS11_WHITELIST +# define DEFAULT_PKCS11_WHITELIST "/usr/lib/*,/usr/local/lib/*" +#endif + #if defined(HAVE_SYS_PRCTL_H) #include /* For prctl() and PR_SET_DUMPABLE */ #endif @@ -139,6 +144,9 @@ pid_t cleanup_pid = 0; char socket_name[PATH_MAX]; char socket_dir[PATH_MAX]; +/* PKCS#11 path whitelist */ +static char *pkcs11_whitelist; + /* locking */ #define LOCK_SIZE 32 #define LOCK_SALT_SIZE 16 @@ -741,7 +749,7 @@ no_identities(SocketEntry *e, u_int type static void process_add_smartcard_key(SocketEntry *e) { - char *provider = NULL, *pin; + char *provider = NULL, *pin, canonical_provider[PATH_MAX]; int r, i, version, count = 0, success = 0, confirm = 0; u_int seconds; time_t death = 0; @@ -773,10 +781,21 @@ process_add_smartcard_key(SocketEntry *e goto send; } } + if (realpath(provider, canonical_provider) == NULL) { + verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", + provider, strerror(errno)); + goto send; + } + if (match_pattern_list(canonical_provider, pkcs11_whitelist, 0) != 1) { + verbose("refusing PKCS#11 add of \"%.100s\": " + "provider not whitelisted", canonical_provider); + goto send; + } + debug("%s: add %.100s", __func__, canonical_provider); if (lifetime && !death) death = monotime() + lifetime; - count = pkcs11_add_provider(provider, pin, &keys); + count = pkcs11_add_provider(canonical_provider, pin, &keys); for (i = 0; i < count; i++) { k = keys[i]; version = k->type == KEY_RSA1 ? 1 : 2; @@ -784,8 +803,8 @@ process_add_smartcard_key(SocketEntry *e if (lookup_identity(k, version) == NULL) { id = xcalloc(1, sizeof(Identity)); id->key = k; - id->provider = xstrdup(provider); - id->comment = xstrdup(provider); /* XXX */ + id->provider = xstrdup(canonical_provider); + id->comment = xstrdup(canonical_provider); /* XXX */ id->death = death; id->confirm = confirm; TAILQ_INSERT_TAIL(&tab->idlist, id, next); @@ -1176,7 +1195,7 @@ usage(void) { fprintf(stderr, "usage: ssh-agent [-c | -s] [-Dd] [-a bind_address] [-E fingerprint_hash]\n" - " [-t life] [command [arg ...]]\n" + " [-P pkcs11_whitelist] [-t life] [command [arg ...]]\n" " ssh-agent [-c | -s] -k\n"); exit(1); } @@ -1220,7 +1239,7 @@ main(int ac, char **av) __progname = ssh_get_progname(av[0]); seed_rng(); - while ((ch = getopt(ac, av, "cDdksE:a:t:")) != -1) { + while ((ch = getopt(ac, av, "cDdksE:a:P:t:")) != -1) { switch (ch) { case 'E': fingerprint_hash = ssh_digest_alg_by_name(optarg); @@ -1235,6 +1254,11 @@ main(int ac, char **av) case 'k': k_flag++; break; + case 'P': + if (pkcs11_whitelist != NULL) + fatal("-P option already specified"); + pkcs11_whitelist = xstrdup(optarg); + break; case 's': if (c_flag) usage(); @@ -1269,6 +1293,9 @@ main(int ac, char **av) if (ac > 0 && (c_flag || k_flag || s_flag || d_flag || D_flag)) usage(); + if (pkcs11_whitelist == NULL) + pkcs11_whitelist = xstrdup(DEFAULT_PKCS11_WHITELIST); + if (ac == 0 && !c_flag && !s_flag) { shell = getenv("SHELL"); if (shell != NULL && (len = strlen(shell)) > 2 && @@ -1416,7 +1443,7 @@ skip: signal(SIGTERM, cleanup_handler); nalloc = 0; - if (pledge("stdio cpath unix id proc exec", NULL) == -1) + if (pledge("stdio rpath cpath unix id proc exec", NULL) == -1) fatal("%s: pledge: %s", __progname, strerror(errno)); platform_pledge_agent(); From owner-svn-src-all@freebsd.org Wed Jan 11 05:49:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DFFDCAA6C1; Wed, 11 Jan 2017 05:49:41 +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 4ABC11509; Wed, 11 Jan 2017 05:49:41 +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 v0B5neNN095118; Wed, 11 Jan 2017 05:49:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B5ndVp095110; Wed, 11 Jan 2017 05:49:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701110549.v0B5ndVp095110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 11 Jan 2017 05:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311914 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 05:49:41 -0000 Author: delphij Date: Wed Jan 11 05:49:39 2017 New Revision: 311914 URL: https://svnweb.freebsd.org/changeset/base/311914 Log: MFV r311913: Fix multiple OpenSSH vulnerabilities. Submitted by: des Approved by: so Modified: head/crypto/openssh/serverloop.c head/crypto/openssh/ssh-agent.1 head/crypto/openssh/ssh-agent.c head/crypto/openssh/ssh_config head/crypto/openssh/ssh_config.5 head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.5 head/crypto/openssh/version.h Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/serverloop.c ============================================================================== --- head/crypto/openssh/serverloop.c Wed Jan 11 05:42:06 2017 (r311913) +++ head/crypto/openssh/serverloop.c Wed Jan 11 05:49:39 2017 (r311914) @@ -995,7 +995,7 @@ server_request_direct_streamlocal(void) /* XXX fine grained permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_LOCAL) != 0 && - !no_port_forwarding_flag) { + !no_port_forwarding_flag && use_privsep) { c = channel_connect_to_path(target, "direct-streamlocal@openssh.com", "direct-streamlocal"); } else { @@ -1279,7 +1279,7 @@ server_input_global_request(int type, u_ /* check permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_REMOTE) == 0 - || no_port_forwarding_flag) { + || no_port_forwarding_flag || !use_privsep) { success = 0; packet_send_debug("Server has disabled port forwarding."); } else { Modified: head/crypto/openssh/ssh-agent.1 ============================================================================== --- head/crypto/openssh/ssh-agent.1 Wed Jan 11 05:42:06 2017 (r311913) +++ head/crypto/openssh/ssh-agent.1 Wed Jan 11 05:49:39 2017 (r311914) @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-agent.1,v 1.62 2015/11/15 23:54:15 jmc Exp $ +.\" $OpenBSD: ssh-agent.1,v 1.63 2016/11/30 03:07:37 djm Exp $ .\" $FreeBSD$ .\" .\" Author: Tatu Ylonen @@ -48,6 +48,7 @@ .Op Fl a Ar bind_address .Op Fl E Ar fingerprint_hash .Op Fl t Ar life +.Op Fl P Ar pkcs11_whitelist .Op Ar command Op Ar arg ... .Nm ssh-agent .Op Fl c | s @@ -122,6 +123,18 @@ The default is Kill the current agent (given by the .Ev SSH_AGENT_PID environment variable). +.It Fl P +Specify a pattern-list of acceptable paths for PKCS#11 shared libraries +that may be added using the +.Fl s +option to +.Xr ssh-add 1 . +The default is to allow loading PKCS#11 libraries from +.Dq /usr/lib/*,/usr/local/lib/* . +PKCS#11 libraries that do not match the whitelist will be refused. +See PATTERNS in +.Xr ssh_config 5 +for a description of pattern-list syntax. .It Fl s Generate Bourne shell commands on .Dv stdout . Modified: head/crypto/openssh/ssh-agent.c ============================================================================== --- head/crypto/openssh/ssh-agent.c Wed Jan 11 05:42:06 2017 (r311913) +++ head/crypto/openssh/ssh-agent.c Wed Jan 11 05:49:39 2017 (r311914) @@ -84,11 +84,16 @@ __RCSID("$FreeBSD$"); #include "misc.h" #include "digest.h" #include "ssherr.h" +#include "match.h" #ifdef ENABLE_PKCS11 #include "ssh-pkcs11.h" #endif +#ifndef DEFAULT_PKCS11_WHITELIST +# define DEFAULT_PKCS11_WHITELIST "/usr/lib/*,/usr/local/lib/*" +#endif + #if defined(HAVE_SYS_PRCTL_H) #include /* For prctl() and PR_SET_DUMPABLE */ #endif @@ -140,6 +145,9 @@ pid_t cleanup_pid = 0; char socket_name[PATH_MAX]; char socket_dir[PATH_MAX]; +/* PKCS#11 path whitelist */ +static char *pkcs11_whitelist; + /* locking */ #define LOCK_SIZE 32 #define LOCK_SALT_SIZE 16 @@ -761,7 +769,7 @@ no_identities(SocketEntry *e, u_int type static void process_add_smartcard_key(SocketEntry *e) { - char *provider = NULL, *pin; + char *provider = NULL, *pin, canonical_provider[PATH_MAX]; int r, i, version, count = 0, success = 0, confirm = 0; u_int seconds; time_t death = 0; @@ -793,10 +801,21 @@ process_add_smartcard_key(SocketEntry *e goto send; } } + if (realpath(provider, canonical_provider) == NULL) { + verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", + provider, strerror(errno)); + goto send; + } + if (match_pattern_list(canonical_provider, pkcs11_whitelist, 0) != 1) { + verbose("refusing PKCS#11 add of \"%.100s\": " + "provider not whitelisted", canonical_provider); + goto send; + } + debug("%s: add %.100s", __func__, canonical_provider); if (lifetime && !death) death = monotime() + lifetime; - count = pkcs11_add_provider(provider, pin, &keys); + count = pkcs11_add_provider(canonical_provider, pin, &keys); for (i = 0; i < count; i++) { k = keys[i]; version = k->type == KEY_RSA1 ? 1 : 2; @@ -804,8 +823,8 @@ process_add_smartcard_key(SocketEntry *e if (lookup_identity(k, version) == NULL) { id = xcalloc(1, sizeof(Identity)); id->key = k; - id->provider = xstrdup(provider); - id->comment = xstrdup(provider); /* XXX */ + id->provider = xstrdup(canonical_provider); + id->comment = xstrdup(canonical_provider); /* XXX */ id->death = death; id->confirm = confirm; TAILQ_INSERT_TAIL(&tab->idlist, id, next); @@ -1200,7 +1219,7 @@ usage(void) { fprintf(stderr, "usage: ssh-agent [-c | -s] [-Dd] [-a bind_address] [-E fingerprint_hash]\n" - " [-t life] [command [arg ...]]\n" + " [-P pkcs11_whitelist] [-t life] [command [arg ...]]\n" " ssh-agent [-c | -s] -k\n"); fprintf(stderr, " -x Exit when the last client disconnects.\n"); exit(1); @@ -1246,7 +1265,7 @@ main(int ac, char **av) __progname = ssh_get_progname(av[0]); seed_rng(); - while ((ch = getopt(ac, av, "cDdksE:a:t:x")) != -1) { + while ((ch = getopt(ac, av, "cDdksE:a:P:t:x")) != -1) { switch (ch) { case 'E': fingerprint_hash = ssh_digest_alg_by_name(optarg); @@ -1261,6 +1280,11 @@ main(int ac, char **av) case 'k': k_flag++; break; + case 'P': + if (pkcs11_whitelist != NULL) + fatal("-P option already specified"); + pkcs11_whitelist = xstrdup(optarg); + break; case 's': if (c_flag) usage(); @@ -1298,6 +1322,9 @@ main(int ac, char **av) if (ac > 0 && (c_flag || k_flag || s_flag || d_flag || D_flag)) usage(); + if (pkcs11_whitelist == NULL) + pkcs11_whitelist = xstrdup(DEFAULT_PKCS11_WHITELIST); + if (ac == 0 && !c_flag && !s_flag) { shell = getenv("SHELL"); if (shell != NULL && (len = strlen(shell)) > 2 && @@ -1445,7 +1472,7 @@ skip: signal(SIGTERM, cleanup_handler); nalloc = 0; - if (pledge("stdio cpath unix id proc exec", NULL) == -1) + if (pledge("stdio rpath cpath unix id proc exec", NULL) == -1) fatal("%s: pledge: %s", __progname, strerror(errno)); platform_pledge_agent(); Modified: head/crypto/openssh/ssh_config ============================================================================== --- head/crypto/openssh/ssh_config Wed Jan 11 05:42:06 2017 (r311913) +++ head/crypto/openssh/ssh_config Wed Jan 11 05:49:39 2017 (r311914) @@ -50,4 +50,4 @@ # ProxyCommand ssh -q -W %h:%p gateway.example.com # RekeyLimit 1G 1h # VerifyHostKeyDNS yes -# VersionAddendum FreeBSD-20160310 +# VersionAddendum FreeBSD-20161230 Modified: head/crypto/openssh/ssh_config.5 ============================================================================== --- head/crypto/openssh/ssh_config.5 Wed Jan 11 05:42:06 2017 (r311913) +++ head/crypto/openssh/ssh_config.5 Wed Jan 11 05:49:39 2017 (r311914) @@ -1727,7 +1727,7 @@ See also VERIFYING HOST KEYS in Specifies a string to append to the regular version string to identify OS- or site-specific modifications. The default is -.Dq FreeBSD-20160310 . +.Dq FreeBSD-20161230 . The value .Dq none may be used to disable this. Modified: head/crypto/openssh/sshd_config ============================================================================== --- head/crypto/openssh/sshd_config Wed Jan 11 05:42:06 2017 (r311913) +++ head/crypto/openssh/sshd_config Wed Jan 11 05:49:39 2017 (r311914) @@ -121,7 +121,7 @@ #PermitTunnel no #ChrootDirectory none #UseBlacklist no -#VersionAddendum FreeBSD-20160310 +#VersionAddendum FreeBSD-20161230 # no default banner path #Banner none Modified: head/crypto/openssh/sshd_config.5 ============================================================================== --- head/crypto/openssh/sshd_config.5 Wed Jan 11 05:42:06 2017 (r311913) +++ head/crypto/openssh/sshd_config.5 Wed Jan 11 05:49:39 2017 (r311914) @@ -1634,7 +1634,7 @@ The default is Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default is -.Dq FreeBSD-20160310 . +.Dq FreeBSD-20161230 . The value .Dq none may be used to disable this. Modified: head/crypto/openssh/version.h ============================================================================== --- head/crypto/openssh/version.h Wed Jan 11 05:42:06 2017 (r311913) +++ head/crypto/openssh/version.h Wed Jan 11 05:49:39 2017 (r311914) @@ -6,7 +6,7 @@ #define SSH_PORTABLE "p2" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE -#define SSH_VERSION_FREEBSD "FreeBSD-20160310" +#define SSH_VERSION_FREEBSD "FreeBSD-20161230" #ifdef WITH_OPENSSL #define OPENSSL_VERSION SSLeay_version(SSLEAY_VERSION) From owner-svn-src-all@freebsd.org Wed Jan 11 05:56:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 333A7CAAA52; Wed, 11 Jan 2017 05:56:42 +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 057091978; Wed, 11 Jan 2017 05:56:41 +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 v0B5ufVO099248; Wed, 11 Jan 2017 05:56:41 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B5ueBx099240; Wed, 11 Jan 2017 05:56:40 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701110556.v0B5ueBx099240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 11 Jan 2017 05:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311915 - in stable: 10/crypto/openssh 11/crypto/openssh X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 05:56:42 -0000 Author: delphij Date: Wed Jan 11 05:56:40 2017 New Revision: 311915 URL: https://svnweb.freebsd.org/changeset/base/311915 Log: MFC r311914: MFV r311913: Fix multiple OpenSSH vulnerabilities. Submitted by: des Approved by: so Modified: stable/11/crypto/openssh/serverloop.c stable/11/crypto/openssh/ssh-agent.1 stable/11/crypto/openssh/ssh-agent.c stable/11/crypto/openssh/ssh_config stable/11/crypto/openssh/ssh_config.5 stable/11/crypto/openssh/sshd_config stable/11/crypto/openssh/sshd_config.5 stable/11/crypto/openssh/version.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/crypto/openssh/serverloop.c stable/10/crypto/openssh/ssh-agent.1 stable/10/crypto/openssh/ssh-agent.c stable/10/crypto/openssh/ssh_config stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/sshd_config stable/10/crypto/openssh/sshd_config.5 stable/10/crypto/openssh/version.h Directory Properties: stable/10/ (props changed) Modified: stable/11/crypto/openssh/serverloop.c ============================================================================== --- stable/11/crypto/openssh/serverloop.c Wed Jan 11 05:49:39 2017 (r311914) +++ stable/11/crypto/openssh/serverloop.c Wed Jan 11 05:56:40 2017 (r311915) @@ -995,7 +995,7 @@ server_request_direct_streamlocal(void) /* XXX fine grained permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_LOCAL) != 0 && - !no_port_forwarding_flag) { + !no_port_forwarding_flag && use_privsep) { c = channel_connect_to_path(target, "direct-streamlocal@openssh.com", "direct-streamlocal"); } else { @@ -1279,7 +1279,7 @@ server_input_global_request(int type, u_ /* check permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_REMOTE) == 0 - || no_port_forwarding_flag) { + || no_port_forwarding_flag || !use_privsep) { success = 0; packet_send_debug("Server has disabled port forwarding."); } else { Modified: stable/11/crypto/openssh/ssh-agent.1 ============================================================================== --- stable/11/crypto/openssh/ssh-agent.1 Wed Jan 11 05:49:39 2017 (r311914) +++ stable/11/crypto/openssh/ssh-agent.1 Wed Jan 11 05:56:40 2017 (r311915) @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-agent.1,v 1.62 2015/11/15 23:54:15 jmc Exp $ +.\" $OpenBSD: ssh-agent.1,v 1.63 2016/11/30 03:07:37 djm Exp $ .\" $FreeBSD$ .\" .\" Author: Tatu Ylonen @@ -48,6 +48,7 @@ .Op Fl a Ar bind_address .Op Fl E Ar fingerprint_hash .Op Fl t Ar life +.Op Fl P Ar pkcs11_whitelist .Op Ar command Op Ar arg ... .Nm ssh-agent .Op Fl c | s @@ -122,6 +123,18 @@ The default is Kill the current agent (given by the .Ev SSH_AGENT_PID environment variable). +.It Fl P +Specify a pattern-list of acceptable paths for PKCS#11 shared libraries +that may be added using the +.Fl s +option to +.Xr ssh-add 1 . +The default is to allow loading PKCS#11 libraries from +.Dq /usr/lib/*,/usr/local/lib/* . +PKCS#11 libraries that do not match the whitelist will be refused. +See PATTERNS in +.Xr ssh_config 5 +for a description of pattern-list syntax. .It Fl s Generate Bourne shell commands on .Dv stdout . Modified: stable/11/crypto/openssh/ssh-agent.c ============================================================================== --- stable/11/crypto/openssh/ssh-agent.c Wed Jan 11 05:49:39 2017 (r311914) +++ stable/11/crypto/openssh/ssh-agent.c Wed Jan 11 05:56:40 2017 (r311915) @@ -84,11 +84,16 @@ __RCSID("$FreeBSD$"); #include "misc.h" #include "digest.h" #include "ssherr.h" +#include "match.h" #ifdef ENABLE_PKCS11 #include "ssh-pkcs11.h" #endif +#ifndef DEFAULT_PKCS11_WHITELIST +# define DEFAULT_PKCS11_WHITELIST "/usr/lib/*,/usr/local/lib/*" +#endif + #if defined(HAVE_SYS_PRCTL_H) #include /* For prctl() and PR_SET_DUMPABLE */ #endif @@ -140,6 +145,9 @@ pid_t cleanup_pid = 0; char socket_name[PATH_MAX]; char socket_dir[PATH_MAX]; +/* PKCS#11 path whitelist */ +static char *pkcs11_whitelist; + /* locking */ #define LOCK_SIZE 32 #define LOCK_SALT_SIZE 16 @@ -761,7 +769,7 @@ no_identities(SocketEntry *e, u_int type static void process_add_smartcard_key(SocketEntry *e) { - char *provider = NULL, *pin; + char *provider = NULL, *pin, canonical_provider[PATH_MAX]; int r, i, version, count = 0, success = 0, confirm = 0; u_int seconds; time_t death = 0; @@ -793,10 +801,21 @@ process_add_smartcard_key(SocketEntry *e goto send; } } + if (realpath(provider, canonical_provider) == NULL) { + verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", + provider, strerror(errno)); + goto send; + } + if (match_pattern_list(canonical_provider, pkcs11_whitelist, 0) != 1) { + verbose("refusing PKCS#11 add of \"%.100s\": " + "provider not whitelisted", canonical_provider); + goto send; + } + debug("%s: add %.100s", __func__, canonical_provider); if (lifetime && !death) death = monotime() + lifetime; - count = pkcs11_add_provider(provider, pin, &keys); + count = pkcs11_add_provider(canonical_provider, pin, &keys); for (i = 0; i < count; i++) { k = keys[i]; version = k->type == KEY_RSA1 ? 1 : 2; @@ -804,8 +823,8 @@ process_add_smartcard_key(SocketEntry *e if (lookup_identity(k, version) == NULL) { id = xcalloc(1, sizeof(Identity)); id->key = k; - id->provider = xstrdup(provider); - id->comment = xstrdup(provider); /* XXX */ + id->provider = xstrdup(canonical_provider); + id->comment = xstrdup(canonical_provider); /* XXX */ id->death = death; id->confirm = confirm; TAILQ_INSERT_TAIL(&tab->idlist, id, next); @@ -1200,7 +1219,7 @@ usage(void) { fprintf(stderr, "usage: ssh-agent [-c | -s] [-Dd] [-a bind_address] [-E fingerprint_hash]\n" - " [-t life] [command [arg ...]]\n" + " [-P pkcs11_whitelist] [-t life] [command [arg ...]]\n" " ssh-agent [-c | -s] -k\n"); fprintf(stderr, " -x Exit when the last client disconnects.\n"); exit(1); @@ -1246,7 +1265,7 @@ main(int ac, char **av) __progname = ssh_get_progname(av[0]); seed_rng(); - while ((ch = getopt(ac, av, "cDdksE:a:t:x")) != -1) { + while ((ch = getopt(ac, av, "cDdksE:a:P:t:x")) != -1) { switch (ch) { case 'E': fingerprint_hash = ssh_digest_alg_by_name(optarg); @@ -1261,6 +1280,11 @@ main(int ac, char **av) case 'k': k_flag++; break; + case 'P': + if (pkcs11_whitelist != NULL) + fatal("-P option already specified"); + pkcs11_whitelist = xstrdup(optarg); + break; case 's': if (c_flag) usage(); @@ -1298,6 +1322,9 @@ main(int ac, char **av) if (ac > 0 && (c_flag || k_flag || s_flag || d_flag || D_flag)) usage(); + if (pkcs11_whitelist == NULL) + pkcs11_whitelist = xstrdup(DEFAULT_PKCS11_WHITELIST); + if (ac == 0 && !c_flag && !s_flag) { shell = getenv("SHELL"); if (shell != NULL && (len = strlen(shell)) > 2 && @@ -1445,7 +1472,7 @@ skip: signal(SIGTERM, cleanup_handler); nalloc = 0; - if (pledge("stdio cpath unix id proc exec", NULL) == -1) + if (pledge("stdio rpath cpath unix id proc exec", NULL) == -1) fatal("%s: pledge: %s", __progname, strerror(errno)); platform_pledge_agent(); Modified: stable/11/crypto/openssh/ssh_config ============================================================================== --- stable/11/crypto/openssh/ssh_config Wed Jan 11 05:49:39 2017 (r311914) +++ stable/11/crypto/openssh/ssh_config Wed Jan 11 05:56:40 2017 (r311915) @@ -50,4 +50,4 @@ # ProxyCommand ssh -q -W %h:%p gateway.example.com # RekeyLimit 1G 1h # VerifyHostKeyDNS yes -# VersionAddendum FreeBSD-20160310 +# VersionAddendum FreeBSD-20161230 Modified: stable/11/crypto/openssh/ssh_config.5 ============================================================================== --- stable/11/crypto/openssh/ssh_config.5 Wed Jan 11 05:49:39 2017 (r311914) +++ stable/11/crypto/openssh/ssh_config.5 Wed Jan 11 05:56:40 2017 (r311915) @@ -1727,7 +1727,7 @@ See also VERIFYING HOST KEYS in Specifies a string to append to the regular version string to identify OS- or site-specific modifications. The default is -.Dq FreeBSD-20160310 . +.Dq FreeBSD-20161230 . The value .Dq none may be used to disable this. Modified: stable/11/crypto/openssh/sshd_config ============================================================================== --- stable/11/crypto/openssh/sshd_config Wed Jan 11 05:49:39 2017 (r311914) +++ stable/11/crypto/openssh/sshd_config Wed Jan 11 05:56:40 2017 (r311915) @@ -121,7 +121,7 @@ #PermitTunnel no #ChrootDirectory none #UseBlacklist no -#VersionAddendum FreeBSD-20160310 +#VersionAddendum FreeBSD-20161230 # no default banner path #Banner none Modified: stable/11/crypto/openssh/sshd_config.5 ============================================================================== --- stable/11/crypto/openssh/sshd_config.5 Wed Jan 11 05:49:39 2017 (r311914) +++ stable/11/crypto/openssh/sshd_config.5 Wed Jan 11 05:56:40 2017 (r311915) @@ -1634,7 +1634,7 @@ The default is Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default is -.Dq FreeBSD-20160310 . +.Dq FreeBSD-20161230 . The value .Dq none may be used to disable this. Modified: stable/11/crypto/openssh/version.h ============================================================================== --- stable/11/crypto/openssh/version.h Wed Jan 11 05:49:39 2017 (r311914) +++ stable/11/crypto/openssh/version.h Wed Jan 11 05:56:40 2017 (r311915) @@ -6,7 +6,7 @@ #define SSH_PORTABLE "p2" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE -#define SSH_VERSION_FREEBSD "FreeBSD-20160310" +#define SSH_VERSION_FREEBSD "FreeBSD-20161230" #ifdef WITH_OPENSSL #define OPENSSL_VERSION SSLeay_version(SSLEAY_VERSION) From owner-svn-src-all@freebsd.org Wed Jan 11 05:56:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FDA7CAAA59; Wed, 11 Jan 2017 05:56:43 +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 0A5311979; Wed, 11 Jan 2017 05:56:42 +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 v0B5ug2v099261; Wed, 11 Jan 2017 05:56:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B5ufq5099254; Wed, 11 Jan 2017 05:56:41 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701110556.v0B5ufq5099254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 11 Jan 2017 05:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311915 - in stable: 10/crypto/openssh 11/crypto/openssh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 05:56:43 -0000 Author: delphij Date: Wed Jan 11 05:56:40 2017 New Revision: 311915 URL: https://svnweb.freebsd.org/changeset/base/311915 Log: MFC r311914: MFV r311913: Fix multiple OpenSSH vulnerabilities. Submitted by: des Approved by: so Modified: stable/10/crypto/openssh/serverloop.c stable/10/crypto/openssh/ssh-agent.1 stable/10/crypto/openssh/ssh-agent.c stable/10/crypto/openssh/ssh_config stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/sshd_config stable/10/crypto/openssh/sshd_config.5 stable/10/crypto/openssh/version.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/crypto/openssh/serverloop.c stable/11/crypto/openssh/ssh-agent.1 stable/11/crypto/openssh/ssh-agent.c stable/11/crypto/openssh/ssh_config stable/11/crypto/openssh/ssh_config.5 stable/11/crypto/openssh/sshd_config stable/11/crypto/openssh/sshd_config.5 stable/11/crypto/openssh/version.h Directory Properties: stable/11/ (props changed) Modified: stable/10/crypto/openssh/serverloop.c ============================================================================== --- stable/10/crypto/openssh/serverloop.c Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/serverloop.c Wed Jan 11 05:56:40 2017 (r311915) @@ -995,7 +995,7 @@ server_request_direct_streamlocal(void) /* XXX fine grained permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_LOCAL) != 0 && - !no_port_forwarding_flag) { + !no_port_forwarding_flag && use_privsep) { c = channel_connect_to_path(target, "direct-streamlocal@openssh.com", "direct-streamlocal"); } else { @@ -1279,7 +1279,7 @@ server_input_global_request(int type, u_ /* check permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_REMOTE) == 0 - || no_port_forwarding_flag) { + || no_port_forwarding_flag || !use_privsep) { success = 0; packet_send_debug("Server has disabled port forwarding."); } else { Modified: stable/10/crypto/openssh/ssh-agent.1 ============================================================================== --- stable/10/crypto/openssh/ssh-agent.1 Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/ssh-agent.1 Wed Jan 11 05:56:40 2017 (r311915) @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-agent.1,v 1.62 2015/11/15 23:54:15 jmc Exp $ +.\" $OpenBSD: ssh-agent.1,v 1.63 2016/11/30 03:07:37 djm Exp $ .\" $FreeBSD$ .\" .\" Author: Tatu Ylonen @@ -48,6 +48,7 @@ .Op Fl a Ar bind_address .Op Fl E Ar fingerprint_hash .Op Fl t Ar life +.Op Fl P Ar pkcs11_whitelist .Op Ar command Op Ar arg ... .Nm ssh-agent .Op Fl c | s @@ -122,6 +123,18 @@ The default is Kill the current agent (given by the .Ev SSH_AGENT_PID environment variable). +.It Fl P +Specify a pattern-list of acceptable paths for PKCS#11 shared libraries +that may be added using the +.Fl s +option to +.Xr ssh-add 1 . +The default is to allow loading PKCS#11 libraries from +.Dq /usr/lib/*,/usr/local/lib/* . +PKCS#11 libraries that do not match the whitelist will be refused. +See PATTERNS in +.Xr ssh_config 5 +for a description of pattern-list syntax. .It Fl s Generate Bourne shell commands on .Dv stdout . Modified: stable/10/crypto/openssh/ssh-agent.c ============================================================================== --- stable/10/crypto/openssh/ssh-agent.c Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/ssh-agent.c Wed Jan 11 05:56:40 2017 (r311915) @@ -84,11 +84,16 @@ __RCSID("$FreeBSD$"); #include "misc.h" #include "digest.h" #include "ssherr.h" +#include "match.h" #ifdef ENABLE_PKCS11 #include "ssh-pkcs11.h" #endif +#ifndef DEFAULT_PKCS11_WHITELIST +# define DEFAULT_PKCS11_WHITELIST "/usr/lib/*,/usr/local/lib/*" +#endif + #if defined(HAVE_SYS_PRCTL_H) #include /* For prctl() and PR_SET_DUMPABLE */ #endif @@ -140,6 +145,9 @@ pid_t cleanup_pid = 0; char socket_name[PATH_MAX]; char socket_dir[PATH_MAX]; +/* PKCS#11 path whitelist */ +static char *pkcs11_whitelist; + /* locking */ #define LOCK_SIZE 32 #define LOCK_SALT_SIZE 16 @@ -761,7 +769,7 @@ no_identities(SocketEntry *e, u_int type static void process_add_smartcard_key(SocketEntry *e) { - char *provider = NULL, *pin; + char *provider = NULL, *pin, canonical_provider[PATH_MAX]; int r, i, version, count = 0, success = 0, confirm = 0; u_int seconds; time_t death = 0; @@ -793,10 +801,21 @@ process_add_smartcard_key(SocketEntry *e goto send; } } + if (realpath(provider, canonical_provider) == NULL) { + verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", + provider, strerror(errno)); + goto send; + } + if (match_pattern_list(canonical_provider, pkcs11_whitelist, 0) != 1) { + verbose("refusing PKCS#11 add of \"%.100s\": " + "provider not whitelisted", canonical_provider); + goto send; + } + debug("%s: add %.100s", __func__, canonical_provider); if (lifetime && !death) death = monotime() + lifetime; - count = pkcs11_add_provider(provider, pin, &keys); + count = pkcs11_add_provider(canonical_provider, pin, &keys); for (i = 0; i < count; i++) { k = keys[i]; version = k->type == KEY_RSA1 ? 1 : 2; @@ -804,8 +823,8 @@ process_add_smartcard_key(SocketEntry *e if (lookup_identity(k, version) == NULL) { id = xcalloc(1, sizeof(Identity)); id->key = k; - id->provider = xstrdup(provider); - id->comment = xstrdup(provider); /* XXX */ + id->provider = xstrdup(canonical_provider); + id->comment = xstrdup(canonical_provider); /* XXX */ id->death = death; id->confirm = confirm; TAILQ_INSERT_TAIL(&tab->idlist, id, next); @@ -1200,7 +1219,7 @@ usage(void) { fprintf(stderr, "usage: ssh-agent [-c | -s] [-Dd] [-a bind_address] [-E fingerprint_hash]\n" - " [-t life] [command [arg ...]]\n" + " [-P pkcs11_whitelist] [-t life] [command [arg ...]]\n" " ssh-agent [-c | -s] -k\n"); fprintf(stderr, " -x Exit when the last client disconnects.\n"); exit(1); @@ -1246,7 +1265,7 @@ main(int ac, char **av) __progname = ssh_get_progname(av[0]); seed_rng(); - while ((ch = getopt(ac, av, "cDdksE:a:t:x")) != -1) { + while ((ch = getopt(ac, av, "cDdksE:a:P:t:x")) != -1) { switch (ch) { case 'E': fingerprint_hash = ssh_digest_alg_by_name(optarg); @@ -1261,6 +1280,11 @@ main(int ac, char **av) case 'k': k_flag++; break; + case 'P': + if (pkcs11_whitelist != NULL) + fatal("-P option already specified"); + pkcs11_whitelist = xstrdup(optarg); + break; case 's': if (c_flag) usage(); @@ -1298,6 +1322,9 @@ main(int ac, char **av) if (ac > 0 && (c_flag || k_flag || s_flag || d_flag || D_flag)) usage(); + if (pkcs11_whitelist == NULL) + pkcs11_whitelist = xstrdup(DEFAULT_PKCS11_WHITELIST); + if (ac == 0 && !c_flag && !s_flag) { shell = getenv("SHELL"); if (shell != NULL && (len = strlen(shell)) > 2 && @@ -1445,7 +1472,7 @@ skip: signal(SIGTERM, cleanup_handler); nalloc = 0; - if (pledge("stdio cpath unix id proc exec", NULL) == -1) + if (pledge("stdio rpath cpath unix id proc exec", NULL) == -1) fatal("%s: pledge: %s", __progname, strerror(errno)); platform_pledge_agent(); Modified: stable/10/crypto/openssh/ssh_config ============================================================================== --- stable/10/crypto/openssh/ssh_config Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/ssh_config Wed Jan 11 05:56:40 2017 (r311915) @@ -50,4 +50,4 @@ # ProxyCommand ssh -q -W %h:%p gateway.example.com # RekeyLimit 1G 1h # VerifyHostKeyDNS yes -# VersionAddendum FreeBSD-20160310 +# VersionAddendum FreeBSD-20161230 Modified: stable/10/crypto/openssh/ssh_config.5 ============================================================================== --- stable/10/crypto/openssh/ssh_config.5 Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/ssh_config.5 Wed Jan 11 05:56:40 2017 (r311915) @@ -1733,7 +1733,7 @@ See also VERIFYING HOST KEYS in Specifies a string to append to the regular version string to identify OS- or site-specific modifications. The default is -.Dq FreeBSD-20160310 . +.Dq FreeBSD-20161230 . The value .Dq none may be used to disable this. Modified: stable/10/crypto/openssh/sshd_config ============================================================================== --- stable/10/crypto/openssh/sshd_config Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/sshd_config Wed Jan 11 05:56:40 2017 (r311915) @@ -120,7 +120,7 @@ #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none -#VersionAddendum FreeBSD-20160310 +#VersionAddendum FreeBSD-20161230 # no default banner path #Banner none Modified: stable/10/crypto/openssh/sshd_config.5 ============================================================================== --- stable/10/crypto/openssh/sshd_config.5 Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/sshd_config.5 Wed Jan 11 05:56:40 2017 (r311915) @@ -1631,7 +1631,7 @@ The default is Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default is -.Dq FreeBSD-20160310 . +.Dq FreeBSD-20161230 . The value .Dq none may be used to disable this. Modified: stable/10/crypto/openssh/version.h ============================================================================== --- stable/10/crypto/openssh/version.h Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/version.h Wed Jan 11 05:56:40 2017 (r311915) @@ -6,7 +6,7 @@ #define SSH_PORTABLE "p2" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE -#define SSH_VERSION_FREEBSD "FreeBSD-20160310" +#define SSH_VERSION_FREEBSD "FreeBSD-20161230" #ifdef WITH_OPENSSL #define OPENSSL_VERSION SSLeay_version(SSLEAY_VERSION) From owner-svn-src-all@freebsd.org Wed Jan 11 06:01:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD74CCAACA9; Wed, 11 Jan 2017 06:01:25 +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 8DDD71D6F; Wed, 11 Jan 2017 06:01:25 +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 v0B61OYQ001007; Wed, 11 Jan 2017 06:01:24 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B61Nip000996; Wed, 11 Jan 2017 06:01:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701110601.v0B61Nip000996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 11 Jan 2017 06:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r311916 - in releng: 10.3 10.3/crypto/openssh 10.3/sys/conf 11.0 11.0/crypto/openssh 11.0/sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 06:01:25 -0000 Author: delphij Date: Wed Jan 11 06:01:23 2017 New Revision: 311916 URL: https://svnweb.freebsd.org/changeset/base/311916 Log: Fix multiple vulnerabilities of OpenSSH. Security: FreeBSD-SA-17:01.openssh Security: CVE-2016-10009 Security: CVE-2016-10010 Approved by: so Modified: releng/10.3/UPDATING releng/10.3/crypto/openssh/serverloop.c releng/10.3/crypto/openssh/ssh-agent.1 releng/10.3/crypto/openssh/ssh-agent.c releng/10.3/sys/conf/newvers.sh releng/11.0/UPDATING releng/11.0/crypto/openssh/serverloop.c releng/11.0/crypto/openssh/ssh-agent.1 releng/11.0/crypto/openssh/ssh-agent.c releng/11.0/sys/conf/newvers.sh Modified: releng/10.3/UPDATING ============================================================================== --- releng/10.3/UPDATING Wed Jan 11 05:56:40 2017 (r311915) +++ releng/10.3/UPDATING Wed Jan 11 06:01:23 2017 (r311916) @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20170111 p16 FreeBSD-SA-17:01.openssh + + Fix multiple vulnerabilities of OpenSSH. + 20161222 p15 FreeBSD-SA-16:39.ntp Fix multiple vulnerabilities of ntp. Modified: releng/10.3/crypto/openssh/serverloop.c ============================================================================== --- releng/10.3/crypto/openssh/serverloop.c Wed Jan 11 05:56:40 2017 (r311915) +++ releng/10.3/crypto/openssh/serverloop.c Wed Jan 11 06:01:23 2017 (r311916) @@ -995,7 +995,7 @@ server_request_direct_streamlocal(void) /* XXX fine grained permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_LOCAL) != 0 && - !no_port_forwarding_flag) { + !no_port_forwarding_flag && use_privsep) { c = channel_connect_to_path(target, "direct-streamlocal@openssh.com", "direct-streamlocal"); } else { @@ -1279,7 +1279,7 @@ server_input_global_request(int type, u_ /* check permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_REMOTE) == 0 - || no_port_forwarding_flag) { + || no_port_forwarding_flag || !use_privsep) { success = 0; packet_send_debug("Server has disabled port forwarding."); } else { Modified: releng/10.3/crypto/openssh/ssh-agent.1 ============================================================================== --- releng/10.3/crypto/openssh/ssh-agent.1 Wed Jan 11 05:56:40 2017 (r311915) +++ releng/10.3/crypto/openssh/ssh-agent.1 Wed Jan 11 06:01:23 2017 (r311916) @@ -48,6 +48,7 @@ .Op Fl a Ar bind_address .Op Fl E Ar fingerprint_hash .Op Fl t Ar life +.Op Fl P Ar pkcs11_whitelist .Op Ar command Op Ar arg ... .Nm ssh-agent .Op Fl c | s @@ -122,6 +123,18 @@ The default is Kill the current agent (given by the .Ev SSH_AGENT_PID environment variable). +.It Fl P +Specify a pattern-list of acceptable paths for PKCS#11 shared libraries +that may be added using the +.Fl s +option to +.Xr ssh-add 1 . +The default is to allow loading PKCS#11 libraries from +.Dq /usr/lib/*,/usr/local/lib/* . +PKCS#11 libraries that do not match the whitelist will be refused. +See PATTERNS in +.Xr ssh_config 5 +for a description of pattern-list syntax. .It Fl s Generate Bourne shell commands on .Dv stdout . Modified: releng/10.3/crypto/openssh/ssh-agent.c ============================================================================== --- releng/10.3/crypto/openssh/ssh-agent.c Wed Jan 11 05:56:40 2017 (r311915) +++ releng/10.3/crypto/openssh/ssh-agent.c Wed Jan 11 06:01:23 2017 (r311916) @@ -84,11 +84,16 @@ __RCSID("$FreeBSD$"); #include "misc.h" #include "digest.h" #include "ssherr.h" +#include "match.h" #ifdef ENABLE_PKCS11 #include "ssh-pkcs11.h" #endif +#ifndef DEFAULT_PKCS11_WHITELIST +# define DEFAULT_PKCS11_WHITELIST "/usr/lib/*,/usr/local/lib/*" +#endif + #if defined(HAVE_SYS_PRCTL_H) #include /* For prctl() and PR_SET_DUMPABLE */ #endif @@ -140,6 +145,9 @@ pid_t cleanup_pid = 0; char socket_name[PATH_MAX]; char socket_dir[PATH_MAX]; +/* PKCS#11 path whitelist */ +static char *pkcs11_whitelist; + /* locking */ #define LOCK_SIZE 32 #define LOCK_SALT_SIZE 16 @@ -761,7 +769,7 @@ no_identities(SocketEntry *e, u_int type static void process_add_smartcard_key(SocketEntry *e) { - char *provider = NULL, *pin; + char *provider = NULL, *pin, canonical_provider[PATH_MAX]; int r, i, version, count = 0, success = 0, confirm = 0; u_int seconds; time_t death = 0; @@ -793,10 +801,21 @@ process_add_smartcard_key(SocketEntry *e goto send; } } + if (realpath(provider, canonical_provider) == NULL) { + verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", + provider, strerror(errno)); + goto send; + } + if (match_pattern_list(canonical_provider, pkcs11_whitelist, 0) != 1) { + verbose("refusing PKCS#11 add of \"%.100s\": " + "provider not whitelisted", canonical_provider); + goto send; + } + debug("%s: add %.100s", __func__, canonical_provider); if (lifetime && !death) death = monotime() + lifetime; - count = pkcs11_add_provider(provider, pin, &keys); + count = pkcs11_add_provider(canonical_provider, pin, &keys); for (i = 0; i < count; i++) { k = keys[i]; version = k->type == KEY_RSA1 ? 1 : 2; @@ -804,8 +823,8 @@ process_add_smartcard_key(SocketEntry *e if (lookup_identity(k, version) == NULL) { id = xcalloc(1, sizeof(Identity)); id->key = k; - id->provider = xstrdup(provider); - id->comment = xstrdup(provider); /* XXX */ + id->provider = xstrdup(canonical_provider); + id->comment = xstrdup(canonical_provider); /* XXX */ id->death = death; id->confirm = confirm; TAILQ_INSERT_TAIL(&tab->idlist, id, next); @@ -1200,7 +1219,7 @@ usage(void) { fprintf(stderr, "usage: ssh-agent [-c | -s] [-Dd] [-a bind_address] [-E fingerprint_hash]\n" - " [-t life] [command [arg ...]]\n" + " [-P pkcs11_whitelist] [-t life] [command [arg ...]]\n" " ssh-agent [-c | -s] -k\n"); fprintf(stderr, " -x Exit when the last client disconnects.\n"); exit(1); @@ -1246,7 +1265,7 @@ main(int ac, char **av) __progname = ssh_get_progname(av[0]); seed_rng(); - while ((ch = getopt(ac, av, "cDdksE:a:t:x")) != -1) { + while ((ch = getopt(ac, av, "cDdksE:a:P:t:x")) != -1) { switch (ch) { case 'E': fingerprint_hash = ssh_digest_alg_by_name(optarg); @@ -1261,6 +1280,11 @@ main(int ac, char **av) case 'k': k_flag++; break; + case 'P': + if (pkcs11_whitelist != NULL) + fatal("-P option already specified"); + pkcs11_whitelist = xstrdup(optarg); + break; case 's': if (c_flag) usage(); @@ -1298,6 +1322,9 @@ main(int ac, char **av) if (ac > 0 && (c_flag || k_flag || s_flag || d_flag || D_flag)) usage(); + if (pkcs11_whitelist == NULL) + pkcs11_whitelist = xstrdup(DEFAULT_PKCS11_WHITELIST); + if (ac == 0 && !c_flag && !s_flag) { shell = getenv("SHELL"); if (shell != NULL && (len = strlen(shell)) > 2 && @@ -1445,7 +1472,7 @@ skip: signal(SIGTERM, cleanup_handler); nalloc = 0; - if (pledge("stdio cpath unix id proc exec", NULL) == -1) + if (pledge("stdio rpath cpath unix id proc exec", NULL) == -1) fatal("%s: pledge: %s", __progname, strerror(errno)); platform_pledge_agent(); Modified: releng/10.3/sys/conf/newvers.sh ============================================================================== --- releng/10.3/sys/conf/newvers.sh Wed Jan 11 05:56:40 2017 (r311915) +++ releng/10.3/sys/conf/newvers.sh Wed Jan 11 06:01:23 2017 (r311916) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.3" -BRANCH="RELEASE-p15" +BRANCH="RELEASE-p16" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/11.0/UPDATING ============================================================================== --- releng/11.0/UPDATING Wed Jan 11 05:56:40 2017 (r311915) +++ releng/11.0/UPDATING Wed Jan 11 06:01:23 2017 (r311916) @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITH the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20170111 p7 FreeBSD-SA-17:01.openssh + + Fix multiple vulnerabilities of OpenSSH. + 20161222 p6 FreeBSD-SA-16:39.ntp Fix multiple vulnerabilities of ntp. Modified: releng/11.0/crypto/openssh/serverloop.c ============================================================================== --- releng/11.0/crypto/openssh/serverloop.c Wed Jan 11 05:56:40 2017 (r311915) +++ releng/11.0/crypto/openssh/serverloop.c Wed Jan 11 06:01:23 2017 (r311916) @@ -995,7 +995,7 @@ server_request_direct_streamlocal(void) /* XXX fine grained permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_LOCAL) != 0 && - !no_port_forwarding_flag) { + !no_port_forwarding_flag && use_privsep) { c = channel_connect_to_path(target, "direct-streamlocal@openssh.com", "direct-streamlocal"); } else { @@ -1279,7 +1279,7 @@ server_input_global_request(int type, u_ /* check permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_REMOTE) == 0 - || no_port_forwarding_flag) { + || no_port_forwarding_flag || !use_privsep) { success = 0; packet_send_debug("Server has disabled port forwarding."); } else { Modified: releng/11.0/crypto/openssh/ssh-agent.1 ============================================================================== --- releng/11.0/crypto/openssh/ssh-agent.1 Wed Jan 11 05:56:40 2017 (r311915) +++ releng/11.0/crypto/openssh/ssh-agent.1 Wed Jan 11 06:01:23 2017 (r311916) @@ -48,6 +48,7 @@ .Op Fl a Ar bind_address .Op Fl E Ar fingerprint_hash .Op Fl t Ar life +.Op Fl P Ar pkcs11_whitelist .Op Ar command Op Ar arg ... .Nm ssh-agent .Op Fl c | s @@ -122,6 +123,18 @@ The default is Kill the current agent (given by the .Ev SSH_AGENT_PID environment variable). +.It Fl P +Specify a pattern-list of acceptable paths for PKCS#11 shared libraries +that may be added using the +.Fl s +option to +.Xr ssh-add 1 . +The default is to allow loading PKCS#11 libraries from +.Dq /usr/lib/*,/usr/local/lib/* . +PKCS#11 libraries that do not match the whitelist will be refused. +See PATTERNS in +.Xr ssh_config 5 +for a description of pattern-list syntax. .It Fl s Generate Bourne shell commands on .Dv stdout . Modified: releng/11.0/crypto/openssh/ssh-agent.c ============================================================================== --- releng/11.0/crypto/openssh/ssh-agent.c Wed Jan 11 05:56:40 2017 (r311915) +++ releng/11.0/crypto/openssh/ssh-agent.c Wed Jan 11 06:01:23 2017 (r311916) @@ -84,11 +84,16 @@ __RCSID("$FreeBSD$"); #include "misc.h" #include "digest.h" #include "ssherr.h" +#include "match.h" #ifdef ENABLE_PKCS11 #include "ssh-pkcs11.h" #endif +#ifndef DEFAULT_PKCS11_WHITELIST +# define DEFAULT_PKCS11_WHITELIST "/usr/lib/*,/usr/local/lib/*" +#endif + #if defined(HAVE_SYS_PRCTL_H) #include /* For prctl() and PR_SET_DUMPABLE */ #endif @@ -140,6 +145,9 @@ pid_t cleanup_pid = 0; char socket_name[PATH_MAX]; char socket_dir[PATH_MAX]; +/* PKCS#11 path whitelist */ +static char *pkcs11_whitelist; + /* locking */ #define LOCK_SIZE 32 #define LOCK_SALT_SIZE 16 @@ -761,7 +769,7 @@ no_identities(SocketEntry *e, u_int type static void process_add_smartcard_key(SocketEntry *e) { - char *provider = NULL, *pin; + char *provider = NULL, *pin, canonical_provider[PATH_MAX]; int r, i, version, count = 0, success = 0, confirm = 0; u_int seconds; time_t death = 0; @@ -793,10 +801,21 @@ process_add_smartcard_key(SocketEntry *e goto send; } } + if (realpath(provider, canonical_provider) == NULL) { + verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", + provider, strerror(errno)); + goto send; + } + if (match_pattern_list(canonical_provider, pkcs11_whitelist, 0) != 1) { + verbose("refusing PKCS#11 add of \"%.100s\": " + "provider not whitelisted", canonical_provider); + goto send; + } + debug("%s: add %.100s", __func__, canonical_provider); if (lifetime && !death) death = monotime() + lifetime; - count = pkcs11_add_provider(provider, pin, &keys); + count = pkcs11_add_provider(canonical_provider, pin, &keys); for (i = 0; i < count; i++) { k = keys[i]; version = k->type == KEY_RSA1 ? 1 : 2; @@ -804,8 +823,8 @@ process_add_smartcard_key(SocketEntry *e if (lookup_identity(k, version) == NULL) { id = xcalloc(1, sizeof(Identity)); id->key = k; - id->provider = xstrdup(provider); - id->comment = xstrdup(provider); /* XXX */ + id->provider = xstrdup(canonical_provider); + id->comment = xstrdup(canonical_provider); /* XXX */ id->death = death; id->confirm = confirm; TAILQ_INSERT_TAIL(&tab->idlist, id, next); @@ -1200,7 +1219,7 @@ usage(void) { fprintf(stderr, "usage: ssh-agent [-c | -s] [-Dd] [-a bind_address] [-E fingerprint_hash]\n" - " [-t life] [command [arg ...]]\n" + " [-P pkcs11_whitelist] [-t life] [command [arg ...]]\n" " ssh-agent [-c | -s] -k\n"); fprintf(stderr, " -x Exit when the last client disconnects.\n"); exit(1); @@ -1246,7 +1265,7 @@ main(int ac, char **av) __progname = ssh_get_progname(av[0]); seed_rng(); - while ((ch = getopt(ac, av, "cDdksE:a:t:x")) != -1) { + while ((ch = getopt(ac, av, "cDdksE:a:P:t:x")) != -1) { switch (ch) { case 'E': fingerprint_hash = ssh_digest_alg_by_name(optarg); @@ -1261,6 +1280,11 @@ main(int ac, char **av) case 'k': k_flag++; break; + case 'P': + if (pkcs11_whitelist != NULL) + fatal("-P option already specified"); + pkcs11_whitelist = xstrdup(optarg); + break; case 's': if (c_flag) usage(); @@ -1298,6 +1322,9 @@ main(int ac, char **av) if (ac > 0 && (c_flag || k_flag || s_flag || d_flag || D_flag)) usage(); + if (pkcs11_whitelist == NULL) + pkcs11_whitelist = xstrdup(DEFAULT_PKCS11_WHITELIST); + if (ac == 0 && !c_flag && !s_flag) { shell = getenv("SHELL"); if (shell != NULL && (len = strlen(shell)) > 2 && @@ -1445,7 +1472,7 @@ skip: signal(SIGTERM, cleanup_handler); nalloc = 0; - if (pledge("stdio cpath unix id proc exec", NULL) == -1) + if (pledge("stdio rpath cpath unix id proc exec", NULL) == -1) fatal("%s: pledge: %s", __progname, strerror(errno)); platform_pledge_agent(); Modified: releng/11.0/sys/conf/newvers.sh ============================================================================== --- releng/11.0/sys/conf/newvers.sh Wed Jan 11 05:56:40 2017 (r311915) +++ releng/11.0/sys/conf/newvers.sh Wed Jan 11 06:01:23 2017 (r311916) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="RELEASE-p6" +BRANCH="RELEASE-p7" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Wed Jan 11 07:17:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E554CAA5B1; Wed, 11 Jan 2017 07:17:04 +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 2F9771FF6; Wed, 11 Jan 2017 07:17:04 +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 v0B7H3QO031631; Wed, 11 Jan 2017 07:17:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B7H30W031630; Wed, 11 Jan 2017 07:17:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701110717.v0B7H30W031630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 11 Jan 2017 07:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311917 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 07:17:04 -0000 Author: ngie Date: Wed Jan 11 07:17:03 2017 New Revision: 311917 URL: https://svnweb.freebsd.org/changeset/base/311917 Log: Fix up r311227 Check for creat returning a value != -1, not a non-zero value MFC after: 3 days Pointyhat to: ngie Reported by: Coverity CID: 1368366 Modified: head/contrib/netbsd-tests/lib/libc/gen/t_dir.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_dir.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_dir.c Wed Jan 11 06:01:23 2017 (r311916) +++ head/contrib/netbsd-tests/lib/libc/gen/t_dir.c Wed Jan 11 07:17:03 2017 (r311917) @@ -59,12 +59,12 @@ ATF_TC_BODY(seekdir_basic, tc) long here; #ifdef __FreeBSD__ -#define CREAT(x, m) do { \ - int _creat_fd; \ - ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))), \ - "creat(%s, %x) failed: %s", (x), (m), \ - strerror(errno)); \ - (void)close(_creat_fd); \ +#define CREAT(x, m) do { \ + int _creat_fd; \ + ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))) != -1, \ + "creat(%s, %x) failed: %s", (x), (m), \ + strerror(errno)); \ + (void)close(_creat_fd); \ } while(0); ATF_REQUIRE_MSG(mkdir("t", 0755) == 0, From owner-svn-src-all@freebsd.org Wed Jan 11 07:22:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4037CAA703; Wed, 11 Jan 2017 07:22:00 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC633143E; Wed, 11 Jan 2017 07:22:00 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0B7Lx8l034644; Wed, 11 Jan 2017 07:21:59 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B7LxDm034643; Wed, 11 Jan 2017 07:21:59 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201701110721.v0B7LxDm034643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 11 Jan 2017 07:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311918 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 07:22:01 -0000 Author: hrs Date: Wed Jan 11 07:21:59 2017 New Revision: 311918 URL: https://svnweb.freebsd.org/changeset/base/311918 Log: Add more #ifdef INET and INET6. Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Wed Jan 11 07:17:03 2017 (r311917) +++ head/usr.sbin/syslogd/syslogd.c Wed Jan 11 07:21:59 2017 (r311918) @@ -89,9 +89,11 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(INET) || defined(INET6) #include -#include #include +#endif +#include #include #include @@ -127,8 +129,11 @@ static const char include_ext[] = ".conf #define MAXUNAMES 20 /* maximum number of user names */ #define sstosa(ss) ((struct sockaddr *)(ss)) +#ifdef INET #define sstosin(ss) ((struct sockaddr_in *)(void *)(ss)) #define satosin(sa) ((struct sockaddr_in *)(void *)(sa)) +#endif +#ifdef INET6 #define sstosin6(ss) ((struct sockaddr_in6 *)(void *)(ss)) #define satosin6(sa) ((struct sockaddr_in6 *)(void *)(sa)) #define s6_addr32 __u6_addr.__u6_addr32 @@ -137,6 +142,7 @@ static const char include_ext[] = ".conf (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) +#endif /* * List of peers and sockets for binding. */ @@ -1305,10 +1311,12 @@ fprintlog(struct filed *f, int flags, co case F_FORW: dprintf(" %s", f->fu_forw_hname); switch (f->fu_forw_addr->ai_addr->sa_family) { +#ifdef INET case AF_INET: dprintf(":%d\n", ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port)); break; +#endif #ifdef INET6 case AF_INET6: dprintf(":%d\n", @@ -1929,7 +1937,20 @@ init(int signo) break; case F_FORW: - port = ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port); + switch (f->fu_forw_addr->ai_addr->sa_family) { +#ifdef INET + case AF_INET: + port = ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port); + break; +#endif +#ifdef INET6 + case AF_INET6: + port = ntohs(satosin6(f->fu_forw_addr->ai_addr)->sin6_port); + break; +#endif + default: + port = 0; + } if (port != 514) { printf("%s:%d", f->fu_forw_hname, port); @@ -2410,6 +2431,7 @@ timedout(int sig __unused) static int allowaddr(char *s) { +#if defined(INET) || defined(INET6) char *cp1, *cp2; struct allowedpeer *ap; struct servent *se; @@ -2571,6 +2593,7 @@ allowaddr(char *s) } printf("port = %d\n", ap->port); } +#endif return (0); } From owner-svn-src-all@freebsd.org Wed Jan 11 07:22:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7545ACAA888; Wed, 11 Jan 2017 07:22:22 +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 423011621; Wed, 11 Jan 2017 07:22:22 +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 v0B7MLxQ035454; Wed, 11 Jan 2017 07:22:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B7MLGi035453; Wed, 11 Jan 2017 07:22:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701110722.v0B7MLGi035453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 11 Jan 2017 07:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311919 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 07:22:22 -0000 Author: ngie Date: Wed Jan 11 07:22:21 2017 New Revision: 311919 URL: https://svnweb.freebsd.org/changeset/base/311919 Log: Partially revert r311236 There's no sense in trying to close a file descriptor from the negative cases with unlink_test; it's best to ignore these cases. The mkfifo case does make sense to keep though. MFC after: 3 days Modified: head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Wed Jan 11 07:21:59 2017 (r311918) +++ head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Wed Jan 11 07:22:21 2017 (r311919) @@ -63,12 +63,7 @@ ATF_TC_BODY(unlink_basic, tc) ATF_REQUIRE(unlink(path) == 0); errno = 0; -#ifdef __FreeBSD__ - ATF_REQUIRE_ERRNO(ENOENT, (fd = open(path, O_RDONLY)) == -1); - (void)close(fd); -#else ATF_REQUIRE_ERRNO(ENOENT, open(path, O_RDONLY) == -1); -#endif } } @@ -128,12 +123,7 @@ ATF_TC_BODY(unlink_fifo, tc) ATF_REQUIRE(unlink(path) == 0); errno = 0; -#ifdef __FreeBSD__ - ATF_REQUIRE_ERRNO(ENOENT, (fd = open(path, O_RDONLY)) == -1); - (void)close(fd); -#else ATF_REQUIRE_ERRNO(ENOENT, open(path, O_RDONLY) == -1); -#endif } ATF_TC_CLEANUP(unlink_fifo, tc) From owner-svn-src-all@freebsd.org Wed Jan 11 07:45:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAF60CAAE1F; Wed, 11 Jan 2017 07:45:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4381FC8; Wed, 11 Jan 2017 07:45:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0B7jT29043768; Wed, 11 Jan 2017 07:45:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B7jTVM043767; Wed, 11 Jan 2017 07:45:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701110745.v0B7jTVM043767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Jan 2017 07:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311920 - stable/11/sys/dev/isci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 07:45:30 -0000 Author: mav Date: Wed Jan 11 07:45:29 2017 New Revision: 311920 URL: https://svnweb.freebsd.org/changeset/base/311920 Log: MFC r310703: Pass proper arguments (handles, not directly structure pointers) to scif_cb_domain_device_removed(). This should fix NULL dereference on task management function timeout. Modified: stable/11/sys/dev/isci/isci_task_request.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isci/isci_task_request.c ============================================================================== --- stable/11/sys/dev/isci/isci_task_request.c Wed Jan 11 07:22:21 2017 (r311919) +++ stable/11/sys/dev/isci/isci_task_request.c Wed Jan 11 07:45:29 2017 (r311920) @@ -210,8 +210,9 @@ isci_task_request_complete(SCI_CONTROLLE retry_task = FALSE; isci_log_message(0, "ISCI", "task timeout - not retrying\n"); - scif_cb_domain_device_removed(isci_controller, - isci_remote_device->domain, isci_remote_device); + scif_cb_domain_device_removed(scif_controller, + isci_remote_device->domain->sci_object, + remote_device); } else { retry_task = TRUE; isci_log_message(0, "ISCI", From owner-svn-src-all@freebsd.org Wed Jan 11 07:46:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F24CAAE92; Wed, 11 Jan 2017 07:46:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD9871130; Wed, 11 Jan 2017 07:46:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0B7k1I5043845; Wed, 11 Jan 2017 07:46:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B7k1hs043844; Wed, 11 Jan 2017 07:46:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701110746.v0B7k1hs043844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Jan 2017 07:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311921 - stable/10/sys/dev/isci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 07:46:03 -0000 Author: mav Date: Wed Jan 11 07:46:01 2017 New Revision: 311921 URL: https://svnweb.freebsd.org/changeset/base/311921 Log: MFC r310703: Pass proper arguments (handles, not directly structure pointers) to scif_cb_domain_device_removed(). This should fix NULL dereference on task management function timeout. Modified: stable/10/sys/dev/isci/isci_task_request.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isci/isci_task_request.c ============================================================================== --- stable/10/sys/dev/isci/isci_task_request.c Wed Jan 11 07:45:29 2017 (r311920) +++ stable/10/sys/dev/isci/isci_task_request.c Wed Jan 11 07:46:01 2017 (r311921) @@ -210,8 +210,9 @@ isci_task_request_complete(SCI_CONTROLLE retry_task = FALSE; isci_log_message(0, "ISCI", "task timeout - not retrying\n"); - scif_cb_domain_device_removed(isci_controller, - isci_remote_device->domain, isci_remote_device); + scif_cb_domain_device_removed(scif_controller, + isci_remote_device->domain->sci_object, + remote_device); } else { retry_task = TRUE; isci_log_message(0, "ISCI", From owner-svn-src-all@freebsd.org Wed Jan 11 08:15:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C369CAAA92; Wed, 11 Jan 2017 08:15:23 +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 B197F10B3; Wed, 11 Jan 2017 08:15:22 +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 v0B8FMOm055941; Wed, 11 Jan 2017 08:15:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B8FJxP055910; Wed, 11 Jan 2017 08:15:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701110815.v0B8FJxP055910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 11 Jan 2017 08:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311922 - in vendor/NetBSD/tests/dist/lib/libc: . c063 gen gen/posix_spawn string sys X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 08:15:23 -0000 Author: ngie Date: Wed Jan 11 08:15:18 2017 New Revision: 311922 URL: https://svnweb.freebsd.org/changeset/base/311922 Log: Pull in changes from upstream for lib/libc/{c063,gen,string,sys} to address issues resolved in FreeBSD or support added to testcases In collaboration with: Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_faccessat.c vendor/NetBSD/tests/dist/lib/libc/c063/t_fchmodat.c vendor/NetBSD/tests/dist/lib/libc/c063/t_fchownat.c vendor/NetBSD/tests/dist/lib/libc/c063/t_fexecve.c vendor/NetBSD/tests/dist/lib/libc/c063/t_fstatat.c vendor/NetBSD/tests/dist/lib/libc/c063/t_mkfifoat.c vendor/NetBSD/tests/dist/lib/libc/c063/t_mknodat.c vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c vendor/NetBSD/tests/dist/lib/libc/c063/t_openat.c vendor/NetBSD/tests/dist/lib/libc/c063/t_readlinkat.c vendor/NetBSD/tests/dist/lib/libc/c063/t_unlinkat.c vendor/NetBSD/tests/dist/lib/libc/c063/t_utimensat.c vendor/NetBSD/tests/dist/lib/libc/gen/posix_spawn/t_fileactions.c vendor/NetBSD/tests/dist/lib/libc/gen/t_assert.c vendor/NetBSD/tests/dist/lib/libc/gen/t_dir.c vendor/NetBSD/tests/dist/lib/libc/gen/t_ftok.c vendor/NetBSD/tests/dist/lib/libc/gen/t_humanize_number.c vendor/NetBSD/tests/dist/lib/libc/gen/t_sleep.c vendor/NetBSD/tests/dist/lib/libc/gen/t_time.c vendor/NetBSD/tests/dist/lib/libc/gen/t_ttyname.c vendor/NetBSD/tests/dist/lib/libc/gen/t_vis.c vendor/NetBSD/tests/dist/lib/libc/string/t_strchr.c vendor/NetBSD/tests/dist/lib/libc/string/t_strerror.c vendor/NetBSD/tests/dist/lib/libc/sys/t_access.c vendor/NetBSD/tests/dist/lib/libc/sys/t_chroot.c vendor/NetBSD/tests/dist/lib/libc/sys/t_mincore.c vendor/NetBSD/tests/dist/lib/libc/sys/t_mmap.c vendor/NetBSD/tests/dist/lib/libc/sys/t_wait.c vendor/NetBSD/tests/dist/lib/libc/t_cdb.c Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_faccessat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_faccessat.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_faccessat.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_faccessat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_faccessat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,7 +41,6 @@ __RCSID("$NetBSD: t_faccessat.c,v 1.2 20 #include #include #include -#include #define DIR "dir" #define FILE "dir/faccessat" Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_fchmodat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_fchmodat.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_fchmodat.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_fchmodat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_fchmodat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,7 +41,6 @@ __RCSID("$NetBSD: t_fchmodat.c,v 1.2 201 #include #include #include -#include #define DIR "dir" #define FILE "dir/fchmodat" Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_fchownat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_fchownat.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_fchownat.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fchownat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_fchownat.c,v 1.4 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_fchownat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_fchownat.c,v 1.4 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -40,7 +42,6 @@ __RCSID("$NetBSD: t_fchownat.c,v 1.3 201 #include #include #include -#include #define DIR "dir" #define FILE "dir/fchownat" Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_fexecve.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_fexecve.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_fexecve.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fexecve.c,v 1.2 2013/03/17 04:35:59 jmmv Exp $ */ +/* $NetBSD: t_fexecve.c,v 1.3 2017/01/10 15:15:09 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_fexecve.c,v 1.2 2013/03/17 04:35:59 jmmv Exp $"); +__RCSID("$NetBSD: t_fexecve.c,v 1.3 2017/01/10 15:15:09 christos Exp $"); #include @@ -70,6 +70,7 @@ ATF_TC_BODY(fexecve, tc) error = 76; else error = EXIT_FAILURE; + (void)close(fd); err(error, "fexecve"); } } Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_fstatat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_fstatat.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_fstatat.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fstatat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_fstatat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_fstatat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_fstatat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,7 +41,6 @@ __RCSID("$NetBSD: t_fstatat.c,v 1.2 2013 #include #include #include -#include #define DIR "dir" #define FILE "dir/fstatat" Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_mkfifoat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_mkfifoat.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_mkfifoat.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mkfifoat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_mkfifoat.c,v 1.3 2017/01/10 15:15:09 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mkfifoat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_mkfifoat.c,v 1.3 2017/01/10 15:15:09 christos Exp $"); #include #include @@ -63,6 +63,7 @@ ATF_TC_BODY(mkfifoat_fd, tc) ATF_REQUIRE((fd = mkfifoat(dfd, BASEFIFO, mode)) != -1); ATF_REQUIRE(close(fd) == 0); ATF_REQUIRE(access(FIFO, F_OK) == 0); + (void)close(dfd); } ATF_TC(mkfifoat_fdcwd); Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_mknodat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_mknodat.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_mknodat.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mknodat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_mknodat.c,v 1.4 2017/01/10 15:15:09 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mknodat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_mknodat.c,v 1.4 2017/01/10 15:15:09 christos Exp $"); #include #include @@ -80,6 +80,7 @@ ATF_TC_BODY(mknodat_fd, tc) ATF_REQUIRE((fd = mknodat(dfd, BASEFILE, mode, dev)) != -1); ATF_REQUIRE(close(fd) == 0); ATF_REQUIRE(access(FILE, F_OK) == 0); + (void)close(dfd); } ATF_TC(mknodat_fdcwd); Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_o_search.c,v 1.4 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_o_search.c,v 1.5 2017/01/10 22:25:01 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,9 +29,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_o_search.c,v 1.4 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_o_search.c,v 1.5 2017/01/10 22:25:01 christos Exp $"); #include + +#include +#include + #include #include #include @@ -40,7 +44,6 @@ __RCSID("$NetBSD: t_o_search.c,v 1.4 201 #include #include #include -#include /* * dholland 20130112: disable tests that require O_SEARCH semantics Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_openat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_openat.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_openat.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_openat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_openat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_openat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_openat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,7 +41,6 @@ __RCSID("$NetBSD: t_openat.c,v 1.2 2013/ #include #include #include -#include #define DIR "dir" #define FILE "dir/openat" Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_readlinkat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_readlinkat.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_readlinkat.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_readlinkat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_readlinkat.c,v 1.4 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_readlinkat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_readlinkat.c,v 1.4 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,7 +41,6 @@ __RCSID("$NetBSD: t_readlinkat.c,v 1.3 2 #include #include #include -#include #define DIR "dir" #define FILE "dir/readlinkat" Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_unlinkat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_unlinkat.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_unlinkat.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_unlinkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_unlinkat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_unlinkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_unlinkat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,7 +41,6 @@ __RCSID("$NetBSD: t_unlinkat.c,v 1.2 201 #include #include #include -#include #define DIR "dir" #define FILE "dir/unlinkat" Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_utimensat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_utimensat.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_utimensat.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_utimensat.c,v 1.5 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_utimensat.c,v 1.6 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_utimensat.c,v 1.5 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_utimensat.c,v 1.6 2017/01/10 15:13:56 christos Exp $"); +#include +#include +#include #include #include #include @@ -39,8 +42,6 @@ __RCSID("$NetBSD: t_utimensat.c,v 1.5 20 #include #include #include -#include -#include #define DIR "dir" #define FILE "dir/utimensat" Modified: vendor/NetBSD/tests/dist/lib/libc/gen/posix_spawn/t_fileactions.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/posix_spawn/t_fileactions.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/gen/posix_spawn/t_fileactions.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fileactions.c,v 1.5 2012/04/09 19:42:07 martin Exp $ */ +/* $NetBSD: t_fileactions.c,v 1.6 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -32,6 +32,10 @@ #include + +#include +#include + #include #include #include @@ -39,7 +43,6 @@ #include #include #include -#include ATF_TC(t_spawn_openmode); Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_assert.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_assert.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_assert.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_assert.c,v 1.2 2011/06/14 05:28:00 jruoho Exp $ */ +/* $NetBSD: t_assert.c,v 1.3 2017/01/10 15:17:57 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,8 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_assert.c,v 1.2 2011/06/14 05:28:00 jruoho Exp $"); +__RCSID("$NetBSD: t_assert.c,v 1.3 2017/01/10 15:17:57 christos Exp $"); +#include +#include +#include #include #include @@ -40,6 +43,17 @@ __RCSID("$NetBSD: t_assert.c,v 1.2 2011/ #include #include +static void +disable_corefile(void) +{ + struct rlimit limits; + + limits.rlim_cur = 0; + limits.rlim_max = 0; + + ATF_REQUIRE(setrlimit(RLIMIT_CORE, &limits) == 0); +} + static void handler(int); static void @@ -65,6 +79,7 @@ ATF_TC_BODY(assert_false, tc) if (pid == 0) { + disable_corefile(); (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); @@ -102,6 +117,7 @@ ATF_TC_BODY(assert_true, tc) if (pid == 0) { + disable_corefile(); (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_dir.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_dir.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_dir.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_dir.c,v 1.6 2013/10/19 17:45:00 christos Exp $ */ +/* $NetBSD: t_dir.c,v 1.8 2017/01/11 07:26:17 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -26,18 +26,19 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include - +#include #include +#include #include #include +#include #include #include #include #include #include -#include + ATF_TC(seekdir_basic); ATF_TC_HEAD(seekdir_basic, tc) @@ -54,10 +55,19 @@ ATF_TC_BODY(seekdir_basic, tc) struct dirent *entry; long here; - mkdir("t", 0755); - creat("t/a", 0600); - creat("t/b", 0600); - creat("t/c", 0600); +#define CREAT(x, m) do { \ + int _creat_fd; \ + ATF_REQUIRE_MSG((_creat_fd = creat((x), (m)) != -1), \ + "creat(%s, %x) failed: %s", (x), (m), \ + strerror(errno)); \ + (void)close(_creat_fd); \ + } while(0); + + ATF_REQUIRE_MSG(mkdir("t", 0755) == 0, + "mkdir failed: %s", strerror(errno)); + CREAT("t/a", 0600); + CREAT("t/b", 0600); + CREAT("t/c", 0600); dp = opendir("t"); if ( dp == NULL) @@ -70,6 +80,8 @@ ATF_TC_BODY(seekdir_basic, tc) /* get first entry */ entry = readdir(dp); here = telldir(dp); + ATF_REQUIRE_MSG(here != -1, + "telldir failed: %s", strerror(errno)); /* get second entry */ entry = readdir(dp); @@ -109,6 +121,7 @@ ATF_TC_BODY(seekdir_basic, tc) atf_tc_fail("3rd seekdir found wrong name"); closedir(dp); + free(wasname); } ATF_TC(telldir_leak); Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_ftok.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_ftok.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_ftok.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ftok.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $ */ +/* $NetBSD: t_ftok.c,v 1.2 2017/01/10 15:19:52 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_ftok.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $"); +__RCSID("$NetBSD: t_ftok.c,v 1.2 2017/01/10 15:19:52 christos Exp $"); #include #include @@ -68,6 +68,7 @@ ATF_TC_BODY(ftok_link, tc) fd = open(path, O_RDONLY | O_CREAT); ATF_REQUIRE(fd >= 0); + (void)close(fd); ATF_REQUIRE(link(path, hlnk) == 0); ATF_REQUIRE(symlink(path, slnk) == 0); Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_humanize_number.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_humanize_number.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_humanize_number.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_humanize_number.c,v 1.8 2012/03/18 07:14:08 jruoho Exp $ */ +/* $NetBSD: t_humanize_number.c,v 1.9 2017/01/10 15:20:44 christos Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. @@ -241,6 +241,7 @@ ATF_TC_BODY(humanize_number_basic, tc) newline(); atf_tc_fail_nonfatal("Failed for table entry %d", i); } + free(buf); } ATF_TC(humanize_number_big); Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_sleep.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_sleep.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_sleep.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_sleep.c,v 1.9 2016/08/11 21:34:11 kre Exp $ */ +/* $NetBSD: t_sleep.c,v 1.11 2017/01/10 15:43:59 maya Exp $ */ /*- * Copyright (c) 2006 Frank Kardel @@ -26,8 +26,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include +#include +#include +#include /* for TIMESPEC_TO_TIMEVAL on FreeBSD */ + #include #include +#include #include #include #include @@ -35,10 +41,6 @@ #include #include -#include -#include -#include - #include "isqemu.h" #define BILLION 1000000000LL /* nano-seconds per second */ Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_time.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_time.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_time.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $ */ +/* $NetBSD: t_time.c,v 1.4 2017/01/10 15:32:46 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $"); +__RCSID("$NetBSD: t_time.c,v 1.4 2017/01/10 15:32:46 christos Exp $"); #include #include @@ -38,6 +38,7 @@ __RCSID("$NetBSD: t_time.c,v 1.3 2014/10 #include #include #include +#include #include ATF_TC(time_copy); Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_ttyname.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_ttyname.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_ttyname.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ttyname.c,v 1.3 2011/05/01 18:14:01 jruoho Exp $ */ +/* $NetBSD: t_ttyname.c,v 1.4 2017/01/10 15:33:40 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_ttyname.c,v 1.3 2011/05/01 18:14:01 jruoho Exp $"); +__RCSID("$NetBSD: t_ttyname.c,v 1.4 2017/01/10 15:33:40 christos Exp $"); #include #include @@ -78,6 +78,7 @@ ATF_TC_BODY(ttyname_err, tc) ATF_REQUIRE(ttyname(fd) == NULL); ATF_REQUIRE(errno == ENOTTY); + (void)close(fd); } } Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_vis.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_vis.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_vis.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_vis.c,v 1.8 2015/05/23 14:02:11 christos Exp $ */ +/* $NetBSD: t_vis.c,v 1.9 2017/01/10 15:16:57 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -144,6 +144,7 @@ ATF_TC_BODY(strunvis_hex, tc) } } +#ifdef VIS_NOLOCALE ATF_TC(strvis_locale); ATF_TC_HEAD(strvis_locale, tc) { @@ -172,6 +173,7 @@ ATF_TC_BODY(strvis_locale, tc) setlocale(LC_CTYPE, ol); free(ol); } +#endif /* VIS_NOLOCALE */ ATF_TP_ADD_TCS(tp) { @@ -180,7 +182,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strvis_null); ATF_TP_ADD_TC(tp, strvis_empty); ATF_TP_ADD_TC(tp, strunvis_hex); +#ifdef VIS_NOLOCALE ATF_TP_ADD_TC(tp, strvis_locale); +#endif /* VIS_NOLOCALE */ return atf_no_error(); } Modified: vendor/NetBSD/tests/dist/lib/libc/string/t_strchr.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/string/t_strchr.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/string/t_strchr.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_strchr.c,v 1.1 2011/07/07 08:59:33 jruoho Exp $ */ +/* $NetBSD: t_strchr.c,v 1.2 2017/01/10 15:34:49 christos Exp $ */ /* * Written by J.T. Conklin @@ -58,9 +58,10 @@ ATF_TC_HEAD(strchr_basic, tc) ATF_TC_BODY(strchr_basic, tc) { - unsigned int t, a; + void *dl_handle; char *off; char buf[32]; + unsigned int t, a; const char *tab[] = { "", @@ -245,8 +246,8 @@ ATF_TC_BODY(strchr_basic, tc) "abcdefgh/abcdefgh/", }; - - strchr_fn = dlsym(dlopen(0, RTLD_LAZY), "test_strchr"); + dl_handle = dlopen(NULL, RTLD_LAZY); + strchr_fn = dlsym(dl_handle, "test_strlen"); if (!strchr_fn) strchr_fn = strchr; @@ -281,6 +282,7 @@ ATF_TC_BODY(strchr_basic, tc) verify_strchr(buf + a, 0xff, t, a); } } + (void)dlclose(dl_handle); } ATF_TP_ADD_TCS(tp) Modified: vendor/NetBSD/tests/dist/lib/libc/string/t_strerror.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/string/t_strerror.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/string/t_strerror.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_strerror.c,v 1.3 2011/05/10 06:55:27 jruoho Exp $ */ +/* $NetBSD: t_strerror.c,v 1.4 2017/01/10 20:35:49 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,10 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_strerror.c,v 1.3 2011/05/10 06:55:27 jruoho Exp $"); +__RCSID("$NetBSD: t_strerror.c,v 1.4 2017/01/10 20:35:49 christos Exp $"); #include #include +#include /* Needed for sys_nerr on FreeBSD */ #include #include #include Modified: vendor/NetBSD/tests/dist/lib/libc/sys/t_access.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/sys/t_access.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/sys/t_access.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_access.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */ +/* $NetBSD: t_access.c,v 1.2 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_access.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $"); +__RCSID("$NetBSD: t_access.c,v 1.2 2017/01/10 22:36:29 christos Exp $"); + +#include + +#include #include #include @@ -38,8 +42,6 @@ __RCSID("$NetBSD: t_access.c,v 1.1 2011/ #include #include -#include - static const char path[] = "access"; static const int mode[4] = { R_OK, W_OK, X_OK, F_OK }; Modified: vendor/NetBSD/tests/dist/lib/libc/sys/t_chroot.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/sys/t_chroot.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/sys/t_chroot.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_chroot.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */ +/* $NetBSD: t_chroot.c,v 1.2 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,9 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_chroot.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $"); +__RCSID("$NetBSD: t_chroot.c,v 1.2 2017/01/10 22:36:29 christos Exp $"); #include +#include #include #include Modified: vendor/NetBSD/tests/dist/lib/libc/sys/t_mincore.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/sys/t_mincore.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/sys/t_mincore.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mincore.c,v 1.8 2012/06/08 07:18:58 martin Exp $ */ +/* $NetBSD: t_mincore.c,v 1.9 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -59,9 +59,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mincore.c,v 1.8 2012/06/08 07:18:58 martin Exp $"); +__RCSID("$NetBSD: t_mincore.c,v 1.9 2017/01/10 22:36:29 christos Exp $"); #include +#include #include #include Modified: vendor/NetBSD/tests/dist/lib/libc/sys/t_mmap.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/sys/t_mmap.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/sys/t_mmap.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mmap.c,v 1.9 2015/02/28 13:57:08 martin Exp $ */ +/* $NetBSD: t_mmap.c,v 1.10 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -55,10 +55,11 @@ * SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mmap.c,v 1.9 2015/02/28 13:57:08 martin Exp $"); +__RCSID("$NetBSD: t_mmap.c,v 1.10 2017/01/10 22:36:29 christos Exp $"); #include #include +#include #include #include #include Modified: vendor/NetBSD/tests/dist/lib/libc/sys/t_wait.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/sys/t_wait.c Wed Jan 11 07:46:01 2017 (r311921) +++ vendor/NetBSD/tests/dist/lib/libc/sys/t_wait.c Wed Jan 11 08:15:18 2017 (r311922) @@ -1,4 +1,4 @@ -/* $NetBSD: t_wait.c,v 1.4 2016/04/27 21:14:24 christos Exp $ */ +/* $NetBSD: t_wait.c,v 1.7 2016/11/06 15:04:14 kamil Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_wait.c,v 1.4 2016/04/27 21:14:24 christos Exp $"); +__RCSID("$NetBSD: t_wait.c,v 1.7 2016/11/06 15:04:14 kamil Exp $"); #include #include @@ -60,22 +60,6 @@ ATF_TC_BODY(wait6_invalid, tc) && errno == EINVAL); } -ATF_TC(wait6_noproc); -ATF_TC_HEAD(wait6_noproc, tc) -{ - atf_tc_set_md_var(tc, "descr", - "Test that wait6(2) returns ECHILD with for no processes"); -} - -ATF_TC_BODY(wait6_noproc, tc) -{ - siginfo_t si; - struct wrusage wru; - int st; - ATF_REQUIRE(wait6(P_ALL, 0, &st, WEXITED, &wru, &si) == -1 - && errno == ECHILD); -} - ATF_TC(wait6_exited); ATF_TC_HEAD(wait6_exited, tc) { @@ -92,12 +76,12 @@ ATF_TC_BODY(wait6_exited, tc) switch (pid = fork()) { case -1: - ATF_REQUIRE(pid > 0); + ATF_REQUIRE(pid > 0); case 0: exit(0x5a5a5a5a); /*NOTREACHED*/ default: - ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); + ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); ATF_REQUIRE(WIFEXITED(st) && WEXITSTATUS(st) == 0x5a); ATF_REQUIRE(si.si_status = 0x5a5a5a5a); ATF_REQUIRE(si.si_pid == pid); @@ -128,10 +112,10 @@ ATF_TC_BODY(wait6_terminated, tc) sleep(100); /*FALLTHROUGH*/ case -1: - ATF_REQUIRE(pid > 0); + ATF_REQUIRE(pid > 0); default: ATF_REQUIRE(kill(pid, SIGTERM) == 0); - ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); + ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); ATF_REQUIRE(WIFSIGNALED(st) && WTERMSIG(st) == SIGTERM); ATF_REQUIRE(si.si_status == SIGTERM); ATF_REQUIRE(si.si_pid == pid); @@ -164,9 +148,9 @@ ATF_TC_BODY(wait6_coredumped, tc) *(char *)8 = 0; /*FALLTHROUGH*/ case -1: - ATF_REQUIRE(pid > 0); + ATF_REQUIRE(pid > 0); default: - ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); + ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); ATF_REQUIRE(WIFSIGNALED(st) && WTERMSIG(st) == SIGSEGV && WCOREDUMP(st)); ATF_REQUIRE(si.si_status == SIGSEGV); @@ -200,11 +184,14 @@ ATF_TC_BODY(wait6_stop_and_go, tc) sleep(100); /*FALLTHROUGH*/ case -1: - ATF_REQUIRE(pid > 0); + ATF_REQUIRE(pid > 0); default: ATF_REQUIRE(kill(pid, SIGSTOP) == 0); - ATF_REQUIRE(wait6(P_PID, pid, &st, WSTOPPED, &wru, &si) == pid); + ATF_REQUIRE(wait6(P_PID, pid, &st, WSTOPPED, &wru, &si) == pid); + ATF_REQUIRE(!WIFEXITED(st)); + ATF_REQUIRE(!WIFSIGNALED(st)); ATF_REQUIRE(WIFSTOPPED(st) && WSTOPSIG(st) == SIGSTOP); + ATF_REQUIRE(!WIFCONTINUED(st)); ATF_REQUIRE(si.si_status == SIGSTOP); ATF_REQUIRE(si.si_pid == pid); ATF_REQUIRE(si.si_uid == getuid()); @@ -213,8 +200,11 @@ ATF_TC_BODY(wait6_stop_and_go, tc) (uintmax_t)si.si_utime); ATF_REQUIRE(kill(pid, SIGCONT) == 0); - ATF_REQUIRE(wait6(P_PID, pid, &st, WCONTINUED, &wru, &si) == pid); + ATF_REQUIRE(wait6(P_PID, pid, &st, WCONTINUED, &wru, &si) == pid); + ATF_REQUIRE(!WIFEXITED(st)); + ATF_REQUIRE(!WIFSIGNALED(st)); ATF_REQUIRE(WIFCONTINUED(st)); + ATF_REQUIRE(!WIFSTOPPED(st)); ATF_REQUIRE(si.si_status == SIGCONT); ATF_REQUIRE(si.si_pid == pid); ATF_REQUIRE(si.si_uid == getuid()); @@ -223,8 +213,11 @@ ATF_TC_BODY(wait6_stop_and_go, tc) (uintmax_t)si.si_utime); ATF_REQUIRE(kill(pid, SIGQUIT) == 0); - ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); + ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); + ATF_REQUIRE(!WIFEXITED(st)); ATF_REQUIRE(WIFSIGNALED(st) && WTERMSIG(st) == SIGQUIT); + ATF_REQUIRE(!WIFSTOPPED(st)); + ATF_REQUIRE(!WIFCONTINUED(st)); ATF_REQUIRE(si.si_status == SIGQUIT); ATF_REQUIRE(si.si_pid == pid); ATF_REQUIRE(si.si_uid == getuid()); @@ -235,15 +228,78 @@ ATF_TC_BODY(wait6_stop_and_go, tc) } } +ATF_TC(wait6_stopgo_loop); +ATF_TC_HEAD(wait6_stopgo_loop, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test that wait6(2) handled stopped/continued process loop"); +} + +ATF_TC_BODY(wait6_stopgo_loop, tc) +{ + siginfo_t si; + struct wrusage wru; + int st; + pid_t pid; + static const struct rlimit rl = { 0, 0 }; + size_t N = 100; + + ATF_REQUIRE(setrlimit(RLIMIT_CORE, &rl) == 0); + switch (pid = fork()) { + case 0: + sleep(100); + /*FALLTHROUGH*/ + case -1: + ATF_REQUIRE(pid > 0); + } + + printf("Before loop of SIGSTOP/SIGCONT sequence %zu times\n", N); + while (N --> 0) { + ATF_REQUIRE(kill(pid, SIGSTOP) == 0); + ATF_REQUIRE(wait6(P_PID, pid, &st, WSTOPPED, &wru, &si) == pid); + ATF_REQUIRE(!WIFEXITED(st)); + ATF_REQUIRE(!WIFSIGNALED(st)); + ATF_REQUIRE(WIFSTOPPED(st) && WSTOPSIG(st) == SIGSTOP); + ATF_REQUIRE(!WIFCONTINUED(st)); + ATF_REQUIRE(si.si_status == SIGSTOP); + ATF_REQUIRE(si.si_pid == pid); + ATF_REQUIRE(si.si_uid == getuid()); + ATF_REQUIRE(si.si_code == CLD_STOPPED); + + ATF_REQUIRE(kill(pid, SIGCONT) == 0); + ATF_REQUIRE(wait6(P_PID, pid, &st, WCONTINUED, &wru, &si) == pid); + ATF_REQUIRE(!WIFEXITED(st)); + ATF_REQUIRE(!WIFSIGNALED(st)); + ATF_REQUIRE(WIFCONTINUED(st)); + ATF_REQUIRE(!WIFSTOPPED(st)); + ATF_REQUIRE(si.si_status == SIGCONT); + ATF_REQUIRE(si.si_pid == pid); + ATF_REQUIRE(si.si_uid == getuid()); + ATF_REQUIRE(si.si_code == CLD_CONTINUED); + } + ATF_REQUIRE(kill(pid, SIGQUIT) == 0); + ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); + ATF_REQUIRE(!WIFEXITED(st)); + ATF_REQUIRE(WIFSIGNALED(st) && WTERMSIG(st) == SIGQUIT); + ATF_REQUIRE(!WIFSTOPPED(st)); + ATF_REQUIRE(!WIFCONTINUED(st)); + ATF_REQUIRE(si.si_status == SIGQUIT); + ATF_REQUIRE(si.si_pid == pid); + ATF_REQUIRE(si.si_uid == getuid()); + ATF_REQUIRE(si.si_code == CLD_KILLED); + printf("user: %ju system: %ju\n", (uintmax_t)si.si_utime, + (uintmax_t)si.si_utime); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, wait6_invalid); - ATF_TP_ADD_TC(tp, wait6_noproc); ATF_TP_ADD_TC(tp, wait6_exited); ATF_TP_ADD_TC(tp, wait6_terminated); ATF_TP_ADD_TC(tp, wait6_coredumped); ATF_TP_ADD_TC(tp, wait6_stop_and_go); + ATF_TP_ADD_TC(tp, wait6_stopgo_loop); return atf_no_error(); } Modified: vendor/NetBSD/tests/dist/lib/libc/t_cdb.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/t_cdb.c Wed Jan 11 07:46:01 2017 (r311921) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 11 08:43:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C8B5CA96BE; Wed, 11 Jan 2017 08:43:59 +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 4937E123B; Wed, 11 Jan 2017 08:43:59 +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 v0B8hwQB068148; Wed, 11 Jan 2017 08:43:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B8hwlR068147; Wed, 11 Jan 2017 08:43:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701110843.v0B8hwlR068147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 11 Jan 2017 08:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311923 - head/sys/modules/sdhci_acpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 08:43:59 -0000 Author: ngie Date: Wed Jan 11 08:43:58 2017 New Revision: 311923 URL: https://svnweb.freebsd.org/changeset/base/311923 Log: Add acpi_if.h and opt_acpi.h to Makefile to unbreak "make depend" with sys/modules/sdhci_acpi MFC after: 6 days X-MFC with: r311911 Reported by: Jenkins Modified: head/sys/modules/sdhci_acpi/Makefile Modified: head/sys/modules/sdhci_acpi/Makefile ============================================================================== --- head/sys/modules/sdhci_acpi/Makefile Wed Jan 11 08:15:18 2017 (r311922) +++ head/sys/modules/sdhci_acpi/Makefile Wed Jan 11 08:43:58 2017 (r311923) @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/../../dev/sdhci KMOD= sdhci_acpi -SRCS= sdhci_acpi.c sdhci.h sdhci_if.h device_if.h bus_if.h pci_if.h mmcbr_if.h +SRCS= sdhci_acpi.c sdhci.h sdhci_if.h +SRCS+= acpi_if.h device_if.h bus_if.h opt_acpi.h pci_if.h mmcbr_if.h .include From owner-svn-src-all@freebsd.org Wed Jan 11 08:45:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 692B7CA975A; Wed, 11 Jan 2017 08:45:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34DE11418; Wed, 11 Jan 2017 08:45:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x242.google.com with SMTP id b1so53146603pgc.1; Wed, 11 Jan 2017 00:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=MzW3R7ThjonW9VaBZ9ZePLrbEzg480rxXv/M0dkUjB0=; b=uE7pMQffTWlj+Ub54Wfi6a1YCPEXHznDsCesQPzY822B1/dE76LQWR4tOpKFBM/jF0 zooSY7NcU2238RaRmNztXojF4MWoXDZQJLeGJWVKV+8oHt/DroVPBOcfABCg4WRRzrbL BvqvAAqT+80AEZAH1KeKYbvsHj5OHe8mW4IdYTPMuHYCSKqp0fy2omyhtZule94HYjKM HAgJg7LKasXR7T2kWkE2oS2ihM079WheACVg/+2IRADjCC68R/8CWu6IMHrvOMPyQRNh 9FTnS4lt30TDDalOgNIUWsHNzDUb57tWcqZonDkep6JkFFuvbjUUvowa6GR7rlj+wE2I JVyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=MzW3R7ThjonW9VaBZ9ZePLrbEzg480rxXv/M0dkUjB0=; b=F/qz7T3Zm+C0URtiRuNXVNJT7Jdc6X9OVnbUbH9uChDgTw41kRtPSnhY6qvdIyn5EC uIAPfUb1XFg9TSqRnIRSYFgjpD/qpTB0nafNF0xFgZsQ4TImA5/rgCL3bsScRXT5BHql d0dWiTA+CS9+GUURWlUw8Grx9rTlJluFNOoQiiNulbmmeihH2a9nKMsD0/JFQMiPFx3P KeF26YtsYHa+UE4znE1+K5Xv1rki9KGBT1mJPC3lVY8DZTjX0TOLNoS3w9+uZRZLkq+C kCfzim5hjOKWBs4Me4v3569uQRe+3fpFf4N9MoXTSbyxbL+NalPRfhMW3zJozAurBn30 5XlQ== X-Gm-Message-State: AIkVDXKLG5EIhDXYkb6EaIP6ybu/ifX+7J3WXYoAZp+yZKUSVeWl8sxO8X2PAtpi4KwFcw== X-Received: by 10.84.232.78 with SMTP id f14mr11717627pln.27.1484124342653; Wed, 11 Jan 2017 00:45:42 -0800 (PST) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id t15sm11594408pgn.18.2017.01.11.00.45.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 00:45:42 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r311911 - in head/sys: conf dev/sdhci modules modules/sdhci_acpi From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701110153.v0B1rsws002127@repo.freebsd.org> Date: Wed, 11 Jan 2017 00:45:40 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <388FCCEE-8999-4DAD-9689-1C50D1F045FE@gmail.com> References: <201701110153.v0B1rsws002127@repo.freebsd.org> To: Oleksandr Tymoshenko X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 08:45:43 -0000 > On Jan 10, 2017, at 5:53 PM, Oleksandr Tymoshenko = wrote: >=20 > Author: gonzo > Date: Wed Jan 11 01:53:54 2017 > New Revision: 311911 > URL: https://svnweb.freebsd.org/changeset/base/311911 >=20 > Log: > [sdhci] Add ACPI platform support for SDHCI driver >=20 > - Create ACPI version of SDHCI attach/detach/accessors logic. Some > platforms (e.g. BayTrail-based Minnowboard) expose SDHCI devices > via ACPI, not PCI > - Add sdchi_acpi kernel module >=20 > Reviewed by: ian, imp > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D9112 Hi, This broke the build for a bit because of missing headers in = SRCS. Please MFC r311923 too. Thank you! -Ngie= From owner-svn-src-all@freebsd.org Wed Jan 11 09:34:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72BEFCAAABA; Wed, 11 Jan 2017 09:34: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 413231089; Wed, 11 Jan 2017 09:34: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 v0B9YgZK088667; Wed, 11 Jan 2017 09:34:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B9YgGW088665; Wed, 11 Jan 2017 09:34:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701110934.v0B9YgGW088665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 11 Jan 2017 09:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311924 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 09:34:43 -0000 Author: ngie Date: Wed Jan 11 09:34:42 2017 New Revision: 311924 URL: https://svnweb.freebsd.org/changeset/base/311924 Log: Fix whitespace in comment MFC after: 3 days Modified: head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c head/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Wed Jan 11 08:43:58 2017 (r311923) +++ head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Wed Jan 11 09:34:42 2017 (r311924) @@ -64,7 +64,7 @@ ATF_TC_BODY(setdomainname_basic, tc) (void)memset(name, 0, sizeof(name)); #ifdef __FreeBSD__ - /* + /* * Sanity checks to ensure that the wrong invariant isn't being * tested for per PR # 181127 */ Modified: head/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Wed Jan 11 08:43:58 2017 (r311923) +++ head/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Wed Jan 11 09:34:42 2017 (r311924) @@ -66,7 +66,7 @@ ATF_TC_BODY(sethostname_basic, tc) (void)memset(name, 0, sizeof(name)); #ifdef __FreeBSD__ - /* + /* * Sanity checks to ensure that the wrong invariant isn't being * tested for per PR # 181127 */ From owner-svn-src-all@freebsd.org Wed Jan 11 09:51:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AAC9CAA20B; Wed, 11 Jan 2017 09:51: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 230701A77; Wed, 11 Jan 2017 09:51: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 v0B9pbOK094495; Wed, 11 Jan 2017 09:51:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B9pYPl094461; Wed, 11 Jan 2017 09:51:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701110951.v0B9pYPl094461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 11 Jan 2017 09:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311925 - in head/contrib/netbsd-tests/lib/libc: . c063 gen gen/posix_spawn string sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 09:51:38 -0000 Author: ngie Date: Wed Jan 11 09:51:34 2017 New Revision: 311925 URL: https://svnweb.freebsd.org/changeset/base/311925 Log: Import testcase updates with code contributed back to NetBSD This also (inadvertently) contains an update to contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases). MFC after: 2 weeks In collaboration with: christos@NetBSD.org Modified: head/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c head/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c head/contrib/netbsd-tests/lib/libc/c063/t_fchownat.c head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c head/contrib/netbsd-tests/lib/libc/c063/t_fstatat.c head/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c head/contrib/netbsd-tests/lib/libc/c063/t_openat.c head/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c head/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c head/contrib/netbsd-tests/lib/libc/gen/t_assert.c head/contrib/netbsd-tests/lib/libc/gen/t_dir.c head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c head/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c head/contrib/netbsd-tests/lib/libc/gen/t_time.c head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c head/contrib/netbsd-tests/lib/libc/gen/t_vis.c head/contrib/netbsd-tests/lib/libc/string/t_strchr.c head/contrib/netbsd-tests/lib/libc/string/t_strerror.c head/contrib/netbsd-tests/lib/libc/sys/t_access.c head/contrib/netbsd-tests/lib/libc/sys/t_chroot.c head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c head/contrib/netbsd-tests/lib/libc/sys/t_mmap.c head/contrib/netbsd-tests/lib/libc/sys/t_wait.c head/contrib/netbsd-tests/lib/libc/t_cdb.c Directory Properties: head/contrib/netbsd-tests/ (props changed) Modified: head/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_faccessat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_faccessat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,10 +41,6 @@ __RCSID("$NetBSD: t_faccessat.c,v 1.2 20 #include #include #include -#include -#ifdef __FreeBSD__ -#include -#endif #define DIR "dir" #define FILE "dir/faccessat" Modified: head/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_fchmodat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_fchmodat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,10 +41,6 @@ __RCSID("$NetBSD: t_fchmodat.c,v 1.2 201 #include #include #include -#include -#ifdef __FreeBSD__ -#include -#endif #define DIR "dir" #define FILE "dir/fchmodat" Modified: head/contrib/netbsd-tests/lib/libc/c063/t_fchownat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_fchownat.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_fchownat.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fchownat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_fchownat.c,v 1.4 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_fchownat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_fchownat.c,v 1.4 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -40,10 +42,6 @@ __RCSID("$NetBSD: t_fchownat.c,v 1.3 201 #include #include #include -#include -#ifdef __FreeBSD__ -#include -#endif #define DIR "dir" #define FILE "dir/fchownat" Modified: head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fexecve.c,v 1.2 2013/03/17 04:35:59 jmmv Exp $ */ +/* $NetBSD: t_fexecve.c,v 1.3 2017/01/10 15:15:09 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_fexecve.c,v 1.2 2013/03/17 04:35:59 jmmv Exp $"); +__RCSID("$NetBSD: t_fexecve.c,v 1.3 2017/01/10 15:15:09 christos Exp $"); #include @@ -70,9 +70,7 @@ ATF_TC_BODY(fexecve, tc) error = 76; else error = EXIT_FAILURE; -#ifdef __FreeBSD__ (void)close(fd); -#endif err(error, "fexecve"); } } Modified: head/contrib/netbsd-tests/lib/libc/c063/t_fstatat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_fstatat.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_fstatat.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fstatat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_fstatat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_fstatat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_fstatat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,10 +41,6 @@ __RCSID("$NetBSD: t_fstatat.c,v 1.2 2013 #include #include #include -#include -#ifdef __FreeBSD__ -#include -#endif #define DIR "dir" #define FILE "dir/fstatat" Modified: head/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mkfifoat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_mkfifoat.c,v 1.3 2017/01/10 15:15:09 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mkfifoat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_mkfifoat.c,v 1.3 2017/01/10 15:15:09 christos Exp $"); #include #include @@ -63,9 +63,7 @@ ATF_TC_BODY(mkfifoat_fd, tc) ATF_REQUIRE((fd = mkfifoat(dfd, BASEFIFO, mode)) != -1); ATF_REQUIRE(close(fd) == 0); ATF_REQUIRE(access(FIFO, F_OK) == 0); -#ifdef __FreeBSD__ (void)close(dfd); -#endif } ATF_TC(mkfifoat_fdcwd); Modified: head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mknodat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_mknodat.c,v 1.4 2017/01/10 15:15:09 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mknodat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_mknodat.c,v 1.4 2017/01/10 15:15:09 christos Exp $"); #include #include @@ -80,9 +80,7 @@ ATF_TC_BODY(mknodat_fd, tc) ATF_REQUIRE((fd = mknodat(dfd, BASEFILE, mode, dev)) != -1); ATF_REQUIRE(close(fd) == 0); ATF_REQUIRE(access(FILE, F_OK) == 0); -#ifdef __FreeBSD__ (void)close(dfd); -#endif } ATF_TC(mknodat_fdcwd); Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_o_search.c,v 1.4 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_o_search.c,v 1.5 2017/01/10 22:25:01 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,9 +29,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_o_search.c,v 1.4 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_o_search.c,v 1.5 2017/01/10 22:25:01 christos Exp $"); #include + +#include +#include + #include #include #include @@ -40,7 +44,6 @@ __RCSID("$NetBSD: t_o_search.c,v 1.4 201 #include #include #include -#include /* * dholland 20130112: disable tests that require O_SEARCH semantics Modified: head/contrib/netbsd-tests/lib/libc/c063/t_openat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_openat.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_openat.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_openat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_openat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_openat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_openat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,10 +41,6 @@ __RCSID("$NetBSD: t_openat.c,v 1.2 2013/ #include #include #include -#include -#ifdef __FreeBSD__ -#include -#endif #define DIR "dir" #define FILE "dir/openat" Modified: head/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_readlinkat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_readlinkat.c,v 1.4 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_readlinkat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_readlinkat.c,v 1.4 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,10 +41,6 @@ __RCSID("$NetBSD: t_readlinkat.c,v 1.3 2 #include #include #include -#include -#ifdef __FreeBSD__ -#include -#endif #define DIR "dir" #define FILE "dir/readlinkat" Modified: head/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_unlinkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_unlinkat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_unlinkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_unlinkat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +#include +#include #include #include #include @@ -39,10 +41,6 @@ __RCSID("$NetBSD: t_unlinkat.c,v 1.2 201 #include #include #include -#include -#ifdef __FreeBSD__ -#include -#endif #define DIR "dir" #define FILE "dir/unlinkat" Modified: head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_utimensat.c,v 1.5 2013/03/17 04:46:06 jmmv Exp $ */ +/* $NetBSD: t_utimensat.c,v 1.6 2017/01/10 15:13:56 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,8 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_utimensat.c,v 1.5 2013/03/17 04:46:06 jmmv Exp $"); +__RCSID("$NetBSD: t_utimensat.c,v 1.6 2017/01/10 15:13:56 christos Exp $"); +#include +#include +#include #include #include #include @@ -39,11 +42,6 @@ __RCSID("$NetBSD: t_utimensat.c,v 1.5 20 #include #include #include -#include -#ifdef __FreeBSD__ -#include -#endif -#include #define DIR "dir" #define FILE "dir/utimensat" Modified: head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fileactions.c,v 1.5 2012/04/09 19:42:07 martin Exp $ */ +/* $NetBSD: t_fileactions.c,v 1.6 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -31,10 +31,11 @@ */ -#ifdef __FreeBSD__ -#include -#endif #include + +#include +#include + #include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include ATF_TC(t_spawn_openmode); Modified: head/contrib/netbsd-tests/lib/libc/gen/t_assert.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_assert.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/gen/t_assert.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_assert.c,v 1.2 2011/06/14 05:28:00 jruoho Exp $ */ +/* $NetBSD: t_assert.c,v 1.3 2017/01/10 15:17:57 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,8 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_assert.c,v 1.2 2011/06/14 05:28:00 jruoho Exp $"); +__RCSID("$NetBSD: t_assert.c,v 1.3 2017/01/10 15:17:57 christos Exp $"); +#include +#include +#include #include #include @@ -40,11 +43,6 @@ __RCSID("$NetBSD: t_assert.c,v 1.2 2011/ #include #include -#ifdef __FreeBSD__ -#include -#include -#include - static void disable_corefile(void) { @@ -55,7 +53,6 @@ disable_corefile(void) ATF_REQUIRE(setrlimit(RLIMIT_CORE, &limits) == 0); } -#endif static void handler(int); @@ -82,9 +79,7 @@ ATF_TC_BODY(assert_false, tc) if (pid == 0) { -#ifdef __FreeBSD__ disable_corefile(); -#endif (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); @@ -122,9 +117,7 @@ ATF_TC_BODY(assert_true, tc) if (pid == 0) { -#ifdef __FreeBSD__ disable_corefile(); -#endif (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); Modified: head/contrib/netbsd-tests/lib/libc/gen/t_dir.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_dir.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/gen/t_dir.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_dir.c,v 1.6 2013/10/19 17:45:00 christos Exp $ */ +/* $NetBSD: t_dir.c,v 1.8 2017/01/11 07:26:17 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -26,22 +26,19 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include - +#include #include +#include #include #include +#include #include #include #include #include #include -#include -#ifdef __FreeBSD__ -#include -#endif ATF_TC(seekdir_basic); ATF_TC_HEAD(seekdir_basic, tc) @@ -58,7 +55,6 @@ ATF_TC_BODY(seekdir_basic, tc) struct dirent *entry; long here; -#ifdef __FreeBSD__ #define CREAT(x, m) do { \ int _creat_fd; \ ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))) != -1, \ @@ -72,12 +68,6 @@ ATF_TC_BODY(seekdir_basic, tc) CREAT("t/a", 0600); CREAT("t/b", 0600); CREAT("t/c", 0600); -#else - mkdir("t", 0755); - creat("t/a", 0600); - creat("t/b", 0600); - creat("t/c", 0600); -#endif dp = opendir("t"); if ( dp == NULL) @@ -90,10 +80,8 @@ ATF_TC_BODY(seekdir_basic, tc) /* get first entry */ entry = readdir(dp); here = telldir(dp); -#ifdef __FreeBSD__ ATF_REQUIRE_MSG(here != -1, "telldir failed: %s", strerror(errno)); -#endif /* get second entry */ entry = readdir(dp); @@ -137,9 +125,7 @@ ATF_TC_BODY(seekdir_basic, tc) atf_tc_fail("3rd seekdir found wrong name"); closedir(dp); -#ifdef __FreeBSD__ free(wasname); -#endif } /* There is no sbrk on AArch64 and RISC-V */ Modified: head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ftok.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $ */ +/* $NetBSD: t_ftok.c,v 1.2 2017/01/10 15:19:52 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_ftok.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $"); +__RCSID("$NetBSD: t_ftok.c,v 1.2 2017/01/10 15:19:52 christos Exp $"); #include #include @@ -68,9 +68,7 @@ ATF_TC_BODY(ftok_link, tc) fd = open(path, O_RDONLY | O_CREAT); ATF_REQUIRE(fd >= 0); -#ifdef __FreeBSD__ (void)close(fd); -#endif ATF_REQUIRE(link(path, hlnk) == 0); ATF_REQUIRE(symlink(path, slnk) == 0); Modified: head/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_humanize_number.c,v 1.8 2012/03/18 07:14:08 jruoho Exp $ */ +/* $NetBSD: t_humanize_number.c,v 1.9 2017/01/10 15:20:44 christos Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. @@ -247,9 +247,7 @@ ATF_TC_BODY(humanize_number_basic, tc) newline(); atf_tc_fail_nonfatal("Failed for table entry %d", i); } -#ifdef __FreeBSD__ free(buf); -#endif } ATF_TC(humanize_number_big); Modified: head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_sleep.c,v 1.9 2016/08/11 21:34:11 kre Exp $ */ +/* $NetBSD: t_sleep.c,v 1.11 2017/01/10 15:43:59 maya Exp $ */ /*- * Copyright (c) 2006 Frank Kardel @@ -26,8 +26,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#ifdef __FreeBSD__ +#include +#endif +#include +#include +#include +#include /* for TIMESPEC_TO_TIMEVAL on FreeBSD */ + #include #include +#include #include #include #include @@ -35,10 +44,6 @@ #include #include -#include -#include -#include - #include "isqemu.h" #define BILLION 1000000000LL /* nano-seconds per second */ @@ -49,11 +54,6 @@ #define KEVNT_TIMEOUT 10300 /* measured in milli-seconds */ #define FUZZ (40 * MILLION) /* scheduling fuzz accepted - 40 ms */ -#ifdef __FreeBSD__ -#include -#include -#endif - /* * Timer notes * Modified: head/contrib/netbsd-tests/lib/libc/gen/t_time.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_time.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/gen/t_time.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $ */ +/* $NetBSD: t_time.c,v 1.4 2017/01/10 15:32:46 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,11 +29,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $"); +__RCSID("$NetBSD: t_time.c,v 1.4 2017/01/10 15:32:46 christos Exp $"); -#ifdef __FreeBSD__ -#include -#endif #include #include #include @@ -41,6 +38,7 @@ __RCSID("$NetBSD: t_time.c,v 1.3 2014/10 #include #include #include +#include #include ATF_TC(time_copy); Modified: head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ttyname.c,v 1.3 2011/05/01 18:14:01 jruoho Exp $ */ +/* $NetBSD: t_ttyname.c,v 1.4 2017/01/10 15:33:40 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_ttyname.c,v 1.3 2011/05/01 18:14:01 jruoho Exp $"); +__RCSID("$NetBSD: t_ttyname.c,v 1.4 2017/01/10 15:33:40 christos Exp $"); #include #include @@ -78,9 +78,7 @@ ATF_TC_BODY(ttyname_err, tc) ATF_REQUIRE(ttyname(fd) == NULL); ATF_REQUIRE(errno == ENOTTY); -#ifdef __FreeBSD__ (void)close(fd); -#endif } } Modified: head/contrib/netbsd-tests/lib/libc/gen/t_vis.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_vis.c,v 1.8 2015/05/23 14:02:11 christos Exp $ */ +/* $NetBSD: t_vis.c,v 1.9 2017/01/10 15:16:57 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -144,9 +144,7 @@ ATF_TC_BODY(strunvis_hex, tc) } } -/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ #ifdef VIS_NOLOCALE -/* End FreeBSD */ ATF_TC(strvis_locale); ATF_TC_HEAD(strvis_locale, tc) { @@ -175,9 +173,7 @@ ATF_TC_BODY(strvis_locale, tc) setlocale(LC_CTYPE, ol); free(ol); } -/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ #endif /* VIS_NOLOCALE */ -/* End FreeBSD */ ATF_TP_ADD_TCS(tp) { @@ -186,13 +182,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strvis_null); ATF_TP_ADD_TC(tp, strvis_empty); ATF_TP_ADD_TC(tp, strunvis_hex); -/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ #ifdef VIS_NOLOCALE -/* End FreeBSD */ ATF_TP_ADD_TC(tp, strvis_locale); -/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ #endif /* VIS_NOLOCALE */ -/* End FreeBSD */ return atf_no_error(); } Modified: head/contrib/netbsd-tests/lib/libc/string/t_strchr.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/string/t_strchr.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/string/t_strchr.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_strchr.c,v 1.1 2011/07/07 08:59:33 jruoho Exp $ */ +/* $NetBSD: t_strchr.c,v 1.2 2017/01/10 15:34:49 christos Exp $ */ /* * Written by J.T. Conklin @@ -58,12 +58,10 @@ ATF_TC_HEAD(strchr_basic, tc) ATF_TC_BODY(strchr_basic, tc) { -#ifdef __FreeBSD__ void *dl_handle; -#endif - unsigned int t, a; char *off; char buf[32]; + unsigned int t, a; const char *tab[] = { "", @@ -248,12 +246,8 @@ ATF_TC_BODY(strchr_basic, tc) "abcdefgh/abcdefgh/", }; -#ifdef __FreeBSD__ dl_handle = dlopen(NULL, RTLD_LAZY); strchr_fn = dlsym(dl_handle, "test_strlen"); -#else - strchr_fn = dlsym(dlopen(0, RTLD_LAZY), "test_strchr"); -#endif if (!strchr_fn) strchr_fn = strchr; @@ -288,9 +282,7 @@ ATF_TC_BODY(strchr_basic, tc) verify_strchr(buf + a, 0xff, t, a); } } -#ifdef __FreeBSD__ (void)dlclose(dl_handle); -#endif } ATF_TP_ADD_TCS(tp) Modified: head/contrib/netbsd-tests/lib/libc/string/t_strerror.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/string/t_strerror.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/string/t_strerror.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_strerror.c,v 1.3 2011/05/10 06:55:27 jruoho Exp $ */ +/* $NetBSD: t_strerror.c,v 1.4 2017/01/10 20:35:49 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,18 +29,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_strerror.c,v 1.3 2011/05/10 06:55:27 jruoho Exp $"); +__RCSID("$NetBSD: t_strerror.c,v 1.4 2017/01/10 20:35:49 christos Exp $"); #include #include +#include /* Needed for sys_nerr on FreeBSD */ #include #include #include -#ifdef __FreeBSD__ -#include -#endif - ATF_TC(strerror_basic); ATF_TC_HEAD(strerror_basic, tc) { Modified: head/contrib/netbsd-tests/lib/libc/sys/t_access.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_access.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/sys/t_access.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_access.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */ +/* $NetBSD: t_access.c,v 1.2 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_access.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $"); +__RCSID("$NetBSD: t_access.c,v 1.2 2017/01/10 22:36:29 christos Exp $"); + +#include + +#include #include #include @@ -38,13 +42,6 @@ __RCSID("$NetBSD: t_access.c,v 1.1 2011/ #include #include -#include - -#ifdef __FreeBSD__ -#include -#include -#endif - static const char path[] = "access"; static const int mode[4] = { R_OK, W_OK, X_OK, F_OK }; Modified: head/contrib/netbsd-tests/lib/libc/sys/t_chroot.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_chroot.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/sys/t_chroot.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_chroot.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */ +/* $NetBSD: t_chroot.c,v 1.2 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,9 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_chroot.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $"); +__RCSID("$NetBSD: t_chroot.c,v 1.2 2017/01/10 22:36:29 christos Exp $"); #include +#include #include #include @@ -42,10 +43,6 @@ __RCSID("$NetBSD: t_chroot.c,v 1.1 2011/ #include #include -#ifdef __FreeBSD__ -#include -#endif - ATF_TC(chroot_basic); ATF_TC_HEAD(chroot_basic, tc) { Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mincore.c,v 1.8 2012/06/08 07:18:58 martin Exp $ */ +/* $NetBSD: t_mincore.c,v 1.9 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -59,9 +59,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mincore.c,v 1.8 2012/06/08 07:18:58 martin Exp $"); +__RCSID("$NetBSD: t_mincore.c,v 1.9 2017/01/10 22:36:29 christos Exp $"); #include +#include #include #include @@ -74,10 +75,6 @@ __RCSID("$NetBSD: t_mincore.c,v 1.8 2012 #include #include -#ifdef __FreeBSD__ -#include -#endif - static long page = 0; static const char path[] = "mincore"; static size_t check_residency(void *, size_t); Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mmap.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mmap.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mmap.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mmap.c,v 1.9 2015/02/28 13:57:08 martin Exp $ */ +/* $NetBSD: t_mmap.c,v 1.10 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -55,10 +55,11 @@ * SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mmap.c,v 1.9 2015/02/28 13:57:08 martin Exp $"); +__RCSID("$NetBSD: t_mmap.c,v 1.10 2017/01/10 22:36:29 christos Exp $"); #include #include +#include #include #include #include @@ -78,7 +79,6 @@ __RCSID("$NetBSD: t_mmap.c,v 1.9 2015/02 #ifdef __FreeBSD__ #include -#include #include #endif Modified: head/contrib/netbsd-tests/lib/libc/sys/t_wait.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_wait.c Wed Jan 11 09:34:42 2017 (r311924) +++ head/contrib/netbsd-tests/lib/libc/sys/t_wait.c Wed Jan 11 09:51:34 2017 (r311925) @@ -1,4 +1,4 @@ -/* $NetBSD: t_wait.c,v 1.4 2016/04/27 21:14:24 christos Exp $ */ +/* $NetBSD: t_wait.c,v 1.7 2016/11/06 15:04:14 kamil Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_wait.c,v 1.4 2016/04/27 21:14:24 christos Exp $"); +__RCSID("$NetBSD: t_wait.c,v 1.7 2016/11/06 15:04:14 kamil Exp $"); #include #include @@ -64,22 +64,6 @@ ATF_TC_BODY(wait6_invalid, tc) && errno == EINVAL); } -ATF_TC(wait6_noproc); -ATF_TC_HEAD(wait6_noproc, tc) -{ - atf_tc_set_md_var(tc, "descr", - "Test that wait6(2) returns ECHILD with for no processes"); -} - -ATF_TC_BODY(wait6_noproc, tc) -{ - siginfo_t si; - struct wrusage wru; - int st; - ATF_REQUIRE(wait6(P_ALL, 0, &st, WEXITED, &wru, &si) == -1 - && errno == ECHILD); -} - ATF_TC(wait6_exited); ATF_TC_HEAD(wait6_exited, tc) { @@ -96,12 +80,12 @@ ATF_TC_BODY(wait6_exited, tc) switch (pid = fork()) { case -1: - ATF_REQUIRE(pid > 0); + ATF_REQUIRE(pid > 0); case 0: exit(0x5a5a5a5a); /*NOTREACHED*/ default: - ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); + ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); ATF_REQUIRE(WIFEXITED(st) && WEXITSTATUS(st) == 0x5a); ATF_REQUIRE(si.si_status = 0x5a5a5a5a); ATF_REQUIRE(si.si_pid == pid); @@ -134,10 +118,10 @@ ATF_TC_BODY(wait6_terminated, tc) sleep(100); /*FALLTHROUGH*/ case -1: - ATF_REQUIRE(pid > 0); + ATF_REQUIRE(pid > 0); default: ATF_REQUIRE(kill(pid, SIGTERM) == 0); - ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); + ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); ATF_REQUIRE(WIFSIGNALED(st) && WTERMSIG(st) == SIGTERM); ATF_REQUIRE(si.si_status == SIGTERM); ATF_REQUIRE(si.si_pid == pid); @@ -172,9 +156,9 @@ ATF_TC_BODY(wait6_coredumped, tc) *(char *)8 = 0; /*FALLTHROUGH*/ case -1: - ATF_REQUIRE(pid > 0); + ATF_REQUIRE(pid > 0); default: - ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); + ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); ATF_REQUIRE(WIFSIGNALED(st) && WTERMSIG(st) == SIGSEGV *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 11 10:14:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE77DCAAA2A; Wed, 11 Jan 2017 10:14:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (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 90A671882; Wed, 11 Jan 2017 10:14:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id b1so53367402pgc.1; Wed, 11 Jan 2017 02:14:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=3847aWVjL1Wq5gTtXMY/Qy5Pw88qLcI8cSJgXyWuJLs=; b=aQWOIwkox89U3PNP2Z6fSQVxBClNvvEQ1WMLNlF3yoUbwU/cYjvMvhZL5K0qoo7GE9 ehLoVDENNUzvqaOE555l1mnpgtWEGFnCvyg4/dlSpg3QDNifAKVc+65xev8eYO9JbaSx Tq6D3wlmME+o3TlRSIm7Mc1YFKuW6x7n/9UNpDk220yK7nCde5pRG+aeBxJA6jWoLwq5 r8P63kWq5If34SeedAH7ia/DtyFmk/DI6H0Tk8aodBVKSTxQ/A8KHYYIZJxTTxbMMZcR ICLGjbsOZqJDqs+INq98gMsGTcXs4O64NNoCYyhW09tBCHM0P65Ev+4yu066Jnxso+eQ NFzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=3847aWVjL1Wq5gTtXMY/Qy5Pw88qLcI8cSJgXyWuJLs=; b=bRV9s6ncM4QrcwArp33QpVsCNJCDt14K4oODBCbJIvrlr4HjvkBH6mwylRNO357iMR UfXDvZzgKr5YPQSB48udge2rTWIuZxFf4UoMUCvhIxYUiCj/luYRHpoL+5bysYjRRtIv 9ryoMjqAuy66qyXju+Jb2X8W9Sg2hIaoaIjNrhXgbSbWeBFiJW+X7lfpkGUURJF74iQM VLhmPB6rF0VJE+0zD0rhEWj56A+J+f8k0Kq55nk457ZYFVORChfh+lJaOORhkBHf9rv2 62abXB3qcEXGa5lOIJ18dxl6IXfDV6b2uuJ/4TrXmcmK5NOuoItVDOY6e+6G5oXgsNQ0 LIsg== X-Gm-Message-State: AIkVDXLZMAPLYvp0DnnRS0KZ5zEPX/vOR5NxCTNRQuTknUxacmzwie/i2xnAheiAlcIW0Q== X-Received: by 10.99.126.27 with SMTP id z27mr9592105pgc.177.1484129655154; Wed, 11 Jan 2017 02:14:15 -0800 (PST) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q27sm12373229pfd.49.2017.01.11.02.14.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 02:14:14 -0800 (PST) From: "Ngie Cooper (yaneurabeya)" Message-Id: <681075F8-78D1-43FF-A75D-71D5CDBA3AB4@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r286649 - in head: contrib/netbsd-tests/lib/libc/locale lib/libc/tests/locale Date: Wed, 11 Jan 2017 02:14:13 -0800 In-Reply-To: Cc: Jilles Tjoelker , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" To: Craig Rodrigues References: <201508112159.t7BLxa6U057950@repo.freebsd.org> X-Mailer: Apple Mail (2.3259) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 10:14:15 -0000 > On Aug 11, 2015, at 6:45 PM, Craig Rodrigues = wrote: >=20 > On Tue, Aug 11, 2015 at 2:59 PM, Jilles Tjoelker > wrote: > Author: jilles > Date: Tue Aug 11 21:59:36 2015 > New Revision: 286649 > URL: https://svnweb.freebsd.org/changeset/base/286649 = >=20 > Log: > Fix and re-enable UTF-8 tests. >=20 > Modified: > head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c > head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c > head/lib/libc/tests/locale/Makefile >=20 >=20 > Thanks for fixing this. What is the procedure that FreeBSD developers = need to follow > to push this kind of change upstream to NetBSD? I=E2=80=99m submitting PRs with NetBSD as needed. To be frank, = I=E2=80=99m not sure that this change is needed upstream (I=E2=80=99m = probably going to #ifdef the code =E2=80=94 some things I found when = trying to push things back). Thanks, -Ngie= From owner-svn-src-all@freebsd.org Wed Jan 11 10:20:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88791CAAC18; Wed, 11 Jan 2017 10:20:36 +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 58B841CBF; Wed, 11 Jan 2017 10:20:36 +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 v0BAKZ4S006131; Wed, 11 Jan 2017 10:20:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BAKZ4E006130; Wed, 11 Jan 2017 10:20:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701111020.v0BAKZ4E006130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 11 Jan 2017 10:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311926 - head/contrib/netbsd-tests/lib/libc/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 10:20:36 -0000 Author: ngie Date: Wed Jan 11 10:20:35 2017 New Revision: 311926 URL: https://svnweb.freebsd.org/changeset/base/311926 Log: Consolidate __NetBSD__ #ifdef MFC after: 3 days Modified: head/contrib/netbsd-tests/lib/libc/regex/debug.c Modified: head/contrib/netbsd-tests/lib/libc/regex/debug.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/regex/debug.c Wed Jan 11 09:51:34 2017 (r311925) +++ head/contrib/netbsd-tests/lib/libc/regex/debug.c Wed Jan 11 10:20:35 2017 (r311926) @@ -48,9 +48,7 @@ #ifdef __NetBSD__ static void s_print(struct re_guts *, FILE *); static char *regchar(int); -#endif -#ifdef __NetBSD__ /* * regprint - print a regexp for debugging */ From owner-svn-src-all@freebsd.org Wed Jan 11 11:25:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53D9ECAB1BC; Wed, 11 Jan 2017 11:25:19 +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 2E288116B; Wed, 11 Jan 2017 11:25: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 v0BBPIlD034286; Wed, 11 Jan 2017 11:25:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BBPIIl034285; Wed, 11 Jan 2017 11:25:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701111125.v0BBPIIl034285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 Jan 2017 11:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311927 - stable/11/lib/libc/x86/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 11:25:19 -0000 Author: kib Date: Wed Jan 11 11:25:18 2017 New Revision: 311927 URL: https://svnweb.freebsd.org/changeset/base/311927 Log: MFC r311287: __vdso_gettc(): be extra careful with /dev/hpet mappings, never unmap the mapping which might be accessed by other threads. Modified: stable/11/lib/libc/x86/sys/__vdso_gettc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/x86/sys/__vdso_gettc.c ============================================================================== --- stable/11/lib/libc/x86/sys/__vdso_gettc.c Wed Jan 11 10:20:35 2017 (r311926) +++ stable/11/lib/libc/x86/sys/__vdso_gettc.c Wed Jan 11 11:25:18 2017 (r311927) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012 Konstantin Belousov - * Copyright (c) 2016 The FreeBSD Foundation + * Copyright (c) 2016, 2017 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -42,11 +42,11 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include #include #include #include #ifdef __amd64__ -#include #include #endif #include "libc_private.h" @@ -115,37 +115,47 @@ __vdso_rdtsc32(void) return (rdtsc32()); } -static char *hpet_dev_map = NULL; -static uint32_t hpet_idx = 0xffffffff; +#define HPET_DEV_MAP_MAX 10 +static volatile char *hpet_dev_map[HPET_DEV_MAP_MAX]; static void __vdso_init_hpet(uint32_t u) { static const char devprefix[] = "/dev/hpet"; char devname[64], *c, *c1, t; + volatile char *new_map, *old_map; + uint32_t u1; int fd; c1 = c = stpcpy(devname, devprefix); - u = hpet_idx; + u1 = u; do { - *c++ = u % 10 + '0'; - u /= 10; - } while (u != 0); + *c++ = u1 % 10 + '0'; + u1 /= 10; + } while (u1 != 0); *c = '\0'; for (c--; c1 != c; c1++, c--) { t = *c1; *c1 = *c; *c = t; } + + old_map = hpet_dev_map[u]; + if (old_map != NULL) + return; + fd = _open(devname, O_RDONLY); if (fd == -1) { - hpet_dev_map = MAP_FAILED; + atomic_cmpset_rel_ptr((volatile uintptr_t *)&hpet_dev_map[u], + (uintptr_t)old_map, (uintptr_t)MAP_FAILED); return; } - if (hpet_dev_map != NULL && hpet_dev_map != MAP_FAILED) - munmap(hpet_dev_map, PAGE_SIZE); - hpet_dev_map = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0); + new_map = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0); _close(fd); + if (atomic_cmpset_rel_ptr((volatile uintptr_t *)&hpet_dev_map[u], + (uintptr_t)old_map, (uintptr_t)new_map) == 0 && + new_map != MAP_FAILED) + munmap((void *)new_map, PAGE_SIZE); } #ifdef __amd64__ @@ -213,7 +223,8 @@ __vdso_hyperv_tsc(struct hyperv_reftsc * int __vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - uint32_t tmp; + volatile char *map; + uint32_t idx; switch (th->th_algo) { case VDSO_TH_ALGO_X86_TSC: @@ -221,14 +232,19 @@ __vdso_gettc(const struct vdso_timehands __vdso_rdtsc32(); return (0); case VDSO_TH_ALGO_X86_HPET: - tmp = th->th_x86_hpet_idx; - if (hpet_dev_map == NULL || tmp != hpet_idx) { - hpet_idx = tmp; - __vdso_init_hpet(hpet_idx); + idx = th->th_x86_hpet_idx; + if (idx >= HPET_DEV_MAP_MAX) + return (ENOSYS); + map = (volatile char *)atomic_load_acq_ptr( + (volatile uintptr_t *)&hpet_dev_map[idx]); + if (map == NULL) { + __vdso_init_hpet(idx); + map = (volatile char *)atomic_load_acq_ptr( + (volatile uintptr_t *)&hpet_dev_map[idx]); } - if (hpet_dev_map == MAP_FAILED) + if (map == MAP_FAILED) return (ENOSYS); - *tc = *(volatile uint32_t *)(hpet_dev_map + HPET_MAIN_COUNTER); + *tc = *(volatile uint32_t *)(map + HPET_MAIN_COUNTER); return (0); #ifdef __amd64__ case VDSO_TH_ALGO_X86_HVTSC: From owner-svn-src-all@freebsd.org Wed Jan 11 12:53:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A429BCA8CCF; Wed, 11 Jan 2017 12:53:32 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com [IPv6:2607:f8b0:400d:c09::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 5C9D8167C; Wed, 11 Jan 2017 12:53:32 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by mail-qk0-x233.google.com with SMTP id u25so591144645qki.2; Wed, 11 Jan 2017 04:53:32 -0800 (PST) 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=VLtTGN6SQis6cnoNnQy/ZAIp0Fi7AKYRBAORyQqSHEs=; b=Aqca+DwZkP6MGZ/vd2Z866vW88B0gH9kStzzP7bOYrq1N538aLe6+GJc3Y1vwMGUW5 uwKrtclaCKb8JUCWiEHQpv3gNDuiDG9vBNG5VA/74QbncpGQVLjG8t+v6q3x0gOeiBWZ U1v3FdfQAHNKOQifMr3aVsTymFDxbjOUmnZufTUFl4czLy4jcuJ6HZubv5etAVRG0dBH esmrU20IVm6iXC9ptfDNtj4eaS+9D4XLJnnho3pAzalk7a456hmJ0S7GF7N2Su0iPAq8 oqB0DHstzW4T62y2nETWLQicnF6tSL8yBqhSHyWQ2z3bNvPQ1g0tP7Vg1u/B+mopa3Cm 2ANg== 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=VLtTGN6SQis6cnoNnQy/ZAIp0Fi7AKYRBAORyQqSHEs=; b=hW+jptfeKY3An1NbJ+ruOBjshUZKZc9dQNqHTsPz3wxL6+EZRVW7BvotKLF8bpUbjz vRgwxab3HhvSfr4weT41nLEFk06smDFxz+K/z9d3spLDVe4OHQZuT0JzV0AM0E8WMQWw HKJljA6CQYFtbZocRSpky0muqx7oR+qyNyMAzhbLFVpHmDYWTxUm7pYGgT5r/UxynTYf gv3c3Re/DXBN0UIueFVAZTtpSlNd+aMB4pwjSH6vv0LW6t0xeqnmCNLZqBchEBCgfQBV 0JN0KUDffRVfcZH7rALaeKFKwsagDhJTINiaC8DFcMAXhOVqLbPz7/NSUBJmlux5hh05 sL1g== X-Gm-Message-State: AIkVDXIA3gJoLSHYqnMNgttGeq7UlYfshlr1Bq/Rcil83YdxU2VihXegRAHqmFFvvpgHtLJHozFK+SS/irwFJw== X-Received: by 10.55.159.206 with SMTP id i197mr7179303qke.175.1484139211363; Wed, 11 Jan 2017 04:53:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.150.188 with HTTP; Wed, 11 Jan 2017 04:53:31 -0800 (PST) In-Reply-To: <201701102043.v0AKhWuv073169@repo.freebsd.org> References: <201701102043.v0AKhWuv073169@repo.freebsd.org> From: Sergey Kandaurov Date: Wed, 11 Jan 2017 15:53:31 +0300 Message-ID: Subject: Re: svn commit: r311895 - in head: etc/mtree usr.bin/tail usr.bin/tail/tests To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 12:53:32 -0000 On 10 January 2017 at 23:43, Alan Somers wrote: > Author: asomers > Date: Tue Jan 10 20:43:32 2017 > New Revision: 311895 > URL: https://svnweb.freebsd.org/changeset/base/311895 > > Log: > Fix memory leaks during "tail -r" of an irregular file > [..] -typedef struct bf { > - struct bf *next; > - struct bf *prev; > - int len; > - char *l; > -} BF; > +static const size_t bsz = 128 * 1024; > +typedef struct bfelem { > + TAILQ_ENTRY(bfelem) entries; > + size_t len; > + char l[bsz]; > +} bfelem_t; > > This breaks on gcc that doesn't respect const for some reason: reverse.c:177: error: variably modified 'l' at file scope > /* > * r_buf -- display a non-regular file in reverse order by line. > @@ -189,64 +190,42 @@ typedef struct bf { > static void > r_buf(FILE *fp, const char *fn) > { > - BF *mark, *tl, *tr; > - int ch, len, llen; > + struct bfelem *tl, *temp, *first = NULL; > + size_t len, llen; > reverse.c:194: warning: 'len' may be used uninitialized in this function I suspect this is due to a typo on line 254. [..] > /* > - * Step through the blocks in the reverse order read. The last > char > - * is special, ignore whether newline or not. > + * Now print the lines in reverse order > + * Outline: > + * Scan backward for "\n", > + * print forward to the end of the buffers > + * free any buffers that start after the "\n" just found > + * Loop > */ > - for (mark = tl;;) { > - for (p = tl->l + (len = tl->len) - 1, llen = 0; len--; > - --p, ++llen) > - if (*p == '\n') { > - if (llen) { > + tl = TAILQ_LAST(&head, bfhead); > + first = TAILQ_FIRST(&head); > + while (tl != NULL) { > + for (p = tl->l + tl->len - 1, llen = 0; p >= tl->l; > + --p, ++llen) { > + int start = (tl == first && p == tl->l); > + > + if ((*p == '\n') || start) { > + struct bfelem *tr; > + > + if (start && len) > here joint patch to fix build on gcc (not tested, although tests pass) Index: reverse.c =================================================================== --- reverse.c (revision 311927) +++ reverse.c (working copy) @@ -170,11 +170,11 @@ ierr(fn); } -static const size_t bsz = 128 * 1024; +#define BSZ (128 * 1024) typedef struct bfelem { TAILQ_ENTRY(bfelem) entries; size_t len; - char l[bsz]; + char l[BSZ]; } bfelem_t; /* @@ -216,9 +216,9 @@ /* Fill the block with input data. */ len = 0; - while ((!feof(fp)) && len < bsz) { + while ((!feof(fp)) && len < BSZ) { p = tl->l + len; - len += fread(p, 1, bsz - len, fp); + len += fread(p, 1, BSZ - len, fp); if (ferror(fp)) { ierr(fn); return; @@ -251,7 +251,7 @@ if ((*p == '\n') || start) { struct bfelem *tr; - if (start && len) + if (start && llen) WR(p, llen + 1); else if (llen) WR(p + 1, llen); -- wbr, pluknet From owner-svn-src-all@freebsd.org Wed Jan 11 16:09:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79383CAB8C1; Wed, 11 Jan 2017 16:09:26 +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 316231966; Wed, 11 Jan 2017 16:09:26 +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 v0BG9P6q048943; Wed, 11 Jan 2017 16:09:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BG9Pce048942; Wed, 11 Jan 2017 16:09:25 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701111609.v0BG9Pce048942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 11 Jan 2017 16:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311928 - head/usr.bin/tail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 16:09:26 -0000 Author: asomers Date: Wed Jan 11 16:09:25 2017 New Revision: 311928 URL: https://svnweb.freebsd.org/changeset/base/311928 Log: Fix build of usr.bin/tail with GCC Submitted by: pluknet Reported by: pluknet MFC after: 27 days X-MFC-with: 311895 Sponsored by: Spectra Logic Corp Modified: head/usr.bin/tail/reverse.c Modified: head/usr.bin/tail/reverse.c ============================================================================== --- head/usr.bin/tail/reverse.c Wed Jan 11 11:25:18 2017 (r311927) +++ head/usr.bin/tail/reverse.c Wed Jan 11 16:09:25 2017 (r311928) @@ -170,11 +170,11 @@ r_reg(FILE *fp, const char *fn, enum STY ierr(fn); } -static const size_t bsz = 128 * 1024; +#define BSZ (128 * 1024) typedef struct bfelem { TAILQ_ENTRY(bfelem) entries; size_t len; - char l[bsz]; + char l[BSZ]; } bfelem_t; /* @@ -190,8 +190,8 @@ typedef struct bfelem { static void r_buf(FILE *fp, const char *fn) { - struct bfelem *tl, *temp, *first = NULL; - size_t len, llen; + struct bfelem *tl, *first = NULL; + size_t llen; char *p; off_t enomem = 0; TAILQ_HEAD(bfhead, bfelem) head; @@ -199,6 +199,8 @@ r_buf(FILE *fp, const char *fn) TAILQ_INIT(&head); while (!feof(fp)) { + size_t len; + /* * Allocate a new block and link it into place in a doubly * linked list. If out of memory, toss the LRU block and @@ -216,9 +218,9 @@ r_buf(FILE *fp, const char *fn) /* Fill the block with input data. */ len = 0; - while ((!feof(fp)) && len < bsz) { + while ((!feof(fp)) && len < BSZ) { p = tl->l + len; - len += fread(p, 1, bsz - len, fp); + len += fread(p, 1, BSZ - len, fp); if (ferror(fp)) { ierr(fn); return; @@ -244,6 +246,8 @@ r_buf(FILE *fp, const char *fn) tl = TAILQ_LAST(&head, bfhead); first = TAILQ_FIRST(&head); while (tl != NULL) { + struct bfelem *temp; + for (p = tl->l + tl->len - 1, llen = 0; p >= tl->l; --p, ++llen) { int start = (tl == first && p == tl->l); @@ -251,7 +255,7 @@ r_buf(FILE *fp, const char *fn) if ((*p == '\n') || start) { struct bfelem *tr; - if (start && len) + if (start && llen) WR(p, llen + 1); else if (llen) WR(p + 1, llen); From owner-svn-src-all@freebsd.org Wed Jan 11 16:09:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F19ACAB91C; Wed, 11 Jan 2017 16:09:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yw0-x243.google.com (mail-yw0-x243.google.com [IPv6:2607:f8b0:4002:c05::243]) (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 58F681AF2; Wed, 11 Jan 2017 16:09:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yw0-x243.google.com with SMTP id k6so16577356ywk.0; Wed, 11 Jan 2017 08:09:59 -0800 (PST) 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=V6A/QHQ3s+vseQCt0ws9lSoKaoAsJSJ72HIyxHhKBu4=; b=aPExZkzkmllwlIh2hXbzmn4DuWhtV9vyEIPNZp5aaen7+Ds8eQZJqCgOcVOamvG5R8 ZCqJ7l32n8Rb1/U6RNEp01efJ2agCBd/yzlTtrqjiVul3KbIXbvfWPHX4QZ+5d7K3Poy plR5L+H5a3QGClH+R64rHw+TqEpIw0TgAzWO3Z8TMEukPAJR9/jt5J19TqlXNKILidgp A7uWSulSSWwiVz1K265qeiVIs4ewBBlpklzZxWAzGR/23uRxSXHeDoCA/DtUhHb90WlS xpXkTFKbZSnq4+zuC/P9O6vc3DUUYBtzMku0vxQBkvIEt6Tjkf6SGzszFKLJZv2Dlou+ P7GA== 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=V6A/QHQ3s+vseQCt0ws9lSoKaoAsJSJ72HIyxHhKBu4=; b=dLLf9kNoxK+OL6I3Rm+3cOzXkmFX6AvFcowfxR7mM9hC6HCn1HR5Ola+gSS1PtfPva K62Z+uCwU/lTIBdzqoZqutKAhOjYRZX/fI/bjujT3upGrh5mABtyKdY8yfs5KPhvA353 KO9hhCe508TZismwyfpTtSB/Oj9G/y4flBepbCjZuCtFZBEkNBsvoNUUJhlUN+Ze/qYZ j0n3C4MXIXPZ2CMGU7vTQW+jjR9JVy6Nju3nTdkBL04TAU4xmWlTigkcz+K8aSdJMHE2 TH/gDAARqhKoIW3zqhGh9bpQ++vgA42/+barUcw3YR43JPaaTj8Ei/geYn9oZamwFpjs VyOA== X-Gm-Message-State: AIkVDXK/P5m6p1Yen5SgUU3wUwqBfJ4sTzyffmY2dieJPWovYYCDRCRDO7wiPhn+13ZJIDJlopVt1N+sr7nUCw== X-Received: by 10.129.90.67 with SMTP id o64mr7677531ywb.188.1484150998221; Wed, 11 Jan 2017 08:09:58 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.137.135 with HTTP; Wed, 11 Jan 2017 08:09:57 -0800 (PST) In-Reply-To: References: <201701102043.v0AKhWuv073169@repo.freebsd.org> From: Alan Somers Date: Wed, 11 Jan 2017 09:09:57 -0700 X-Google-Sender-Auth: SrQNADLRjgHE72LM8US3c4KxXKY Message-ID: Subject: Re: svn commit: r311895 - in head: etc/mtree usr.bin/tail usr.bin/tail/tests To: Sergey Kandaurov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 16:09:59 -0000 On Wed, Jan 11, 2017 at 5:53 AM, Sergey Kandaurov wrote: > On 10 January 2017 at 23:43, Alan Somers wrote: >> >> Author: asomers >> Date: Tue Jan 10 20:43:32 2017 >> New Revision: 311895 >> URL: https://svnweb.freebsd.org/changeset/base/311895 >> >> Log: >> Fix memory leaks during "tail -r" of an irregular file >> [..] >> >> -typedef struct bf { >> - struct bf *next; >> - struct bf *prev; >> - int len; >> - char *l; >> -} BF; >> +static const size_t bsz = 128 * 1024; >> +typedef struct bfelem { >> + TAILQ_ENTRY(bfelem) entries; >> + size_t len; >> + char l[bsz]; >> +} bfelem_t; >> > > This breaks on gcc that doesn't respect const for some reason: > reverse.c:177: error: variably modified 'l' at file scope > >> >> /* >> * r_buf -- display a non-regular file in reverse order by line. >> @@ -189,64 +190,42 @@ typedef struct bf { >> static void >> r_buf(FILE *fp, const char *fn) >> { >> - BF *mark, *tl, *tr; >> - int ch, len, llen; >> + struct bfelem *tl, *temp, *first = NULL; >> + size_t len, llen; > > > reverse.c:194: warning: 'len' may be used uninitialized in this function > > I suspect this is due to a typo on line 254. > > [..] > >> >> /* >> - * Step through the blocks in the reverse order read. The last >> char >> - * is special, ignore whether newline or not. >> + * Now print the lines in reverse order >> + * Outline: >> + * Scan backward for "\n", >> + * print forward to the end of the buffers >> + * free any buffers that start after the "\n" just found >> + * Loop >> */ >> - for (mark = tl;;) { >> - for (p = tl->l + (len = tl->len) - 1, llen = 0; len--; >> - --p, ++llen) >> - if (*p == '\n') { >> - if (llen) { >> + tl = TAILQ_LAST(&head, bfhead); >> + first = TAILQ_FIRST(&head); >> + while (tl != NULL) { >> + for (p = tl->l + tl->len - 1, llen = 0; p >= tl->l; >> + --p, ++llen) { >> + int start = (tl == first && p == tl->l); >> + >> + if ((*p == '\n') || start) { >> + struct bfelem *tr; >> + >> + if (start && len) > > > here > > joint patch to fix build on gcc (not tested, although tests pass) > > Index: reverse.c > =================================================================== > --- reverse.c (revision 311927) > +++ reverse.c (working copy) > @@ -170,11 +170,11 @@ > ierr(fn); > } > > -static const size_t bsz = 128 * 1024; > +#define BSZ (128 * 1024) > typedef struct bfelem { > TAILQ_ENTRY(bfelem) entries; > size_t len; > - char l[bsz]; > + char l[BSZ]; > } bfelem_t; > > /* > @@ -216,9 +216,9 @@ > > /* Fill the block with input data. */ > len = 0; > - while ((!feof(fp)) && len < bsz) { > + while ((!feof(fp)) && len < BSZ) { > p = tl->l + len; > - len += fread(p, 1, bsz - len, fp); > + len += fread(p, 1, BSZ - len, fp); > if (ferror(fp)) { > ierr(fn); > return; > @@ -251,7 +251,7 @@ > if ((*p == '\n') || start) { > struct bfelem *tr; > > - if (start && len) > + if (start && llen) > WR(p, llen + 1); > else if (llen) > WR(p + 1, llen); > > -- > wbr, > pluknet Thanks for the tip, Sergey. Fixed in 311928. From owner-svn-src-all@freebsd.org Wed Jan 11 17:34:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 720C4CAB48A; Wed, 11 Jan 2017 17:34:17 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 527A41702; Wed, 11 Jan 2017 17:34:16 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from [127.0.0.1] (helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1cRMmt-000CsH-PV; Wed, 11 Jan 2017 09:34:16 -0800 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id v0BHYFWM049492; Wed, 11 Jan 2017 09:34:15 -0800 (PST) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Wed, 11 Jan 2017 09:34:15 -0800 From: Oleksandr Tymoshenko To: "Ngie Cooper (yaneurabeya)" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311911 - in head/sys: conf dev/sdhci modules modules/sdhci_acpi Message-ID: <20170111173415.GA49467@bluezbox.com> References: <201701110153.v0B1rsws002127@repo.freebsd.org> <388FCCEE-8999-4DAD-9689-1C50D1F045FE@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <388FCCEE-8999-4DAD-9689-1C50D1F045FE@gmail.com> X-Operating-System: FreeBSD/11.0-RELEASE-p2 (amd64) User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Ngie Cooper (yaneurabeya) (yaneurabeya@gmail.com) wrote: > > > On Jan 10, 2017, at 5:53 PM, Oleksandr Tymoshenko wrote: > > > > Author: gonzo > > Date: Wed Jan 11 01:53:54 2017 > > New Revision: 311911 > > URL: https://svnweb.freebsd.org/changeset/base/311911 > > > > Log: > > [sdhci] Add ACPI platform support for SDHCI driver > > > > - Create ACPI version of SDHCI attach/detach/accessors logic. Some > > platforms (e.g. BayTrail-based Minnowboard) expose SDHCI devices > > via ACPI, not PCI > > - Add sdchi_acpi kernel module > > > > Reviewed by: ian, imp > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D9112 > > > Hi, > This broke the build for a bit because of missing headers in SRCS. Please MFC r311923 too. > Thank you! [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 17:34:17 -0000 Ngie Cooper (yaneurabeya) (yaneurabeya@gmail.com) wrote: > > > On Jan 10, 2017, at 5:53 PM, Oleksandr Tymoshenko wrote: > > > > Author: gonzo > > Date: Wed Jan 11 01:53:54 2017 > > New Revision: 311911 > > URL: https://svnweb.freebsd.org/changeset/base/311911 > > > > Log: > > [sdhci] Add ACPI platform support for SDHCI driver > > > > - Create ACPI version of SDHCI attach/detach/accessors logic. Some > > platforms (e.g. BayTrail-based Minnowboard) expose SDHCI devices > > via ACPI, not PCI > > - Add sdchi_acpi kernel module > > > > Reviewed by: ian, imp > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D9112 > > > Hi, > This broke the build for a bit because of missing headers in SRCS. Please MFC r311923 too. > Thank you! Oops. My apologies. Thanks for fixing. -- gonzo From owner-svn-src-all@freebsd.org Wed Jan 11 18:47:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73C2DCABAA0; Wed, 11 Jan 2017 18:47:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 435421F25; Wed, 11 Jan 2017 18:47:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BIl0ek013955; Wed, 11 Jan 2017 18:47:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BIl0Mg013954; Wed, 11 Jan 2017 18:47:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701111847.v0BIl0Mg013954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 18:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311929 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 18:47:01 -0000 Author: dim Date: Wed Jan 11 18:47:00 2017 New Revision: 311929 URL: https://svnweb.freebsd.org/changeset/base/311929 Log: Don't include in reloc_elf.c, as it includes just after it, which has a conflicting definition of errno. This leads to the following warning with clang 4.0.0: In file included from sys/boot/common/reloc_elf32.c:6: In file included from sys/boot/common/reloc_elf.c:37: /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] extern int errno; ^ sys/sys/errno.h:46:26: note: expanded from macro 'errno' #define errno (* __error()) ^ MFC after: 3 days Modified: head/sys/boot/common/reloc_elf.c Modified: head/sys/boot/common/reloc_elf.c ============================================================================== --- head/sys/boot/common/reloc_elf.c Wed Jan 11 16:09:25 2017 (r311928) +++ head/sys/boot/common/reloc_elf.c Wed Jan 11 18:47:00 2017 (r311929) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #define FREEBSD_ELF From owner-svn-src-all@freebsd.org Wed Jan 11 19:29:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DA7CCAAE29; Wed, 11 Jan 2017 19:29:29 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CB661C41; Wed, 11 Jan 2017 19:29:29 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BJTSJh030233; Wed, 11 Jan 2017 19:29:28 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BJTSJh030232; Wed, 11 Jan 2017 19:29:28 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201701111929.v0BJTSJh030232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Wed, 11 Jan 2017 19:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311930 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 19:29:29 -0000 Author: dumbbell Date: Wed Jan 11 19:29:28 2017 New Revision: 311930 URL: https://svnweb.freebsd.org/changeset/base/311930 Log: committers-ports.dot: Add myself Approved by: antoine (mentor) Differential Revision: https://reviews.freebsd.org/D9143 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Wed Jan 11 18:47:00 2017 (r311929) +++ head/share/misc/committers-ports.dot Wed Jan 11 19:29:28 2017 (r311930) @@ -90,6 +90,7 @@ delphij [label="Xin Li\ndelphij@FreeBSD. demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03"] dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25"] +dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2017/01/10"] dvl [label="Dan Langille\ndvl@FreeBSD.org\n2014/08/10"] eadler [label="Eitan Adler\neadler@FreeBSD.org\n2011/08/17"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002/10/22"] @@ -265,6 +266,8 @@ ahze -> tmclaugh amdmi3 -> jrm +antoine -> dumbbell + araujo -> lippe araujo -> pclin araujo -> pgollucci @@ -283,6 +286,7 @@ bdrewery -> trociny bapt -> bdrewery bapt -> bofh +bapt -> dumbbell bapt -> eadler bapt -> grembo bapt -> jbeich From owner-svn-src-all@freebsd.org Wed Jan 11 19:29:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C18CECAAE5F; Wed, 11 Jan 2017 19:29:34 +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 78BED1C6D; Wed, 11 Jan 2017 19:29:34 +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 v0BJTXFg030282; Wed, 11 Jan 2017 19:29:33 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BJTX4m030279; Wed, 11 Jan 2017 19:29:33 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701111929.v0BJTX4m030279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 11 Jan 2017 19:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311931 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 19:29:34 -0000 Author: sbruno Date: Wed Jan 11 19:29:33 2017 New Revision: 311931 URL: https://svnweb.freebsd.org/changeset/base/311931 Log: Restore v6 offload caps for igb(4) class devices. Reported by: tuxen Modified: head/sys/dev/e1000/em_txrx.c head/sys/dev/e1000/if_em.h head/sys/dev/e1000/igb_txrx.c Modified: head/sys/dev/e1000/em_txrx.c ============================================================================== --- head/sys/dev/e1000/em_txrx.c Wed Jan 11 19:29:28 2017 (r311930) +++ head/sys/dev/e1000/em_txrx.c Wed Jan 11 19:29:33 2017 (r311931) @@ -304,7 +304,7 @@ em_isc_txd_encap(void *arg, if_pkt_info_ if (do_tso) { i = em_tso_setup(sc, pi, &txd_upper, &txd_lower); tso_desc = TRUE; - } else if (csum_flags & CSUM_OFFLOAD) { + } else if (csum_flags & EM_CSUM_OFFLOAD) { i = em_transmit_checksum_setup(sc, pi, &txd_upper, &txd_lower); } Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Wed Jan 11 19:29:28 2017 (r311930) +++ head/sys/dev/e1000/if_em.h Wed Jan 11 19:29:33 2017 (r311931) @@ -330,7 +330,8 @@ #define EM_MSIX_LINK 0x01000000 /* For 82574 use */ #define ETH_ZLEN 60 #define ETH_ADDR_LEN 6 -#define CSUM_OFFLOAD 7 /* Offload bits in mbuf flag */ +#define EM_CSUM_OFFLOAD 7 /* Offload bits in mbuf flag */ +#define IGB_CSUM_OFFLOAD 0x0E0F /* Offload bits in mbuf flag */ #define IGB_PKTTYPE_MASK 0x0000FFF0 #define IGB_DMCTLX_DCFLUSH_DIS 0x80000000 /* Disable DMA Coalesce Flush */ Modified: head/sys/dev/e1000/igb_txrx.c ============================================================================== --- head/sys/dev/e1000/igb_txrx.c Wed Jan 11 19:29:28 2017 (r311930) +++ head/sys/dev/e1000/igb_txrx.c Wed Jan 11 19:29:33 2017 (r311931) @@ -171,7 +171,7 @@ igb_tx_ctx_setup(struct tx_ring *txr, if */ if (pi->ipi_mflags & M_VLANTAG) { vlan_macip_lens |= (pi->ipi_vtag << E1000_ADVTXD_VLAN_SHIFT); - } else if ((pi->ipi_csum_flags & CSUM_OFFLOAD) == 0) { + } else if ((pi->ipi_csum_flags & IGB_CSUM_OFFLOAD) == 0) { return (0); } From owner-svn-src-all@freebsd.org Wed Jan 11 19:55:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F03CCABDC0; Wed, 11 Jan 2017 19:55:53 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward2o.cmail.yandex.net (forward2o.cmail.yandex.net [IPv6:2a02:6b8:0:1a72::287]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 421481F90; Wed, 11 Jan 2017 19:55:53 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1m.mail.yandex.net (smtp1m.mail.yandex.net [IPv6:2a02:6b8:0:2519::121]) by forward2o.cmail.yandex.net (Yandex) with ESMTP id 3D527211C5; Wed, 11 Jan 2017 22:55:49 +0300 (MSK) Received: from smtp1m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1m.mail.yandex.net (Yandex) with ESMTP id D0CDB63C0E22; Wed, 11 Jan 2017 22:55:47 +0300 (MSK) Received: by smtp1m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Vlj57T8Rnw-tl3WHPPh; Wed, 11 Jan 2017 22:55:47 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1484164547; bh=jTVXT12OrQGGk8wZIRHCzgG/SZ7+zGTVvrcA74azIto=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=mXSOvG/0TVU68/4XbDOWNrddLDjTcyYbog6r7gvc3vRRW5gQzgzV3/twgT1eyap5n Ex/pdaiY5Bhs7LCH9N5oTfpNPcsNsBbJnNp8ylEAgrfsjvOxyKXHzJUEu5xp0LcOm0 Fo8msXLQCI741N4NdX4DC2cjWTbPDO/V2AvK4UyU= Authentication-Results: smtp1m.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: svn commit: r311931 - head/sys/dev/e1000 To: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201701111929.v0BJTX4m030279@repo.freebsd.org> From: "Andrey V. Elsukov" Message-ID: <821fe1c5-8173-1f2d-f691-2d89eb8b0e69@yandex.ru> Date: Wed, 11 Jan 2017 22:54:58 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <201701111929.v0BJTX4m030279@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 19:55:53 -0000 On 11.01.2017 22:29, Sean Bruno wrote: > Author: sbruno > Date: Wed Jan 11 19:29:33 2017 > New Revision: 311931 > URL: https://svnweb.freebsd.org/changeset/base/311931 > > Log: > Restore v6 offload caps for igb(4) class devices. > Modified: head/sys/dev/e1000/if_em.h > ============================================================================== > --- head/sys/dev/e1000/if_em.h Wed Jan 11 19:29:28 2017 (r311930) > +++ head/sys/dev/e1000/if_em.h Wed Jan 11 19:29:33 2017 (r311931) > @@ -330,7 +330,8 @@ > #define EM_MSIX_LINK 0x01000000 /* For 82574 use */ > #define ETH_ZLEN 60 > #define ETH_ADDR_LEN 6 > -#define CSUM_OFFLOAD 7 /* Offload bits in mbuf flag */ > +#define EM_CSUM_OFFLOAD 7 /* Offload bits in mbuf flag */ > +#define IGB_CSUM_OFFLOAD 0x0E0F /* Offload bits in mbuf flag */ Hi, Sean, why did you not define these masks using macros from sys/mbuf.h? It seems it would be more readable. -- WBR, Andrey V. Elsukov From owner-svn-src-all@freebsd.org Wed Jan 11 19:59:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01EF7CABFA1; Wed, 11 Jan 2017 19:59:29 +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 C5AFD13AB; Wed, 11 Jan 2017 19:59:28 +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 v0BJxRmi043499; Wed, 11 Jan 2017 19:59:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BJxRTO043498; Wed, 11 Jan 2017 19:59:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701111959.v0BJxRTO043498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 19:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311932 - head/sys/boot/efi/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 19:59:29 -0000 Author: dim Date: Wed Jan 11 19:59:27 2017 New Revision: 311932 URL: https://svnweb.freebsd.org/changeset/base/311932 Log: Make EFI_RESERVED_SERVICE a proper prototype With clang 4.0.0, the EFI API header causes the following warning: In file included from sys/boot/efi/loader/bootinfo.c:43: In file included from sys/boot/efi/loader/../include/efi.h:52: sys/boot/efi/include/efiapi.h:534:32: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] (EFIAPI *EFI_RESERVED_SERVICE) ( ^ Add VOID to make it into a real prototype. Reviewed by: imp, emaste, tsoome MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9132 Modified: head/sys/boot/efi/include/efiapi.h Modified: head/sys/boot/efi/include/efiapi.h ============================================================================== --- head/sys/boot/efi/include/efiapi.h Wed Jan 11 19:29:33 2017 (r311931) +++ head/sys/boot/efi/include/efiapi.h Wed Jan 11 19:59:27 2017 (r311932) @@ -532,6 +532,7 @@ EFI_STATUS typedef EFI_STATUS (EFIAPI *EFI_RESERVED_SERVICE) ( + VOID ); typedef From owner-svn-src-all@freebsd.org Wed Jan 11 20:00:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30546CAB040; Wed, 11 Jan 2017 20:00:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3855166C; Wed, 11 Jan 2017 20:00:25 +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 v0BK0PeD043616; Wed, 11 Jan 2017 20:00:25 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BK0Pd0043615; Wed, 11 Jan 2017 20:00:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112000.v0BK0Pd0043615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 20:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311933 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 20:00:26 -0000 Author: dim Date: Wed Jan 11 20:00:24 2017 New Revision: 311933 URL: https://svnweb.freebsd.org/changeset/base/311933 Log: Use proper prototypes in struct boot_module_t With clang 4.0.0, we are getting the following warnings about struct boot_module_t in efi's boot_module.h: In file included from sys/boot/efi/boot1/ufs_module.c:41: sys/boot/efi/boot1/boot_module.h:67:14: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] void (*init)(); ^ void sys/boot/efi/boot1/boot_module.h:92:16: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] void (*status)(); ^ void sys/boot/efi/boot1/boot_module.h:95:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] dev_info_t *(*devices)(); ^ void 3 errors generated. Fix this by adding 'void' to the parameter lists. No functional change. Reviewed by: emaste, imp, smh MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9144 Modified: head/sys/boot/efi/boot1/boot_module.h Modified: head/sys/boot/efi/boot1/boot_module.h ============================================================================== --- head/sys/boot/efi/boot1/boot_module.h Wed Jan 11 19:59:27 2017 (r311932) +++ head/sys/boot/efi/boot1/boot_module.h Wed Jan 11 20:00:24 2017 (r311933) @@ -64,7 +64,7 @@ typedef struct boot_module_t const char *name; /* init is the optional initialiser for the module. */ - void (*init)(); + void (*init)(void); /* * probe checks to see if the module can handle dev. @@ -89,10 +89,10 @@ typedef struct boot_module_t void **buf, size_t *bufsize); /* status outputs information about the probed devices. */ - void (*status)(); + void (*status)(void); /* valid devices as found by probe. */ - dev_info_t *(*devices)(); + dev_info_t *(*devices)(void); } boot_module_t; /* Standard boot modules. */ From owner-svn-src-all@freebsd.org Wed Jan 11 20:21:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F3D2CABCDA; Wed, 11 Jan 2017 20:21:07 +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 C878B1CAE; Wed, 11 Jan 2017 20:21:06 +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 v0BKL50f051774; Wed, 11 Jan 2017 20:21:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BKL5Jm051771; Wed, 11 Jan 2017 20:21:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112021.v0BKL5Jm051771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 20:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311934 - in stable/11: . tools/build/mk usr.bin/clang/llvm-ar X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 20:21:07 -0000 Author: dim Date: Wed Jan 11 20:21:05 2017 New Revision: 311934 URL: https://svnweb.freebsd.org/changeset/base/311934 Log: MFC r311565: Link llvm-ar to llvm-ranlib, if WITH_CLANG_EXTRAS is enabled. When invoked as llvm-ranlib, it can create an archive symbol table for archives of objects compiled for LTO by an LLVM compiler. Submitted by: Dan McGregor MFC r311806: After r311565, also remove llvm-ranlib from ObsoleteFiles.inc. Modified: stable/11/ObsoleteFiles.inc stable/11/tools/build/mk/OptionalObsoleteFiles.inc stable/11/usr.bin/clang/llvm-ar/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Wed Jan 11 20:00:24 2017 (r311933) +++ stable/11/ObsoleteFiles.inc Wed Jan 11 20:21:05 2017 (r311934) @@ -2177,7 +2177,6 @@ OLD_LIBS+=usr/lib32/private/libyaml.so.1 OLD_FILES+=usr/lib32/private/libyaml_p.a # 20140216: new clang import which bumps version from 3.3 to 3.4. OLD_FILES+=usr/bin/llvm-prof -OLD_FILES+=usr/bin/llvm-ranlib OLD_FILES+=usr/include/clang/3.3/__wmmintrin_aes.h OLD_FILES+=usr/include/clang/3.3/__wmmintrin_pclmul.h OLD_FILES+=usr/include/clang/3.3/altivec.h Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Jan 11 20:00:24 2017 (r311933) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Jan 11 20:21:05 2017 (r311934) @@ -1493,6 +1493,7 @@ OLD_FILES+=usr/bin/llvm-mc OLD_FILES+=usr/bin/llvm-nm OLD_FILES+=usr/bin/llvm-objdump OLD_FILES+=usr/bin/llvm-pdbdump +OLD_FILES+=usr/bin/llvm-ranlib OLD_FILES+=usr/bin/llvm-rtdyld OLD_FILES+=usr/bin/llvm-symbolizer OLD_FILES+=usr/bin/opt Modified: stable/11/usr.bin/clang/llvm-ar/Makefile ============================================================================== --- stable/11/usr.bin/clang/llvm-ar/Makefile Wed Jan 11 20:00:24 2017 (r311933) +++ stable/11/usr.bin/clang/llvm-ar/Makefile Wed Jan 11 20:21:05 2017 (r311934) @@ -7,4 +7,6 @@ SRCS+= llvm-ar.cpp LIBADD+= z +LINKS+= ${BINDIR}/llvm-ar ${BINDIR}/llvm-ranlib + .include "../llvm.prog.mk" From owner-svn-src-all@freebsd.org Wed Jan 11 20:23:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5EDCCABD83; Wed, 11 Jan 2017 20:23:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5D5A1F4B; Wed, 11 Jan 2017 20:23:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BKNjqv055797; Wed, 11 Jan 2017 20:23:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BKNjcq055796; Wed, 11 Jan 2017 20:23:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701112023.v0BKNjcq055796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Jan 2017 20:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311935 - head/sys/dev/ntb/if_ntb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 20:23:46 -0000 Author: mav Date: Wed Jan 11 20:23:45 2017 New Revision: 311935 URL: https://svnweb.freebsd.org/changeset/base/311935 Log: Pretend we support some IOCTLs to not scary upper layers. MFC after: 2 weeks Modified: head/sys/dev/ntb/if_ntb/if_ntb.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Wed Jan 11 20:21:05 2017 (r311934) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Wed Jan 11 20:23:45 2017 (r311935) @@ -237,6 +237,11 @@ ntb_ioctl(if_t ifp, u_long command, cadd int error = 0; switch (command) { + case SIOCSIFFLAGS: + case SIOCADDMULTI: + case SIOCDELMULTI: + break; + case SIOCSIFMTU: { if (ifr->ifr_mtu > sc->mtu - ETHER_HDR_LEN) { From owner-svn-src-all@freebsd.org Wed Jan 11 20:29:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 819CCCABF85; Wed, 11 Jan 2017 20:29:59 +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 389A3137A; Wed, 11 Jan 2017 20:29:59 +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 v0BKTwhg056056; Wed, 11 Jan 2017 20:29:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BKTwCb056055; Wed, 11 Jan 2017 20:29:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112029.v0BKTwCb056055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 20:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311936 - stable/11/sbin/ping X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 20:29:59 -0000 Author: dim Date: Wed Jan 11 20:29:58 2017 New Revision: 311936 URL: https://svnweb.freebsd.org/changeset/base/311936 Log: MFC r311530: Fix clang 4.0.0 warnings about taking the address of a packed member of struct ip in ping(8): sbin/ping/ping.c:1684:53: error: taking address of packed member 'ip_src' of class or structure 'ip' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_src.s_addr)); ^~~~~~~~~~~~~~~~~ sbin/ping/ping.c:1685:53: error: taking address of packed member 'ip_dst' of class or structure 'ip' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_dst.s_addr)); ^~~~~~~~~~~~~~~~~ Modified: stable/11/sbin/ping/ping.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ping/ping.c ============================================================================== --- stable/11/sbin/ping/ping.c Wed Jan 11 20:23:45 2017 (r311935) +++ stable/11/sbin/ping/ping.c Wed Jan 11 20:29:58 2017 (r311936) @@ -1666,6 +1666,7 @@ pr_icmph(struct icmp *icp) static void pr_iph(struct ip *ip) { + struct in_addr ina; u_char *cp; int hlen; @@ -1681,8 +1682,10 @@ pr_iph(struct ip *ip) (u_long) ntohl(ip->ip_off) & 0x1fff); (void)printf(" %02x %02x %04x", ip->ip_ttl, ip->ip_p, ntohs(ip->ip_sum)); - (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_src.s_addr)); - (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_dst.s_addr)); + memcpy(&ina, &ip->ip_src.s_addr, sizeof ina); + (void)printf(" %s ", inet_ntoa(ina)); + memcpy(&ina, &ip->ip_dst.s_addr, sizeof ina); + (void)printf(" %s ", inet_ntoa(ina)); /* dump any option bytes */ while (hlen-- > 20) { (void)printf("%02x", *cp++); From owner-svn-src-all@freebsd.org Wed Jan 11 20:45:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E4E4CAB70D; Wed, 11 Jan 2017 20:45:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CFA51355; Wed, 11 Jan 2017 20:45:28 +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 v0BKjRmJ063784; Wed, 11 Jan 2017 20:45:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BKjRsO063783; Wed, 11 Jan 2017 20:45:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112045.v0BKjRsO063783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 20:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r311937 - in stable: 10/contrib/ngatm/snmp_atm 11/contrib/ngatm/snmp_atm 9/contrib/ngatm/snmp_atm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 20:45:28 -0000 Author: dim Date: Wed Jan 11 20:45:27 2017 New Revision: 311937 URL: https://svnweb.freebsd.org/changeset/base/311937 Log: MFC r311649: Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c: contrib/ngatm/snmp_atm/snmp_atm.c:173:6: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!ifmr.ifm_status & IFM_AVALID) { ^ ~ Obviously, the masking needs to be done before the logical not operation. Add parentheses to make it so. Modified: stable/9/contrib/ngatm/snmp_atm/snmp_atm.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ngatm/snmp_atm/snmp_atm.c stable/11/contrib/ngatm/snmp_atm/snmp_atm.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/9/contrib/ngatm/snmp_atm/snmp_atm.c ============================================================================== --- stable/9/contrib/ngatm/snmp_atm/snmp_atm.c Wed Jan 11 20:29:58 2017 (r311936) +++ stable/9/contrib/ngatm/snmp_atm/snmp_atm.c Wed Jan 11 20:45:27 2017 (r311937) @@ -170,7 +170,7 @@ atmif_check_carrier(struct atmif_priv *a aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; return; } - if (!ifmr.ifm_status & IFM_AVALID) { + if (!(ifmr.ifm_status & IFM_AVALID)) { aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; return; } From owner-svn-src-all@freebsd.org Wed Jan 11 20:45:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C56E3CAB713; Wed, 11 Jan 2017 20:45:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 941281356; Wed, 11 Jan 2017 20:45:28 +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 v0BKjR3u063790; Wed, 11 Jan 2017 20:45:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BKjRDt063789; Wed, 11 Jan 2017 20:45:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112045.v0BKjRDt063789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 20:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311937 - in stable: 10/contrib/ngatm/snmp_atm 11/contrib/ngatm/snmp_atm 9/contrib/ngatm/snmp_atm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 20:45:28 -0000 Author: dim Date: Wed Jan 11 20:45:27 2017 New Revision: 311937 URL: https://svnweb.freebsd.org/changeset/base/311937 Log: MFC r311649: Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c: contrib/ngatm/snmp_atm/snmp_atm.c:173:6: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!ifmr.ifm_status & IFM_AVALID) { ^ ~ Obviously, the masking needs to be done before the logical not operation. Add parentheses to make it so. Modified: stable/11/contrib/ngatm/snmp_atm/snmp_atm.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ngatm/snmp_atm/snmp_atm.c stable/9/contrib/ngatm/snmp_atm/snmp_atm.c Directory Properties: stable/10/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) Modified: stable/11/contrib/ngatm/snmp_atm/snmp_atm.c ============================================================================== --- stable/11/contrib/ngatm/snmp_atm/snmp_atm.c Wed Jan 11 20:29:58 2017 (r311936) +++ stable/11/contrib/ngatm/snmp_atm/snmp_atm.c Wed Jan 11 20:45:27 2017 (r311937) @@ -170,7 +170,7 @@ atmif_check_carrier(struct atmif_priv *a aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; return; } - if (!ifmr.ifm_status & IFM_AVALID) { + if (!(ifmr.ifm_status & IFM_AVALID)) { aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; return; } From owner-svn-src-all@freebsd.org Wed Jan 11 20:45:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0832ECAB71A; Wed, 11 Jan 2017 20:45:29 +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 CAB5E1357; Wed, 11 Jan 2017 20:45:28 +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 v0BKjS8m063796; Wed, 11 Jan 2017 20:45:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BKjSKQ063795; Wed, 11 Jan 2017 20:45:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112045.v0BKjSKQ063795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 20:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311937 - in stable: 10/contrib/ngatm/snmp_atm 11/contrib/ngatm/snmp_atm 9/contrib/ngatm/snmp_atm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 20:45:29 -0000 Author: dim Date: Wed Jan 11 20:45:27 2017 New Revision: 311937 URL: https://svnweb.freebsd.org/changeset/base/311937 Log: MFC r311649: Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c: contrib/ngatm/snmp_atm/snmp_atm.c:173:6: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!ifmr.ifm_status & IFM_AVALID) { ^ ~ Obviously, the masking needs to be done before the logical not operation. Add parentheses to make it so. Modified: stable/10/contrib/ngatm/snmp_atm/snmp_atm.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ngatm/snmp_atm/snmp_atm.c stable/9/contrib/ngatm/snmp_atm/snmp_atm.c Directory Properties: stable/11/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) Modified: stable/10/contrib/ngatm/snmp_atm/snmp_atm.c ============================================================================== --- stable/10/contrib/ngatm/snmp_atm/snmp_atm.c Wed Jan 11 20:29:58 2017 (r311936) +++ stable/10/contrib/ngatm/snmp_atm/snmp_atm.c Wed Jan 11 20:45:27 2017 (r311937) @@ -170,7 +170,7 @@ atmif_check_carrier(struct atmif_priv *a aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; return; } - if (!ifmr.ifm_status & IFM_AVALID) { + if (!(ifmr.ifm_status & IFM_AVALID)) { aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; return; } From owner-svn-src-all@freebsd.org Wed Jan 11 20:55:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC538CABCC1; Wed, 11 Jan 2017 20:55:02 +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 BB90F1EB7; Wed, 11 Jan 2017 20:55:02 +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 v0BKt1G8067856; Wed, 11 Jan 2017 20:55:01 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BKt1Y7067855; Wed, 11 Jan 2017 20:55:01 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112055.v0BKt1Y7067855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 20:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311938 - stable/11/contrib/tcpdump X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 20:55:03 -0000 Author: dim Date: Wed Jan 11 20:55:01 2017 New Revision: 311938 URL: https://svnweb.freebsd.org/changeset/base/311938 Log: MFC r311570: In tcpdump's print-tcp.c, avoid increasing alignment when taking the addresses of members of struct ip, which is packed. Since the pointers are only used for memcmp'ing, they can be pointing to void instead. Note that upstream has removed the src and dst variables, in the mean time. Modified: stable/11/contrib/tcpdump/print-tcp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcpdump/print-tcp.c ============================================================================== --- stable/11/contrib/tcpdump/print-tcp.c Wed Jan 11 20:45:27 2017 (r311937) +++ stable/11/contrib/tcpdump/print-tcp.c Wed Jan 11 20:55:01 2017 (r311938) @@ -253,7 +253,7 @@ tcp_print(netdissect_options *ndo, if (ip6) { register struct tcp_seq_hash6 *th; struct tcp_seq_hash6 *tcp_seq_hash; - const struct in6_addr *src, *dst; + const void *src, *dst; struct tha6 tha; tcp_seq_hash = tcp_seq_hash6; @@ -309,7 +309,7 @@ tcp_print(netdissect_options *ndo, #endif /*INET6*/ register struct tcp_seq_hash *th; struct tcp_seq_hash *tcp_seq_hash; - const struct in_addr *src, *dst; + const void *src, *dst; struct tha tha; tcp_seq_hash = tcp_seq_hash4; From owner-svn-src-all@freebsd.org Wed Jan 11 21:01:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2A3CCAA019; Wed, 11 Jan 2017 21:01:50 +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 A01ED1502; Wed, 11 Jan 2017 21:01:50 +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 v0BL1nuH069897; Wed, 11 Jan 2017 21:01:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BL1nIg069896; Wed, 11 Jan 2017 21:01:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112101.v0BL1nIg069896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 21:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311939 - in stable: 10/sys/geom/vinum 11/sys/geom/vinum 9/sys/geom/vinum X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 21:01:50 -0000 Author: dim Date: Wed Jan 11 21:01:49 2017 New Revision: 311939 URL: https://svnweb.freebsd.org/changeset/base/311939 Log: MFC r311688: Fix logic error in gvinum's gv_set_sd_state() With clang 4.0.0, I'm getting the following warnings: sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!flags & GV_SETSTATE_FORCE) ^ ~ The logical not operator should obiously be called after masking. Reviewed by: mav, pfg Differential Revision: https://reviews.freebsd.org/D9093 Modified: stable/11/sys/geom/vinum/geom_vinum_state.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/geom/vinum/geom_vinum_state.c stable/9/sys/geom/vinum/geom_vinum_state.c Directory Properties: stable/10/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/11/sys/geom/vinum/geom_vinum_state.c ============================================================================== --- stable/11/sys/geom/vinum/geom_vinum_state.c Wed Jan 11 20:55:01 2017 (r311938) +++ stable/11/sys/geom/vinum/geom_vinum_state.c Wed Jan 11 21:01:49 2017 (r311939) @@ -183,7 +183,7 @@ gv_set_sd_state(struct gv_sd *s, int new * Only do this if we're forced, since it usually is done * internally, and then we do use the force flag. */ - if (!flags & GV_SETSTATE_FORCE) + if (!(flags & GV_SETSTATE_FORCE)) return (GV_ERR_SETSTATE); break; From owner-svn-src-all@freebsd.org Wed Jan 11 21:01:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B217CAA013; Wed, 11 Jan 2017 21:01:50 +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 69FF914F4; Wed, 11 Jan 2017 21:01:50 +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 v0BL1nSL069890; Wed, 11 Jan 2017 21:01:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BL1nja069889; Wed, 11 Jan 2017 21:01:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112101.v0BL1nja069889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 21:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r311939 - in stable: 10/sys/geom/vinum 11/sys/geom/vinum 9/sys/geom/vinum X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 21:01:50 -0000 Author: dim Date: Wed Jan 11 21:01:49 2017 New Revision: 311939 URL: https://svnweb.freebsd.org/changeset/base/311939 Log: MFC r311688: Fix logic error in gvinum's gv_set_sd_state() With clang 4.0.0, I'm getting the following warnings: sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!flags & GV_SETSTATE_FORCE) ^ ~ The logical not operator should obiously be called after masking. Reviewed by: mav, pfg Differential Revision: https://reviews.freebsd.org/D9093 Modified: stable/9/sys/geom/vinum/geom_vinum_state.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/geom/vinum/geom_vinum_state.c stable/11/sys/geom/vinum/geom_vinum_state.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/9/sys/geom/vinum/geom_vinum_state.c ============================================================================== --- stable/9/sys/geom/vinum/geom_vinum_state.c Wed Jan 11 20:55:01 2017 (r311938) +++ stable/9/sys/geom/vinum/geom_vinum_state.c Wed Jan 11 21:01:49 2017 (r311939) @@ -183,7 +183,7 @@ gv_set_sd_state(struct gv_sd *s, int new * Only do this if we're forced, since it usually is done * internally, and then we do use the force flag. */ - if (!flags & GV_SETSTATE_FORCE) + if (!(flags & GV_SETSTATE_FORCE)) return (GV_ERR_SETSTATE); break; From owner-svn-src-all@freebsd.org Wed Jan 11 21:01:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13C31CAA023; Wed, 11 Jan 2017 21:01:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D69F61504; Wed, 11 Jan 2017 21:01:50 +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 v0BL1ojS069903; Wed, 11 Jan 2017 21:01:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BL1o8K069902; Wed, 11 Jan 2017 21:01:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112101.v0BL1o8K069902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 21:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311939 - in stable: 10/sys/geom/vinum 11/sys/geom/vinum 9/sys/geom/vinum X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 21:01:51 -0000 Author: dim Date: Wed Jan 11 21:01:49 2017 New Revision: 311939 URL: https://svnweb.freebsd.org/changeset/base/311939 Log: MFC r311688: Fix logic error in gvinum's gv_set_sd_state() With clang 4.0.0, I'm getting the following warnings: sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!flags & GV_SETSTATE_FORCE) ^ ~ The logical not operator should obiously be called after masking. Reviewed by: mav, pfg Differential Revision: https://reviews.freebsd.org/D9093 Modified: stable/10/sys/geom/vinum/geom_vinum_state.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/geom/vinum/geom_vinum_state.c stable/9/sys/geom/vinum/geom_vinum_state.c Directory Properties: stable/11/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/10/sys/geom/vinum/geom_vinum_state.c ============================================================================== --- stable/10/sys/geom/vinum/geom_vinum_state.c Wed Jan 11 20:55:01 2017 (r311938) +++ stable/10/sys/geom/vinum/geom_vinum_state.c Wed Jan 11 21:01:49 2017 (r311939) @@ -183,7 +183,7 @@ gv_set_sd_state(struct gv_sd *s, int new * Only do this if we're forced, since it usually is done * internally, and then we do use the force flag. */ - if (!flags & GV_SETSTATE_FORCE) + if (!(flags & GV_SETSTATE_FORCE)) return (GV_ERR_SETSTATE); break; From owner-svn-src-all@freebsd.org Wed Jan 11 21:18:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D69DCAA8E8; Wed, 11 Jan 2017 21:18: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 D253012A0; Wed, 11 Jan 2017 21:18: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 v0BLIFjW076396; Wed, 11 Jan 2017 21:18:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BLIF8n076395; Wed, 11 Jan 2017 21:18:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701112118.v0BLIF8n076395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Jan 2017 21:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311941 - head/contrib/elftoolchain/libelftc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 21:18:16 -0000 Author: emaste Date: Wed Jan 11 21:18:14 2017 New Revision: 311941 URL: https://svnweb.freebsd.org/changeset/base/311941 Log: readelf: add PPC64 relocation types Reported by: Mark Millard MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9146 Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Wed Jan 11 21:05:13 2017 (r311940) +++ head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Wed Jan 11 21:18:14 2017 (r311941) @@ -501,6 +501,114 @@ elftc_reloc_type_str(unsigned int mach, case 116: return "R_PPC_EMB_RELSDA"; } break; + case EM_PPC64: + switch(type) { + case 0: return "R_PPC64_NONE"; + case 1: return "R_PPC64_ADDR32"; + case 2: return "R_PPC64_ADDR24"; + case 3: return "R_PPC64_ADDR16"; + case 4: return "R_PPC64_ADDR16_LO"; + case 5: return "R_PPC64_ADDR16_HI"; + case 6: return "R_PPC64_ADDR16_HA"; + case 7: return "R_PPC64_ADDR14"; + case 8: return "R_PPC64_ADDR14_BRTAKEN"; + case 9: return "R_PPC64_ADDR14_BRNTAKEN"; + case 10: return "R_PPC64_REL24"; + case 11: return "R_PPC64_REL14"; + case 12: return "R_PPC64_REL14_BRTAKEN"; + case 13: return "R_PPC64_REL14_BRNTAKEN"; + case 14: return "R_PPC64_GOT16"; + case 15: return "R_PPC64_GOT16_LO"; + case 16: return "R_PPC64_GOT16_HI"; + case 17: return "R_PPC64_GOT16_HA"; + case 19: return "R_PPC64_COPY"; + case 20: return "R_PPC64_GLOB_DAT"; + case 21: return "R_PPC64_JMP_SLOT"; + case 22: return "R_PPC64_RELATIVE"; + case 24: return "R_PPC64_UADDR32"; + case 25: return "R_PPC64_UADDR16"; + case 26: return "R_PPC64_REL32"; + case 27: return "R_PPC64_PLT32"; + case 28: return "R_PPC64_PLTREL32"; + case 29: return "R_PPC64_PLT16_LO"; + case 30: return "R_PPC64_PLT16_HI"; + case 31: return "R_PPC64_PLT16_HA"; + case 33: return "R_PPC64_SECTOFF"; + case 34: return "R_PPC64_SECTOFF_LO"; + case 35: return "R_PPC64_SECTOFF_HI"; + case 36: return "R_PPC64_SECTOFF_HA"; + case 37: return "R_PPC64_ADDR30"; + case 38: return "R_PPC64_ADDR64"; + case 39: return "R_PPC64_ADDR16_HIGHER"; + case 40: return "R_PPC64_ADDR16_HIGHERA"; + case 41: return "R_PPC64_ADDR16_HIGHEST"; + case 42: return "R_PPC64_ADDR16_HIGHESTA"; + case 43: return "R_PPC64_UADDR64"; + case 44: return "R_PPC64_REL64"; + case 45: return "R_PPC64_PLT64"; + case 46: return "R_PPC64_PLTREL64"; + case 47: return "R_PPC64_TOC16"; + case 48: return "R_PPC64_TOC16_LO"; + case 49: return "R_PPC64_TOC16_HI"; + case 50: return "R_PPC64_TOC16_HA"; + case 51: return "R_PPC64_TOC"; + case 52: return "R_PPC64_PLTGOT16"; + case 53: return "R_PPC64_PLTGOT16_LO"; + case 54: return "R_PPC64_PLTGOT16_HI"; + case 55: return "R_PPC64_PLTGOT16_HA"; + case 56: return "R_PPC64_ADDR16_DS"; + case 57: return "R_PPC64_ADDR16_LO_DS"; + case 58: return "R_PPC64_GOT16_DS"; + case 59: return "R_PPC64_GOT16_LO_DS"; + case 60: return "R_PPC64_PLT16_LO_DS"; + case 61: return "R_PPC64_SECTOFF_DS"; + case 62: return "R_PPC64_SECTOFF_LO_DS"; + case 63: return "R_PPC64_TOC16_DS"; + case 64: return "R_PPC64_TOC16_LO_DS"; + case 65: return "R_PPC64_PLTGOT16_DS"; + case 66: return "R_PPC64_PLTGOT16_LO_DS"; + case 67: return "R_PPC64_TLS"; + case 68: return "R_PPC64_DTPMOD64"; + case 69: return "R_PPC64_TPREL16"; + case 70: return "R_PPC64_TPREL16_LO"; + case 71: return "R_PPC64_TPREL16_HI"; + case 72: return "R_PPC64_TPREL16_HA"; + case 73: return "R_PPC64_TPREL64"; + case 74: return "R_PPC64_DTPREL16"; + case 75: return "R_PPC64_DTPREL16_LO"; + case 76: return "R_PPC64_DTPREL16_HI"; + case 77: return "R_PPC64_DTPREL16_HA"; + case 78: return "R_PPC64_DTPREL64"; + case 79: return "R_PPC64_GOT_TLSGD16"; + case 80: return "R_PPC64_GOT_TLSGD16_LO"; + case 81: return "R_PPC64_GOT_TLSGD16_HI"; + case 82: return "R_PPC64_GOT_TLSGD16_HA"; + case 83: return "R_PPC64_GOT_TLSLD16"; + case 84: return "R_PPC64_GOT_TLSLD16_LO"; + case 85: return "R_PPC64_GOT_TLSLD16_HI"; + case 86: return "R_PPC64_GOT_TLSLD16_HA"; + case 87: return "R_PPC64_GOT_TPREL16_DS"; + case 88: return "R_PPC64_GOT_TPREL16_LO_DS"; + case 89: return "R_PPC64_GOT_TPREL16_HI"; + case 90: return "R_PPC64_GOT_TPREL16_HA"; + case 91: return "R_PPC64_GOT_DTPREL16_DS"; + case 92: return "R_PPC64_GOT_DTPREL16_LO_DS"; + case 93: return "R_PPC64_GOT_DTPREL16_HI"; + case 94: return "R_PPC64_GOT_DTPREL16_HA"; + case 95: return "R_PPC64_TPREL16_DS"; + case 96: return "R_PPC64_TPREL16_LO_DS"; + case 97: return "R_PPC64_TPREL16_HIGHER"; + case 98: return "R_PPC64_TPREL16_HIGHERA"; + case 99: return "R_PPC64_TPREL16_HIGHEST"; + case 100: return "R_PPC64_TPREL16_HIGHESTA"; + case 101: return "R_PPC64_DTPREL16_DS"; + case 102: return "R_PPC64_DTPREL16_LO_DS"; + case 103: return "R_PPC64_DTPREL16_HIGHER"; + case 104: return "R_PPC64_DTPREL16_HIGHERA"; + case 105: return "R_PPC64_DTPREL16_HIGHEST"; + case 106: return "R_PPC64_DTPREL16_HIGHESTA"; + } + break; case EM_RISCV: switch(type) { case 0: return "R_RISCV_NONE"; From owner-svn-src-all@freebsd.org Wed Jan 11 21:28:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24600CAACC1; Wed, 11 Jan 2017 21:28:24 +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 E80B919EF; Wed, 11 Jan 2017 21:28:23 +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 v0BLSNvf080276; Wed, 11 Jan 2017 21:28:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BLSNUV080275; Wed, 11 Jan 2017 21:28:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701112128.v0BLSNUV080275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Jan 2017 21:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311942 - head/contrib/elftoolchain/libelftc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 21:28:24 -0000 Author: emaste Date: Wed Jan 11 21:28:22 2017 New Revision: 311942 URL: https://svnweb.freebsd.org/changeset/base/311942 Log: readelf: add more PPC64 relocation types found in LLVM MFC after: 2 weeks MFC with: r311941 Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Wed Jan 11 21:18:14 2017 (r311941) +++ head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Wed Jan 11 21:28:22 2017 (r311942) @@ -607,6 +607,12 @@ elftc_reloc_type_str(unsigned int mach, case 104: return "R_PPC64_DTPREL16_HIGHERA"; case 105: return "R_PPC64_DTPREL16_HIGHEST"; case 106: return "R_PPC64_DTPREL16_HIGHESTA"; + case 107: return "R_PPC64_TLSGD"; + case 108: return "R_PPC64_TLSLD"; + case 249: return "R_PPC64_REL16"; + case 250: return "R_PPC64_REL16_LO"; + case 251: return "R_PPC64_REL16_HI"; + case 252: return "R_PPC64_REL16_HA"; } break; case EM_RISCV: From owner-svn-src-all@freebsd.org Wed Jan 11 21:35:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7295CAB01C; Wed, 11 Jan 2017 21:35:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::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 944F01F5B; Wed, 11 Jan 2017 21:35:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x22e.google.com with SMTP id u25so874396qki.2; Wed, 11 Jan 2017 13:35:51 -0800 (PST) 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=BE8eQvUP8jTYsWD4AQKL84vg7Cw6QT1v2I0rczonWbA=; b=fOxchh1gkreZvX82dCzLvfhlrmjP7WPFAP3UuFZpf+BorbjFzDfm7IQPukm4qGvpkV XDGRk/BdVYQhxKXW1kKz3ba648heKblyOyq895wP+I6yAmcFlFM0x8VXgSKRtS8dQIwc wLPjxfMbP9CiGqwdZO/dYCKpSXZkO7VXp6r/EwGPY5qa2MNVaIc0TQwmv3JR/L1FeBDB JMVXnuUoOx9qngqsllzo/PLgeufXwVJSbmEym3mOG7C6QUbXDDmgcUWDwU6AZYa3wudY XS4Oc+MYv4xe7qdgGO20Y/m8PpAn38I5VkfKsZCu31emYOWcmQORfu44nR6k+G0bL/Aj A8bA== 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=BE8eQvUP8jTYsWD4AQKL84vg7Cw6QT1v2I0rczonWbA=; b=b/rc9LM7OPaASqN2ga6KKbZIZvSkKPVxnra18oMrvN51U3KmKQL2jJ27ObVIZXunve smsf6a4QdIdosIos5uMWU3FzhPzPdoT20JfTen/DL6icstQQWEy5n8evdMqfxfRY+aaB 2XM34mLFrUmqVwAhfeYnVobQ9NJvWLeEZpxTdINHHoCN4PI05q2z47/upG0pPXoSZeB3 dhxVE/jH6Vw2iyyChBaT2PDuG0/+tL0s3oszA8Y8UpfEWddfOCNuQ7/fO6ujGbZ1j+Jd Z4ZuyBzbo1hYYWbh6jl9vfOBEUmBehzwPSxc+73N/5oFGqsc81w64OLzVk4jfkdbIKPp gXaw== X-Gm-Message-State: AIkVDXIUQ2opTEBbF51+pmKFJ3lfOmtBxxoDqEDjfy9GxGY/oQkzh5U5HkEvwjiITFNz22CSNrd7OFDPO3IIGg== X-Received: by 10.55.112.65 with SMTP id l62mr11729959qkc.76.1484170550648; Wed, 11 Jan 2017 13:35:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.83.133 with HTTP; Wed, 11 Jan 2017 13:35:50 -0800 (PST) In-Reply-To: <201701111847.v0BIl0Mg013954@repo.freebsd.org> References: <201701111847.v0BIl0Mg013954@repo.freebsd.org> From: Ngie Cooper Date: Wed, 11 Jan 2017 13:35:50 -0800 Message-ID: Subject: Re: svn commit: r311929 - head/sys/boot/common To: Dimitry Andric Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 21:35:51 -0000 On Wed, Jan 11, 2017 at 10:47 AM, Dimitry Andric wrote: > Author: dim > Date: Wed Jan 11 18:47:00 2017 > New Revision: 311929 > URL: https://svnweb.freebsd.org/changeset/base/311929 > > Log: > Don't include in reloc_elf.c, as it includes just > after it, which has a conflicting definition of errno. This leads to > the following warning with clang 4.0.0: > > In file included from sys/boot/common/reloc_elf32.c:6: > In file included from sys/boot/common/reloc_elf.c:37: > /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] > extern int errno; > ^ > sys/sys/errno.h:46:26: note: expanded from macro 'errno' > #define errno (* __error()) It seems like libstand (once again) should be fixed, not the "offending code". -Ngie From owner-svn-src-all@freebsd.org Wed Jan 11 21:42:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10550CAB1F7 for ; Wed, 11 Jan 2017 21:42:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E288B143F for ; Wed, 11 Jan 2017 21:42:44 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ec1eae4e-d846-11e6-8c89-112185c90658 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id ec1eae4e-d846-11e6-8c89-112185c90658; Wed, 11 Jan 2017 21:43:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0BLgahN001909; Wed, 11 Jan 2017 14:42:36 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1484170956.86335.17.camel@freebsd.org> Subject: Re: svn commit: r311929 - head/sys/boot/common From: Ian Lepore To: Ngie Cooper , Dimitry Andric Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Wed, 11 Jan 2017 14:42:36 -0700 In-Reply-To: References: <201701111847.v0BIl0Mg013954@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 21:42:45 -0000 On Wed, 2017-01-11 at 13:35 -0800, Ngie Cooper wrote: > On Wed, Jan 11, 2017 at 10:47 AM, Dimitry Andric > wrote: > > > > Author: dim > > Date: Wed Jan 11 18:47:00 2017 > > New Revision: 311929 > > URL: https://svnweb.freebsd.org/changeset/base/311929 > > > > Log: > >   Don't include in reloc_elf.c, as it includes > > just > >   after it, which has a conflicting definition of errno.  This > > leads to > >   the following warning with clang 4.0.0: > > > >       In file included from sys/boot/common/reloc_elf32.c:6: > >       In file included from sys/boot/common/reloc_elf.c:37: > >       /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this > > function declaration is not a prototype [-Werror,-Wstrict- > > prototypes] > >       extern int errno; > >                  ^ > >       sys/sys/errno.h:46:26: note: expanded from macro 'errno' > >       #define errno           (* __error()) > It seems like libstand (once again) should be fixed, not the > "offending code". > -Ngie > In this case it's not the library that's in error.  Libstand is the thing that implements errno, so it's the thing that must define it. The code that includes both errno.h and libstand.h was wrong.  errno.h is a standard header file used with libc, and the loader code doesn't link with libc. The thing that amazes me is the usual:  how did this ever work with gcc 4.2? -- Ian From owner-svn-src-all@freebsd.org Wed Jan 11 22:10:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 027A8CABA7F; Wed, 11 Jan 2017 22:10:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C540814E2; Wed, 11 Jan 2017 22:10:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BMAg6g096750; Wed, 11 Jan 2017 22:10:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BMAgkD096749; Wed, 11 Jan 2017 22:10:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201701112210.v0BMAgkD096749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 11 Jan 2017 22:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311943 - stable/11/share/misc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:10:43 -0000 Author: bapt Date: Wed Jan 11 22:10:41 2017 New Revision: 311943 URL: https://svnweb.freebsd.org/changeset/base/311943 Log: MFC r311706: Update pciids to 2017.01.08 Modified: stable/11/share/misc/pci_vendors Directory Properties: stable/11/ (props changed) Modified: stable/11/share/misc/pci_vendors ============================================================================== --- stable/11/share/misc/pci_vendors Wed Jan 11 21:28:22 2017 (r311942) +++ stable/11/share/misc/pci_vendors Wed Jan 11 22:10:41 2017 (r311943) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2016.11.21 -# Date: 2016-11-21 03:15:01 +# Version: 2017.01.08 +# Date: 2017-01-08 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -249,6 +249,7 @@ 0014 MegaRAID Tri-Mode SAS3516 1028 1fd4 PERC H745P MX 1d49 0602 ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter + 0015 MegaRAID Tri-Mode SAS3416 0016 MegaRAID Tri-Mode SAS3508 1028 1fc9 PERC H840 Adapter 1028 1fcb PERC H740P Adapter @@ -548,6 +549,7 @@ 1028 1f53 HBA330 Mini 1028 1fd2 HBA330 MX 1028 1fd3 HBA330 MMZ + 1bd4 0011 Inspur 12Gb 8i-3008 IT SAS HBA 00ab SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00ac SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 1d49 0201 ThinkSystem 430-16i SAS/SATA 12Gb HBA @@ -2201,6 +2203,11 @@ 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE 67c0 Ellesmere [Polaris10] + 67c4 Ellesmere [Radeon Pro WX 7100] + 67c7 Ellesmere [Radeon Pro WX 5100] + 67ca Ellesmere [Polaris10] + 67cc Ellesmere [Polaris10] + 67cf Ellesmere [Polaris10] 67df Ellesmere [Radeon RX 470/480] 1002 0b37 Radeon RX 480 1043 04a8 Radeon RX 480 @@ -2218,6 +2225,7 @@ 1787 a480 Radeon RX 480 67e0 Baffin [Polaris11] 67e1 Baffin [Polaris11] + 67e3 Baffin [Radeon Pro WX 4100] 67e8 Baffin [Polaris11] 67e9 Baffin [Polaris11] 67eb Baffin [Polaris11] @@ -2924,6 +2932,12 @@ 148c 9380 Radeon R9 380 # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 + 6980 Polaris12 + 6981 Polaris12 + 6985 Polaris12 + 6986 Polaris12 + 6987 Polaris12 + 699f Polaris12 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge 7100 R520 [Radeon X1800 XT] @@ -5095,6 +5109,7 @@ 0675 1704 ISDN Adapter (PCI Bus, D, C) 0675 1707 ISDN Adapter (PCI Bus, DV, W) 10cf 105e ISDN Adapter (PCI Bus, DV, W) + 13a0 Transformer Book T101HA-GR030R # Should be 1022:9602 9602 AMD RS780/RS880 PCI to PCI bridge (int gfx) 1043 83a2 M4A785TD Motherboard @@ -10077,6 +10092,7 @@ 10c3 GT218 [GeForce 8400 GS Rev. 3] 10c5 GT218 [GeForce 405] 10d8 GT218 [NVS 300] + 10ef GP102 HDMI Audio Controller 10f0 GP104 High Definition Audio Controller 1140 GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] 1019 0799 GeForce 820M @@ -10620,7 +10636,7 @@ 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] 13f3 GM204GL [Tesla M6] - 13f8 GM204GLM [Quadro M5000M] + 13f8 GM204GLM [Quadro M5000M / M5000 SE] 13f9 GM204GLM [Quadro M4000M] 13fa GM204GLM [Quadro M3000M] 10de 11c9 Quadro M3000 SE @@ -10634,8 +10650,9 @@ 1431 GM206GL [Tesla M4] 15f0 GP100GL 15f1 GP100GL - 15f8 GP100GL - 15f9 GP100GL + 15f7 GP100GL [Tesla P100 PCIe 12GB] + 15f8 GP100GL [Tesla P100 PCIe 16GB] + 15f9 GP100GL [Tesla P100 SMX2 16GB] 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] 1619 GM204M [GeForce GTX 965M] @@ -10659,10 +10676,12 @@ 1b81 GP104 [GeForce GTX 1070] 1b82 GP104 1b83 GP104 + 1b84 GP104 [GeForce GTX 1060 3GB] 1ba0 GP104M [GeForce GTX 1080] 1ba1 GP104M [GeForce GTX 1070] 1bb0 GP104GL [Quadro P5000] 1bb1 GP104GL + 1bb3 GP104GL [Tesla P4] 1bb4 GP104GL 1be0 GP104M [GeForce GTX 1080] 1be1 GP104M [GeForce GTX 1070] @@ -10678,6 +10697,9 @@ 1c80 GP107 1c81 GP107 [GeForce GTX 1050] 1c82 GP107 [GeForce GTX 1050 Ti] + 1c8c GP107M [GeForce GTX 1050 Ti] + 1c8d GP107M [GeForce GTX 1050] + 1c8e GP107M 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL @@ -12103,7 +12125,11 @@ 111f Precision Digital Images 4a47 Precision MX Video engine interface 5243 Frame capture bus interface -1120 EMC Corporation +# formerly EMC Corporation +1120 Dell EMC + 2306 Unity Fibre Channel Controller + 2501 Unity Ethernet Controller + 2505 Unity Fibre Channel Controller 1121 Zilog 1122 Multi-tech Systems, Inc. 1123 Excellent Design, Inc. @@ -15975,7 +16001,7 @@ 5081 T540-5081 Unified Wire Ethernet Controller 5082 T504-5082 Unified Wire Ethernet Controller 5083 T540-5083 Unified Wire Ethernet Controller - 5084 T580-5084 Unified Wire Ethernet Controller + 5084 T540-5084 Unified Wire Ethernet Controller 5085 T580-5085 Unified Wire Ethernet Controller 5086 T580-5086 Unified Wire Ethernet Controller 5087 T580-5087 Unified Wire Ethernet Controller @@ -15994,6 +16020,7 @@ 509a T520-509A Unified Wire Ethernet Controller 509b T540-509B Unified Wire Ethernet Controller 509c T520-509C Unified Wire Ethernet Controller + 509d T540-509D Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16041,6 +16068,7 @@ 549a T520-509A Unified Wire Ethernet Controller 549b T540-509B Unified Wire Ethernet Controller 549c T520-509C Unified Wire Ethernet Controller + 549d T540-509D Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16088,6 +16116,7 @@ 559a T520-509A Unified Wire Storage Controller 559b T540-509B Unified Wire Storage Controller 559c T520-509C Unified Wire Storage Controller + 559d T540-509D Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16135,6 +16164,7 @@ 569a T520-509A Unified Wire Storage Controller 569b T540-509B Unified Wire Storage Controller 569c T520-509C Unified Wire Storage Controller + 569d T540-509D Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16221,6 +16251,7 @@ 589a T520-509A Unified Wire Ethernet Controller [VF] 589b T540-509B Unified Wire Ethernet Controller [VF] 589c T520-509C Unified Wire Ethernet Controller [VF] + 589d T540-509D Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16357,7 +16388,8 @@ 144d Samsung Electronics Co Ltd 1600 Apple PCIe SSD a800 XP941 PCIe SSD - a802 NVMe SSD Controller + a802 NVMe SSD Controller SM951/PM951 + a804 NVMe SSD Controller SM961/PM961 a820 NVMe SSD Controller 171X 1028 1f95 Express Flash NVMe XS1715 SSD 400GB 1028 1f96 Express Flash NVMe XS1715 SSD 800GB @@ -17968,11 +18000,13 @@ 15b3 Mellanox Technologies 0191 MT25408 [ConnectX IB Flash Recovery] 01f6 MT27500 Family [ConnectX-3 Flash Recovery] + 01f8 MT27520 Family [ConnectX-3 Pro Flash Recovery] 01ff MT27600 Family [Connect-IB Flash Recovery] 0209 MT27700 Family [ConnectX-4 Flash Recovery] 020b MT27710 Family [ConnectX-4 Lx Flash Recovery] 020d MT28800 Family [ConnectX-5 Flash Recovery] 020f MT28908A0 Family [ConnectX-6 Flash Recovery] + 0211 MT416842 Family [BlueField SoC Flash Recovery] # reserved for RM#105916 024e MT53100 [Spectrum-2, Flash recovery mode] # Actual value to be used @@ -18732,6 +18766,7 @@ 7013 AP440-3: 32-Channel Isolated Digital Input Module 7014 AP445: 32-Channel Isolated Digital Output Module 7016 AP470 48-Channel TTL Level Digital Input/Output Module + 7017 AP323 16-bit, 20 or 40 Channel Analog Input Module 7018 AP408: 32-Channel Digital I/O Module 701a AP220-16 12-Bit, 16-Channel Analog Output Module 701b AP231-16 16-Bit, 16-Channel Analog Output Module @@ -18992,6 +19027,7 @@ 1160 ARC-1160 16-Port PCI-X to SATA RAID Controller 1170 ARC-1170 24-Port PCI-X to SATA RAID Controller 1201 ARC-1200 2-Port PCI-Express to SATA II RAID Controller + 1203 ARC-1203 2/4/8 Port PCIe 2.0 to SATA 6Gb RAID Controller 1210 ARC-1210 4-Port PCI-Express to SATA RAID Controller 1214 ARC-12x4 PCIe 2.0 to SAS/SATA 6Gb RAID Controller 17d3 1214 ARC-1214 4-Port PCIe 2.0 to SAS/SATA 6Gb RAID Controller @@ -19510,7 +19546,7 @@ 1924 5105 SFN4111T-R5 1924 5201 SFN4112F-R1 1924 5202 SFN4112F-R2 - 0803 SFC9020 [Solarstorm] + 0803 SFC9020 10G Ethernet Controller 1014 0478 2-port 10GbE Low-Latency (R7) 1014 0479 2-port 10GbE OpenOnload (R7) 1014 04a7 Solarflare 10Gb Low-latency Dual-port HBA (R7) @@ -19540,7 +19576,7 @@ 1924 7207 SFN5162F-R7 SFP+ Server Adapter 1924 7a06 SFN5152F-R6 SFP+ Server Adapter 1924 7a07 SFN5152F-R7 SFP+ Server Adapter - 0813 SFL9021 [Solarstorm] + 0813 SFL9021 10GBASE-T Ethernet Controller 1924 6100 SFN5121T-R0 10GBASE-T Server Adapter 1924 6102 SFN5121T-R2 10GBASE-T Server Adapter 1924 6103 SFN5121T-R3 10GBASE-T Server Adapter @@ -19549,7 +19585,7 @@ 1924 6904 SFN5111T-R4 10GBASE-T Server Adapter 1924 7104 SFN5161T-R4 10GBASE-T Server Adapter 1924 7904 SFN5151T-R4 10GBASE-T Server Adapter - 0903 SFC9120 + 0903 SFC9120 10G Ethernet Controller 1014 04cc SFN7122F-R2 2x10GbE SFP+ Flareon Ultra 1924 8002 SFN7122F-R1 SFP+ Server Adapter 1924 8003 SFN7x41Q-R1 Flareon Ultra 7000 Series 10/40G Adapter @@ -19561,11 +19597,11 @@ 1924 800d SFN7x02F-R3 Flareon 7000 Series 10G Adapter 1924 8010 SFA7942Q-R1 QSFP+ AOE Adapter 1924 8015 SFA7942Q-A5-0-R1 QSFP+ AOE Adapter - 0923 SFC9140 + 0923 SFC9140 10/40G Ethernet Controller 1924 800b SFN7x42Q-R1 Flareon Ultra 7000 Series 10/40G Adapter 1924 800e SFN7x42Q-R2 Flareon Ultra 7000 Series 10/40G Adapter 1924 800f SFN7xx4F-R1 Flareon Ultra 7000 Series 10G Adapter - 0a03 SFC9220 + 0a03 SFC9220 10/40G Ethernet Controller 1924 8011 SFN 8022-R1 Solarflare Flareon 8000 Series 10G Adapter 1924 8012 SFN8522-R1 Flareon Ultra 8000 Series 10G Adapter 1924 8013 SFN8042-R1 Solarflare Flareon 8000 Series 10/40G Adapter @@ -19574,10 +19610,11 @@ 1924 8017 SFN8522-R2 Flareon Ultra 8000 Series 10G Adapter 1924 8018 SFN8042-R2 Flareon 8000 Series 10/40G Adapter 1924 8019 SFN8542-R2 Flareon Ultra 8000 Series 10/40G Adapter - 1803 SFC9020 Virtual Function [Solarstorm] - 1813 SFL9021 Virtual Function [Solarstorm] - 1903 SFC9120 Virtual Function - 1923 SFC9140 Virtual Function + 1803 SFC9020 10G Ethernet Controller (Virtual Function) + 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) + 1903 SFC9120 10G Ethernet Controller (Virtual Function) + 1923 SFC9140 10/40G Ethernet Controller (Virtual Function) + 1a03 SFC9220 10/40G Ethernet Controller (Virtual Function) 6703 SFC4000 rev A iSCSI/Onload [Solarstorm] 10b8 0102 SMC10GPCIe-10BT (A2) [TigerCard] 10b8 0103 SMC10GPCIe-10BT (A3) [TigerCard] @@ -19864,6 +19901,7 @@ 5801 DDRdrive X1 5808 DDRdrive X8 dd52 DDRdrive X1-30 +19e5 Huawei Technologies Co., Ltd. 19e7 NET (Network Equipment Technologies) 1001 STIX DSP Card 1002 STIX - 1 Port T1/E1 Card @@ -20303,6 +20341,8 @@ 0303 Simulyzer-RT CompactPCI Serial PSI5-SIM-1 card 0304 Simulyzer-RT CompactPCI Serial PWR-ANA-1 card 0305 Simulyzer-RT CompactPCI Serial CAN-1 card +1cd7 Nanjing Magewell Electronics Co., Ltd. + 0010 Pro Capture Endpoint 1cdd secunet Security Networks AG 1ce4 Exablaze 0001 ExaNIC X4 @@ -20310,6 +20350,7 @@ 0003 ExaNIC X10 0004 ExaNIC X10-GM 0005 ExaNIC X40 + 0006 ExaNIC X10-HPT 1cf7 Subspace Dynamics 1d00 Pure Storage 1d1d CNEX Labs @@ -21336,6 +21377,27 @@ 0813 Moorestown SC DMA 0814 Moorestown LPE DMA 0815 Moorestown SSP0 + 0817 Medfield Serial IO I2C Controller #3 + 0818 Medfield Serial IO I2C Controller #4 + 0819 Medfield Serial IO I2C Controller #5 + 081a Medfield GPIO Controller [Core] + 081b Medfield Serial IO HSUART Controller #1 + 081c Medfield Serial IO HSUART Controller #2 + 081d Medfield Serial IO HSUART Controller #3 + 081e Medfield Serial IO HSUART DMA Controller + 081f Medfield GPIO Controller [AON] + 0820 Medfield SD Host Controller + 0821 Medfield SDIO Controller #1 + 0822 Medfield SDIO Controller #2 + 0823 Medfield eMMC Controller #0 + 0824 Medfield eMMC Controller #1 + 0827 Medfield Serial IO DMA Controller + 0828 Medfield Power Management Unit + 0829 Medfield USB Device Controller (OTG) + 082a Medfield SCU IPC + 082c Medfield Serial IO I2C Controller #0 + 082d Medfield Serial IO I2C Controller #1 + 082e Medfield Serial IO I2C Controller #2 0885 Centrino Wireless-N + WiMAX 6150 8086 1305 Centrino Wireless-N + WiMAX 6150 BGN 8086 1307 Centrino Wireless-N + WiMAX 6150 BG @@ -22445,6 +22507,18 @@ 1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller 8086 1161 82806AA PCI64 Hub APIC 1162 Xscale 80200 Big Endian Companion Chip + 1190 Merrifield SD/SDIO/eMMC Controller + 1191 Merrifield Serial IO HSUART Controller + 1192 Merrifield Serial IO HSUART DMA Controller + 1194 Merrifield Serial IO SPI Controller + 1195 Merrifield Serial IO I2C Controller + 1196 Merrifield Serial IO I2C Controller + 1199 Merrifield GPIO Controller + 119e Merrifield USB Device Controller (OTG) + 11a0 Merrifield SCU IPC + 11a1 Merrifield Power Management Unit + 11a2 Merrifield Serial IO DMA Controller + 11a5 Merrifield Serial IO PWM Controller 1200 IXP1200 Network Processor 172a 0000 AEP SSL Accelerator 1209 8255xER/82551IT Fast Ethernet Controller @@ -22917,8 +22991,8 @@ 103c 0000 HPE Ethernet 10/20Gb 2-port 660FLB Adapter 103c 22fe HPE Ethernet 10/20Gb 2-port 660FLB Adapter 1588 Ethernet Controller XL710 for 20GbE backplane - 103c 0000 HPE Ethernet 10/20Gb 2-port 660M Adapter - 103c 22ff HPE Ethernet 10/20Gb 2-port 660M Adapter + 103c 0000 Ethernet 10/20Gb 2-port 660M Adapter + 103c 22ff Ethernet 10/20Gb 2-port 660M Adapter 1589 Ethernet Controller X710/X557-AT 10GBASE-T 108e 0000 Quad Port 10GBase-T Adapter 108e 7b1c Quad Port 10GBase-T Adapter @@ -22951,12 +23025,17 @@ 15ac Ethernet Connection X552 10 GbE SFP+ 15ad Ethernet Connection X552/X557-AT 10GBASE-T 15ae Ethernet Connection X552 1000BASE-T + 15b0 Ethernet Connection X552 Backplane 15b4 X553 Virtual Function 15b5 DSL6340 USB 3.1 Controller [Alpine Ridge] 15b6 DSL6540 USB 3.1 Controller [Alpine Ridge] 15b7 Ethernet Connection (2) I219-LM 15b8 Ethernet Connection (2) I219-V 15b9 Ethernet Connection (3) I219-LM + 15bb Ethernet Connection (7) I219-LM + 15bc Ethernet Connection (7) I219-V + 15bd Ethernet Connection (6) I219-LM + 15be Ethernet Connection (6) I219-V 15bf JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] 15c0 JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] 15c5 X553 Virtual Function @@ -24258,6 +24337,9 @@ 24f4 Wireless 8260 # Snow Field Peak AC 8086 0030 Dual Band Wireless-AC 8260 + 24fd Wireless 8265 / 8275 +# Windstorm Peak + 8086 0010 Dual Band Wireless-AC 8265 2500 82820 820 (Camino) Chipset Host Bridge (MCH) 1028 0095 Precision Workstation 220 Chipset 1043 801c P3C-2000 system chipset @@ -25145,12 +25227,12 @@ 1028 01da OptiPlex 745 1462 7235 P965 Neo MS-7235 mainboard 2826 C600/X79 series chipset SATA RAID Controller - 1d49 0100 ThinkSystem RAID 331 - 1d49 0101 ThinkSystem RAID 331 - 1d49 0102 ThinkSystem RAID 331 - 1d49 0103 ThinkSystem RAID 331 - 1d49 0104 ThinkSystem RAID 331 - 1d49 0105 ThinkSystem RAID 331 + 1d49 0100 Intel RSTe SATA Software RAID + 1d49 0101 Intel RSTe SATA Software RAID + 1d49 0102 Intel RSTe SATA Software RAID + 1d49 0103 Intel RSTe SATA Software RAID + 1d49 0104 Intel RSTe SATA Software RAID + 1d49 0105 Intel RSTe SATA Software RAID 2827 C610/X99 series chipset sSATA Controller [RAID mode] 2828 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [IDE mode] 1028 01f3 Inspiron 1420 @@ -26950,41 +27032,41 @@ 530d 80310 (IOP) IO Processor 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine - 5a84 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Integrated Graphics Controller - 5a88 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Imaging Unit - 5a98 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Audio Cluster - 5a9a Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Trusted Execution Engine - 5aa2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Integrated Sensor Hub - 5aa8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series USB xHCI - 5aac Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #1 - 5aae Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #2 - 5ab0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #3 - 5ab2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #4 - 5ab4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #5 - 5ab6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #6 - 5ab8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #7 - 5aba Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #8 - 5abc Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #1 - 5abe Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #2 - 5ac0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #3 - 5ac2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #1 - 5ac4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #2 - 5ac6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #3 - 5ac8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PWM Pin Controller - 5aca Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SDXC/MMC Host Controller - 5acc Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series eMMC Controller - 5ad0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SDIO Controller - 5ad4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SMBus Controller - 5ad6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port B #1 - 5ad7 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port B #2 - 5ad8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #1 - 5ad9 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #2 - 5ada Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #3 - 5adb Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #4 - 5ae3 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SATA AHCI Controller - 5ae8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Low Pin Count Interface - 5aee Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #4 - 5af0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Host Bridge + 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller + 5a88 Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit + 5a98 Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster + 5a9a Celeron N3350/Pentium N4200/Atom E3900 Series Trusted Execution Engine + 5aa2 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Sensor Hub + 5aa8 Celeron N3350/Pentium N4200/Atom E3900 Series USB xHCI + 5aac Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #1 + 5aae Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #2 + 5ab0 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #3 + 5ab2 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #4 + 5ab4 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #5 + 5ab6 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #6 + 5ab8 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #7 + 5aba Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #8 + 5abc Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #1 + 5abe Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #2 + 5ac0 Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #3 + 5ac2 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #1 + 5ac4 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #2 + 5ac6 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #3 + 5ac8 Celeron N3350/Pentium N4200/Atom E3900 Series PWM Pin Controller + 5aca Celeron N3350/Pentium N4200/Atom E3900 Series SDXC/MMC Host Controller + 5acc Celeron N3350/Pentium N4200/Atom E3900 Series eMMC Controller + 5ad0 Celeron N3350/Pentium N4200/Atom E3900 Series SDIO Controller + 5ad4 Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller + 5ad6 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #1 + 5ad7 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #2 + 5ad8 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #1 + 5ad9 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #2 + 5ada Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #3 + 5adb Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #4 + 5ae3 Celeron N3350/Pentium N4200/Atom E3900 Series SATA AHCI Controller + 5ae8 Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface + 5aee Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #4 + 5af0 Celeron N3350/Pentium N4200/Atom E3900 Series Host Bridge 65c0 5100 Chipset Memory Controller Hub 65e2 5100 Chipset PCI Express x4 Port 2 65e3 5100 Chipset PCI Express x4 Port 3 @@ -27826,6 +27908,25 @@ a243 Lewisburg LPC or eSPI Controller a252 Lewisburg SSATA Controller [AHCI mode] a256 Lewisburg SSATA Controller [RAID mode] + a282 200 Series PCH SATA controller [AHCI mode] + a294 200 Series PCH PCI Express Root Port #1 + a2a1 200 Series PCH PMC + a2a3 200 Series PCH SMBus Controller + a2a7 200 Series PCH Serial IO UART Controller #0 + a2a8 200 Series PCH Serial IO UART Controller #1 + a2a9 200 Series PCH Serial IO SPI Controller #0 + a2aa 200 Series PCH Serial IO SPI Controller #1 + a2af 200 Series PCH USB 3.0 xHCI Controller + a2b1 200 Series PCH Thermal Subsystem + a2ba 200 Series PCH CSME HECI #1 + a2bb 200 Series PCH CSME HECI #2 + a2c6 200 Series PCH LPC Controller + a2e0 200 Series PCH Serial IO I2C Controller #0 + a2e1 200 Series PCH Serial IO I2C Controller #1 + a2e2 200 Series PCH Serial IO I2C Controller #2 + a2e3 200 Series PCH Serial IO I2C Controller #3 + a2e6 200 Series PCH Serial IO UART Controller #2 + a2f0 200 Series PCH HD Audio a620 6400/6402 Advanced Memory Buffer (AMB) abc0 Omni-Path Fabric Switch Silicon 100 Series b152 21152 PCI-to-PCI Bridge @@ -28605,6 +28706,7 @@ f1d0 AJA Video cafe Kona SD cfee Xena LS/SD-22-DA/SD-DA daff KONA LHi + db09 Corvid 24 dcaf Kona HD dfee Xena HD-DA efac Xena SD-MM/SD-22-MM From owner-svn-src-all@freebsd.org Wed Jan 11 22:10:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47890CABADD; Wed, 11 Jan 2017 22:10:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13FD8160A; Wed, 11 Jan 2017 22:10:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BMAud6096802; Wed, 11 Jan 2017 22:10:56 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BMAuLv096801; Wed, 11 Jan 2017 22:10:56 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201701112210.v0BMAuLv096801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 11 Jan 2017 22:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311944 - stable/10/share/misc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:10:57 -0000 Author: bapt Date: Wed Jan 11 22:10:56 2017 New Revision: 311944 URL: https://svnweb.freebsd.org/changeset/base/311944 Log: MFC r311706: Update pciids to 2017.01.08 Modified: stable/10/share/misc/pci_vendors Directory Properties: stable/10/ (props changed) Modified: stable/10/share/misc/pci_vendors ============================================================================== --- stable/10/share/misc/pci_vendors Wed Jan 11 22:10:41 2017 (r311943) +++ stable/10/share/misc/pci_vendors Wed Jan 11 22:10:56 2017 (r311944) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2016.11.21 -# Date: 2016-11-21 03:15:01 +# Version: 2017.01.08 +# Date: 2017-01-08 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -249,6 +249,7 @@ 0014 MegaRAID Tri-Mode SAS3516 1028 1fd4 PERC H745P MX 1d49 0602 ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter + 0015 MegaRAID Tri-Mode SAS3416 0016 MegaRAID Tri-Mode SAS3508 1028 1fc9 PERC H840 Adapter 1028 1fcb PERC H740P Adapter @@ -548,6 +549,7 @@ 1028 1f53 HBA330 Mini 1028 1fd2 HBA330 MX 1028 1fd3 HBA330 MMZ + 1bd4 0011 Inspur 12Gb 8i-3008 IT SAS HBA 00ab SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00ac SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 1d49 0201 ThinkSystem 430-16i SAS/SATA 12Gb HBA @@ -2201,6 +2203,11 @@ 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE 67c0 Ellesmere [Polaris10] + 67c4 Ellesmere [Radeon Pro WX 7100] + 67c7 Ellesmere [Radeon Pro WX 5100] + 67ca Ellesmere [Polaris10] + 67cc Ellesmere [Polaris10] + 67cf Ellesmere [Polaris10] 67df Ellesmere [Radeon RX 470/480] 1002 0b37 Radeon RX 480 1043 04a8 Radeon RX 480 @@ -2218,6 +2225,7 @@ 1787 a480 Radeon RX 480 67e0 Baffin [Polaris11] 67e1 Baffin [Polaris11] + 67e3 Baffin [Radeon Pro WX 4100] 67e8 Baffin [Polaris11] 67e9 Baffin [Polaris11] 67eb Baffin [Polaris11] @@ -2924,6 +2932,12 @@ 148c 9380 Radeon R9 380 # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 + 6980 Polaris12 + 6981 Polaris12 + 6985 Polaris12 + 6986 Polaris12 + 6987 Polaris12 + 699f Polaris12 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge 7100 R520 [Radeon X1800 XT] @@ -5095,6 +5109,7 @@ 0675 1704 ISDN Adapter (PCI Bus, D, C) 0675 1707 ISDN Adapter (PCI Bus, DV, W) 10cf 105e ISDN Adapter (PCI Bus, DV, W) + 13a0 Transformer Book T101HA-GR030R # Should be 1022:9602 9602 AMD RS780/RS880 PCI to PCI bridge (int gfx) 1043 83a2 M4A785TD Motherboard @@ -10077,6 +10092,7 @@ 10c3 GT218 [GeForce 8400 GS Rev. 3] 10c5 GT218 [GeForce 405] 10d8 GT218 [NVS 300] + 10ef GP102 HDMI Audio Controller 10f0 GP104 High Definition Audio Controller 1140 GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] 1019 0799 GeForce 820M @@ -10620,7 +10636,7 @@ 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] 13f3 GM204GL [Tesla M6] - 13f8 GM204GLM [Quadro M5000M] + 13f8 GM204GLM [Quadro M5000M / M5000 SE] 13f9 GM204GLM [Quadro M4000M] 13fa GM204GLM [Quadro M3000M] 10de 11c9 Quadro M3000 SE @@ -10634,8 +10650,9 @@ 1431 GM206GL [Tesla M4] 15f0 GP100GL 15f1 GP100GL - 15f8 GP100GL - 15f9 GP100GL + 15f7 GP100GL [Tesla P100 PCIe 12GB] + 15f8 GP100GL [Tesla P100 PCIe 16GB] + 15f9 GP100GL [Tesla P100 SMX2 16GB] 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] 1619 GM204M [GeForce GTX 965M] @@ -10659,10 +10676,12 @@ 1b81 GP104 [GeForce GTX 1070] 1b82 GP104 1b83 GP104 + 1b84 GP104 [GeForce GTX 1060 3GB] 1ba0 GP104M [GeForce GTX 1080] 1ba1 GP104M [GeForce GTX 1070] 1bb0 GP104GL [Quadro P5000] 1bb1 GP104GL + 1bb3 GP104GL [Tesla P4] 1bb4 GP104GL 1be0 GP104M [GeForce GTX 1080] 1be1 GP104M [GeForce GTX 1070] @@ -10678,6 +10697,9 @@ 1c80 GP107 1c81 GP107 [GeForce GTX 1050] 1c82 GP107 [GeForce GTX 1050 Ti] + 1c8c GP107M [GeForce GTX 1050 Ti] + 1c8d GP107M [GeForce GTX 1050] + 1c8e GP107M 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL @@ -12103,7 +12125,11 @@ 111f Precision Digital Images 4a47 Precision MX Video engine interface 5243 Frame capture bus interface -1120 EMC Corporation +# formerly EMC Corporation +1120 Dell EMC + 2306 Unity Fibre Channel Controller + 2501 Unity Ethernet Controller + 2505 Unity Fibre Channel Controller 1121 Zilog 1122 Multi-tech Systems, Inc. 1123 Excellent Design, Inc. @@ -15975,7 +16001,7 @@ 5081 T540-5081 Unified Wire Ethernet Controller 5082 T504-5082 Unified Wire Ethernet Controller 5083 T540-5083 Unified Wire Ethernet Controller - 5084 T580-5084 Unified Wire Ethernet Controller + 5084 T540-5084 Unified Wire Ethernet Controller 5085 T580-5085 Unified Wire Ethernet Controller 5086 T580-5086 Unified Wire Ethernet Controller 5087 T580-5087 Unified Wire Ethernet Controller @@ -15994,6 +16020,7 @@ 509a T520-509A Unified Wire Ethernet Controller 509b T540-509B Unified Wire Ethernet Controller 509c T520-509C Unified Wire Ethernet Controller + 509d T540-509D Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16041,6 +16068,7 @@ 549a T520-509A Unified Wire Ethernet Controller 549b T540-509B Unified Wire Ethernet Controller 549c T520-509C Unified Wire Ethernet Controller + 549d T540-509D Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16088,6 +16116,7 @@ 559a T520-509A Unified Wire Storage Controller 559b T540-509B Unified Wire Storage Controller 559c T520-509C Unified Wire Storage Controller + 559d T540-509D Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16135,6 +16164,7 @@ 569a T520-509A Unified Wire Storage Controller 569b T540-509B Unified Wire Storage Controller 569c T520-509C Unified Wire Storage Controller + 569d T540-509D Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16221,6 +16251,7 @@ 589a T520-509A Unified Wire Ethernet Controller [VF] 589b T540-509B Unified Wire Ethernet Controller [VF] 589c T520-509C Unified Wire Ethernet Controller [VF] + 589d T540-509D Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16357,7 +16388,8 @@ 144d Samsung Electronics Co Ltd 1600 Apple PCIe SSD a800 XP941 PCIe SSD - a802 NVMe SSD Controller + a802 NVMe SSD Controller SM951/PM951 + a804 NVMe SSD Controller SM961/PM961 a820 NVMe SSD Controller 171X 1028 1f95 Express Flash NVMe XS1715 SSD 400GB 1028 1f96 Express Flash NVMe XS1715 SSD 800GB @@ -17968,11 +18000,13 @@ 15b3 Mellanox Technologies 0191 MT25408 [ConnectX IB Flash Recovery] 01f6 MT27500 Family [ConnectX-3 Flash Recovery] + 01f8 MT27520 Family [ConnectX-3 Pro Flash Recovery] 01ff MT27600 Family [Connect-IB Flash Recovery] 0209 MT27700 Family [ConnectX-4 Flash Recovery] 020b MT27710 Family [ConnectX-4 Lx Flash Recovery] 020d MT28800 Family [ConnectX-5 Flash Recovery] 020f MT28908A0 Family [ConnectX-6 Flash Recovery] + 0211 MT416842 Family [BlueField SoC Flash Recovery] # reserved for RM#105916 024e MT53100 [Spectrum-2, Flash recovery mode] # Actual value to be used @@ -18732,6 +18766,7 @@ 7013 AP440-3: 32-Channel Isolated Digital Input Module 7014 AP445: 32-Channel Isolated Digital Output Module 7016 AP470 48-Channel TTL Level Digital Input/Output Module + 7017 AP323 16-bit, 20 or 40 Channel Analog Input Module 7018 AP408: 32-Channel Digital I/O Module 701a AP220-16 12-Bit, 16-Channel Analog Output Module 701b AP231-16 16-Bit, 16-Channel Analog Output Module @@ -18992,6 +19027,7 @@ 1160 ARC-1160 16-Port PCI-X to SATA RAID Controller 1170 ARC-1170 24-Port PCI-X to SATA RAID Controller 1201 ARC-1200 2-Port PCI-Express to SATA II RAID Controller + 1203 ARC-1203 2/4/8 Port PCIe 2.0 to SATA 6Gb RAID Controller 1210 ARC-1210 4-Port PCI-Express to SATA RAID Controller 1214 ARC-12x4 PCIe 2.0 to SAS/SATA 6Gb RAID Controller 17d3 1214 ARC-1214 4-Port PCIe 2.0 to SAS/SATA 6Gb RAID Controller @@ -19510,7 +19546,7 @@ 1924 5105 SFN4111T-R5 1924 5201 SFN4112F-R1 1924 5202 SFN4112F-R2 - 0803 SFC9020 [Solarstorm] + 0803 SFC9020 10G Ethernet Controller 1014 0478 2-port 10GbE Low-Latency (R7) 1014 0479 2-port 10GbE OpenOnload (R7) 1014 04a7 Solarflare 10Gb Low-latency Dual-port HBA (R7) @@ -19540,7 +19576,7 @@ 1924 7207 SFN5162F-R7 SFP+ Server Adapter 1924 7a06 SFN5152F-R6 SFP+ Server Adapter 1924 7a07 SFN5152F-R7 SFP+ Server Adapter - 0813 SFL9021 [Solarstorm] + 0813 SFL9021 10GBASE-T Ethernet Controller 1924 6100 SFN5121T-R0 10GBASE-T Server Adapter 1924 6102 SFN5121T-R2 10GBASE-T Server Adapter 1924 6103 SFN5121T-R3 10GBASE-T Server Adapter @@ -19549,7 +19585,7 @@ 1924 6904 SFN5111T-R4 10GBASE-T Server Adapter 1924 7104 SFN5161T-R4 10GBASE-T Server Adapter 1924 7904 SFN5151T-R4 10GBASE-T Server Adapter - 0903 SFC9120 + 0903 SFC9120 10G Ethernet Controller 1014 04cc SFN7122F-R2 2x10GbE SFP+ Flareon Ultra 1924 8002 SFN7122F-R1 SFP+ Server Adapter 1924 8003 SFN7x41Q-R1 Flareon Ultra 7000 Series 10/40G Adapter @@ -19561,11 +19597,11 @@ 1924 800d SFN7x02F-R3 Flareon 7000 Series 10G Adapter 1924 8010 SFA7942Q-R1 QSFP+ AOE Adapter 1924 8015 SFA7942Q-A5-0-R1 QSFP+ AOE Adapter - 0923 SFC9140 + 0923 SFC9140 10/40G Ethernet Controller 1924 800b SFN7x42Q-R1 Flareon Ultra 7000 Series 10/40G Adapter 1924 800e SFN7x42Q-R2 Flareon Ultra 7000 Series 10/40G Adapter 1924 800f SFN7xx4F-R1 Flareon Ultra 7000 Series 10G Adapter - 0a03 SFC9220 + 0a03 SFC9220 10/40G Ethernet Controller 1924 8011 SFN 8022-R1 Solarflare Flareon 8000 Series 10G Adapter 1924 8012 SFN8522-R1 Flareon Ultra 8000 Series 10G Adapter 1924 8013 SFN8042-R1 Solarflare Flareon 8000 Series 10/40G Adapter @@ -19574,10 +19610,11 @@ 1924 8017 SFN8522-R2 Flareon Ultra 8000 Series 10G Adapter 1924 8018 SFN8042-R2 Flareon 8000 Series 10/40G Adapter 1924 8019 SFN8542-R2 Flareon Ultra 8000 Series 10/40G Adapter - 1803 SFC9020 Virtual Function [Solarstorm] - 1813 SFL9021 Virtual Function [Solarstorm] - 1903 SFC9120 Virtual Function - 1923 SFC9140 Virtual Function + 1803 SFC9020 10G Ethernet Controller (Virtual Function) + 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) + 1903 SFC9120 10G Ethernet Controller (Virtual Function) + 1923 SFC9140 10/40G Ethernet Controller (Virtual Function) + 1a03 SFC9220 10/40G Ethernet Controller (Virtual Function) 6703 SFC4000 rev A iSCSI/Onload [Solarstorm] 10b8 0102 SMC10GPCIe-10BT (A2) [TigerCard] 10b8 0103 SMC10GPCIe-10BT (A3) [TigerCard] @@ -19864,6 +19901,7 @@ 5801 DDRdrive X1 5808 DDRdrive X8 dd52 DDRdrive X1-30 +19e5 Huawei Technologies Co., Ltd. 19e7 NET (Network Equipment Technologies) 1001 STIX DSP Card 1002 STIX - 1 Port T1/E1 Card @@ -20303,6 +20341,8 @@ 0303 Simulyzer-RT CompactPCI Serial PSI5-SIM-1 card 0304 Simulyzer-RT CompactPCI Serial PWR-ANA-1 card 0305 Simulyzer-RT CompactPCI Serial CAN-1 card +1cd7 Nanjing Magewell Electronics Co., Ltd. + 0010 Pro Capture Endpoint 1cdd secunet Security Networks AG 1ce4 Exablaze 0001 ExaNIC X4 @@ -20310,6 +20350,7 @@ 0003 ExaNIC X10 0004 ExaNIC X10-GM 0005 ExaNIC X40 + 0006 ExaNIC X10-HPT 1cf7 Subspace Dynamics 1d00 Pure Storage 1d1d CNEX Labs @@ -21336,6 +21377,27 @@ 0813 Moorestown SC DMA 0814 Moorestown LPE DMA 0815 Moorestown SSP0 + 0817 Medfield Serial IO I2C Controller #3 + 0818 Medfield Serial IO I2C Controller #4 + 0819 Medfield Serial IO I2C Controller #5 + 081a Medfield GPIO Controller [Core] + 081b Medfield Serial IO HSUART Controller #1 + 081c Medfield Serial IO HSUART Controller #2 + 081d Medfield Serial IO HSUART Controller #3 + 081e Medfield Serial IO HSUART DMA Controller + 081f Medfield GPIO Controller [AON] + 0820 Medfield SD Host Controller + 0821 Medfield SDIO Controller #1 + 0822 Medfield SDIO Controller #2 + 0823 Medfield eMMC Controller #0 + 0824 Medfield eMMC Controller #1 + 0827 Medfield Serial IO DMA Controller + 0828 Medfield Power Management Unit + 0829 Medfield USB Device Controller (OTG) + 082a Medfield SCU IPC + 082c Medfield Serial IO I2C Controller #0 + 082d Medfield Serial IO I2C Controller #1 + 082e Medfield Serial IO I2C Controller #2 0885 Centrino Wireless-N + WiMAX 6150 8086 1305 Centrino Wireless-N + WiMAX 6150 BGN 8086 1307 Centrino Wireless-N + WiMAX 6150 BG @@ -22445,6 +22507,18 @@ 1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller 8086 1161 82806AA PCI64 Hub APIC 1162 Xscale 80200 Big Endian Companion Chip + 1190 Merrifield SD/SDIO/eMMC Controller + 1191 Merrifield Serial IO HSUART Controller + 1192 Merrifield Serial IO HSUART DMA Controller + 1194 Merrifield Serial IO SPI Controller + 1195 Merrifield Serial IO I2C Controller + 1196 Merrifield Serial IO I2C Controller + 1199 Merrifield GPIO Controller + 119e Merrifield USB Device Controller (OTG) + 11a0 Merrifield SCU IPC + 11a1 Merrifield Power Management Unit + 11a2 Merrifield Serial IO DMA Controller + 11a5 Merrifield Serial IO PWM Controller 1200 IXP1200 Network Processor 172a 0000 AEP SSL Accelerator 1209 8255xER/82551IT Fast Ethernet Controller @@ -22917,8 +22991,8 @@ 103c 0000 HPE Ethernet 10/20Gb 2-port 660FLB Adapter 103c 22fe HPE Ethernet 10/20Gb 2-port 660FLB Adapter 1588 Ethernet Controller XL710 for 20GbE backplane - 103c 0000 HPE Ethernet 10/20Gb 2-port 660M Adapter - 103c 22ff HPE Ethernet 10/20Gb 2-port 660M Adapter + 103c 0000 Ethernet 10/20Gb 2-port 660M Adapter + 103c 22ff Ethernet 10/20Gb 2-port 660M Adapter 1589 Ethernet Controller X710/X557-AT 10GBASE-T 108e 0000 Quad Port 10GBase-T Adapter 108e 7b1c Quad Port 10GBase-T Adapter @@ -22951,12 +23025,17 @@ 15ac Ethernet Connection X552 10 GbE SFP+ 15ad Ethernet Connection X552/X557-AT 10GBASE-T 15ae Ethernet Connection X552 1000BASE-T + 15b0 Ethernet Connection X552 Backplane 15b4 X553 Virtual Function 15b5 DSL6340 USB 3.1 Controller [Alpine Ridge] 15b6 DSL6540 USB 3.1 Controller [Alpine Ridge] 15b7 Ethernet Connection (2) I219-LM 15b8 Ethernet Connection (2) I219-V 15b9 Ethernet Connection (3) I219-LM + 15bb Ethernet Connection (7) I219-LM + 15bc Ethernet Connection (7) I219-V + 15bd Ethernet Connection (6) I219-LM + 15be Ethernet Connection (6) I219-V 15bf JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] 15c0 JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] 15c5 X553 Virtual Function @@ -24258,6 +24337,9 @@ 24f4 Wireless 8260 # Snow Field Peak AC 8086 0030 Dual Band Wireless-AC 8260 + 24fd Wireless 8265 / 8275 +# Windstorm Peak + 8086 0010 Dual Band Wireless-AC 8265 2500 82820 820 (Camino) Chipset Host Bridge (MCH) 1028 0095 Precision Workstation 220 Chipset 1043 801c P3C-2000 system chipset @@ -25145,12 +25227,12 @@ 1028 01da OptiPlex 745 1462 7235 P965 Neo MS-7235 mainboard 2826 C600/X79 series chipset SATA RAID Controller - 1d49 0100 ThinkSystem RAID 331 - 1d49 0101 ThinkSystem RAID 331 - 1d49 0102 ThinkSystem RAID 331 - 1d49 0103 ThinkSystem RAID 331 - 1d49 0104 ThinkSystem RAID 331 - 1d49 0105 ThinkSystem RAID 331 + 1d49 0100 Intel RSTe SATA Software RAID + 1d49 0101 Intel RSTe SATA Software RAID + 1d49 0102 Intel RSTe SATA Software RAID + 1d49 0103 Intel RSTe SATA Software RAID + 1d49 0104 Intel RSTe SATA Software RAID + 1d49 0105 Intel RSTe SATA Software RAID 2827 C610/X99 series chipset sSATA Controller [RAID mode] 2828 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [IDE mode] 1028 01f3 Inspiron 1420 @@ -26950,41 +27032,41 @@ 530d 80310 (IOP) IO Processor 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine - 5a84 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Integrated Graphics Controller - 5a88 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Imaging Unit - 5a98 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Audio Cluster - 5a9a Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Trusted Execution Engine - 5aa2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Integrated Sensor Hub - 5aa8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series USB xHCI - 5aac Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #1 - 5aae Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #2 - 5ab0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #3 - 5ab2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #4 - 5ab4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #5 - 5ab6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #6 - 5ab8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #7 - 5aba Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #8 - 5abc Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #1 - 5abe Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #2 - 5ac0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #3 - 5ac2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #1 - 5ac4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #2 - 5ac6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #3 - 5ac8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PWM Pin Controller - 5aca Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SDXC/MMC Host Controller - 5acc Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series eMMC Controller - 5ad0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SDIO Controller - 5ad4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SMBus Controller - 5ad6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port B #1 - 5ad7 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port B #2 - 5ad8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #1 - 5ad9 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #2 - 5ada Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #3 - 5adb Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #4 - 5ae3 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SATA AHCI Controller - 5ae8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Low Pin Count Interface - 5aee Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #4 - 5af0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Host Bridge + 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller + 5a88 Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit + 5a98 Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster + 5a9a Celeron N3350/Pentium N4200/Atom E3900 Series Trusted Execution Engine + 5aa2 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Sensor Hub + 5aa8 Celeron N3350/Pentium N4200/Atom E3900 Series USB xHCI + 5aac Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #1 + 5aae Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #2 + 5ab0 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #3 + 5ab2 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #4 + 5ab4 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #5 + 5ab6 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #6 + 5ab8 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #7 + 5aba Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #8 + 5abc Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #1 + 5abe Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #2 + 5ac0 Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #3 + 5ac2 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #1 + 5ac4 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #2 + 5ac6 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #3 + 5ac8 Celeron N3350/Pentium N4200/Atom E3900 Series PWM Pin Controller + 5aca Celeron N3350/Pentium N4200/Atom E3900 Series SDXC/MMC Host Controller + 5acc Celeron N3350/Pentium N4200/Atom E3900 Series eMMC Controller + 5ad0 Celeron N3350/Pentium N4200/Atom E3900 Series SDIO Controller + 5ad4 Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller + 5ad6 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #1 + 5ad7 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #2 + 5ad8 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #1 + 5ad9 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #2 + 5ada Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #3 + 5adb Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #4 + 5ae3 Celeron N3350/Pentium N4200/Atom E3900 Series SATA AHCI Controller + 5ae8 Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface + 5aee Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #4 + 5af0 Celeron N3350/Pentium N4200/Atom E3900 Series Host Bridge 65c0 5100 Chipset Memory Controller Hub 65e2 5100 Chipset PCI Express x4 Port 2 65e3 5100 Chipset PCI Express x4 Port 3 @@ -27826,6 +27908,25 @@ a243 Lewisburg LPC or eSPI Controller a252 Lewisburg SSATA Controller [AHCI mode] a256 Lewisburg SSATA Controller [RAID mode] + a282 200 Series PCH SATA controller [AHCI mode] + a294 200 Series PCH PCI Express Root Port #1 + a2a1 200 Series PCH PMC + a2a3 200 Series PCH SMBus Controller + a2a7 200 Series PCH Serial IO UART Controller #0 + a2a8 200 Series PCH Serial IO UART Controller #1 + a2a9 200 Series PCH Serial IO SPI Controller #0 + a2aa 200 Series PCH Serial IO SPI Controller #1 + a2af 200 Series PCH USB 3.0 xHCI Controller + a2b1 200 Series PCH Thermal Subsystem + a2ba 200 Series PCH CSME HECI #1 + a2bb 200 Series PCH CSME HECI #2 + a2c6 200 Series PCH LPC Controller + a2e0 200 Series PCH Serial IO I2C Controller #0 + a2e1 200 Series PCH Serial IO I2C Controller #1 + a2e2 200 Series PCH Serial IO I2C Controller #2 + a2e3 200 Series PCH Serial IO I2C Controller #3 + a2e6 200 Series PCH Serial IO UART Controller #2 + a2f0 200 Series PCH HD Audio a620 6400/6402 Advanced Memory Buffer (AMB) abc0 Omni-Path Fabric Switch Silicon 100 Series b152 21152 PCI-to-PCI Bridge @@ -28605,6 +28706,7 @@ f1d0 AJA Video cafe Kona SD cfee Xena LS/SD-22-DA/SD-DA daff KONA LHi + db09 Corvid 24 dcaf Kona HD dfee Xena HD-DA efac Xena SD-MM/SD-22-MM From owner-svn-src-all@freebsd.org Wed Jan 11 22:11:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D566CABB34; Wed, 11 Jan 2017 22:11:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 311751723; Wed, 11 Jan 2017 22:11:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::7049:d69d:d97f:c66f] (unknown [IPv6:2001:7b8:3a7:0:7049:d69d:d97f:c66f]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id DBF14254B8; Wed, 11 Jan 2017 23:11:03 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_96E7DCCF-5558-4B57-AE01-E03A43495047"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r311929 - head/sys/boot/common From: Dimitry Andric In-Reply-To: <1484170956.86335.17.camel@freebsd.org> Date: Wed, 11 Jan 2017 23:10:55 +0100 Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <8EF36240-8CD0-449E-AA9C-EFFB7BF0C111@FreeBSD.org> References: <201701111847.v0BIl0Mg013954@repo.freebsd.org> <1484170956.86335.17.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:11:07 -0000 --Apple-Mail=_96E7DCCF-5558-4B57-AE01-E03A43495047 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 On 11 Jan 2017, at 22:42, Ian Lepore wrote: > > On Wed, 2017-01-11 at 13:35 -0800, Ngie Cooper wrote: >> On Wed, Jan 11, 2017 at 10:47 AM, Dimitry Andric >> wrote: >>> >>> Author: dim >>> Date: Wed Jan 11 18:47:00 2017 >>> New Revision: 311929 >>> URL: https://svnweb.freebsd.org/changeset/base/311929 >>> >>> Log: >>> Don't include in reloc_elf.c, as it includes >>> just >>> after it, which has a conflicting definition of errno. This >>> leads to >>> the following warning with clang 4.0.0: >>> >>> In file included from sys/boot/common/reloc_elf32.c:6: >>> In file included from sys/boot/common/reloc_elf.c:37: >>> /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this >>> function declaration is not a prototype [-Werror,-Wstrict- >>> prototypes] >>> extern int errno; >>> ^ >>> sys/sys/errno.h:46:26: note: expanded from macro 'errno' >>> #define errno (* __error()) >> It seems like libstand (once again) should be fixed, not the >> "offending code". >> -Ngie >> > > In this case it's not the library that's in error. Libstand is the > thing that implements errno, so it's the thing that must define it. > > The code that includes both errno.h and libstand.h was wrong. errno.h > is a standard header file used with libc, and the loader code doesn't > link with libc. > > The thing that amazes me is the usual: how did this ever work with gcc > 4.2? The line: extern int errno; expanded to: extern int (* __error()); which is a declaration of an external function pointer called __error (albeit with an empty parameter list). Since nobody actually refers to this symbol in libstand, there are no later complaints. Interestingly, reloc_elf.c does not use errno at all, so I have no idea why the include was originally added. -Dimitry --Apple-Mail=_96E7DCCF-5558-4B57-AE01-E03A43495047 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlh2rXcACgkQsF6jCi4glqP8zQCeINInEOUVS5IPMGmWXEYQ5zon wR0AoMw7WEJJOqE8t3in9Fe5L35F87Ll =lVEX -----END PGP SIGNATURE----- --Apple-Mail=_96E7DCCF-5558-4B57-AE01-E03A43495047-- From owner-svn-src-all@freebsd.org Wed Jan 11 22:32:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E4F8CAB8EE; Wed, 11 Jan 2017 22:32:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) (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 09C171E0B; Wed, 11 Jan 2017 22:32:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x244.google.com with SMTP id a20so282366qkc.3; Wed, 11 Jan 2017 14:32:15 -0800 (PST) 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=iO8aak/MljmzY9Q9kk//8m856HWViNaypMWfsNBHR3E=; b=K1U+dgr6i/OohhyEOW0fRDAe3NowCuPxbdCTnIudlWztcfh/XT/sqF+XH0YVSUNatV EHsjNDbvlmeY0PYCSuqrjXqv2TWwi9M5Y9dzI4bdv+GgBPNqP+q2ORDCiI24bsCaFoKJ 36UZv4CQAFO5VMYPmyrONPkwuyAZMzWSeT+tC76S1eKLQTBUy/feJbg8tBQoqdvdOITM W8wCdkdAhQNUKDfNUZyKWh9yhMMFF1tRMsv8ZTOQtWFX7OOyj3VF1YemT9CGALMZRQlo QcujcfMj7T1FLa9kdmmc9VQuxOr6BdFwQckNElQouem2B1R8Ke9fYMqIeWl6FAJANT2/ UUsA== 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=iO8aak/MljmzY9Q9kk//8m856HWViNaypMWfsNBHR3E=; b=MWj7Ctd59g/wyEp8K6s6wVaYewu7WAb1Uyv3p0L+dzNJuclE5k+y7ZP+P9ON2FlN/x q8ykb7HD5GJ5QKWDroz8v5SDGcM/9geadEO1W9WZ4Yywx2fJOe/K9siioEPbOXX504J3 L8E+o6HIU3sb0KSIIdVnOrZ/ucnY2Bq0AHiZ9dv7b2MHCiXXPVQtUkAL3uEhpB3Rcwtv vo5NEtQ8FBepw3l3DAPxwq15YERpe7a8v1EHGdVGZEnYRrt0lsLSKYWYsn0C5Wxte+HD cQypGVTpkV7ftmZP0phjL16ZrKZAw7R+QpbdUvGX0sWeH6VtbkaMAZMbxi+hC/zUUwNY Lqvg== X-Gm-Message-State: AIkVDXLbx73N28/Or09MEsuri506+gG4u3CyZ7s3yKFZI6fB/Kq7aH8XW5hwrNn5smqZ9OiWFe5E7R552Ml93Q== X-Received: by 10.55.16.11 with SMTP id a11mr11756614qkh.3.1484173934201; Wed, 11 Jan 2017 14:32:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.83.133 with HTTP; Wed, 11 Jan 2017 14:32:13 -0800 (PST) In-Reply-To: <8EF36240-8CD0-449E-AA9C-EFFB7BF0C111@FreeBSD.org> References: <201701111847.v0BIl0Mg013954@repo.freebsd.org> <1484170956.86335.17.camel@freebsd.org> <8EF36240-8CD0-449E-AA9C-EFFB7BF0C111@FreeBSD.org> From: Ngie Cooper Date: Wed, 11 Jan 2017 14:32:13 -0800 Message-ID: Subject: Re: svn commit: r311929 - head/sys/boot/common To: Dimitry Andric Cc: Ian Lepore , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:32:15 -0000 On Wed, Jan 11, 2017 at 2:10 PM, Dimitry Andric wrote: ... > The line: > > extern int errno; > > expanded to: > > extern int (* __error()); > > which is a declaration of an external function pointer called __error > (albeit with an empty parameter list). Since nobody actually refers to > this symbol in libstand, there are no later complaints. > > Interestingly, reloc_elf.c does not use errno at all, so I have no idea > why the include was originally added. This is why: 95dd728f5ca86 (iedowse 2004-08-28 23:03:05 +0000 221) #else 95dd728f5ca86 (iedowse 2004-08-28 23:03:05 +0000 222) return (EOPNOTSUPP); 95dd728f5ca86 (iedowse 2004-08-28 23:03:05 +0000 223) #endif You probably just broke tinderbox on non-x86/-powerpc. Cheers, -Ngie From owner-svn-src-all@freebsd.org Wed Jan 11 22:33:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34995CAB9F5; Wed, 11 Jan 2017 22:33:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (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 E13F71167; Wed, 11 Jan 2017 22:33:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x241.google.com with SMTP id n13so277613qtc.0; Wed, 11 Jan 2017 14:33:08 -0800 (PST) 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=DWh9+iV8nbm+W/nPWZDkDyBkQR9lQ9s/dKeXLNvSTSE=; b=K7bXvz0NPlh3wYkCy+GpMk678gFbUSyJwhKb7PX1edrFW1LoK6p0YWzgQlAHCvLwNf co0TJn54qb6WAUtHGrSb72RmM5jvPWL/9N41LttXElbzG4UOfK+hj2UdJy4ChE4gNLuD vO9EWdb39FlfzdBQsoqh5gDDfl+fyLKkE8zeK4CqMNIhUojWDFVsoTrLitXvVNJyOYN4 u6PfvXpQPBeqL9iS5+Fkjv/qTWT8kmXuoGgK3/rTGUh603LbAcWkhO80E35GGytdGbdm SRjnStwPC/Qm6Vsqh0dxljN1YdkbpmDVe1YJM4SNAWLgxUiPs3JZanCYCb/s43Pk+ABF SgZg== 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=DWh9+iV8nbm+W/nPWZDkDyBkQR9lQ9s/dKeXLNvSTSE=; b=eApSMy3aJlTgq80MAPwZ5jzqc/bECIDadx7JGoxeFnxs/fXwuld7+sxNHwsOzEw4Sc 53rFxeHreai2g4mr7fGUwOv2Rrv8KyfTh35/3/TCcQl4ij+h7o8VVduN7djBk2EWOkTj rf9b4EfaGu0S1tnPWief3/iY1lZu1ajmvw6XTgN5CQwpXXiPN/Eabja5Nei+7tjOBylq fUv2cAad46rxypDN3aqdv8McFga07I7zmjDFIy6kQwhf/dTc5OGy+TYKszE2DcZxtAZP BlgUKojaJ3KpNj6VsHwu5GDJmsw0QIkKX/NSKHjVp9y7WzguyncyL2LM42Zpiof7yCHl zu5w== X-Gm-Message-State: AIkVDXK7mynpa0nhx/yn0KdEmDFL0DsAAX36ZzDdu5/jRqn0Fhow+j6lubgcH9kQd0EXiBgRA5yGo3f2Ddm9Hg== X-Received: by 10.237.45.71 with SMTP id h65mr9702685qtd.244.1484173988060; Wed, 11 Jan 2017 14:33:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.83.133 with HTTP; Wed, 11 Jan 2017 14:33:07 -0800 (PST) In-Reply-To: References: <201701111847.v0BIl0Mg013954@repo.freebsd.org> <1484170956.86335.17.camel@freebsd.org> <8EF36240-8CD0-449E-AA9C-EFFB7BF0C111@FreeBSD.org> From: Ngie Cooper Date: Wed, 11 Jan 2017 14:33:07 -0800 Message-ID: Subject: Re: svn commit: r311929 - head/sys/boot/common To: Dimitry Andric Cc: Ian Lepore , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:33:09 -0000 On Wed, Jan 11, 2017 at 2:32 PM, Ngie Cooper wrote: > On Wed, Jan 11, 2017 at 2:10 PM, Dimitry Andric wrote: > > ... > >> The line: >> >> extern int errno; >> >> expanded to: >> >> extern int (* __error()); >> >> which is a declaration of an external function pointer called __error >> (albeit with an empty parameter list). Since nobody actually refers to >> this symbol in libstand, there are no later complaints. >> >> Interestingly, reloc_elf.c does not use errno at all, so I have no idea >> why the include was originally added. > > This is why: > > 95dd728f5ca86 (iedowse 2004-08-28 23:03:05 +0000 221) #else > 95dd728f5ca86 (iedowse 2004-08-28 23:03:05 +0000 222) return (EOPNOTSUPP); > 95dd728f5ca86 (iedowse 2004-08-28 23:03:05 +0000 223) #endif Oh... sparc64's ok too. Talk about #ifdef soup. Thanks, -Ngie From owner-svn-src-all@freebsd.org Wed Jan 11 22:37:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE0DFCABCA3; Wed, 11 Jan 2017 22:37:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72260159F; Wed, 11 Jan 2017 22:37:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::7049:d69d:d97f:c66f] (unknown [IPv6:2001:7b8:3a7:0:7049:d69d:d97f:c66f]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id D76E425530; Wed, 11 Jan 2017 23:37:02 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_4FED3BA0-1148-4DE5-A65D-4E8CF6CE1323"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r311929 - head/sys/boot/common From: Dimitry Andric In-Reply-To: Date: Wed, 11 Jan 2017 23:36:55 +0100 Cc: Ian Lepore , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <0ADFDAAC-3858-49B1-BB37-E179D55AF6CE@FreeBSD.org> References: <201701111847.v0BIl0Mg013954@repo.freebsd.org> <1484170956.86335.17.camel@freebsd.org> <8EF36240-8CD0-449E-AA9C-EFFB7BF0C111@FreeBSD.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:37:04 -0000 --Apple-Mail=_4FED3BA0-1148-4DE5-A65D-4E8CF6CE1323 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 11 Jan 2017, at 23:32, Ngie Cooper wrote: >=20 > On Wed, Jan 11, 2017 at 2:10 PM, Dimitry Andric = wrote: >=20 > ... >=20 >> The line: >>=20 >> extern int errno; >>=20 >> expanded to: >>=20 >> extern int (* __error()); >>=20 >> which is a declaration of an external function pointer called __error >> (albeit with an empty parameter list). Since nobody actually refers = to >> this symbol in libstand, there are no later complaints. >>=20 >> Interestingly, reloc_elf.c does not use errno at all, so I have no = idea >> why the include was originally added. >=20 > This is why: >=20 > 95dd728f5ca86 (iedowse 2004-08-28 23:03:05 +0000 221) #else > 95dd728f5ca86 (iedowse 2004-08-28 23:03:05 +0000 222) return = (EOPNOTSUPP); > 95dd728f5ca86 (iedowse 2004-08-28 23:03:05 +0000 223) #endif >=20 > You probably just broke tinderbox on non-x86/-powerpc. Not very likely, since includes . -Dimitry --Apple-Mail=_4FED3BA0-1148-4DE5-A65D-4E8CF6CE1323 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlh2s44ACgkQsF6jCi4glqOlvACgz3TmtZNnUB6yjD8oiithWfpX aBEAoNSklFcZWVQLRQnK5jPYmMTSgfuK =W3s1 -----END PGP SIGNATURE----- --Apple-Mail=_4FED3BA0-1148-4DE5-A65D-4E8CF6CE1323-- From owner-svn-src-all@freebsd.org Wed Jan 11 22:50:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2194DCAB6C1; Wed, 11 Jan 2017 22:50:59 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E37BF1387; Wed, 11 Jan 2017 22:50:58 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BMowJG014059; Wed, 11 Jan 2017 22:50:58 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BMowUA014058; Wed, 11 Jan 2017 22:50:58 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201701112250.v0BMowUA014058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Wed, 11 Jan 2017 22:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311945 - head/usr.bin/fortune/fortune X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:50:59 -0000 Author: cperciva Date: Wed Jan 11 22:50:57 2017 New Revision: 311945 URL: https://svnweb.freebsd.org/changeset/base/311945 Log: Remove obsolete path from fortune(6). This was inadvertantly left over when fortune and other games moved from /usr/games to /usr/bin; I am removing rather than correcting it since we normally do not mention in the FILES section the paths to programs in /usr/bin/. PR: 215962 Reported by: Andras Farkas Modified: head/usr.bin/fortune/fortune/fortune.6 Modified: head/usr.bin/fortune/fortune/fortune.6 ============================================================================== --- head/usr.bin/fortune/fortune/fortune.6 Wed Jan 11 22:10:56 2017 (r311944) +++ head/usr.bin/fortune/fortune/fortune.6 Wed Jan 11 22:50:57 2017 (r311945) @@ -176,7 +176,6 @@ it was up to on disk. .El .Sh FILES .Bl -tag -width ".Pa /usr/share/games/fortune/*" -.It Pa /usr/games/fortune .It Pa /usr/share/games/fortune/* the fortunes databases (those files ending .Dq Pa -o From owner-svn-src-all@freebsd.org Wed Jan 11 22:54:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8155BCAB90B; Wed, 11 Jan 2017 22:54:05 +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 380381A5A; Wed, 11 Jan 2017 22:54:05 +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 v0BMs4XT017132; Wed, 11 Jan 2017 22:54:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BMs4pc017131; Wed, 11 Jan 2017 22:54:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701112254.v0BMs4pc017131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Jan 2017 22:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311946 - head/contrib/elftoolchain/libelftc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:54:05 -0000 Author: emaste Date: Wed Jan 11 22:54:04 2017 New Revision: 311946 URL: https://svnweb.freebsd.org/changeset/base/311946 Log: readelf: add S390 relocation types From https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html Reviewed by: bz MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9149 Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Wed Jan 11 22:50:57 2017 (r311945) +++ head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Wed Jan 11 22:54:04 2017 (r311946) @@ -664,6 +664,37 @@ elftc_reloc_type_str(unsigned int mach, case 48: return "R_RISCV_GPREL_S"; } break; + case EM_S390: + switch (type) { + case 0: return "R_390_NONE"; + case 1: return "R_390_8"; + case 2: return "R_390_12"; + case 3: return "R_390_16"; + case 4: return "R_390_32"; + case 5: return "R_390_PC32"; + case 6: return "R_390_GOT12"; + case 7: return "R_390_GOT32"; + case 8: return "R_390_PLT32"; + case 9: return "R_390_COPY"; + case 10: return "R_390_GLOB_DAT"; + case 11: return "R_390_JMP_SLOT"; + case 12: return "R_390_RELATIVE"; + case 13: return "R_390_GOTOFF"; + case 14: return "R_390_GOTPC"; + case 15: return "R_390_GOT16"; + case 16: return "R_390_PC16"; + case 17: return "R_390_PC16DBL"; + case 18: return "R_390_PLT16DBL"; + case 19: return "R_390_PC32DBL"; + case 20: return "R_390_PLT32DBL"; + case 21: return "R_390_GOTPCDBL"; + case 22: return "R_390_64"; + case 23: return "R_390_PC64"; + case 24: return "R_390_GOT64"; + case 25: return "R_390_PLT64"; + case 26: return "R_390_GOTENT"; + } + break; case EM_SPARC: case EM_SPARCV9: switch(type) { From owner-svn-src-all@freebsd.org Wed Jan 11 23:05:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC90BCABDED; Wed, 11 Jan 2017 23:05:30 +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 8C2981184; Wed, 11 Jan 2017 23:05:30 +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 v0BN5T4d021076; Wed, 11 Jan 2017 23:05:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BN5Tsp021075; Wed, 11 Jan 2017 23:05:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701112305.v0BN5Tsp021075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 11 Jan 2017 23:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311947 - head/usr.bin/rpcgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 23:05:30 -0000 Author: pfg Date: Wed Jan 11 23:05:29 2017 New Revision: 311947 URL: https://svnweb.freebsd.org/changeset/base/311947 Log: rpcgen(1): Avoid unused variable warning on generated code. Avoid "unused variable 'i'" warnings in generated .c files by only emitting the "int i;" for non-opaque arrays. Opaque arrays use xdr_opaque() rather than iterating over the array. Obtained from: OpenBSD (CVS rev 1.28) MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_cout.c Modified: head/usr.bin/rpcgen/rpc_cout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_cout.c Wed Jan 11 22:54:04 2017 (r311946) +++ head/usr.bin/rpcgen/rpc_cout.c Wed Jan 11 23:05:29 2017 (r311947) @@ -551,7 +551,8 @@ emit_struct(definition *def) } for (dl = def->def.st.decls; dl != NULL; dl = dl->next) - if (dl->decl.rel == REL_VECTOR){ + if (dl->decl.rel == REL_VECTOR && + strcmp(dl->decl.type, "opaque") != 0){ f_print(fout, "\tint i;\n"); break; } From owner-svn-src-all@freebsd.org Wed Jan 11 23:32:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AE58CAB586; Wed, 11 Jan 2017 23:32:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7E81FC0; Wed, 11 Jan 2017 23:32:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BNWeNW033026; Wed, 11 Jan 2017 23:32:40 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BNWejq033025; Wed, 11 Jan 2017 23:32:40 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701112332.v0BNWejq033025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 11 Jan 2017 23:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311948 - head/sys/dev/rtwn/rtl8192c X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 23:32:41 -0000 Author: avos Date: Wed Jan 11 23:32:40 2017 New Revision: 311948 URL: https://svnweb.freebsd.org/changeset/base/311948 Log: rtwn: fix R92C_TXDW4_RTSRATE_M definition (0x3f -> 0x1f) Submitted by: kevlo Modified: head/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h Modified: head/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h Wed Jan 11 23:05:29 2017 (r311947) +++ head/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h Wed Jan 11 23:32:40 2017 (r311948) @@ -68,7 +68,7 @@ struct r92c_tx_desc { uint16_t txdseq; uint32_t txdw4; -#define R92C_TXDW4_RTSRATE_M 0x0000003f +#define R92C_TXDW4_RTSRATE_M 0x0000001f #define R92C_TXDW4_RTSRATE_S 0 #define R92C_TXDW4_SEQ_SEL_M 0x00000040 #define R92C_TXDW4_SEQ_SEL_S 6 From owner-svn-src-all@freebsd.org Wed Jan 11 23:48:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 024A0CABB3B; Wed, 11 Jan 2017 23:48:18 +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 B7C6016D1; Wed, 11 Jan 2017 23:48:18 +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 v0BNmHOb037280; Wed, 11 Jan 2017 23:48:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BNmHWu037273; Wed, 11 Jan 2017 23:48:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701112348.v0BNmHWu037273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 11 Jan 2017 23:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311949 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 23:48:19 -0000 Author: np Date: Wed Jan 11 23:48:17 2017 New Revision: 311949 URL: https://svnweb.freebsd.org/changeset/base/311949 Log: cxgbe/tom: Add VIMAGE support to the TOE driver. Active Open: - Save the socket's vnet at the time of the active open (t4_connect) and switch to it when processing the reply (do_act_open_rpl or do_act_establish). Passive Open: - Save the listening socket's vnet in the driver's listen_ctx and switch to it when processing incoming SYNs for the socket. - Reject SYNs that arrive on an ifnet that's not in the same vnet as the listening socket. CLIP (Compressed Local IPv6) table: - Add only those IPv6 addresses to the CLIP that are in a vnet associated with one of the card's ifnets. Misc: - Set vnet from the toepcb when processing TCP state transitions. - The kernel sets the vnet when calling the driver's output routine so t4_push_frames runs in proper vnet context already. One exception is when incoming credits trigger tx within the driver's ithread. Set the vnet explicitly in do_fw4_ack for that case. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Wed Jan 11 23:32:40 2017 (r311948) +++ head/sys/dev/cxgbe/tom/t4_connect.c Wed Jan 11 23:48:17 2017 (r311949) @@ -126,6 +126,7 @@ do_act_establish(struct sge_iq *iq, cons CTR3(KTR_CXGBE, "%s: atid %u, tid %u", __func__, atid, tid); free_atid(sc, atid); + CURVNET_SET(toep->vnet); INP_WLOCK(inp); toep->tid = tid; insert_tid(sc, tid, toep, inp->inp_vflag & INP_IPV6 ? 2 : 1); @@ -141,6 +142,7 @@ do_act_establish(struct sge_iq *iq, cons make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); done: INP_WUNLOCK(inp); + CURVNET_RESTORE(); return (0); } @@ -178,6 +180,7 @@ act_open_failure_cleanup(struct adapter free_atid(sc, atid); toep->tid = -1; + CURVNET_SET(toep->vnet); if (status != EAGAIN) INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); @@ -185,6 +188,7 @@ act_open_failure_cleanup(struct adapter final_cpl_received(toep); /* unlocks inp */ if (status != EAGAIN) INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); } /* @@ -360,6 +364,7 @@ t4_connect(struct toedev *tod, struct so if (wr == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); + toep->vnet = so->so_vnet; if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) set_tcpddp_ulp_mode(toep); else Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jan 11 23:32:40 2017 (r311948) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jan 11 23:48:17 2017 (r311949) @@ -306,7 +306,6 @@ make_established(struct toepcb *toep, ui uint16_t tcpopt = be16toh(opt); struct flowc_tx_params ftxp; - CURVNET_SET(so->so_vnet); INP_WLOCK_ASSERT(inp); KASSERT(tp->t_state == TCPS_SYN_SENT || tp->t_state == TCPS_SYN_RECEIVED, @@ -357,7 +356,6 @@ make_established(struct toepcb *toep, ui send_flowc_wr(toep, &ftxp); soisconnected(so); - CURVNET_RESTORE(); } static int @@ -1146,6 +1144,7 @@ do_peer_close(struct sge_iq *iq, const s KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1191,6 +1190,7 @@ do_peer_close(struct sge_iq *iq, const s tcp_twstart(tp); INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); INP_WLOCK(inp); final_cpl_received(toep); @@ -1203,6 +1203,7 @@ do_peer_close(struct sge_iq *iq, const s done: INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1229,6 +1230,7 @@ do_close_con_rpl(struct sge_iq *iq, cons KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1248,6 +1250,7 @@ do_close_con_rpl(struct sge_iq *iq, cons release: INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); INP_WLOCK(inp); final_cpl_received(toep); /* no more CPLs expected */ @@ -1272,6 +1275,7 @@ release: done: INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1345,6 +1349,7 @@ do_abort_req(struct sge_iq *iq, const st } inp = toep->inp; + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); /* for tcp_close */ INP_WLOCK(inp); @@ -1380,6 +1385,7 @@ do_abort_req(struct sge_iq *iq, const st final_cpl_received(toep); done: INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); send_abort_rpl(sc, ofld_txq, tid, CPL_ABORT_NO_RST); return (0); } @@ -1501,18 +1507,21 @@ do_rx_data(struct sge_iq *iq, const stru DDP_UNLOCK(toep); INP_WUNLOCK(inp); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } /* receive buffer autosize */ - CURVNET_SET(so->so_vnet); + MPASS(toep->vnet == so->so_vnet); + CURVNET_SET(toep->vnet); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && @@ -1713,10 +1722,12 @@ do_fw4_ack(struct sge_iq *iq, const stru tid); #endif toep->flags &= ~TPF_TX_SUSPENDED; + CURVNET_SET(toep->vnet); if (toep->ulp_mode == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, plen); else t4_push_frames(sc, toep, plen); + CURVNET_RESTORE(); } else if (plen > 0) { struct sockbuf *sb = &so->so_snd; int sbu; @@ -2143,7 +2154,7 @@ t4_aiotx_task(void *context, int pending struct socket *so = inp->inp_socket; struct kaiocb *job; - CURVNET_SET(so->so_vnet); + CURVNET_SET(toep->vnet); SOCKBUF_LOCK(&so->so_snd); while (!TAILQ_EMPTY(&toep->aiotx_jobq) && sowriteable(so)) { job = TAILQ_FIRST(&toep->aiotx_jobq); Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Wed Jan 11 23:32:40 2017 (r311948) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Wed Jan 11 23:48:17 2017 (r311949) @@ -546,7 +546,8 @@ handle_ddp_data(struct toepcb *toep, __b #endif /* receive buffer autosize */ - CURVNET_SET(so->so_vnet); + MPASS(toep->vnet == so->so_vnet); + CURVNET_SET(toep->vnet); SOCKBUF_LOCK(sb); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Wed Jan 11 23:32:40 2017 (r311948) +++ head/sys/dev/cxgbe/tom/t4_listen.c Wed Jan 11 23:48:17 2017 (r311949) @@ -222,6 +222,7 @@ alloc_lctx(struct adapter *sc, struct in TAILQ_INIT(&lctx->synq); lctx->inp = inp; + lctx->vnet = inp->inp_socket->so_vnet; in_pcbref(inp); return (lctx); @@ -1200,6 +1201,8 @@ do_pass_accept_req(struct sge_iq *iq, co pi = sc->port[G_SYN_INTF(be16toh(cpl->l2info))]; + CURVNET_SET(lctx->vnet); + /* * Use the MAC index to lookup the associated VI. If this SYN * didn't match a perfect MAC filter, punt. @@ -1274,6 +1277,13 @@ found: ntids = 1; } + /* + * Don't offload if the ifnet that the SYN came in on is not in the same + * vnet as the listening socket. + */ + if (lctx->vnet != ifp->if_vnet) + REJECT_PASS_ACCEPT(); + e = get_l2te_for_nexthop(pi, ifp, &inc); if (e == NULL) REJECT_PASS_ACCEPT(); @@ -1313,7 +1323,6 @@ found: REJECT_PASS_ACCEPT(); } so = inp->inp_socket; - CURVNET_SET(so->so_vnet); mtu_idx = find_best_mtu_idx(sc, &inc, be16toh(cpl->tcpopt.mss)); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; @@ -1360,7 +1369,6 @@ found: */ toe_syncache_add(&inc, &to, &th, inp, tod, synqe); INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */ - CURVNET_RESTORE(); /* * If we replied during syncache_add (synqe->wr has been consumed), @@ -1415,10 +1423,12 @@ found: return (__LINE__); } INP_WUNLOCK(inp); + CURVNET_RESTORE(); release_synqe(synqe); /* extra hold */ return (0); reject: + CURVNET_RESTORE(); CTR4(KTR_CXGBE, "%s: stid %u, tid %u, REJECT (%d)", __func__, stid, tid, reject_reason); @@ -1490,6 +1500,7 @@ do_pass_establish(struct sge_iq *iq, con KASSERT(synqe->flags & TPF_SYNQE, ("%s: tid %u (ctx %p) not a synqe", __func__, tid, synqe)); + CURVNET_SET(lctx->vnet); INP_INFO_RLOCK(&V_tcbinfo); /* for syncache_expand */ INP_WLOCK(inp); @@ -1507,6 +1518,7 @@ do_pass_establish(struct sge_iq *iq, con INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1532,6 +1544,7 @@ reset: send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } toep->tid = tid; @@ -1568,6 +1581,8 @@ reset: /* New connection inpcb is already locked by syncache_expand(). */ new_inp = sotoinpcb(so); INP_WLOCK_ASSERT(new_inp); + MPASS(so->so_vnet == lctx->vnet); + toep->vnet = lctx->vnet; /* * This is for the unlikely case where the syncache entry that we added @@ -1591,6 +1606,7 @@ reset: if (inp != NULL) INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); release_synqe(synqe); return (0); Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Wed Jan 11 23:32:40 2017 (r311948) +++ head/sys/dev/cxgbe/tom/t4_tom.c Wed Jan 11 23:48:17 2017 (r311949) @@ -799,74 +799,96 @@ update_clip_table(struct adapter *sc, st struct in6_addr *lip, tlip; struct clip_head stale; struct clip_entry *ce, *ce_temp; - int rc, gen = atomic_load_acq_int(&in6_ifaddr_gen); + struct vi_info *vi; + int rc, gen, i, j; + uintptr_t last_vnet; ASSERT_SYNCHRONIZED_OP(sc); IN6_IFADDR_RLOCK(&in6_ifa_tracker); mtx_lock(&td->clip_table_lock); + gen = atomic_load_acq_int(&in6_ifaddr_gen); if (gen == td->clip_gen) goto done; TAILQ_INIT(&stale); TAILQ_CONCAT(&stale, &td->clip_table, link); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { - lip = &ia->ia_addr.sin6_addr; + /* + * last_vnet optimizes the common cases where all if_vnet = NULL (no + * VIMAGE) or all if_vnet = vnet0. + */ + last_vnet = (uintptr_t)(-1); + for_each_port(sc, i) + for_each_vi(sc->port[i], j, vi) { + if (last_vnet == (uintptr_t)vi->ifp->if_vnet) + continue; - KASSERT(!IN6_IS_ADDR_MULTICAST(lip), - ("%s: mcast address in in6_ifaddr list", __func__)); + /* XXX: races with if_vmove */ + CURVNET_SET(vi->ifp->if_vnet); + TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { + lip = &ia->ia_addr.sin6_addr; + + KASSERT(!IN6_IS_ADDR_MULTICAST(lip), + ("%s: mcast address in in6_ifaddr list", __func__)); + + if (IN6_IS_ADDR_LOOPBACK(lip)) + continue; + if (IN6_IS_SCOPE_EMBED(lip)) { + /* Remove the embedded scope */ + tlip = *lip; + lip = &tlip; + in6_clearscope(lip); + } + /* + * XXX: how to weed out the link local address for the + * loopback interface? It's fe80::1 usually (always?). + */ + + /* + * If it's in the main list then we already know it's + * not stale. + */ + TAILQ_FOREACH(ce, &td->clip_table, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) + goto next; + } - if (IN6_IS_ADDR_LOOPBACK(lip)) - continue; - if (IN6_IS_SCOPE_EMBED(lip)) { - /* Remove the embedded scope */ - tlip = *lip; - lip = &tlip; - in6_clearscope(lip); - } - /* - * XXX: how to weed out the link local address for the loopback - * interface? It's fe80::1 usually (always?). - */ - - /* - * If it's in the main list then we already know it's not stale. - */ - TAILQ_FOREACH(ce, &td->clip_table, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) - goto next; - } + /* + * If it's in the stale list we should move it to the + * main list. + */ + TAILQ_FOREACH(ce, &stale, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { + TAILQ_REMOVE(&stale, ce, link); + TAILQ_INSERT_TAIL(&td->clip_table, ce, + link); + goto next; + } + } - /* - * If it's in the stale list we should move it to the main list. - */ - TAILQ_FOREACH(ce, &stale, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { - TAILQ_REMOVE(&stale, ce, link); + /* A new IP6 address; add it to the CLIP table */ + ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); + memcpy(&ce->lip, lip, sizeof(ce->lip)); + ce->refcount = 0; + rc = add_lip(sc, lip); + if (rc == 0) TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - goto next; - } - } + else { + char ip[INET6_ADDRSTRLEN]; - /* A new IP6 address; add it to the CLIP table */ - ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); - memcpy(&ce->lip, lip, sizeof(ce->lip)); - ce->refcount = 0; - rc = add_lip(sc, lip); - if (rc == 0) - TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - else { - char ip[INET6_ADDRSTRLEN]; - - inet_ntop(AF_INET6, &ce->lip, &ip[0], sizeof(ip)); - log(LOG_ERR, "%s: could not add %s (%d)\n", - __func__, ip, rc); - free(ce, M_CXGBE); - } + inet_ntop(AF_INET6, &ce->lip, &ip[0], + sizeof(ip)); + log(LOG_ERR, "%s: could not add %s (%d)\n", + __func__, ip, rc); + free(ce, M_CXGBE); + } next: - continue; + continue; + } + CURVNET_RESTORE(); + last_vnet = (uintptr_t)vi->ifp->if_vnet; } /* Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Wed Jan 11 23:32:40 2017 (r311948) +++ head/sys/dev/cxgbe/tom/t4_tom.h Wed Jan 11 23:48:17 2017 (r311949) @@ -141,6 +141,7 @@ struct toepcb { int refcount; struct tom_data *td; struct inpcb *inp; /* backpointer to host stack's PCB */ + struct vnet *vnet; struct vi_info *vi; /* virtual interface */ struct sge_wrq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; @@ -232,6 +233,7 @@ struct listen_ctx { struct stid_region stid_region; int flags; struct inpcb *inp; /* listening socket's inp */ + struct vnet *vnet; struct sge_wrq *ctrlq; struct sge_ofld_rxq *ofld_rxq; struct clip_entry *ce; From owner-svn-src-all@freebsd.org Thu Jan 12 00:01:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0D9CCAB0CF; Thu, 12 Jan 2017 00:01:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70AFB1DA2; Thu, 12 Jan 2017 00:01:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0C012du041490; Thu, 12 Jan 2017 00:01:02 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C012XL041489; Thu, 12 Jan 2017 00:01:02 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201701120001.v0C012XL041489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 12 Jan 2017 00:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311950 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 00:01:03 -0000 Author: bz Date: Thu Jan 12 00:01:02 2017 New Revision: 311950 URL: https://svnweb.freebsd.org/changeset/base/311950 Log: Get rid of a compiler warning which I saw too often. Include netinet/in.h before ip_compat.t which will then check if IPPROTO_IPIP is defined or not. Doing it the other way round, ip_compat.h would not find it defined and netinet/in.h then redefine it. Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Wed Jan 11 23:48:17 2017 (r311949) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jan 12 00:01:02 2017 (r311950) @@ -11,6 +11,10 @@ #ifndef __IP_FIL_H__ #define __IP_FIL_H__ +#if !defined(linux) || !defined(_KERNEL) +# include +#endif + #include "netinet/ip_compat.h" #include "netinet/ipf_rb.h" #if NETBSD_GE_REV(104040000) @@ -24,10 +28,6 @@ # endif #endif -#if !defined(linux) || !defined(_KERNEL) -# include -#endif - #ifndef SOLARIS # if defined(sun) && (defined(__svr4__) || defined(__SVR4)) # define SOLARIS 1 From owner-svn-src-all@freebsd.org Thu Jan 12 00:09:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E0DECAB37E; Thu, 12 Jan 2017 00:09:32 +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 3A6DE12A4; Thu, 12 Jan 2017 00:09:32 +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 v0C09VUp045394; Thu, 12 Jan 2017 00:09:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C09VsD045393; Thu, 12 Jan 2017 00:09:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701120009.v0C09VsD045393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 12 Jan 2017 00:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311951 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 00:09:32 -0000 Author: ian Date: Thu Jan 12 00:09:31 2017 New Revision: 311951 URL: https://svnweb.freebsd.org/changeset/base/311951 Log: Include sys/systm.h for use of bootverbose. Fixes powerpc MPC85XXSPE build. Modified: head/sys/dev/sdhci/sdhci_fdt_gpio.c Modified: head/sys/dev/sdhci/sdhci_fdt_gpio.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt_gpio.c Thu Jan 12 00:01:02 2017 (r311950) +++ head/sys/dev/sdhci/sdhci_fdt_gpio.c Thu Jan 12 00:09:31 2017 (r311951) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@freebsd.org Thu Jan 12 00:22:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 033BBCABB82; Thu, 12 Jan 2017 00:22:38 +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 C6F8E1E2F; Thu, 12 Jan 2017 00:22:37 +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 v0C0Ma7p053077; Thu, 12 Jan 2017 00:22:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C0MaHq053076; Thu, 12 Jan 2017 00:22:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701120022.v0C0MaHq053076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 12 Jan 2017 00:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311952 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 00:22:38 -0000 Author: markj Date: Thu Jan 12 00:22:36 2017 New Revision: 311952 URL: https://svnweb.freebsd.org/changeset/base/311952 Log: Enable the use of ^C and ^S/^Q in DDB. This lets one interrupt DDB's output, which is useful if paging is disabled and the output device is slow. Submitted by: Anton Rang Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9138 Modified: head/sys/ddb/db_input.c Modified: head/sys/ddb/db_input.c ============================================================================== --- head/sys/ddb/db_input.c Thu Jan 12 00:09:31 2017 (r311951) +++ head/sys/ddb/db_input.c Thu Jan 12 00:22:36 2017 (r311952) @@ -63,7 +63,6 @@ static int db_lhist_nlines; #define BLANK ' ' #define BACKUP '\b' -static int cnmaygetc(void); static void db_delete(int n, int bwd); static int db_inputchar(int c); static void db_putnchars(int c, int count); @@ -291,12 +290,6 @@ db_inputchar(c) return (0); } -static int -cnmaygetc() -{ - return (-1); -} - int db_readline(lstart, lsize) char * lstart; @@ -350,7 +343,7 @@ db_check_interrupt(void) { int c; - c = cnmaygetc(); + c = cncheckc(); switch (c) { case -1: /* no character */ return; @@ -361,7 +354,7 @@ db_check_interrupt(void) case CTRL('s'): do { - c = cnmaygetc(); + c = cncheckc(); if (c == CTRL('c')) db_error((char *)0); } while (c != CTRL('q')); From owner-svn-src-all@freebsd.org Thu Jan 12 00:34:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96A14CA90C5; Thu, 12 Jan 2017 00:34:38 +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 664DB162B; Thu, 12 Jan 2017 00:34:38 +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 v0C0YbVX057239; Thu, 12 Jan 2017 00:34:37 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C0Ybt3057238; Thu, 12 Jan 2017 00:34:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701120034.v0C0Ybt3057238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 Jan 2017 00:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311953 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 00:34:38 -0000 Author: cem Date: Thu Jan 12 00:34:37 2017 New Revision: 311953 URL: https://svnweb.freebsd.org/changeset/base/311953 Log: pciconf(8): Reallow trailing colon in selectors Reallow device selectors to have a trailing colon, as documented in the manual page. This was broken along with some unrelated cleanups in r295806. PR: 215979 Reported by: David Boyd Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/pciconf/pciconf.c Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Thu Jan 12 00:22:36 2017 (r311952) +++ head/usr.sbin/pciconf/pciconf.c Thu Jan 12 00:34:37 2017 (r311953) @@ -917,11 +917,8 @@ parsesel(const char *str) while (isdigit(*ep) && i < 4) { selarr[i++] = strtoul(ep, &eppos, 10); ep = eppos; - if (*ep == ':') { + if (*ep == ':') ep++; - if (*ep == '\0') - i = 0; - } } if (i > 0 && *ep == '\0') { sel.pc_func = (i > 2) ? selarr[--i] : 0; From owner-svn-src-all@freebsd.org Thu Jan 12 00:48:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53411CA95FF; Thu, 12 Jan 2017 00:48:08 +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 2D17F1D48; Thu, 12 Jan 2017 00:48:08 +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 v0C0m7pH061350; Thu, 12 Jan 2017 00:48:07 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C0m7I2061346; Thu, 12 Jan 2017 00:48:07 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701120048.v0C0m7I2061346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 12 Jan 2017 00:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311954 - in head: lib/libc/gen share/man/man4 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 00:48:08 -0000 Author: ian Date: Thu Jan 12 00:48:06 2017 New Revision: 311954 URL: https://svnweb.freebsd.org/changeset/base/311954 Log: Rework tty_drain() to poll the hardware for completion, and restore drain timeout handling to historical freebsd behavior. The primary reason for these changes is the need to have tty_drain() call ttydevsw_busy() at some reasonable sub-second rate, to poll hardware that doesn't signal an interrupt when the transmit shift register becomes empty (which includes virtually all USB serial hardware). Such hardware hangs in a ttyout wait, because it never gets an opportunity to trigger a wakeup from the sleep in tty_drain() by calling ttydisc_getc() again, after handing the last of the buffered data to the hardware. While researching the history of changes to tty_drain() I stumbled across some email describing the historical BSD behavior of tcdrain() and close() on serial ports, and the ability of comcontrol(1) to control timeout behavior. Using that and some advice from Bruce Evans as a guide, I've put together these changes to implement the hardware polling and restore the historical timeout behaviors... - tty_drain() now calls ttydevsw_busy() in a loop at 10 Hz to accomodate hardware that requires polling for busy state. - The "new historical" behavior for draining during close(2) is retained: the drain timeout is "1 second without making any progress". When the 1-second timeout expires, if the count of bytes remaining in the tty layer buffer is smaller than last time, the timeout is extended for another second. Unfortunately, the same logic cannot be extended all the way down to the hardware, because the interface to that layer is a simple busy/not-busy indication. - Due to the previous point, an application that needs a guarantee that all data has been transmitted must use TIOCDRAIN/tcdrain(3) before calling close(2). - The historical behavior of honoring the drainwait setting for TIOCDRAIN (used by tcdrain(3)) is restored. - The historical kern.drainwait sysctl to control the global default drainwait time is restored, but is now named kern.tty_drainwait. - The historical default drainwait timeout of 300 seconds is restored. - Handling of TIOCGDRAINWAIT and TIOCSDRAINWAIT ioctls is restored (this also makes the comcontrol(1) drainwait verb work again). - Manpages are updated to document these behaviors. Reviewed by: bde (prior version) Modified: head/lib/libc/gen/tcsendbreak.3 head/share/man/man4/tty.4 head/sys/kern/tty.c head/sys/sys/tty.h Modified: head/lib/libc/gen/tcsendbreak.3 ============================================================================== --- head/lib/libc/gen/tcsendbreak.3 Thu Jan 12 00:34:37 2017 (r311953) +++ head/lib/libc/gen/tcsendbreak.3 Thu Jan 12 00:48:06 2017 (r311954) @@ -28,7 +28,7 @@ .\" @(#)tcsendbreak.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 11, 2017 .Dt TCSENDBREAK 3 .Os .Sh NAME @@ -137,17 +137,44 @@ is not a terminal. A signal interrupted the .Fn tcdrain function. +.It Bq Er EWOULDBLOCK +The configured timeout expired before the +.Fn tcdrain +function could write all buffered output. .El .Sh SEE ALSO .Xr tcsetattr 3 , -.Xr termios 4 +.Xr termios 4 , +.Xr tty 4 , +.Xr comcontrol 8 .Sh STANDARDS The .Fn tcsendbreak , -.Fn tcdrain , .Fn tcflush and .Fn tcflow functions are expected to be compliant with the .St -p1003.1-88 specification. +.Pp +The +.Fn tcdrain +function is expected to be compliant with +.St -p1003.1-88 +when the drain wait value is set to zero with +.Xr comcontrol 8 , +or with +.Xr ioctl 2 +.Va TIOCSDRAINWAIT , +or with +.Xr sysctl 8 +.Va kern.tty_drainwait . +A non-zero drain wait value can result in +.Fn tcdrain +returning +.Va EWOULDBLOCK +without writing all output. +The default value for +.Va kern.tty_drainwait +is 300 seconds. + Modified: head/share/man/man4/tty.4 ============================================================================== --- head/share/man/man4/tty.4 Thu Jan 12 00:34:37 2017 (r311953) +++ head/share/man/man4/tty.4 Thu Jan 12 00:48:06 2017 (r311954) @@ -28,7 +28,7 @@ .\" @(#)tty.4 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 26, 2009 +.Dd January 11, 2017 .Dt TTY 4 .Os .Sh NAME @@ -238,7 +238,16 @@ Start output on the terminal (like typin Make the terminal the controlling terminal for the process (the process must not currently have a controlling terminal). .It Dv TIOCDRAIN Fa void -Wait until all output is drained. +Wait until all output is drained, or until the drain wait timeout expires. +.It Dv TIOCGDRAINWAIT Fa int *timeout +Return the current drain wait timeout in seconds. +.It Dv TIOCSDRAINWAIT Fa int *timeout +Set the drain wait timeout in seconds. +A value of zero disables timeouts. +The default drain wait timeout is controlled by the tunable +.Xr sysctl 8 +OID +.Va kern.tty_drainwait . .It Dv TIOCEXCL Fa void Set exclusive use on the terminal. No further opens are permitted except by root. Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Thu Jan 12 00:34:37 2017 (r311953) +++ head/sys/kern/tty.c Thu Jan 12 00:48:06 2017 (r311954) @@ -95,6 +95,10 @@ static const char *dev_console_filename; #define TTY_CALLOUT(tp,d) (dev2unit(d) & TTYUNIT_CALLOUT) +static int tty_drainwait = 5 * 60; +SYSCTL_INT(_kern, OID_AUTO, tty_drainwait, CTLFLAG_RWTUN, + &tty_drainwait, 0, "Default output drain timeout in seconds"); + /* * Set TTY buffer sizes. */ @@ -125,34 +129,56 @@ tty_watermarks(struct tty *tp) static int tty_drain(struct tty *tp, int leaving) { - size_t bytesused; + sbintime_t timeout_at; + size_t bytes; int error; if (ttyhook_hashook(tp, getc_inject)) /* buffer is inaccessible */ return (0); - while (ttyoutq_bytesused(&tp->t_outq) > 0 || ttydevsw_busy(tp)) { - ttydevsw_outwakeup(tp); - /* Could be handled synchronously. */ - bytesused = ttyoutq_bytesused(&tp->t_outq); - if (bytesused == 0 && !ttydevsw_busy(tp)) - return (0); - - /* Wait for data to be drained. */ - if (leaving) { - error = tty_timedwait(tp, &tp->t_outwait, hz); - if (error == EWOULDBLOCK && - ttyoutq_bytesused(&tp->t_outq) < bytesused) - error = 0; - } else - error = tty_wait(tp, &tp->t_outwait); + /* + * For close(), use the recent historic timeout of "1 second without + * making progress". For tcdrain(), use t_drainwait as the timeout, + * with zero meaning "no timeout" which gives POSIX behavior. + */ + if (leaving) + timeout_at = getsbinuptime() + SBT_1S; + else if (tp->t_drainwait != 0) + timeout_at = getsbinuptime() + SBT_1S * tp->t_drainwait; + else + timeout_at = 0; - if (error) + /* + * Poll the output buffer and the hardware for completion, at 10 Hz. + * Polling is required for devices which are not able to signal an + * interrupt when the transmitter becomes idle (most USB serial devs). + * The unusual structure of this loop ensures we check for busy one more + * time after tty_timedwait() returns EWOULDBLOCK, so that success has + * higher priority than timeout if the IO completed in the last 100mS. + */ + error = 0; + bytes = ttyoutq_bytesused(&tp->t_outq); + for (;;) { + if (ttyoutq_bytesused(&tp->t_outq) == 0 && !ttydevsw_busy(tp)) + return (0); + if (error != 0) return (error); + ttydevsw_outwakeup(tp); + error = tty_timedwait(tp, &tp->t_outwait, hz / 10); + if (timeout_at == 0 && error == EWOULDBLOCK) + error = 0; + if (error != EWOULDBLOCK) + continue; + if (getsbinuptime() < timeout_at) + error = 0; + else if (leaving && ttyoutq_bytesused(&tp->t_outq) < bytes) { + /* In close, making progress, grant an extra second. */ + error = 0; + timeout_at += SBT_1S; + bytes = ttyoutq_bytesused(&tp->t_outq); + } } - - return (0); } /* @@ -1015,6 +1041,7 @@ tty_alloc_mutex(struct ttydevsw *tsw, vo tp->t_devsw = tsw; tp->t_devswsoftc = sc; tp->t_flags = tsw->tsw_flags; + tp->t_drainwait = tty_drainwait; tty_init_termios(tp); @@ -1755,6 +1782,14 @@ tty_generic_ioctl(struct tty *tp, u_long case TIOCDRAIN: /* Drain TTY output. */ return tty_drain(tp, 0); + case TIOCGDRAINWAIT: + *(int *)data = tp->t_drainwait; + return (0); + case TIOCSDRAINWAIT: + error = priv_check(td, PRIV_TTY_DRAINWAIT); + if (error == 0) + tp->t_drainwait = *(int *)data; + return (error); case TIOCCONS: /* Set terminal as console TTY. */ if (*(int *)data) { Modified: head/sys/sys/tty.h ============================================================================== --- head/sys/sys/tty.h Thu Jan 12 00:34:37 2017 (r311953) +++ head/sys/sys/tty.h Thu Jan 12 00:48:06 2017 (r311954) @@ -62,6 +62,7 @@ struct tty { struct mtx *t_mtx; /* TTY lock. */ struct mtx t_mtxobj; /* Per-TTY lock (when not borrowing). */ TAILQ_ENTRY(tty) t_list; /* (l) TTY list entry. */ + int t_drainwait; /* (t) TIOCDRAIN timeout seconds. */ unsigned int t_flags; /* (t) Terminal option flags. */ /* Keep flags in sync with db_show_tty and pstat(8). */ #define TF_NOPREFIX 0x00001 /* Don't prepend "tty" to device name. */ From owner-svn-src-all@freebsd.org Thu Jan 12 00:50:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30AA5CA96A7; Thu, 12 Jan 2017 00:50:39 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F40DF1F06; Thu, 12 Jan 2017 00:50:38 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0C0ocok061502; Thu, 12 Jan 2017 00:50:38 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C0ocU1061501; Thu, 12 Jan 2017 00:50:38 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201701120050.v0C0ocU1061501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Thu, 12 Jan 2017 00:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311955 - stable/11/sys/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 00:50:39 -0000 Author: hiren Date: Thu Jan 12 00:50:37 2017 New Revision: 311955 URL: https://svnweb.freebsd.org/changeset/base/311955 Log: MFC r311453 sysctl net.inet.tcp.hostcache.list in a jail can see connections from other jails and the host. This commit fixes it. PR: 200361 Modified: stable/11/sys/netinet/tcp_hostcache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_hostcache.c ============================================================================== --- stable/11/sys/netinet/tcp_hostcache.c Thu Jan 12 00:48:06 2017 (r311954) +++ stable/11/sys/netinet/tcp_hostcache.c Thu Jan 12 00:50:37 2017 (r311955) @@ -69,10 +69,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include #include #include #include @@ -623,6 +625,9 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) char ip6buf[INET6_ADDRSTRLEN]; #endif + if (jailed_without_vnet(curthread->td_ucred) != 0) + return (EPERM); + sbuf_new(&sb, NULL, linesize * (V_tcp_hostcache.cache_count + 1), SBUF_INCLUDENUL); From owner-svn-src-all@freebsd.org Thu Jan 12 01:05:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76FDBCA9D92; Thu, 12 Jan 2017 01:05:35 +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 4606F1ACD; Thu, 12 Jan 2017 01:05:35 +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 v0C15YRh069402; Thu, 12 Jan 2017 01:05:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C15YZ6069400; Thu, 12 Jan 2017 01:05:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701120105.v0C15YZ6069400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Jan 2017 01:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311956 - in stable/11/sys: compat/freebsd32 kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 01:05:35 -0000 Author: kib Date: Thu Jan 12 01:05:34 2017 New Revision: 311956 URL: https://svnweb.freebsd.org/changeset/base/311956 Log: MFC r311447: Some style fixes for getfstat(2)-related code. Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c stable/11/sys/kern/vfs_syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_misc.c Thu Jan 12 00:50:37 2017 (r311955) +++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Thu Jan 12 01:05:34 2017 (r311956) @@ -244,7 +244,8 @@ copy_statfs(struct statfs *in, struct st #ifdef COMPAT_FREEBSD4 int -freebsd4_freebsd32_getfsstat(struct thread *td, struct freebsd4_freebsd32_getfsstat_args *uap) +freebsd4_freebsd32_getfsstat(struct thread *td, + struct freebsd4_freebsd32_getfsstat_args *uap) { struct statfs *buf, *sp; struct statfs32 stat32; Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Thu Jan 12 00:50:37 2017 (r311955) +++ stable/11/sys/kern/vfs_syscalls.c Thu Jan 12 01:05:34 2017 (r311956) @@ -476,7 +476,7 @@ restart: continue; } } - if (sfsp && count < maxcount) { + if (sfsp != NULL && count < maxcount) { sp = &mp->mnt_stat; /* * Set these in case the underlying filesystem @@ -521,7 +521,7 @@ restart: vfs_unbusy(mp); } mtx_unlock(&mountlist_mtx); - if (sfsp && count > maxcount) + if (sfsp != NULL && count > maxcount) *countp = maxcount; else *countp = count; From owner-svn-src-all@freebsd.org Thu Jan 12 01:09:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC8BDCAA0D1; Thu, 12 Jan 2017 01:09: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 74FB41FB1; Thu, 12 Jan 2017 01:09: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 v0C19GMm069586; Thu, 12 Jan 2017 01:09:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C19FJi069573; Thu, 12 Jan 2017 01:09:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701120109.v0C19FJi069573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Jan 2017 01:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311957 - in stable/11/sys: compat/freebsd32 compat/linux compat/svr4 fs/nfs fs/nfsserver fs/nullfs fs/unionfs i386/ibcs2 kern sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 01:09:18 -0000 Author: kib Date: Thu Jan 12 01:09:15 2017 New Revision: 311957 URL: https://svnweb.freebsd.org/changeset/base/311957 Log: MFC r311452: Do not allocate struct statfs on kernel stack. Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c stable/11/sys/compat/linux/linux_stats.c stable/11/sys/compat/svr4/svr4_misc.c stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/fs/nfsserver/nfs_nfsdserv.c stable/11/sys/fs/nullfs/null_vfsops.c stable/11/sys/fs/unionfs/union_vfsops.c stable/11/sys/i386/ibcs2/ibcs2_stat.c stable/11/sys/kern/kern_acct.c stable/11/sys/kern/vfs_default.c stable/11/sys/kern/vfs_mount.c stable/11/sys/kern/vfs_syscalls.c stable/11/sys/sys/mount.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_misc.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Thu Jan 12 01:09:15 2017 (r311957) @@ -265,7 +265,7 @@ freebsd4_freebsd32_getfsstat(struct thre uap->buf++; copycount--; } - free(buf, M_TEMP); + free(buf, M_STATFS); } if (error == 0) td->td_retval[0] = count; @@ -1394,14 +1394,17 @@ int freebsd4_freebsd32_statfs(struct thread *td, struct freebsd4_freebsd32_statfs_args *uap) { struct statfs32 s32; - struct statfs s; + struct statfs *sp; int error; - error = kern_statfs(td, uap->path, UIO_USERSPACE, &s); - if (error) - return (error); - copy_statfs(&s, &s32); - return (copyout(&s32, uap->buf, sizeof(s32))); + sp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_statfs(td, uap->path, UIO_USERSPACE, sp); + if (error == 0) { + copy_statfs(sp, &s32); + error = copyout(&s32, uap->buf, sizeof(s32)); + } + free(sp, M_STATFS); + return (error); } #endif @@ -1410,14 +1413,17 @@ int freebsd4_freebsd32_fstatfs(struct thread *td, struct freebsd4_freebsd32_fstatfs_args *uap) { struct statfs32 s32; - struct statfs s; + struct statfs *sp; int error; - error = kern_fstatfs(td, uap->fd, &s); - if (error) - return (error); - copy_statfs(&s, &s32); - return (copyout(&s32, uap->buf, sizeof(s32))); + sp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fstatfs(td, uap->fd, sp); + if (error == 0) { + copy_statfs(sp, &s32); + error = copyout(&s32, uap->buf, sizeof(s32)); + } + free(sp, M_STATFS); + return (error); } #endif @@ -1426,17 +1432,20 @@ int freebsd4_freebsd32_fhstatfs(struct thread *td, struct freebsd4_freebsd32_fhstatfs_args *uap) { struct statfs32 s32; - struct statfs s; + struct statfs *sp; fhandle_t fh; int error; if ((error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t))) != 0) return (error); - error = kern_fhstatfs(td, fh, &s); - if (error) - return (error); - copy_statfs(&s, &s32); - return (copyout(&s32, uap->buf, sizeof(s32))); + sp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fhstatfs(td, fh, sp); + if (error == 0) { + copy_statfs(sp, &s32); + error = copyout(&s32, uap->buf, sizeof(s32)); + } + free(sp, M_STATFS); + return (error); } #endif Modified: stable/11/sys/compat/linux/linux_stats.c ============================================================================== --- stable/11/sys/compat/linux/linux_stats.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/compat/linux/linux_stats.c Thu Jan 12 01:09:15 2017 (r311957) @@ -415,7 +415,7 @@ int linux_statfs(struct thread *td, struct linux_statfs_args *args) { struct l_statfs linux_statfs; - struct statfs bsd_statfs; + struct statfs *bsd_statfs; char *path; int error; @@ -425,12 +425,13 @@ linux_statfs(struct thread *td, struct l if (ldebug(statfs)) printf(ARGS(statfs, "%s, *"), path); #endif - error = kern_statfs(td, path, UIO_SYSSPACE, &bsd_statfs); + bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs); LFREEPATH(path); - if (error) - return (error); - error = bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); - if (error) + if (error == 0) + error = bsd_to_linux_statfs(bsd_statfs, &linux_statfs); + free(bsd_statfs, M_STATFS); + if (error != 0) return (error); return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } @@ -456,7 +457,7 @@ int linux_statfs64(struct thread *td, struct linux_statfs64_args *args) { struct l_statfs64 linux_statfs; - struct statfs bsd_statfs; + struct statfs *bsd_statfs; char *path; int error; @@ -469,11 +470,14 @@ linux_statfs64(struct thread *td, struct if (ldebug(statfs64)) printf(ARGS(statfs64, "%s, *"), path); #endif - error = kern_statfs(td, path, UIO_SYSSPACE, &bsd_statfs); + bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs); LFREEPATH(path); - if (error) + if (error == 0) + bsd_to_linux_statfs64(bsd_statfs, &linux_statfs); + free(bsd_statfs, M_STATFS); + if (error != 0) return (error); - bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs); return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } @@ -481,7 +485,7 @@ int linux_fstatfs64(struct thread *td, struct linux_fstatfs64_args *args) { struct l_statfs64 linux_statfs; - struct statfs bsd_statfs; + struct statfs *bsd_statfs; int error; #ifdef DEBUG @@ -491,10 +495,13 @@ linux_fstatfs64(struct thread *td, struc if (args->bufsize != sizeof(struct l_statfs64)) return (EINVAL); - error = kern_fstatfs(td, args->fd, &bsd_statfs); - if (error) - return error; - bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs); + bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fstatfs(td, args->fd, bsd_statfs); + if (error == 0) + bsd_to_linux_statfs64(bsd_statfs, &linux_statfs); + free(bsd_statfs, M_STATFS); + if (error != 0) + return (error); return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -503,18 +510,19 @@ int linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args) { struct l_statfs linux_statfs; - struct statfs bsd_statfs; + struct statfs *bsd_statfs; int error; #ifdef DEBUG if (ldebug(fstatfs)) printf(ARGS(fstatfs, "%d, *"), args->fd); #endif - error = kern_fstatfs(td, args->fd, &bsd_statfs); - if (error) - return (error); - error = bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); - if (error) + bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fstatfs(td, args->fd, bsd_statfs); + if (error == 0) + error = bsd_to_linux_statfs(bsd_statfs, &linux_statfs); + free(bsd_statfs, M_STATFS); + if (error != 0) return (error); return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } Modified: stable/11/sys/compat/svr4/svr4_misc.c ============================================================================== --- stable/11/sys/compat/svr4/svr4_misc.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/compat/svr4/svr4_misc.c Thu Jan 12 01:09:15 2017 (r311957) @@ -1430,17 +1430,20 @@ svr4_sys_statvfs(td, uap) struct svr4_sys_statvfs_args *uap; { struct svr4_statvfs sfs; - struct statfs bfs; + struct statfs *bfs; char *path; int error; CHECKALTEXIST(td, uap->path, &path); - error = kern_statfs(td, path, UIO_SYSSPACE, &bfs); + bfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_statfs(td, path, UIO_SYSSPACE, bfs); free(path, M_TEMP); - if (error) + if (error == 0) + bsd_statfs_to_svr4_statvfs(bfs, &sfs); + free(bfs, M_STATFS); + if (error != 0) return (error); - bsd_statfs_to_svr4_statvfs(&bfs, &sfs); return copyout(&sfs, uap->fs, sizeof(sfs)); } @@ -1451,13 +1454,16 @@ svr4_sys_fstatvfs(td, uap) struct svr4_sys_fstatvfs_args *uap; { struct svr4_statvfs sfs; - struct statfs bfs; + struct statfs *bfs; int error; - error = kern_fstatfs(td, uap->fd, &bfs); - if (error) + bfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fstatfs(td, uap->fd, bfs); + if (error == 0) + bsd_statfs_to_svr4_statvfs(bfs, &sfs); + free(bfs, M_STATFS); + if (error != 0) return (error); - bsd_statfs_to_svr4_statvfs(&bfs, &sfs); return copyout(&sfs, uap->fs, sizeof(sfs)); } @@ -1468,17 +1474,20 @@ svr4_sys_statvfs64(td, uap) struct svr4_sys_statvfs64_args *uap; { struct svr4_statvfs64 sfs; - struct statfs bfs; + struct statfs *bfs; char *path; int error; CHECKALTEXIST(td, uap->path, &path); - error = kern_statfs(td, path, UIO_SYSSPACE, &bfs); + bfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_statfs(td, path, UIO_SYSSPACE, bfs); free(path, M_TEMP); - if (error) + if (error == 0) + bsd_statfs_to_svr4_statvfs64(bfs, &sfs); + free(bfs, M_STATFS); + if (error != 0) return (error); - bsd_statfs_to_svr4_statvfs64(&bfs, &sfs); return copyout(&sfs, uap->fs, sizeof(sfs)); } @@ -1489,13 +1498,16 @@ svr4_sys_fstatvfs64(td, uap) struct svr4_sys_fstatvfs64_args *uap; { struct svr4_statvfs64 sfs; - struct statfs bfs; + struct statfs *bfs; int error; - error = kern_fstatfs(td, uap->fd, &bfs); - if (error) + bfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fstatfs(td, uap->fd, bfs); + if (error == 0) + bsd_statfs_to_svr4_statvfs64(bfs, &sfs); + free(bfs, M_STATFS); + if (error != 0) return (error); - bsd_statfs_to_svr4_statvfs64(&bfs, &sfs); return copyout(&sfs, uap->fs, sizeof(sfs)); } Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Thu Jan 12 01:09:15 2017 (r311957) @@ -2047,7 +2047,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd nfsattrbit_t *retbitp = &retbits; u_int32_t freenum, *retnump; u_int64_t uquad; - struct statfs fs; + struct statfs *fs; struct nfsfsinfo fsinf; struct timespec temptime; NFSACL_T *aclp, *naclp = NULL; @@ -2079,11 +2079,13 @@ nfsv4_fillattr(struct nfsrv_descript *nd /* * Get the VFS_STATFS(), since some attributes need them. */ + fs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); if (NFSISSETSTATFS_ATTRBIT(retbitp)) { - error = VFS_STATFS(mp, &fs); + error = VFS_STATFS(mp, fs); if (error != 0) { if (reterr) { nd->nd_repstat = NFSERR_ACCES; + free(fs, M_STATFS); return (0); } NFSCLRSTATFS_ATTRBIT(retbitp); @@ -2115,6 +2117,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd if (error != 0) { if (reterr) { nd->nd_repstat = NFSERR_ACCES; + free(fs, M_STATFS); return (0); } NFSCLRBIT_ATTRBIT(retbitp, NFSATTRBIT_ACL); @@ -2256,7 +2259,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd /* * Check quota and use min(quota, f_ffree). */ - freenum = fs.f_ffree; + freenum = fs->f_ffree; #ifdef QUOTA /* * ufs_quotactl() insists that the uid argument @@ -2279,13 +2282,13 @@ nfsv4_fillattr(struct nfsrv_descript *nd case NFSATTRBIT_FILESFREE: NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); *tl++ = 0; - *tl = txdr_unsigned(fs.f_ffree); + *tl = txdr_unsigned(fs->f_ffree); retnum += NFSX_HYPER; break; case NFSATTRBIT_FILESTOTAL: NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); *tl++ = 0; - *tl = txdr_unsigned(fs.f_files); + *tl = txdr_unsigned(fs->f_files); retnum += NFSX_HYPER; break; case NFSATTRBIT_FSLOCATIONS: @@ -2361,9 +2364,9 @@ nfsv4_fillattr(struct nfsrv_descript *nd break; case NFSATTRBIT_QUOTAHARD: if (priv_check_cred(cred, PRIV_VFS_EXCEEDQUOTA, 0)) - freenum = fs.f_bfree; + freenum = fs->f_bfree; else - freenum = fs.f_bavail; + freenum = fs->f_bavail; #ifdef QUOTA /* * ufs_quotactl() insists that the uid argument @@ -2379,15 +2382,15 @@ nfsv4_fillattr(struct nfsrv_descript *nd #endif /* QUOTA */ NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); uquad = (u_int64_t)freenum; - NFSQUOTABLKTOBYTE(uquad, fs.f_bsize); + NFSQUOTABLKTOBYTE(uquad, fs->f_bsize); txdr_hyper(uquad, tl); retnum += NFSX_HYPER; break; case NFSATTRBIT_QUOTASOFT: if (priv_check_cred(cred, PRIV_VFS_EXCEEDQUOTA, 0)) - freenum = fs.f_bfree; + freenum = fs->f_bfree; else - freenum = fs.f_bavail; + freenum = fs->f_bavail; #ifdef QUOTA /* * ufs_quotactl() insists that the uid argument @@ -2403,7 +2406,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd #endif /* QUOTA */ NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); uquad = (u_int64_t)freenum; - NFSQUOTABLKTOBYTE(uquad, fs.f_bsize); + NFSQUOTABLKTOBYTE(uquad, fs->f_bsize); txdr_hyper(uquad, tl); retnum += NFSX_HYPER; break; @@ -2424,7 +2427,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd #endif /* QUOTA */ NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); uquad = (u_int64_t)freenum; - NFSQUOTABLKTOBYTE(uquad, fs.f_bsize); + NFSQUOTABLKTOBYTE(uquad, fs->f_bsize); txdr_hyper(uquad, tl); retnum += NFSX_HYPER; break; @@ -2437,24 +2440,24 @@ nfsv4_fillattr(struct nfsrv_descript *nd case NFSATTRBIT_SPACEAVAIL: NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); if (priv_check_cred(cred, PRIV_VFS_BLOCKRESERVE, 0)) - uquad = (u_int64_t)fs.f_bfree; + uquad = (u_int64_t)fs->f_bfree; else - uquad = (u_int64_t)fs.f_bavail; - uquad *= fs.f_bsize; + uquad = (u_int64_t)fs->f_bavail; + uquad *= fs->f_bsize; txdr_hyper(uquad, tl); retnum += NFSX_HYPER; break; case NFSATTRBIT_SPACEFREE: NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); - uquad = (u_int64_t)fs.f_bfree; - uquad *= fs.f_bsize; + uquad = (u_int64_t)fs->f_bfree; + uquad *= fs->f_bsize; txdr_hyper(uquad, tl); retnum += NFSX_HYPER; break; case NFSATTRBIT_SPACETOTAL: NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); - uquad = (u_int64_t)fs.f_blocks; - uquad *= fs.f_bsize; + uquad = (u_int64_t)fs->f_blocks; + uquad *= fs->f_bsize; txdr_hyper(uquad, tl); retnum += NFSX_HYPER; break; @@ -2531,6 +2534,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd } if (naclp != NULL) acl_free(naclp); + free(fs, M_STATFS); *retnump = txdr_unsigned(retnum); return (retnum + prefixnum); } Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Thu Jan 12 01:09:15 2017 (r311957) @@ -2035,14 +2035,14 @@ nfsrvd_statfs(struct nfsrv_descript *nd, u_int32_t *tl; int getret = 1; struct nfsvattr at; - struct statfs sfs; u_quad_t tval; + sf = NULL; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); goto out; } - sf = &sfs; + sf = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); nd->nd_repstat = nfsvno_statfs(vp, sf); getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1); vput(vp); @@ -2078,6 +2078,7 @@ nfsrvd_statfs(struct nfsrv_descript *nd, } out: + free(sf, M_STATFS); NFSEXITCODE2(0, nd); return (0); } @@ -3603,19 +3604,20 @@ nfsrvd_verify(struct nfsrv_descript *nd, { int error = 0, ret, fhsize = NFSX_MYFH; struct nfsvattr nva; - struct statfs sf; + struct statfs *sf; struct nfsfsinfo fs; fhandle_t fh; + sf = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (!nd->nd_repstat) - nd->nd_repstat = nfsvno_statfs(vp, &sf); + nd->nd_repstat = nfsvno_statfs(vp, sf); if (!nd->nd_repstat) nd->nd_repstat = nfsvno_getfh(vp, &fh, p); if (!nd->nd_repstat) { nfsvno_getfs(&fs, isdgram); error = nfsv4_loadattr(nd, vp, &nva, NULL, &fh, fhsize, NULL, - &sf, NULL, &fs, NULL, 1, &ret, NULL, NULL, p, nd->nd_cred); + sf, NULL, &fs, NULL, 1, &ret, NULL, NULL, p, nd->nd_cred); if (!error) { if (nd->nd_procnum == NFSV4OP_NVERIFY) { if (ret == 0) @@ -3627,6 +3629,7 @@ nfsrvd_verify(struct nfsrv_descript *nd, } } vput(vp); + free(sf, M_STATFS); NFSEXITCODE2(error, nd); return (error); } Modified: stable/11/sys/fs/nullfs/null_vfsops.c ============================================================================== --- stable/11/sys/fs/nullfs/null_vfsops.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/fs/nullfs/null_vfsops.c Thu Jan 12 01:09:15 2017 (r311957) @@ -301,29 +301,33 @@ nullfs_statfs(mp, sbp) struct statfs *sbp; { int error; - struct statfs mstat; + struct statfs *mstat; NULLFSDEBUG("nullfs_statfs(mp = %p, vp = %p->%p)\n", (void *)mp, (void *)MOUNTTONULLMOUNT(mp)->nullm_rootvp, (void *)NULLVPTOLOWERVP(MOUNTTONULLMOUNT(mp)->nullm_rootvp)); - bzero(&mstat, sizeof(mstat)); + mstat = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK | M_ZERO); - error = VFS_STATFS(MOUNTTONULLMOUNT(mp)->nullm_vfs, &mstat); - if (error) + error = VFS_STATFS(MOUNTTONULLMOUNT(mp)->nullm_vfs, mstat); + if (error) { + free(mstat, M_STATFS); return (error); + } /* now copy across the "interesting" information and fake the rest */ - sbp->f_type = mstat.f_type; + sbp->f_type = mstat->f_type; sbp->f_flags = (sbp->f_flags & (MNT_RDONLY | MNT_NOEXEC | MNT_NOSUID | - MNT_UNION | MNT_NOSYMFOLLOW)) | (mstat.f_flags & ~MNT_ROOTFS); - sbp->f_bsize = mstat.f_bsize; - sbp->f_iosize = mstat.f_iosize; - sbp->f_blocks = mstat.f_blocks; - sbp->f_bfree = mstat.f_bfree; - sbp->f_bavail = mstat.f_bavail; - sbp->f_files = mstat.f_files; - sbp->f_ffree = mstat.f_ffree; + MNT_UNION | MNT_NOSYMFOLLOW)) | (mstat->f_flags & ~MNT_ROOTFS); + sbp->f_bsize = mstat->f_bsize; + sbp->f_iosize = mstat->f_iosize; + sbp->f_blocks = mstat->f_blocks; + sbp->f_bfree = mstat->f_bfree; + sbp->f_bavail = mstat->f_bavail; + sbp->f_files = mstat->f_files; + sbp->f_ffree = mstat->f_ffree; + + free(mstat, M_STATFS); return (0); } Modified: stable/11/sys/fs/unionfs/union_vfsops.c ============================================================================== --- stable/11/sys/fs/unionfs/union_vfsops.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/fs/unionfs/union_vfsops.c Thu Jan 12 01:09:15 2017 (r311957) @@ -390,7 +390,7 @@ unionfs_statfs(struct mount *mp, struct { struct unionfs_mount *ump; int error; - struct statfs mstat; + struct statfs *mstat; uint64_t lbsize; ump = MOUNTTOUNIONFSMOUNT(mp); @@ -398,39 +398,47 @@ unionfs_statfs(struct mount *mp, struct UNIONFSDEBUG("unionfs_statfs(mp = %p, lvp = %p, uvp = %p)\n", (void *)mp, (void *)ump->um_lowervp, (void *)ump->um_uppervp); - bzero(&mstat, sizeof(mstat)); + mstat = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK | M_ZERO); - error = VFS_STATFS(ump->um_lowervp->v_mount, &mstat); - if (error) + error = VFS_STATFS(ump->um_lowervp->v_mount, mstat); + if (error) { + free(mstat, M_STATFS); return (error); + } /* now copy across the "interesting" information and fake the rest */ - sbp->f_blocks = mstat.f_blocks; - sbp->f_files = mstat.f_files; + sbp->f_blocks = mstat->f_blocks; + sbp->f_files = mstat->f_files; - lbsize = mstat.f_bsize; + lbsize = mstat->f_bsize; - error = VFS_STATFS(ump->um_uppervp->v_mount, &mstat); - if (error) + error = VFS_STATFS(ump->um_uppervp->v_mount, mstat); + if (error) { + free(mstat, M_STATFS); return (error); + } + /* * The FS type etc is copy from upper vfs. * (write able vfs have priority) */ - sbp->f_type = mstat.f_type; - sbp->f_flags = mstat.f_flags; - sbp->f_bsize = mstat.f_bsize; - sbp->f_iosize = mstat.f_iosize; - - if (mstat.f_bsize != lbsize) - sbp->f_blocks = ((off_t)sbp->f_blocks * lbsize) / mstat.f_bsize; - - sbp->f_blocks += mstat.f_blocks; - sbp->f_bfree = mstat.f_bfree; - sbp->f_bavail = mstat.f_bavail; - sbp->f_files += mstat.f_files; - sbp->f_ffree = mstat.f_ffree; + sbp->f_type = mstat->f_type; + sbp->f_flags = mstat->f_flags; + sbp->f_bsize = mstat->f_bsize; + sbp->f_iosize = mstat->f_iosize; + + if (mstat->f_bsize != lbsize) + sbp->f_blocks = ((off_t)sbp->f_blocks * lbsize) / + mstat->f_bsize; + + sbp->f_blocks += mstat->f_blocks; + sbp->f_bfree = mstat->f_bfree; + sbp->f_bavail = mstat->f_bavail; + sbp->f_files += mstat->f_files; + sbp->f_ffree = mstat->f_ffree; + + free(mstat, M_STATFS); return (0); } Modified: stable/11/sys/i386/ibcs2/ibcs2_stat.c ============================================================================== --- stable/11/sys/i386/ibcs2/ibcs2_stat.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/i386/ibcs2/ibcs2_stat.c Thu Jan 12 01:09:15 2017 (r311957) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -108,16 +109,18 @@ ibcs2_statfs(td, uap) struct thread *td; struct ibcs2_statfs_args *uap; { - struct statfs sf; + struct statfs *sf; char *path; int error; CHECKALTEXIST(td, uap->path, &path); - error = kern_statfs(td, path, UIO_SYSSPACE, &sf); + sf = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_statfs(td, path, UIO_SYSSPACE, sf); free(path, M_TEMP); - if (error) - return (error); - return cvt_statfs(&sf, (caddr_t)uap->buf, uap->len); + if (error == 0) + error = cvt_statfs(sf, (caddr_t)uap->buf, uap->len); + free(sf, M_STATFS); + return (error); } int @@ -125,13 +128,15 @@ ibcs2_fstatfs(td, uap) struct thread *td; struct ibcs2_fstatfs_args *uap; { - struct statfs sf; + struct statfs *sf; int error; - error = kern_fstatfs(td, uap->fd, &sf); - if (error) - return (error); - return cvt_statfs(&sf, (caddr_t)uap->buf, uap->len); + sf = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fstatfs(td, uap->fd, sf); + if (error == 0) + error = cvt_statfs(sf, (caddr_t)uap->buf, uap->len); + free(sf, M_STATFS); + return (error); } int Modified: stable/11/sys/kern/kern_acct.c ============================================================================== --- stable/11/sys/kern/kern_acct.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/kern/kern_acct.c Thu Jan 12 01:09:15 2017 (r311957) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -552,7 +553,7 @@ encode_long(long val) static void acctwatch(void) { - struct statfs sb; + struct statfs *sp; sx_assert(&acct_sx, SX_XLOCKED); @@ -580,21 +581,25 @@ acctwatch(void) * Stopping here is better than continuing, maybe it will be VBAD * next time around. */ - if (VFS_STATFS(acct_vp->v_mount, &sb) < 0) + sp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + if (VFS_STATFS(acct_vp->v_mount, sp) < 0) { + free(sp, M_STATFS); return; + } if (acct_suspended) { - if (sb.f_bavail > (int64_t)(acctresume * sb.f_blocks / + if (sp->f_bavail > (int64_t)(acctresume * sp->f_blocks / 100)) { acct_suspended = 0; log(LOG_NOTICE, "Accounting resumed\n"); } } else { - if (sb.f_bavail <= (int64_t)(acctsuspend * sb.f_blocks / + if (sp->f_bavail <= (int64_t)(acctsuspend * sp->f_blocks / 100)) { acct_suspended = 1; log(LOG_NOTICE, "Accounting suspended\n"); } } + free(sp, M_STATFS); } /* Modified: stable/11/sys/kern/vfs_default.c ============================================================================== --- stable/11/sys/kern/vfs_default.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/kern/vfs_default.c Thu Jan 12 01:09:15 2017 (r311957) @@ -931,7 +931,8 @@ int vop_stdallocate(struct vop_allocate_args *ap) { #ifdef __notyet__ - struct statfs sfs; + struct statfs *sfs; + off_t maxfilesize = 0; #endif struct iovec aiov; struct vattr vattr, *vap; @@ -967,12 +968,16 @@ vop_stdallocate(struct vop_allocate_args * Check if the filesystem sets f_maxfilesize; if not use * VOP_SETATTR to perform the check. */ - error = VFS_STATFS(vp->v_mount, &sfs, td); + sfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = VFS_STATFS(vp->v_mount, sfs, td); + if (error == 0) + maxfilesize = sfs->f_maxfilesize; + free(sfs, M_STATFS); if (error != 0) goto out; - if (sfs.f_maxfilesize) { - if (offset > sfs.f_maxfilesize || len > sfs.f_maxfilesize || - offset + len > sfs.f_maxfilesize) { + if (maxfilesize) { + if (offset > maxfilesize || len > maxfilesize || + offset + len > maxfilesize) { error = EFBIG; goto out; } Modified: stable/11/sys/kern/vfs_mount.c ============================================================================== --- stable/11/sys/kern/vfs_mount.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/kern/vfs_mount.c Thu Jan 12 01:09:15 2017 (r311957) @@ -79,6 +79,7 @@ SYSCTL_INT(_vfs, OID_AUTO, usermount, CT "Unprivileged users may mount and unmount file systems"); MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure"); +MALLOC_DEFINE(M_STATFS, "statfs", "statfs structure"); static uma_zone_t mount_zone; /* List of mounted filesystems. */ Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/kern/vfs_syscalls.c Thu Jan 12 01:09:15 2017 (r311957) @@ -298,12 +298,14 @@ sys_statfs(td, uap) struct statfs *buf; } */ *uap; { - struct statfs sf; + struct statfs *sfp; int error; - error = kern_statfs(td, uap->path, UIO_USERSPACE, &sf); + sfp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_statfs(td, uap->path, UIO_USERSPACE, sfp); if (error == 0) - error = copyout(&sf, uap->buf, sizeof(sf)); + error = copyout(sfp, uap->buf, sizeof(struct statfs)); + free(sfp, M_STATFS); return (error); } @@ -344,12 +346,14 @@ sys_fstatfs(td, uap) struct statfs *buf; } */ *uap; { - struct statfs sf; + struct statfs *sfp; int error; - error = kern_fstatfs(td, uap->fd, &sf); + sfp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fstatfs(td, uap->fd, sfp); if (error == 0) - error = copyout(&sf, uap->buf, sizeof(sf)); + error = copyout(sfp, uap->buf, sizeof(struct statfs)); + free(sfp, M_STATFS); return (error); } @@ -420,7 +424,7 @@ kern_getfsstat(struct thread *td, struct size_t *countp, enum uio_seg bufseg, int flags) { struct mount *mp, *nmp; - struct statfs *sfsp, *sp, sb, *tofree; + struct statfs *sfsp, *sp, *sptmp, *tofree; size_t count, maxcount; int error; @@ -442,7 +446,7 @@ restart: if (maxcount > count) maxcount = count; tofree = sfsp = *buf = malloc(maxcount * sizeof(struct statfs), - M_TEMP, M_WAITOK); + M_STATFS, M_WAITOK); } count = 0; mtx_lock(&mountlist_mtx); @@ -467,7 +471,7 @@ restart: * no other choice than to start over. */ mtx_unlock(&mountlist_mtx); - free(tofree, M_TEMP); + free(tofree, M_STATFS); goto restart; } } else { @@ -499,15 +503,20 @@ restart: } } if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, &sb, sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, &sb); - sp = &sb; - } - if (bufseg == UIO_SYSSPACE) + sptmp = malloc(sizeof(struct statfs), M_STATFS, + M_WAITOK); + *sptmp = *sp; + sptmp->f_fsid.val[0] = sptmp->f_fsid.val[1] = 0; + prison_enforce_statfs(td->td_ucred, mp, sptmp); + sp = sptmp; + } else + sptmp = NULL; + if (bufseg == UIO_SYSSPACE) { bcopy(sp, sfsp, sizeof(*sp)); - else /* if (bufseg == UIO_USERSPACE) */ { + free(sptmp, M_STATFS); + } else /* if (bufseg == UIO_USERSPACE) */ { error = copyout(sp, sfsp, sizeof(*sp)); + free(sptmp, M_STATFS); if (error != 0) { vfs_unbusy(mp); return (error); @@ -549,14 +558,17 @@ freebsd4_statfs(td, uap) } */ *uap; { struct ostatfs osb; - struct statfs sf; + struct statfs *sfp; int error; - error = kern_statfs(td, uap->path, UIO_USERSPACE, &sf); - if (error != 0) - return (error); - cvtstatfs(&sf, &osb); - return (copyout(&osb, uap->buf, sizeof(osb))); + sfp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_statfs(td, uap->path, UIO_USERSPACE, sfp); + if (error == 0) { + cvtstatfs(sfp, &osb); + error = copyout(&osb, uap->buf, sizeof(osb)); + } + free(sfp, M_STATFS); + return (error); } /* @@ -577,14 +589,17 @@ freebsd4_fstatfs(td, uap) } */ *uap; { struct ostatfs osb; - struct statfs sf; + struct statfs *sfp; int error; - error = kern_fstatfs(td, uap->fd, &sf); - if (error != 0) - return (error); - cvtstatfs(&sf, &osb); - return (copyout(&osb, uap->buf, sizeof(osb))); + sfp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fstatfs(td, uap->fd, sfp); + if (error == 0) { + cvtstatfs(sfp, &osb); + error = copyout(&osb, uap->buf, sizeof(osb)); + } + free(sfp, M_STATFS); + return (error); } /* @@ -629,7 +644,7 @@ freebsd4_getfsstat(td, uap) uap->buf++; count--; } - free(buf, M_TEMP); + free(buf, M_STATFS); } return (error); } @@ -652,18 +667,21 @@ freebsd4_fhstatfs(td, uap) } */ *uap; { struct ostatfs osb; - struct statfs sf; + struct statfs *sfp; fhandle_t fh; int error; error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); if (error != 0) return (error); - error = kern_fhstatfs(td, fh, &sf); - if (error != 0) - return (error); - cvtstatfs(&sf, &osb); - return (copyout(&osb, uap->buf, sizeof(osb))); + sfp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fhstatfs(td, fh, sfp); + if (error == 0) { + cvtstatfs(sfp, &osb); + error = copyout(&osb, uap->buf, sizeof(osb)); + } + free(sfp, M_STATFS); + return (error); } /* @@ -4398,17 +4416,19 @@ sys_fhstatfs(td, uap) struct statfs *buf; } */ *uap; { - struct statfs sf; + struct statfs *sfp; fhandle_t fh; int error; error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); if (error != 0) return (error); - error = kern_fhstatfs(td, fh, &sf); - if (error != 0) - return (error); - return (copyout(&sf, uap->buf, sizeof(sf))); + sfp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); + error = kern_fhstatfs(td, fh, sfp); + if (error == 0) + error = copyout(sfp, uap->buf, sizeof(*sfp)); + free(sfp, M_STATFS); + return (error); } int Modified: stable/11/sys/sys/mount.h ============================================================================== --- stable/11/sys/sys/mount.h Thu Jan 12 01:05:34 2017 (r311956) +++ stable/11/sys/sys/mount.h Thu Jan 12 01:09:15 2017 (r311957) @@ -593,6 +593,7 @@ struct uio; #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_MOUNT); +MALLOC_DECLARE(M_STATFS); #endif extern int maxvfsconf; /* highest defined filesystem type */ From owner-svn-src-all@freebsd.org Thu Jan 12 01:13:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC17CCAA30E; Thu, 12 Jan 2017 01:13:06 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BAD6144B; Thu, 12 Jan 2017 01:13:06 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0C1D5ks073486; Thu, 12 Jan 2017 01:13:05 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C1D5gP073484; Thu, 12 Jan 2017 01:13:05 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201701120113.v0C1D5gP073484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Thu, 12 Jan 2017 01:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311958 - in head/sys/dev: mpr mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 01:13:06 -0000 Author: scottl Date: Thu Jan 12 01:13:05 2017 New Revision: 311958 URL: https://svnweb.freebsd.org/changeset/base/311958 Log: Print out the number of queues/MSIx vectors. Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr_table.c head/sys/dev/mps/mps_table.c Modified: head/sys/dev/mpr/mpr_table.c ============================================================================== --- head/sys/dev/mpr/mpr_table.c Thu Jan 12 01:09:15 2017 (r311957) +++ head/sys/dev/mpr/mpr_table.c Thu Jan 12 01:13:05 2017 (r311958) @@ -209,6 +209,7 @@ mpr_print_iocfacts(struct mpr_softc *sc, mpr_dprint_field(sc, MPR_XINFO, "WhoInit: %s\n", mpr_describe_table(mpr_whoinit_names, facts->WhoInit)); MPR_PRINTFIELD(sc, facts, NumberOfPorts, %d); + MPR_PRINTFIELD(sc, facts, MaxMSIxVectors, %d); MPR_PRINTFIELD(sc, facts, RequestCredit, %d); MPR_PRINTFIELD(sc, facts, ProductID, 0x%x); mpr_dprint_field(sc, MPR_XINFO, "IOCCapabilities: %b\n", Modified: head/sys/dev/mps/mps_table.c ============================================================================== --- head/sys/dev/mps/mps_table.c Thu Jan 12 01:09:15 2017 (r311957) +++ head/sys/dev/mps/mps_table.c Thu Jan 12 01:13:05 2017 (r311958) @@ -208,6 +208,7 @@ mps_print_iocfacts(struct mps_softc *sc, mps_dprint_field(sc, MPS_XINFO, "WhoInit: %s\n", mps_describe_table(mps_whoinit_names, facts->WhoInit)); MPS_PRINTFIELD(sc, facts, NumberOfPorts, %d); + MPS_PRINTFIELD(sc, facts, MaxMSIxVectors, %d); MPS_PRINTFIELD(sc, facts, RequestCredit, %d); MPS_PRINTFIELD(sc, facts, ProductID, 0x%x); mps_dprint_field(sc, MPS_XINFO, "IOCCapabilities: %b\n", From owner-svn-src-all@freebsd.org Thu Jan 12 01:18:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F19F2CAA3D3; Thu, 12 Jan 2017 01:18:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (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 C726916A2; Thu, 12 Jan 2017 01:18:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 965FF10B5CF; Wed, 11 Jan 2017 20:18:46 -0500 (EST) From: John Baldwin To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311950 - head/sys/contrib/ipfilter/netinet Date: Wed, 11 Jan 2017 17:13:48 -0800 Message-ID: <2784897.3xYUuiBYOU@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201701120001.v0C012XL041489@repo.freebsd.org> References: <201701120001.v0C012XL041489@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 11 Jan 2017 20:18:46 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 01:18:48 -0000 On Thursday, January 12, 2017 12:01:02 AM Bjoern A. Zeeb wrote: > Author: bz > Date: Thu Jan 12 00:01:02 2017 > New Revision: 311950 > URL: https://svnweb.freebsd.org/changeset/base/311950 > > Log: > Get rid of a compiler warning which I saw too often. > Include netinet/in.h before ip_compat.t which will then check if > IPPROTO_IPIP is defined or not. Doing it the other way round, > ip_compat.h would not find it defined and netinet/in.h then > redefine it. Thank you! -- John Baldwin From owner-svn-src-all@freebsd.org Thu Jan 12 01:20:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9643DCAA480; Thu, 12 Jan 2017 01:20:52 +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 6437818EF; Thu, 12 Jan 2017 01:20:52 +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 v0C1KpuH074517; Thu, 12 Jan 2017 01:20:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C1Kpg7074515; Thu, 12 Jan 2017 01:20:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701120120.v0C1Kpg7074515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Jan 2017 01:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311959 - in stable/10/sys: compat/freebsd32 kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 01:20:52 -0000 Author: kib Date: Thu Jan 12 01:20:51 2017 New Revision: 311959 URL: https://svnweb.freebsd.org/changeset/base/311959 Log: MFC r311447: Some style fixes for getfstat(2)-related code. Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_misc.c Thu Jan 12 01:13:05 2017 (r311958) +++ stable/10/sys/compat/freebsd32/freebsd32_misc.c Thu Jan 12 01:20:51 2017 (r311959) @@ -244,7 +244,8 @@ copy_statfs(struct statfs *in, struct st #ifdef COMPAT_FREEBSD4 int -freebsd4_freebsd32_getfsstat(struct thread *td, struct freebsd4_freebsd32_getfsstat_args *uap) +freebsd4_freebsd32_getfsstat(struct thread *td, + struct freebsd4_freebsd32_getfsstat_args *uap) { struct statfs *buf, *sp; struct statfs32 stat32; Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Thu Jan 12 01:13:05 2017 (r311958) +++ stable/10/sys/kern/vfs_syscalls.c Thu Jan 12 01:20:51 2017 (r311959) @@ -464,7 +464,7 @@ kern_getfsstat(struct thread *td, struct nmp = TAILQ_NEXT(mp, mnt_list); continue; } - if (sfsp && count < maxcount) { + if (sfsp != NULL && count < maxcount) { sp = &mp->mnt_stat; /* * Set these in case the underlying filesystem @@ -509,7 +509,7 @@ kern_getfsstat(struct thread *td, struct vfs_unbusy(mp); } mtx_unlock(&mountlist_mtx); - if (sfsp && count > maxcount) + if (sfsp != NULL && count > maxcount) td->td_retval[0] = maxcount; else td->td_retval[0] = count; From owner-svn-src-all@freebsd.org Thu Jan 12 03:34:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55AB0CAB2BB; Thu, 12 Jan 2017 03:34:30 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 178D61FCD; Thu, 12 Jan 2017 03:34:30 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0C3YT29030810; Thu, 12 Jan 2017 03:34:29 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C3YT4X030809; Thu, 12 Jan 2017 03:34:29 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201701120334.v0C3YT4X030809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 12 Jan 2017 03:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311960 - stable/11/sys/dev/hwpmc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 03:34:30 -0000 Author: gnn Date: Thu Jan 12 03:34:29 2017 New Revision: 311960 URL: https://svnweb.freebsd.org/changeset/base/311960 Log: MFC 311224 Fix PMC architecture check to handle later IPAs including Skylake Tested with tools/test/hwpmc/pmctest.py Obtained from: Oliver Pinter Modified: stable/11/sys/dev/hwpmc/hwpmc_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_core.c Thu Jan 12 01:20:51 2017 (r311959) +++ stable/11/sys/dev/hwpmc/hwpmc_core.c Thu Jan 12 03:34:29 2017 (r311960) @@ -2857,7 +2857,7 @@ pmc_core_initialize(struct pmc_mdep *md, PMCDBG3(MDP,INI,1,"core-init cputype=%d ncpu=%d ipa-version=%d", core_cputype, maxcpu, ipa_version); - if (ipa_version < 1 || ipa_version > 3 || + if (ipa_version < 1 || ipa_version > 4 || (core_cputype != PMC_CPU_INTEL_CORE && ipa_version == 1)) { /* Unknown PMC architecture. */ printf("hwpc_core: unknown PMC architecture: %d\n", From owner-svn-src-all@freebsd.org Thu Jan 12 05:32:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B3E2CAC572; Thu, 12 Jan 2017 05:32:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) (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 214A91C10; Thu, 12 Jan 2017 05:32:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f53.google.com with SMTP id r126so6417153wmr.0; Wed, 11 Jan 2017 21:32:19 -0800 (PST) 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=nA+6zgtr45/CefNQ0au2JWyhyAEbQds5+M7Z0P5qMQc=; b=UW5MJlalslcgT3/0aAd03PMLtqYovWDDgWLdzh+WOCPi8YDJyGXhdMlRanedbyY6LZ +1K48/5McupnemHB8vZHuoY9Z7aSfRdpd5nGEl2wbJym0P2KBMX8UA0fV16KsYs1Iwao Jr8iN0qXCdMquJoSGRZooEO/ZWThw4dgaZT5joaJcwLHmIEq4rkRrWQ8xyz8Rg++VU38 uL+pFKUpbuY5vrgewJ5LuXzfDIjeIoHoMCVmk+2s5iXR3XlpZnH7uWfACWFlw1grACQw yaXkd5Wxqa7cB6CPuIiyynVOkBS15OLEG21ILrISsWPdw0Yh8Ep5oENOvOaN9IonGnQ9 /V4w== X-Gm-Message-State: AIkVDXKTcD8GsAs8sVANlfBeMR2zuVaLFeMyx8sY3grUYFJzh+6LLmVCQWKJmNPiT3huUA== X-Received: by 10.223.139.19 with SMTP id n19mr6337836wra.5.1484189456037; Wed, 11 Jan 2017 18:50:56 -0800 (PST) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com. [74.125.82.46]) by smtp.gmail.com with ESMTPSA id 14sm828280wmk.1.2017.01.11.18.50.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 18:50:55 -0800 (PST) Received: by mail-wm0-f46.google.com with SMTP id c206so4348991wme.0; Wed, 11 Jan 2017 18:50:55 -0800 (PST) X-Received: by 10.28.182.6 with SMTP id g6mr6183033wmf.11.1484189455701; Wed, 11 Jan 2017 18:50:55 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.29.72 with HTTP; Wed, 11 Jan 2017 18:50:55 -0800 (PST) In-Reply-To: References: <201611242254.uAOMswkb081748@repo.freebsd.org> From: Conrad Meyer Date: Wed, 11 Jan 2017 18:50:55 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... To: svn-src-head@freebsd.org Cc: Dimitry Andric , svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 05:32:20 -0000 More context and fix here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214654 Best, Conrad On Wed, Jan 11, 2017 at 6:35 PM, Conrad Meyer wrote: > This appears to have broken Chromium[0]: > > FAILED: obj/services/ui/ws/lib/window_manager_display_root.o > clang++39 -MMD -MF > obj/services/ui/ws/lib/window_manager_display_root.o.d > -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -DV8_DEPRECATION_WARNINGS > -DENABLE_MDNS=1 -DENABLE_NOTIFICATIONS -DENABLE_PEPPER_CDMS > -DENABLE_PLUGINS=1 -DENABLE_PDF=1 -DENABLE_PRINTING=1 > -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 > -DENABLE_SPELLCHECK=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 > -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_CLIPBOARD_AURAX11=1 > -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 > -DUSE_X11=1 -DNO_TCMALLOC -DENABLE_WEBRTC=1 -DDISABLE_NACL > -DENABLE_EXTENSIONS=1 -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 > -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 > -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 > -DUSE_PROPRIETARY_CODECS -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD > -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 > -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=278861-1 > -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE > -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 > -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 > -DGL_GLEXT_PROTOTYPES -DUSE_GLX -DUSE_EGL -DSK_IGNORE_DW_GRAY_FIX > -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_SUPPORT_GPU=1 > -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_NOEXCEPT= > -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE > -I../.. -Igen -I/usr/local/include/glib-2.0 > -I/usr/local/lib/glib-2.0/include -I/usr/local/include > -Igen/shim_headers/harfbuzz_shim -I../../third_party/khronos > -I../../gpu -I../../skia/config -I../../skia/ext > -I../../third_party/skia/include/c > -I../../third_party/skia/include/config > -I../../third_party/skia/include/core > -I../../third_party/skia/include/effects > -I../../third_party/skia/include/images > -I../../third_party/skia/include/lazy > -I../../third_party/skia/include/pathops > -I../../third_party/skia/include/pdf > -I../../third_party/skia/include/pipe > -I../../third_party/skia/include/ports > -I../../third_party/skia/include/utils > -I../../third_party/skia/include/gpu -I../../third_party/skia/src/gpu > -I../../third_party/icu/source/common > -I../../third_party/icu/source/i18n > -I../../third_party/mesa/src/include -fno-strict-aliasing > --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC > -pipe -fcolor-diagnostics > -fdebug-prefix-map=/wrkdirs/usr/ports/www/chromium/work/chromium-54.0.2840.100=. > -pthread -m64 -march=x86-64 -Wall -Wextra > -Wno-missing-field-initializers -Wno-unused-parameter > -Wno-c++11-narrowing -Wno-covered-switch-default > -Wno-deprecated-register -Wno-unneeded-internal-declaration > -Wno-inconsistent-missing-override -Wno-shift-negative-value > -Wno-undefined-var-template -Wno-nonportable-include-path -O2 > -fno-ident -fdata-sections -ffunction-sections -g0 -fvisibility=hidden > -Wheader-hygiene -Wstring-conversion -fno-threadsafe-statics > -fvisibility-inlines-hidden -std=gnu++11 -fno-rtti -fno-exceptions -c > ../../services/ui/ws/window_manager_display_root.cc -o > obj/services/ui/ws/lib/window_manager_display_root.o > In file included from ../../services/ui/ws/window_manager_display_root.cc:5: > In file included from ../../services/ui/ws/window_manager_display_root.h:10: > In file included from /usr/include/c++/v1/memory:599: > /usr/include/c++/v1/__config:58:2: error: > "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. use > _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead > #error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \ > ^ > 1 error generated. > > > contrib/libc++/include/__config: > 309124 dim #ifdef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR > 309124 dim #error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer > supported. \ > 309124 dim use > _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead > 309124 dim #endif > > Best, > Conrad > > > [0]: http://beefy12.nyi.freebsd.org/data/head-amd64-default/p431044_s311844/logs/errors/chromium-54.0.2840.100_1.log > (warning: BIG) > > On Thu, Nov 24, 2016 at 2:54 PM, Dimitry Andric wrote: >> Author: dim >> Date: Thu Nov 24 22:54:55 2016 >> New Revision: 309124 >> URL: https://svnweb.freebsd.org/changeset/base/309124 >> >> Log: >> Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 >> release, and add lld 3.9.0. Also completely revamp the build system for >> clang, llvm, lldb and their related tools. >> >> Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 >> support to build; see UPDATING for more information. >> >> Release notes for llvm, clang and lld are available here: >> >> >> >> >> Thanks to Ed Maste, Bryan Drewery, Andrew Turner, Antoine Brodin and Jan >> Beich for their help. From owner-svn-src-all@freebsd.org Thu Jan 12 06:29:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBB64CACF63; Thu, 12 Jan 2017 06:29:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88DDA149E; Thu, 12 Jan 2017 06:29:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0C6TEoH098750; Thu, 12 Jan 2017 06:29:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C6TEMw098748; Thu, 12 Jan 2017 06:29:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701120629.v0C6TEMw098748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 12 Jan 2017 06:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311961 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 06:29:15 -0000 Author: arybchik Date: Thu Jan 12 06:29:14 2017 New Revision: 311961 URL: https://svnweb.freebsd.org/changeset/base/311961 Log: sfxge(4): do not ignore requested MAC stats update period Firmware version which takes PERIOD_MS parameter into account is required. Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D9129 Modified: head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Thu Jan 12 03:34:29 2017 (r311960) +++ head/sys/dev/sfxge/common/efx_mcdi.c Thu Jan 12 06:29:14 2017 (r311961) @@ -1725,7 +1725,8 @@ static __checkReturn efx_rc_t efx_mcdi_mac_stats( __in efx_nic_t *enp, __in_opt efsys_mem_t *esmp, - __in efx_stats_action_t action) + __in efx_stats_action_t action, + __in uint16_t period_ms) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_MAC_STATS_IN_LEN, @@ -1750,7 +1751,7 @@ efx_mcdi_mac_stats( MAC_STATS_IN_PERIODIC_CHANGE, enable | events | disable, MAC_STATS_IN_PERIODIC_ENABLE, enable | events, MAC_STATS_IN_PERIODIC_NOEVENT, !events, - MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000 : 0); + MAC_STATS_IN_PERIOD_MS, (enable | events) ? period_ms : 0); if (esmp != NULL) { int bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t); @@ -1800,7 +1801,7 @@ efx_mcdi_mac_stats_clear( { efx_rc_t rc; - if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR)) != 0) + if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR, 0)) != 0) goto fail1; return (0); @@ -1823,7 +1824,7 @@ efx_mcdi_mac_stats_upload( * avoid having to pull the statistics buffer into the cache to * maintain cumulative statistics. */ - if ((rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_UPLOAD)) != 0) + if ((rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_UPLOAD, 0)) != 0) goto fail1; return (0); @@ -1838,7 +1839,7 @@ fail1: efx_mcdi_mac_stats_periodic( __in efx_nic_t *enp, __in efsys_mem_t *esmp, - __in uint16_t period, + __in uint16_t period_ms, __in boolean_t events) { efx_rc_t rc; @@ -1847,14 +1848,17 @@ efx_mcdi_mac_stats_periodic( * The MC DMAs aggregate statistics for our convenience, so we can * avoid having to pull the statistics buffer into the cache to * maintain cumulative statistics. - * Huntington uses a fixed 1sec period, so use that on Siena too. + * Huntington uses a fixed 1sec period. + * Medford uses a fixed 1sec period before v6.2.1.1033 firmware. */ - if (period == 0) - rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_DISABLE); + if (period_ms == 0) + rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_DISABLE, 0); else if (events) - rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_EVENTS); + rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_EVENTS, + period_ms); else - rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_NOEVENTS); + rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_NOEVENTS, + period_ms); if (rc != 0) goto fail1; Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Thu Jan 12 03:34:29 2017 (r311960) +++ head/sys/dev/sfxge/common/efx_mcdi.h Thu Jan 12 06:29:14 2017 (r311961) @@ -218,7 +218,7 @@ extern __checkReturn efx_rc_t efx_mcdi_mac_stats_periodic( __in efx_nic_t *enp, __in efsys_mem_t *esmp, - __in uint16_t period, + __in uint16_t period_ms, __in boolean_t events); From owner-svn-src-all@freebsd.org Thu Jan 12 06:30:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4753ECAC079; Thu, 12 Jan 2017 06:30:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F11E016DC; Thu, 12 Jan 2017 06:30:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0C6UjOX098877; Thu, 12 Jan 2017 06:30:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C6UjrO098875; Thu, 12 Jan 2017 06:30:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701120630.v0C6UjrO098875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 12 Jan 2017 06:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311962 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 06:30:46 -0000 Author: arybchik Date: Thu Jan 12 06:30:44 2017 New Revision: 311962 URL: https://svnweb.freebsd.org/changeset/base/311962 Log: sfxge(4): stats refresh in SW should depend on HW update period The period should be taken into account by the function which refreshes driver stats. Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D9130 Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Thu Jan 12 06:29:14 2017 (r311961) +++ head/sys/dev/sfxge/sfxge.h Thu Jan 12 06:30:44 2017 (r311962) @@ -159,6 +159,8 @@ enum sfxge_evq_state { #define SFXGE_EV_BATCH 16384 +#define SFXGE_STATS_UPDATE_PERIOD_MS 1000 + struct sfxge_evq { /* Structure members below are sorted by usage order */ struct sfxge_softc *sc; Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Thu Jan 12 06:29:14 2017 (r311961) +++ head/sys/dev/sfxge/sfxge_port.c Thu Jan 12 06:30:44 2017 (r311962) @@ -51,6 +51,7 @@ sfxge_mac_stat_update(struct sfxge_softc struct sfxge_port *port = &sc->port; efsys_mem_t *esmp = &(port->mac_stats.dma_buf); clock_t now; + unsigned int min_ticks; unsigned int count; int rc; @@ -61,8 +62,10 @@ sfxge_mac_stat_update(struct sfxge_softc goto out; } + min_ticks = (unsigned int)hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000; + now = ticks; - if ((unsigned int)(now - port->mac_stats.update_time) < (unsigned int)hz) { + if ((unsigned int)(now - port->mac_stats.update_time) < min_ticks) { rc = 0; goto out; } @@ -510,9 +513,10 @@ sfxge_port_start(struct sfxge_softc *sc) sfxge_mac_filter_set_locked(sc); - /* Update MAC stats by DMA every second */ + /* Update MAC stats by DMA every period */ if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - 1000, B_FALSE)) != 0) + SFXGE_STATS_UPDATE_PERIOD_MS, + B_FALSE)) != 0) goto fail6; if ((rc = efx_mac_drain(enp, B_FALSE)) != 0) From owner-svn-src-all@freebsd.org Thu Jan 12 06:38:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44600CAC295; Thu, 12 Jan 2017 06:38:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13CC11BCB; Thu, 12 Jan 2017 06:38:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0C6c3FA002957; Thu, 12 Jan 2017 06:38:03 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C6c3qW002956; Thu, 12 Jan 2017 06:38:03 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201701120638.v0C6c3qW002956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 12 Jan 2017 06:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311963 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 06:38:04 -0000 Author: rpokala Date: Thu Jan 12 06:38:03 2017 New Revision: 311963 URL: https://svnweb.freebsd.org/changeset/base/311963 Log: Remove writability requirement for single-mbuf, contiguous-range m_pulldown() m_pulldown() only needs to determine if a mbuf is writable if it is going to copy data into the data region of an existing mbuf. It does this to create a contiguous data region in a single mbuf from multiple mbufs in the chain. If the requested memory region is already contiguous and nothing needs to change, the mbuf does not need to be writeable. Submitted by: Brian Mueller Reviewed by: bz MFC after: 1 week Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D9053 Modified: head/sys/kern/uipc_mbuf2.c Modified: head/sys/kern/uipc_mbuf2.c ============================================================================== --- head/sys/kern/uipc_mbuf2.c Thu Jan 12 06:30:44 2017 (r311962) +++ head/sys/kern/uipc_mbuf2.c Thu Jan 12 06:38:03 2017 (r311963) @@ -159,7 +159,7 @@ m_pulldown(struct mbuf *m, int off, int * the target data is on . * if we got enough data on the mbuf "n", we're done. */ - if ((off == 0 || offp) && len <= n->m_len - off && writable) + if ((off == 0 || offp) && len <= n->m_len - off) goto ok; /* From owner-svn-src-all@freebsd.org Thu Jan 12 06:58:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E02CAC69B; Thu, 12 Jan 2017 06:58:33 +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 D06441658; Thu, 12 Jan 2017 06:58:32 +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 v0C6wWig010967; Thu, 12 Jan 2017 06:58:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C6wVrU010965; Thu, 12 Jan 2017 06:58:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701120658.v0C6wVrU010965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 Jan 2017 06:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311964 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 06:58:33 -0000 Author: cem Date: Thu Jan 12 06:58:31 2017 New Revision: 311964 URL: https://svnweb.freebsd.org/changeset/base/311964 Log: g_raid: Prevent tasters from attempting excessively large reads Some g_raid tasters attempt metadata reads in multiples of the provider sectorsize. Reads larger than MAXPHYS are invalid, so detect and abort in such situations. Spiritually similar to r217305 / PR 147851. PR: 214721 Sponsored by: Dell EMC Isilon Modified: head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_promise.c Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Thu Jan 12 06:38:03 2017 (r311963) +++ head/sys/geom/raid/md_ddf.c Thu Jan 12 06:58:31 2017 (r311964) @@ -1161,6 +1161,16 @@ hdrerror: (GET16(meta, hdr->Configuration_Record_Length) * ss - 512) / 12)); } + if (GET32(meta, hdr->cd_length) * ss >= MAXPHYS || + GET32(meta, hdr->pdr_length) * ss >= MAXPHYS || + GET32(meta, hdr->vdr_length) * ss >= MAXPHYS || + GET32(meta, hdr->cr_length) * ss >= MAXPHYS || + GET32(meta, hdr->pdd_length) * ss >= MAXPHYS || + GET32(meta, hdr->bbmlog_length) * ss >= MAXPHYS) { + G_RAID_DEBUG(1, "%s: Blocksize is too big.", pp->name); + goto hdrerror; + } + /* Read controller data. */ buf = g_read_data(cp, (lba + GET32(meta, hdr->cd_section)) * ss, GET32(meta, hdr->cd_length) * ss, &error); Modified: head/sys/geom/raid/md_promise.c ============================================================================== --- head/sys/geom/raid/md_promise.c Thu Jan 12 06:38:03 2017 (r311963) +++ head/sys/geom/raid/md_promise.c Thu Jan 12 06:58:31 2017 (r311964) @@ -341,6 +341,11 @@ promise_meta_read(struct g_consumer *cp, pp = cp->provider; subdisks = 0; + + if (pp->sectorsize * 4 > MAXPHYS) { + G_RAID_DEBUG(1, "%s: Blocksize is too big.", pp->name); + return (subdisks); + } next: /* Read metadata block. */ buf = g_read_data(cp, pp->mediasize - pp->sectorsize * From owner-svn-src-all@freebsd.org Thu Jan 12 07:21:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 718F5CACCA8; Thu, 12 Jan 2017 07:21:58 +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 3297D1487; Thu, 12 Jan 2017 07:21:58 +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 v0C7Lvfe021040; Thu, 12 Jan 2017 07:21:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C7Lv33021037; Thu, 12 Jan 2017 07:21:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701120721.v0C7Lv33021037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 12 Jan 2017 07:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311965 - in vendor/NetBSD/tests/dist/lib/libc: gen string X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 07:21:58 -0000 Author: ngie Date: Thu Jan 12 07:21:56 2017 New Revision: 311965 URL: https://svnweb.freebsd.org/changeset/base/311965 Log: Commit updates accepted upstream (NetBSD) Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_dir.c vendor/NetBSD/tests/dist/lib/libc/string/t_memcpy.c vendor/NetBSD/tests/dist/lib/libc/string/t_memmem.c Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_dir.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_dir.c Thu Jan 12 06:58:31 2017 (r311964) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_dir.c Thu Jan 12 07:21:56 2017 (r311965) @@ -1,4 +1,4 @@ -/* $NetBSD: t_dir.c,v 1.8 2017/01/11 07:26:17 christos Exp $ */ +/* $NetBSD: t_dir.c,v 1.10 2017/01/11 18:15:02 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ ATF_TC_BODY(seekdir_basic, tc) #define CREAT(x, m) do { \ int _creat_fd; \ - ATF_REQUIRE_MSG((_creat_fd = creat((x), (m)) != -1), \ + ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))) != -1, \ "creat(%s, %x) failed: %s", (x), (m), \ strerror(errno)); \ (void)close(_creat_fd); \ @@ -75,29 +75,40 @@ ATF_TC_BODY(seekdir_basic, tc) /* skip two for . and .. */ entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + ".", strerror(errno)); + entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "..", strerror(errno)); /* get first entry */ entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "first", strerror(errno)); + here = telldir(dp); - ATF_REQUIRE_MSG(here != -1, - "telldir failed: %s", strerror(errno)); + ATF_REQUIRE_MSG(here != -1, "telldir failed: %s", strerror(errno)); /* get second entry */ entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "second", strerror(errno)); + wasname = strdup(entry->d_name); if (wasname == NULL) atf_tc_fail("cannot allocate memory"); /* get third entry */ entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "third", strerror(errno)); /* try to return to the position after the first entry */ seekdir(dp, here); entry = readdir(dp); - - if (entry == NULL) - atf_tc_fail("entry 1 not found"); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "first[1]", strerror(errno)); if (strcmp(entry->d_name, wasname) != 0) atf_tc_fail("1st seekdir found wrong name"); @@ -105,18 +116,17 @@ ATF_TC_BODY(seekdir_basic, tc) seekdir(dp, here); here = telldir(dp); entry = readdir(dp); - - if (entry == NULL) - atf_tc_fail("entry 2 not found"); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "second[1]", strerror(errno)); if (strcmp(entry->d_name, wasname) != 0) atf_tc_fail("2nd seekdir found wrong name"); /* One more time, to make sure that telldir() doesn't affect result */ seekdir(dp, here); entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "third[1]", strerror(errno)); - if (entry == NULL) - atf_tc_fail("entry 3 not found"); if (strcmp(entry->d_name, wasname) != 0) atf_tc_fail("3rd seekdir found wrong name"); Modified: vendor/NetBSD/tests/dist/lib/libc/string/t_memcpy.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/string/t_memcpy.c Thu Jan 12 06:58:31 2017 (r311964) +++ vendor/NetBSD/tests/dist/lib/libc/string/t_memcpy.c Thu Jan 12 07:21:56 2017 (r311965) @@ -1,4 +1,4 @@ -/* $NetBSD: t_memcpy.c,v 1.5 2013/03/17 02:23:31 christos Exp $ */ +/* $NetBSD: t_memcpy.c,v 1.6 2017/01/11 18:05:54 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -96,7 +96,8 @@ ATF_TC_BODY(memcpy_basic, tc) if (i != j) runTest(start[i], start[j]); MD5End(mc, result); - ATF_REQUIRE_EQ(strcmp(result, goodResult), 0); + ATF_REQUIRE_EQ_MSG(strcmp(result, goodResult), 0, "%s != %s", + result, goodResult); } ATF_TC(memccpy_simple); Modified: vendor/NetBSD/tests/dist/lib/libc/string/t_memmem.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/string/t_memmem.c Thu Jan 12 06:58:31 2017 (r311964) +++ vendor/NetBSD/tests/dist/lib/libc/string/t_memmem.c Thu Jan 12 07:21:56 2017 (r311965) @@ -1,4 +1,4 @@ -/* $NetBSD: t_memmem.c,v 1.2 2011/07/07 08:27:36 jruoho Exp $ */ +/* $NetBSD: t_memmem.c,v 1.3 2017/01/11 18:07:37 christos Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -51,6 +51,8 @@ char p6[] = "9"; int lp6 = 1; char p7[] = "654"; int lp7 = 3; +char p8[] = "89abc"; +int lp8 = 5; char b0[] = ""; int lb0 = 0; @@ -89,6 +91,7 @@ ATF_TC_BODY(memmem_basic, tc) expect(memmem(b2, lb2, p4, lp4) == NULL); expect(memmem(b2, lb2, p7, lp7) == NULL); + expect(memmem(b2, lb2, p8, lp8) == NULL); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Thu Jan 12 07:26:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 066EDCACD48; Thu, 12 Jan 2017 07:26:41 +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 9EF1F1721; Thu, 12 Jan 2017 07:26: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 v0C7QdFw023384; Thu, 12 Jan 2017 07:26:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C7QdcR023376; Thu, 12 Jan 2017 07:26:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701120726.v0C7QdcR023376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 12 Jan 2017 07:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311966 - in vendor/NetBSD/tests/dist: . crypto/libcrypto crypto/libcrypto/rc4 dev dev/audio dev/cgd fs/ffs fs/fifofs fs/nfs/nfsservice fs/psshfs fs/puffs fs/vfs kernel lib lib/libc/arc... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 07:26:41 -0000 Author: ngie Date: Thu Jan 12 07:26:39 2017 New Revision: 311966 URL: https://svnweb.freebsd.org/changeset/base/311966 Log: Sync ^/vendor/NetBSD/tests/dist with upstream Added: vendor/NetBSD/tests/dist/dev/cgd/t_cgd_3des.c (contents, props changed) vendor/NetBSD/tests/dist/dev/cgd/t_cgd_aes.c (contents, props changed) vendor/NetBSD/tests/dist/dev/cgd/t_cgd_blowfish.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/msg.h (contents, props changed) vendor/NetBSD/tests/dist/kernel/t_ptrace.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.h (contents, props changed) vendor/NetBSD/tests/dist/kernel/t_ptrace_wait3.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/t_ptrace_wait4.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/t_ptrace_wait6.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/t_ptrace_waitid.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/t_ptrace_waitpid.c (contents, props changed) vendor/NetBSD/tests/dist/lib/libc/sys/t_clock_nanosleep.c (contents, props changed) vendor/NetBSD/tests/dist/lib/libc/sys/t_wait_noproc.c (contents, props changed) vendor/NetBSD/tests/dist/lib/libc/sys/t_wait_noproc_wnohang.c (contents, props changed) vendor/NetBSD/tests/dist/net/net/t_mtudisc.sh (contents, props changed) vendor/NetBSD/tests/dist/net/net/t_mtudisc6.sh (contents, props changed) vendor/NetBSD/tests/dist/net/net/t_ping6_opts.sh (contents, props changed) vendor/NetBSD/tests/dist/net/net_common.sh (contents, props changed) vendor/NetBSD/tests/dist/usr.bin/xlint/lint1/d_c99_anon_union.c (contents, props changed) vendor/NetBSD/tests/dist/usr.bin/xlint/lint1/d_c99_union_cast.c (contents, props changed) Modified: vendor/NetBSD/tests/dist/crypto/libcrypto/rc4/Makefile vendor/NetBSD/tests/dist/crypto/libcrypto/t_libcrypto.sh vendor/NetBSD/tests/dist/crypto/libcrypto/t_pubkey.sh vendor/NetBSD/tests/dist/dev/Makefile vendor/NetBSD/tests/dist/dev/audio/h_pad.c vendor/NetBSD/tests/dist/dev/audio/t_pad_output.bz2.uue vendor/NetBSD/tests/dist/dev/cgd/Makefile vendor/NetBSD/tests/dist/fs/ffs/ffs_common.sh vendor/NetBSD/tests/dist/fs/fifofs/t_fifo.c vendor/NetBSD/tests/dist/fs/nfs/nfsservice/Makefile vendor/NetBSD/tests/dist/fs/psshfs/t_psshfs.sh vendor/NetBSD/tests/dist/fs/puffs/t_basic.c vendor/NetBSD/tests/dist/fs/vfs/Makefile vendor/NetBSD/tests/dist/fs/vfs/t_vnops.c vendor/NetBSD/tests/dist/h_macros.h vendor/NetBSD/tests/dist/kernel/Makefile vendor/NetBSD/tests/dist/kernel/t_mqueue.c vendor/NetBSD/tests/dist/lib/Makefile vendor/NetBSD/tests/dist/lib/libc/arch/sparc64/exec_prot_support.c vendor/NetBSD/tests/dist/lib/libc/arch/sparc64/return_one.S vendor/NetBSD/tests/dist/lib/libc/db/Makefile vendor/NetBSD/tests/dist/lib/libc/db/h_db.c vendor/NetBSD/tests/dist/lib/libc/db/t_db.sh vendor/NetBSD/tests/dist/lib/libc/gen/Makefile vendor/NetBSD/tests/dist/lib/libc/gen/t_fnmatch.c vendor/NetBSD/tests/dist/lib/libc/net/getaddrinfo/Makefile vendor/NetBSD/tests/dist/lib/libc/regex/Makefile vendor/NetBSD/tests/dist/lib/libc/rpc/t_rpc.c vendor/NetBSD/tests/dist/lib/libc/sync/cpp_atomic_ops_linkable.cc vendor/NetBSD/tests/dist/lib/libc/sys/Makefile vendor/NetBSD/tests/dist/lib/libm/Makefile vendor/NetBSD/tests/dist/lib/libm/t_ldexp.c vendor/NetBSD/tests/dist/lib/libm/t_precision.c vendor/NetBSD/tests/dist/lib/libpthread/Makefile vendor/NetBSD/tests/dist/lib/libpthread/h_common.h vendor/NetBSD/tests/dist/lib/libpthread/t_mutex.c vendor/NetBSD/tests/dist/lib/librumpclient/Makefile vendor/NetBSD/tests/dist/lib/librumpclient/h_execthr.c vendor/NetBSD/tests/dist/lib/librumphijack/t_tcpip.sh vendor/NetBSD/tests/dist/lib/libusbhid/t_usbhid.c vendor/NetBSD/tests/dist/net/Makefile vendor/NetBSD/tests/dist/net/arp/Makefile vendor/NetBSD/tests/dist/net/arp/t_arp.sh vendor/NetBSD/tests/dist/net/arp/t_dad.sh vendor/NetBSD/tests/dist/net/icmp/Makefile vendor/NetBSD/tests/dist/net/icmp/t_icmp6_redirect.sh vendor/NetBSD/tests/dist/net/icmp/t_icmp_redirect.sh vendor/NetBSD/tests/dist/net/if/t_compat.c vendor/NetBSD/tests/dist/net/if/t_ifconfig.sh vendor/NetBSD/tests/dist/net/if_bridge/Makefile vendor/NetBSD/tests/dist/net/if_bridge/t_bridge.sh vendor/NetBSD/tests/dist/net/if_gif/Makefile vendor/NetBSD/tests/dist/net/if_gif/t_gif.sh vendor/NetBSD/tests/dist/net/if_pppoe/Makefile vendor/NetBSD/tests/dist/net/if_pppoe/t_pppoe.sh vendor/NetBSD/tests/dist/net/if_tap/Makefile vendor/NetBSD/tests/dist/net/if_tap/t_tap.sh vendor/NetBSD/tests/dist/net/mcast/Makefile vendor/NetBSD/tests/dist/net/mcast/t_mcast.sh vendor/NetBSD/tests/dist/net/ndp/Makefile vendor/NetBSD/tests/dist/net/ndp/t_dad.sh vendor/NetBSD/tests/dist/net/ndp/t_ndp.sh vendor/NetBSD/tests/dist/net/ndp/t_ra.sh vendor/NetBSD/tests/dist/net/net/Makefile vendor/NetBSD/tests/dist/net/net/t_forwarding.sh vendor/NetBSD/tests/dist/net/net/t_ipaddress.sh vendor/NetBSD/tests/dist/net/net/t_ipv6_lifetime.sh vendor/NetBSD/tests/dist/net/net/t_ipv6address.sh vendor/NetBSD/tests/dist/net/route/Makefile vendor/NetBSD/tests/dist/net/route/t_change.sh vendor/NetBSD/tests/dist/net/route/t_flags.sh vendor/NetBSD/tests/dist/net/route/t_flags6.sh vendor/NetBSD/tests/dist/net/route/t_route.sh vendor/NetBSD/tests/dist/rump/modautoload/Makefile vendor/NetBSD/tests/dist/rump/modautoload/t_modautoload.c vendor/NetBSD/tests/dist/rump/rumpkern/t_lwproc.c vendor/NetBSD/tests/dist/sys/net/t_print.c vendor/NetBSD/tests/dist/usr.bin/Makefile vendor/NetBSD/tests/dist/usr.bin/config/t_config.sh vendor/NetBSD/tests/dist/usr.bin/netpgpverify/t_netpgpverify.sh vendor/NetBSD/tests/dist/usr.bin/xlint/lint1/Makefile Modified: vendor/NetBSD/tests/dist/crypto/libcrypto/rc4/Makefile ============================================================================== --- vendor/NetBSD/tests/dist/crypto/libcrypto/rc4/Makefile Thu Jan 12 07:21:56 2017 (r311965) +++ vendor/NetBSD/tests/dist/crypto/libcrypto/rc4/Makefile Thu Jan 12 07:26:39 2017 (r311966) @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ +# $NetBSD: Makefile,v 1.2 2016/10/14 16:09:45 spz Exp $ HELPER_NAME= rc4test HELPER_DIR= rc4 +CPPFLAGS= -DOPENSSL_PIC .include Modified: vendor/NetBSD/tests/dist/crypto/libcrypto/t_libcrypto.sh ============================================================================== --- vendor/NetBSD/tests/dist/crypto/libcrypto/t_libcrypto.sh Thu Jan 12 07:21:56 2017 (r311965) +++ vendor/NetBSD/tests/dist/crypto/libcrypto/t_libcrypto.sh Thu Jan 12 07:26:39 2017 (r311966) @@ -1,4 +1,4 @@ -# $NetBSD: t_libcrypto.sh,v 1.3 2010/11/08 19:06:12 pooka Exp $ +# $NetBSD: t_libcrypto.sh,v 1.4 2016/10/13 09:25:37 martin Exp $ # # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -49,7 +49,7 @@ atf_test_case bn bn_head() { atf_set "descr" "Checks BIGNUM library" - atf_set "timeout" "300" + atf_set "timeout" "360" } bn_body() { Modified: vendor/NetBSD/tests/dist/crypto/libcrypto/t_pubkey.sh ============================================================================== --- vendor/NetBSD/tests/dist/crypto/libcrypto/t_pubkey.sh Thu Jan 12 07:21:56 2017 (r311965) +++ vendor/NetBSD/tests/dist/crypto/libcrypto/t_pubkey.sh Thu Jan 12 07:26:39 2017 (r311966) @@ -1,4 +1,4 @@ -# $NetBSD: t_pubkey.sh,v 1.3 2011/06/09 05:25:21 spz Exp $ +# $NetBSD: t_pubkey.sh,v 1.4 2016/10/13 09:25:37 martin Exp $ # # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -49,7 +49,7 @@ atf_test_case rsa rsa_head() { atf_set "descr" "Checks RSA" - atf_set "timeout" "300" + atf_set "timeout" "420" } rsa_body() { @@ -60,7 +60,7 @@ atf_test_case ec ec_head() { atf_set "descr" "Checks EC cipher" - atf_set "timeout" "300" + atf_set "timeout" "480" } ec_body() { @@ -81,7 +81,7 @@ atf_test_case ecdsa ecdsa_head() { atf_set "descr" "Checks ECDSA algorithm" - atf_set "timeout" "300" + atf_set "timeout" "480" } ecdsa_body() { Modified: vendor/NetBSD/tests/dist/dev/Makefile ============================================================================== --- vendor/NetBSD/tests/dist/dev/Makefile Thu Jan 12 07:21:56 2017 (r311965) +++ vendor/NetBSD/tests/dist/dev/Makefile Thu Jan 12 07:26:39 2017 (r311966) @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.11 2016/07/29 06:13:39 pgoyette Exp $ +# $NetBSD: Makefile,v 1.12 2016/08/14 14:55:42 jakllsch Exp $ # .include TESTSDIR= ${TESTSBASE}/dev -TESTS_SUBDIRS+= cgd fss raidframe +TESTS_SUBDIRS+= cgd clock_subr fss raidframe .if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE) TESTS_SUBDIRS+= audio md scsipi sysmon usb .endif Modified: vendor/NetBSD/tests/dist/dev/audio/h_pad.c ============================================================================== --- vendor/NetBSD/tests/dist/dev/audio/h_pad.c Thu Jan 12 07:21:56 2017 (r311965) +++ vendor/NetBSD/tests/dist/dev/audio/h_pad.c Thu Jan 12 07:26:39 2017 (r311966) @@ -1,4 +1,4 @@ -/* $NetBSD: h_pad.c,v 1.1 2010/08/04 13:15:15 pooka Exp $ */ +/* $NetBSD: h_pad.c,v 1.2 2016/10/15 07:08:06 nat Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -56,14 +56,14 @@ main(int argc, char *argv[]) ssize_t n; rump_init(); - audiofd = rump_sys_open("/dev/audio0", O_RDWR); - if (audiofd == -1) - err(1, "open audio"); - padfd = rump_sys_open("/dev/pad0", O_RDONLY); if (padfd == -1) err(1, "open pad"); + audiofd = rump_sys_open("/dev/audio0", O_RDWR); + if (audiofd == -1) + err(1, "open audio"); + if ((n = rump_sys_write(audiofd, musa, sizeof(musa))) != sizeof(musa)) err(1, "write"); Modified: vendor/NetBSD/tests/dist/dev/audio/t_pad_output.bz2.uue ============================================================================== --- vendor/NetBSD/tests/dist/dev/audio/t_pad_output.bz2.uue Thu Jan 12 07:21:56 2017 (r311965) +++ vendor/NetBSD/tests/dist/dev/audio/t_pad_output.bz2.uue Thu Jan 12 07:26:39 2017 (r311966) @@ -1,1035 +1,1040 @@ begin 644 t_pad_output.bz2 -M0EIH.3%!629369%IQ#X`MT#FU'+1O7<;MT;NYNNYW<[N[OO;K>W7+>^Y[M;[LV]??=M] -MYZ[MMMO>WO;6=W.KIOKNUF:EFEJVK5I"+:J;8:B5K1JJIJVUJV,K6IK5MJJ6 -M--%5FJLS55K158M5K:U5FU4RVMJ(K0BK-6Q0-L+6JVLJ6MK559M5556*M54J -MJMIMFS-"U6LJRUBRJJRV;55::M6U[G=0JI5-4W66J=KVZ]LNW=]W=FW=S;YM -MDO<]LW>Z[WW%E@WUOD-[G!SN<'=W$CD8@[KN<36:PVO=W;*I*E%4SC -MV]XE)5!54*"@*JJMH)J0H*`4&V4`!11(``!4BJI27O>Z(]5()`22)**%4``I -M0`!*B5`D(DB*5@:5``AH`"8F3"8`F0#3(Q,FF@#1H&(&C)H-#3330!ID,C`C -M!-,F)IIA`TQ-,!,33$831@@R9&$T`!,`@TD@FC$``````&@```:-`3`F$P0T -M,$!@`$``#03T!H-`U,`33$TTQJ-,$P$P%/$R8",!-02FDI"!$QJ>S,`0`$!H -M:!#":$Q-,28$V@0-`34]$:;*:>D]1I[0H'HGDRC:AD&@]0&@/4`]0R`R,AH- -M!H`VHS2`:`(4E)*)&R>J-^GBGL!2,:::2;48GI$IO%)Y)Y)[3TE/U1^FFC*C -MQ&H>IZC$T,AIZAZF31H>4``'J!DTTT---```#U```-`9#0T``T!(I((28-)B -M>A3TTF>14]3VT&IJ>R,@F$TQ'DT3&@FU3\4GFDT>J>333&IBFTPF$T]$-,32 -MGM-4]IDTR)ZI^1I3V332;(93-4_5/R>D#":GDU-D:FIZ>IM3U-HTH)-25)%1 -MM3:3]L/-2$FWD4S4U-B:::FB;4V3"4_4R4>H>U0;4]JGJ&33T]4T`#(T-&0] -M0!HT-`_5`!Z@T````9!IH:```````_Q$/Z:,D&8X$&L.'B.D00+!M12TQ2"> -MGH4)$$U776'(,NA5T"`@H&+#%`;<'^;2<4$`CK#I>?6\SY]KTOQX,LDD%=#] -M=K=W[.S5.*PD:9EE+#8V,8RRL@"_3]+%\'Y\OE<[XY25)9,&QL(&#!(B3@T. -MCTYNF5=LVA0D0'QD+"T]J]AX/R0)P"P$\13QX$Q,/GR(O5_U5.R7J.DE`0K( -MEC0PL$_ONQ0)A@@60_";^_OE&;Q_:\_3BPGL8?\=O:KUNG!-MF0A03X9PPMX -MF'WE;&SK)O(N2J"`80_J9Y6*=6(?DZ7*_=I%;(JB,Q$/X5S@P$*M6IZ6$>F. -M&L;Y&C($S\KC'O`Q#')%M:;\FTP-4ET5[;UV7JU<$0D7*H[&KC\]MFO+$`\& -MK%L^,?8,8N-=10VF1`%ZT<0V#-6C#OCSQ<+:D1!\*'M+14@>!P\/!T&+LDA` -MM>S!`Y))"PU-A7RRF1#XLD2TAAXFXPES0HB!="\G,MI5;+<6\:#8!?:^9F[% -ME',L8MFO;T)7.GR!;_`/D0:1+;UF7Y[3=J&V"``O/U.NE!"#*9$.X86#N,8I -M`#2>Y2VR.+WM3?[`$7UIE`R.12-/ADE3=;A$1!:]O_:**7`0NS1[]JFWB&;, -M9H]?3J1$29(D`##!T*ZI]K?Y2?W`!+<"-:V[)FM&)64CY`27=R&1(43Q0:.3 -M57.RL\G5'0B!%DUBC6R2:/8GH36'00V/_3FF$$BHG7;+O%I3X!8&S2LK'/>1 -M8OS=Z#;4Y$43X>>W=G@!;JCZJXZ+CG@"_SV[O7ZI=P8DJ:+_5D',I4)`;G=/ -M'LMX@K6`@UZ4;>CQD0!>G1L^>LPH@:>W<=.CS^7@)?+I``+POTESZ]3/ZA2! -M75?3@*BYG9V,AZN4Q4&IJ@(<=6[N*2:B4T)ITB]VC:@%[*8[4SK5EZR_]5WDD@B*BP]Z -MM&`(P"9NX?<(%_4:IX/(`!5M=`Y*J0ALV/=9UEH,?/)])PN4S.3Q*JX(OE@. -M2:Z?"+C-^RQK#(AH^YZF'"(N4H(.K.`QOV&@=HI"`,-P0@1,W5)#ZE916Z/V -MDMCV8^`4YS\-7R*L!D&Y@OT/@[O\HB+8?+K:EP*>6KQIHI#9&]*\I@AOG`B[ -ME!(1^\3.":TV[8($^"X\PV,D"7'@5IA -M_&HS5?4^K5(@17-'D>"%FJ8^%HE-%-GP07=Y"M@$+JL?O=<_H_;+X"$$)/+$ -M(#&Y%>VSVDIS6@!!PH[W&3U(!SXV;RV<\".VZ\"A!%NDZM&LY*JMTR0+GH5% -M-UD0(OWQ1PM=G=;!V2D>(AEP2@)MH6&EBU77QS:R7B0`5P)?N)=]4'"%!``L -M6>;IEY>3]?^J#F8Y((@VJ'9(3=(Y;EL/U*W3_M""&*6LOPA)`2G2\;XHZ?,1 -MN@9?--I!`7BU)`)6&?V2\RV=GPPO_+AI`13_]&!9NI8WF&D8=EAD>=1@A]-M -M2*,@.#^UP_^]`1,'Y@7\>&O=GPWW86]K`46*"9"107H9R&2FIS4QC(C9?S9E -M0`/+,`K\G03>F3F0D&K]O^I"WC##9]90$6;P/K*\,L":#V^TRY\OGS?!Z.>D -M($R4A>S*K^+BN!7^#D(`!):^.YO0(#Y_7L:3*O#7:[G5>S#2DD#:[ZDW8'GX -M2)284[['@*/]+TCLR$C2\R=8*W5,5CI?!P%6`2B(:+04!>;6K6S6]](_;T]*B(`QH.-:D+F0Y(DOX[O8A^D&ZOMFWV'@4'P8^/`G6' -M4MT7D&'K95`"'TM;8HC'LCRM8)T%MM8^D+N/=;2(V#3NCX`4ISMR_2ZY!(<< -MODMH/*.`-_8\FLT9T`6L6N;B -ML+\].#\V8R;3BE920@#2V1+PA(E.R3ONAYKUN//A^GSGB+*OAX\D`:G4 -M:N6A>'`4Q\%%^V;+*\"K@=4D2`OFKMZ-$0*_[`*>S-)N7WOTB9UK:P8!A_-* -M!#IK6Q(LWF_4F>(UJO>>(9:Z7`0D,+EMF0/N3>?#*1()V)O8Z86&8^!<^ZRS=X!-^V>ZVP;`ZT!\%Z,_M4O]>(!*Q -M%78V.MY[N[_RBAL(JLA?)W_"-+S/ZED0 -M;/3I;2@T6N\'?(;S])2EU,C6-+$@`&SZ+)688"[5QVM98;-GB%YN\`AY&9IE -MW6!=**T2J@+$5]."ANQ]8K\>S;J0'=Q541?&&5H]>H.:O/8H/BC(H+5TL-!% -MC&+N0$H<`3/0LN='R;P@R<.!'<-C*;7FPP#W3-Z"8=_X,P_=A -MXHKO&(2"G=D,QU$C((T6%6GP&!#S"XF5-4V6YAT`'5EB!2_H5R+\+"TB'N$` -M+T%X4&3]-]G#I0>*@2%GIH7 -MSW9O]0D`OIGB+^\1)&P36=Y]RD/%JD1%"5@`[_O_LUM7*JV1\K6;+I3/![/Q -M.#`S2;N_U[:(B>+8XRN,SF.'J%WW8:0"&DUMP7D:"XONX&O-1"LFTT^RG -MR+S^5?!8/;3Y9K[##DDM+1(B+E*B/MD%:Y4H%W4-P>!,]+^'3!:;H\PZRRFC -M,*N]1$`Y3OHLIC/@I?18G7MEW5J04*WZE9NVEJCX]O3A@!"*.^XTQR#K_H+B -MK`_GST-]:GHOXGP6;!7_\>WC/V4[-<>[Y"(A'>SUX`+BNS=W40.$/SF;@#%7 -M/G9ZN`.E)(9E.O"`OX'_/=0TANWS\@%ZGZ"Q`@[-KB[#G4C"?(+B9O2!?3V? -MU(RWC7&#H]VG6T@"3_+P0#-+4"/+:-K195`'/]=0!>5EY/E\%"0EO%WYN;I\ -M,!92L^L[-@(=H^*F`-%2+>M'^T?2W -M'C:U,6=Z7MD- -M!S,3Y&RP>BX!RT^M!(O4_R)^"A]\?+TU4;M'@"5;;:ZIS@]DEP@`GW#)=.K] -MO\7W&3'^J?:TH`>FSXA%M?%/2O67]%.K"6EKOD22)U:K(B^/TNND%OAGR,>$A17>EHS;U89'SEZ,TK*[C@G2H>W_/QJP2&S5GGO -MJE2]X=O]U=K22`\/)G.A*\;1D5Y8TB9-1"S]]V@!)?#_OC6ZNP(-L@?M71N) -MF5SY`+]]\X//8((6RI`6'=Q>`,79HH,_*7BDQ5B$ -MF#C;\$,9E\_=O%KQ8180+*XJ:0$1[TM:]]/]?3>UY$I,\SDOR,#I1E=JFS"! -M)D6KO$6H8D4OU,[!)!$>B\C[>U3$!Z^KJW(<\.5K:U&!G41!!%$5_Y/6QC+5MNVCN4"&]Z]DJO`(9_'6]7?*ZF8/$&+R1H`D$,1>.+._G@W*)DDB;]VG`*5YF7 -MWD]IU[X\&5T,-")):A_]LR"]=;MJN5!LX6;D=]@@KQ`@^-G`>;-=H$6+3?0; -MYG3YLP?<=K)H?)5`"JW_5R6!`Q9OZ8Z#_17/+4<,$0*_:]M -M['1B(#.(QC+-;7CH'N\LREOH(>W0-/OY\=&_S[F9)"7_77XA@06;X>OJ&IOK -M]_"/D$]\6"(#S']/.AK:OAKS"CC7-%WN:`*S+_$Q\,^Z5>:9-EA;.ZD`(GSF -MIQ:L*`\3U-]F](KQ2F<&;.+!Y/Y?&`$JI5%RF94'0/-]9,`:CO;'C<7'S6Y/ -MC(IK?C@3Z*)/UJ'6-^%6!`"074SY(^7^GX$0[^K\-)/;:';#_=4R9TB+O0^G -M[]]7D3#&W$Q$WJ'_>WZV-KK`!WGEP^O)3UHKSY6'>%*ZJN$_$'M>40"Y'4TKT[6!UHFC)`&?/)6ALNE4_=YKB+#=*OU0?%/4DSB6RY5I(*1T -MBS_(D<8`16E0,O"KK9W:_/'P9`7LW2]VZ=L6P&CX1W4GLP1+"_P[R>#N[U"/ -M6WJ(6I\K#MUC,*=$& -M1:KI+^\1_-\P/5`$`\H[779:X^25NX"RC<8`-!NW(+E)7#8<-$0NNC.=8%;Y -M""W5''H1A\USP=7IXRZHLP`5SU[KII-+72^YR&2"Z82`/&[YW!C^'UK5S(MO -MW&B.-PG"G%8BH=8XL2#/=7#/E$X>/AR(5Z^AT]%#>CG.$(E5&]2?[<@D>*0/ -MLZ<&PTK&10ST<\S7A0!X<3B>_3^EJE_\RHP"TFVYCEX^77UK9&C9T20A*]99 -M7K6E``:<-TKEE8"N>WK92J@43N+VH+CGZ#],-YHU(37CX]<0)-RJOCFS%/>< -MAQN%3[ZBT6R(:O24[5N6@(0PW=6K8XBYT._;F*0;7N`AGO:TU&>^N%)?1CJ+ -MGA$!F/HR`O_,-OQ]:S+*EE+7F; -M)8:Y8$Z23!0[=.AU<55;Y+G00EZ:%X+;4.QH1$7K^V(=S>;QJF5!%*(66:M6 -M[]<2>?+NA5:@B'.L/3K#D=IF8CCD"I:=]2]C(V:VB`Z -MOS\_5M\P`2K/>9)C:#G,^D1A32(@7>9.&JW(0D0'@NOJ*)ZVW.3&/)46P09QKXZA5D`53`!D=\)LX*R1 -M!$VM(PTC]$J02F,8P,".;C\K*?9X_7%;MH6>P6<2HYV8U=JFL3)L0P;&-M=6 -MQ"QWM=K46:O@8B=]_\<9C+E\'NRM?3;$*AU\"9&FVFFQH!@"],<7:RQP[:(X -M(.&1#:N&(>`2H-SY3E0:Q```RU<;/1R="%-3!('Y%^`@'U3/^:?U'4DDD^2K -M_QSJ>F@<3(!_5_39XX%+[S0)3Q!$2G$(CR,W5,0ALWVR5@^PNW\Z?G(" -M`E5V)'F?/MYL@H'05?I>U/0;5$JNX(9@PLAMWF/]5Y=G2)KZA/W]\6KGP7TW -M=W;`93G$(W[@47APG.]9PXDV619K+/GQ=Y"H#*8MA2K<.U0:]J -M:[P_S0(`0S@3L$R/6W=-GT;+A'"+='OL8`Z36_XSN)T+M;(@*I\0Q$P[W.QU -M75`U^S3T[*WDD"J.S-BXH)4"-NVA`QPE7A^H`7^G#K^Y#]GW?Z@6;MLN!LH;Y8V[TBAUSY!77`-3DZ).?CA%NN(3U]N[8L)PO7=2[[? -MK?+IP4G)+./7E[L39T%%XY?YT$-0U[8TLY4Z3UDGQ6P.(=`BEAE9/#\#15F/ -M`>_ME9OM"".@E3DR84IGAU)L@Y9W1:M_[OX_)?[G)6:Y=`;!--*(GTMVGOC@ -M"M.:85V$\*TYC78\0T]2+KO*6=_-F75H3!"RI[5E%MF-L:((=8,M2&70#ZW- -M$O9J/0@H[BV!#T_DCO-3-M>J1$32[58X'"UIXHV&4I<18I##UHY6XXEJN&P/ -M[+_)I,DH:BVYVQQZ_O,X=!-]/8)XA,][37V[KG"[%TA.S(Y(\1:.1<'+8>P! -MTC2B]U(SYL#9%1^*\-#T-R]I/8`]M.T2RK3'>,$!HM`\3#=>9@\`-?GY`S\] -M'^7GF;T%I/11:4V6BU8@[1!]C9"PV\A^?P9`WL8!?79D"YCUK:`64G<=<^![ -MM#C.5F/_>8BBW!5>]G?,QPK`MOE8>+$X\S@'%B3EB66;K,\3Q-+A\#K:&\@;TVTVP'I=^: -MY=HX3U'3"E-E/-<7;]7*'2RO(T-)_@5+]/#*EW,7;/R1#'2:/\X@06H4X2+? -M`);^=S>ZPX(A-FAP#!KYMMM\W+;4D_I/>>`'+KI;G\$G;W7IKB3!)@6L?=9B -M8*,D]4:LO-(+-(:$GC_"'/22E/38XZ!EYB]IL#7&,F0SV+_9H#_L$NH_NN$; -M`YY;>`WRW)2(R_EGS0Y>4R/2%0UT!H>XOSJ#,5UEL#1:S819LJ2Y9YXR$;:* -M+2R9H5&H;4'TW\@&]O?C08ZIYG"M.?O$WF_L;$_+KZ/I@,;.8VO8-DAQLE_@ -M*F+&8>S(8K^[BR.2[.:J/%0B[B^IOZ/H"=7ELT(5Z3P-M%;0Y0'"PW0%B^-L -M^CHCB]9>CRF/0VMBJ084\S(]"?`EVGY&D]WJF)<7_849]9\T%NQU1^_WH&,_ -M5^:^K6L2FR(J\PH/W*3)P.C^9',6$)OO0-%D1.;GY>Z%(/[H^5!\IJCTY>TVV!=^XZ] -M/D?;R_(6)'WW?`>S2].TI:(%$?*%L3XD%Z`_[1*CVU3[S"EBV,S3O&V(D7C? -MCX7#((A-/5OOM."4.=)P3%-$'!ZQ;SBG8+&8(;Y]WO/QB!8>_ -M1`09PN#_L;#77^>^Z%CSS_RF*D%4_LM6Y\0W(7R&+SJ10?Z[!0X^R(2VMM<7 -MZ#@QIZ_ML697.F[D/>_WWC^,Z;,J'`[$<)J(QAJ.R^W['JQ@*YSF!LV#'(0G -MINP0WMHSPE6@)+;2#N0I#RQP\XZOY8'[VWX$,"E;-W,?+W,3.!;[=@838['X -MN'5^;;`/^,,G%+:5H+V&^EX>L`)7RZ=4\T.LI[4M4,2"M_G>?%I`_EHW'7=U -M+'\NP(?YXV&)GD&EZ'@@71ZH48<^!BD^E^U2EAOE3@"A4:9C6">_N/?-+AH: -MV$R>6I6S($%7H_C2_"R$&>,CKU`#E3X^\=.6!@_1^I.?=:Q_$04>S+1J?7[P -MOT8K<\G7.YV1#T(@W_3_Y[^,B6: -MEF)6-335TB(-Y'S(@B&TWK?H@"KS3:49A_AC%$T#$SB3$_&C7A%PGX%@U%E# -MH3OAQ,#V+C%%TJMF6WRU[G>I.+H?NE^<7ZO7[4$JNYWJ7W[J"60W_3]NLWF+ -MRZ7*TDY,V)/9C`GOL=[=+.]8$$0`E5TIH!H:),G*`Y\F'SZ6&"/IHYD84M7- -MB@SK9"-\W8^A%&3A-3T0L_8UBV6.(/_'+6Y_4<_W0:X/95G9K[]6,VW;)RW[BL&"4QI*+FQIL3-;]0MTG,P&5];4I-/<#MZ[$G6F\QXH3/S1?6PP?`?+Q$ -M]R*YE='TQ>X[,Z+H34N>&#L0FK==ON$!U>%8>&^_LQ7N:&03DMT_&/"P/5EL4ZUQPD"B_ -M&<%C2OQET?ZHSC`WFH*3S?D6R3B,6V'?[-W>B$Q@W>M,_N;\<`M2)=NG;C07 -M>9]X%OU`=]09"9P(UX,A^TM<,V7&O82A?MG/#`EKFD#9CS(HRZ_O6S(@.2:6 -M92'[SCA]-D@A0XX!P&6[(P'*M+1[4=/><0R]>^8MH)B>5ZXD?R9(8"OG#+]/ -MXU#^`[.XMGMC-!X*,,;J-L\ZJ[9JT&"-'.[P5%`A]1L53J-Z8O^1B&F(?/F? -MEZ6-.7H;)E,M&+ISG+`U?ZT)VCVXY'G]3\C'Y&&]UV(.+R!'\3#[M"',]^NSG/W!-`R+(=B;KN?>=B0!7YM]TGPN?R]6>&E? -M2\]9^5R5!!-?`^QG\F?HCEEH)^F(2RF_6)I0OS;,8,&8'4?ISN> -M4>5)YWW/\][[2T/#PW\^+!DC(RF'_+C\3NG0WN\FGH(:C?6_:G#U_-QO`]/L -MS0O9V;_2/OARD3*]*Q#?(@?>WP$_1TUJX%51#[8U%HU5L747&5+ST6H,!2 -M$X;-DZ;MV/:X!CJ#M-XM6U]D;/`Z@0PP% -MF8::)8Q5B+;K[!7`EGD7FR+Y68,^N&P?O`G.GY'PAY'?!EACMOFL9%XRW$LB -M2'AGMOZ+&XPU;+URN9\?W'D-6+ZHR5Y\[7_/)CNNL@J\UM&A5Q%+NN]]&.=% -M$U4\8`_>`>'`,HH/SN[`*'XE]#\?44AD&_N:@Q(@E("%]S%59Y!(SB/1:].4 -MW5K]Z+_CFN-\O"ZRF5<<61,*,QBBQXIKL0[ZB\?,S(&W)JZN4#'B-$WN"P)EZU%:7!\\_ -MG(CG+4Z09+L97)['"&1WNL:^#0DW7G*"RRF!3,OP,:)>2;LNA)RV"3ZU,^R* -M4.IG6(!CK#(+B8.'T2_W^NROX2A*1LH=*[VT&VU\\HRN/SG/#=KGH['/O<.# -M:MD,GO^/']`S!X]Q"]Y&MNP8FX^)U,5ME6[+T>)FM#Q2_S3_%VXB)5LUEX -M>+7;'D@[U-(:=6'&SD-&)[Z=DZAX<8/0;,9:/#^/J'9@J"U5#Z%&CSR(T0)V -MS.Y84,1>/W<3VO2T.].F:1;VG!XQH@Z)_,\(KV&\\PX%;;=Y/2.8S_ZS4_/=LX2 -MVN:NW,>H7RAPLCFW?KW"Q0#G0^A/!= -MP<([\FPL?J-D>"ZJB[,K_26\6@VQVD7L_`CR2IQ76S4JX\.6S6#&)2VE,7G+ -M3%:>?-AUK$ZV[*N&],3ZW.J+FV#:*#KV,^YD]6>2I*C$JJL2\7L&MZ:5Y\?> -MFZC=+!FI!PQTM68V@V7$888RN<*)`:TP=[R\]U$&_C;4F:,-':'75;7BZ?)[ -M:->K&P^#J_ZP.M(R$//!/IKX:D:#WJ/O*#T_!J)VF3#.,JZ\9GIRTY"\23IL -M[7GQWV+W#DZXJ?S*:M^Z^94<4.IJO:%]CN=[Q=&N1;J5O3Q6`BS@%]",K!&? -M;D]5YWW9KDY8FPV5)@E1M^=X="Z=95@N+B?B8A2[V.&;T3V!F^:R\7J"K&^5 -M>B4GI=!W*.@Q0$I:WC\K%/[R=-92FE"N;C72E0_U$DRCA%.MAXU7G#%G=*5W -MI'''Q@<"!KUFH=&EX?'G-2+BX\H72GD2#6;J3 -M[M!IO)0^%X\.1R"A\;JB^=/["Q?9"(*5_A_;RO;D:8MIG2$S]>8SN=@NGQZ!RY9'U7`WG;M>";K1[:9B$VB\<#)XCYV; -M=D8C`ZWY0NRS5^#$]6^RGZ#%!X6[A\IPI9-IA:KV)FG'(/%)6F0^4=H#ORE_ -M*0>K[,L;Z_OVL8YXT+^_I!BDS)"A]8R=)C$#HPW9[!%AT8K$*`W/?%^($=7/ -M/-ZT&8!)T'',A*Z_B'#V'B]3DQ^DB%LP^Q@P=[K[VNN&\-&V'3QK#)OQF7R\ -MFB_T=B?K>K6-_0.T;6*KK4E4X#0C.>C4:EL'),%X?6]^.;BY*,:3(RVI;K0V -MI[FDQ7J;,?GN#^M[3F%'KBU\L#)1LG0X1[*W:)RE3#6CW,.?@//J)#2\"S.7 -M\V1XS`6JQ\L>$'K==I'+F\KS.N7_RHPC6R$*9!3;CI.^%Q=1UM%9F-Q?P-S> -M(&DQZ8'4\=.>PAJ9Y&'[81 -MBU!XS]NLQK6PEH;8R@A[%F-;+C15JNUH\4:WSVWW3D58ZQC'T*'*;JUU&XJ] -M#N=&QG:27'&21/0F)\3F"IFV').61IE7[!M*A;^'0B$[B$\*?;3:B4PT!,MM -MV]HA%3>-R?[A1Y@YT&.I$4SEF+:OI;\2-Z= -ML]CLQ!48G=#\+[HFA=8$Z`M'\!.(#Y[H%J!SPR$VV6OSF^<;N#%^;%&+/.9X -M<1/#3.YW.`TMZ^`)[L%G??@EE0P*+I1[JR1HX-+>6VK/.YF!JF1=*7EX2< -M&\7:DPEVSXTW??#PV/G7),\&,=;;=K]5#?].'AT6,RM<:`P/@U)IC%WH198Q -MC8S]Z`=Z<\:7=5](-56M?`RKAS^Z6_U>.S9=BA> -M)FZ)9&HQ^$]0W`M`C@`MH[9.[]RRC`@'1U3UI.T)PQ?1`T>:%K'RVC:S61OF -M96XXV.DU^PY,-S60)MG3"YC3OQ1/0^5!`.$YAEIHL@@R(=G'A:'QT<;8&&6B0)61_[4IJ!K'%5).TB*[WJ(['O&K_"$ -MP$-C#YE/FZP?AHLWGK#.ZO)7=WF;NSUC]+%,.U^W9IENONCJG0L,UFK*QS+I -M%S&LUI;]C3FAE2]T<$T!A,?%YRAGK\H[/*_Q)?;TJN)Q11Z^0ZXM@CO`,Q7B1->Q(S2S3NE6Q,$\^N-[]M -M1#Z^YM_X?!J&J"7*?,7LP:X$1;"MH6LVCJPR95[HKIT&G2N8VCU_J>[:,:=I -MJ#/6K>VTNSHABWO(Z7/Y-";,/35L^NXO69)D49Q#L]CE5QHC(,4+Q,T.9E6@ -M:5,#D!PM!]1[$]'\A\OH^![X>_)[X(P_1H3YA^>2:6T0BP#\<`OX=I&,1(?2 -ML7WQ4]NC\&D])_,[`,]4^F]_R_(,!I-!(`.QYJ5Y<\^:0[1&>5F:=3<86763 -M!N/,2PEV>JAC'AO9<=`8_-=]Z#%(C&5/W9CQ+BE0`- -M.9S0/H5)3M.4S:$9%/._OL]QH;?'^,3RS')<,<\?MF9[#C7.+@:5Z]ZEO,KR -ME&C4<'I%0M]O&,0GL[;V9P,XS?P2[@;&REA!(_8PSB01DFHU7")L([$DQ&<\`-5A(EH'/YZ& -M=,[$\]=\SCN#4*CN^;=T#K3V883?\TMN,R.2\4'>;]@ZS_72Y[?)_"W>'L7< -M6S9N9LKFPQX5>+Q[H."G=U6,'0O>D]RQTDUN/$"'[M9/W[T+`N8A!'?APTSB -MUX-PK>+,MGQ&37<+7?8)Z6O:AA4LBV5&3&998%K7DR'LO32L%#.]P:9?V-WN -M5F"FOXC?#\V_(()7\#XSU)[\7J,M%BE,%9#(/;5&H!5ML6(*M/+*UHXU]<#U(GFTE* -MIAIAV7%BBJF6EJ'QU#M"4C4X343C7D\K6(DS]"^KIX/PIJ;[N]&0_;AO"[MW -M1YGT_YZW*_/\5:_R -M@.?#1+X.-.[U4RU-((0^J_)?%17?S*GO@H5/`-LFI3L]0&&\"&M>> -MK3+DQ&F*>4+\=]-4F,H*JJJBEFR,^VJH-*J&VQ55U?=10H7!N*"'0$E,@8?D -M0<]8&>G6D=/Z?+9K_1DT?J-A(F!@1WXT)R4QD1AT^U7G946<)I]*P]2=QG[4 -M?J*3?,"%^*QR;#>]SV6%A?:S4VEMRJA.W1CV!+^`G?']ZBKBM1MXM7@4U,X7 -M^:-=#C%L<>8VH1\Y*&+2%M12J_`ALFD'S9_^S,=]FY3N?\74R_+_6+D#0K`- -MT996(1ZC!"&>_NE(M;>W#?"*WR<\F;P<:,$==RB8?65C6S-",BY")BF^G<*: -M^01=&:?=^"];C^^CO_V)=K"JHI^[6K87'QF7-<+]9E -MCXU-JIP89K=QN6ZV+HZJ_%\\^ZQ7M^RFI@CRYG!])\`F+C>`TK]HQSK*WYW_ -M>S(4V@?L.P5IF"2+BJF^D/-8"SE.1BXW,+[-XL."9%:OKI%"RDF>VR>>GEH; -MJ-?AXUC\+B)TS7N7IZ#^P-1^*8PYL\([&0QD6L0FR7W80IY-&(ZM/`O,#(,4 -M6$\C/6FHI[\5ZAU=1J\#V.K?;26[DZ>H3IZAJEA3*FI@(S%>X"@T/W6W\/55 -M`'U`*B3[R1_OYH+QC?'/MQM2M -MQ]E>Y&()C1, -M\JZ-O^KYF1&Y,L$N+Z-X3L\`PK+H\0ZT.LH>'D]K/._PL&MQ<:^N;K`\:%B# -MTD?I(+1L#TB/'3T_.P$4R3L[AY8GZWWZ50??!-3]]JQ`@BB;PX*,5L-A_:I(TIALLN=V?KPE63I3Z#68#WDT#*0 -M""I&=IDJE4$?6:_-4$-UWUDY -M*LR^RI'^7TO'-RPH'381J9M:5V>Z9<8O,$<U!QB!YP79`\>/!3-*Q(*#Z09/T@DE/A&J@HD#Z26L< -MOI9`2@,:;2Y+2P6<1@FE7QM7:*,N'"&"P:9@Y8N_>Y[!6`,1X6X5Z>`?TE3R -MY1ZJN(Y7N3UKJF)57>OWMAGD^E4O_?+VRJ+/(,4H!@;)1&PSZRR(6S4(/UPV -M;NN+-;=)77]FW -M85FS>;!F.S)_5")LW'2CW'RZ+IT="*+5:Z.N.'/D1=]'H;B2'AN<37AXKL+T*Z_9KOR7,/I=-+1_+?NCBO&6NVI^-ITR6QVBZC:97@K&2^6_JV -MF(2A@,"Q3<7%_SXJ]:P2%4H0:7CG#')";RDM,^?+9U3#21D':*7=*RJD5"M# -MDON*3<,;#HE^;A9%@<$+2BA7Q_=E_-IH9B+CM%)'22X<(N=-F[]F?L[WOYX^ -MO?%_!^NE$>+PX_@TQ)T?7#W1=_=&I%:&,*DV$-(EQ.[TY7,RU-I&A+".'68<*R6U[G4 -M:5"4/:5=4B@_RNQWM>EV[4%*:3QRUOC+JW@I=MUU#N,:Q'I/Q/FNY@-'+Q_8 -MR6*,8YE^C@U[.O5SL)H='FT^/@HDZ,USGWLF+\^GYGM-#M&W)Y/:@;7M)W/) -M\EH6.PR'"TEJ\TE>8J,\T6"*(0L`QD/,0Q@8XX1YB!HX""!C0XCK0TJ\ON9Y -M\5(R-SU;YR3\Q]Y$JLKBM(_QAL[!@JXPGA2V[E=JERN_#Q'E;N+I]?/:]@6% -MAA1K*L;7+:TJ/M^##4LS[3&8#C4S\$V'J/!ZMGJLQO%\LE/<^6:M2?+JHHA/ -M?6UBQM&TG,"'$F`@EJ)MH;$_K-Y9]34,[\_V#^#G9M7H$N;ZVK=M6JKM3YJO -M!K?P@3RYE3#I+LIJ?3:K9]?8+;UL&UG%32(SZRQ'VE7_&3LJO -M]_Q^4\@4UA'UVW>L;TP*ZNKJR\KZC3+J1_7%PT^@K>'[+8F1;+%/4TVS'*LPR@H4,,L,PQCU0 -M/[63`H)YB@X!.SR@X!/3S+F=\.DWUABBNIU7.WE`4%W[QV(N_'T>2R*0?+4Q -M7AB5@(3UN?\ND$VJ3-H[MZS.LJ_^_[P#2N+JU[UI>>.N%5@A&1?782V0H>K\ -M[?:VO.OZS7J>I.KO+/30Z83I#NT5"=,!G2T+(`J`&(Q`!`1\!Z3!,8)CB/GP -M>ERR"9^?CGUN?*E\M#JG.R/YK_^4Y6WWV[5I+[QQF6NE&L07E;V/:A-($MF3 -M9[U)?V,DI+">K(3JDLIZB;Z0;YC&2-\$D)54AWP[]5$12!1$8I#OC&3X0=^3UCUL4UC;:C\Y,UE'G^ -MKGAV>S_PO?Q#-AO2[I3XQ__(=FP6?24:T(+8Y8(?"E)E:J*2@E*6=HR<[Z]C -M@]B/I0EK2Q19]?G:7RMI;7WAKMKLMA/OU>)K<>WYZD26[Z5M"]ZLHGC[_'QA -MY7:SZEFD_7S'S/BHNK*)5\?HYVAT>?XGC^1T?'[?17R-3'[O%6R`^3"-A,1B -M<@[LR=,[IQ5(^<"AH0\X$D>>!\^M:)="><^[/J8.=0Z#OL[N-4'2UY7;2)_: -MXWALJV0D`I0N^IUIW;-EI104$;71QVZ.34/"R'/J]-R.!94"2UYVVQ:'*;-,?2HT"5(>+SNAT/%Y_/. -MAT?]W.^?^J1]UZM[%B/44&QH$D8PY^/$C$F!\9WZQ#2$,5$@;!G9:T9"'H39 -MKOQ&0F,`F0B#)GF6XS^?]^^^59,<^4OO!UJ+GN_??DI,1+/0$:84$A`C.(D1 -M])26$[,^I]H^]>UR>;S3FY:.:C<:>8.8YN8G-(C!!('(![D&665K,E#220ON -M20_(`]S,Q/<`Z.X=CHX6P?%YX#OPLAJZ;.JM\?K*C3FU3W90Z58.0*7O4S*Z -M155T:O9/+-$/7D:GH6,.,,=]\)BAB/$Q0$V)H`03H8Q,"$(3,W>!)44#WMY\ -MPS%\^N]-FR'8?,_6?XV?Q9];Y!YOK<>LX$LX,YI#3_JX_^6)E.0AADV+C"-QT$ -M%OWF[P_3;0AL^+S. -M=[:MM[;<\+(K+6K*+53L[0$DDF"TP)`-@!B1233`1DS(LTG!14X(:=(L:SD( -M?@UOHG!'#1X":+-3?:_.8/5R>NIH3FM`CZB0R)--34;-"M#8X'!P;VV:R*A>@297S%1F!T4'F^"[C#R7W67;^\U\' -M^[_&=_]I^A_Y_V]G\WYW,SL^'@^=X;_VY:*BAKEEV03E0E2G3.#4C"$0E>0, -M30/,:/;UH-49*'B6CQ2E4F20;0]DL[:VW>VK1R6_?W-S[#_/K?@^1G?1T/MS -M0S_QO4S]@RJK+GZ)G,UK-3,BS@EJRM*'882TFTE(@R`[,A,%10AT/2FJI"F?9,_R_V!^Z-#SNU;^#[K*^)]E(N7B_X\"\7AKI -M>82&+PD-:S**:$.T*I8A3M&[;"(UCBA$AMQX`-%K+87$T/4R=]RCY-9A8W-( -MV^C..RYZNN43Z_P9HFJ+V?9B/@.SCG)X\.08E!R62-2,+,%`'GS_*R<]J(99 -M5*A0+D(SQ9AXU/5]5/6/'W_F?+_*_TN?]OKD/Q>E9SXWKBYL'9@O(/UG[ -MWJZS:-JYH.%LR6[0K;F>]M"4>.@]H?'X]:-9B&EO'K0&#!-`'Q%/#!P:VQ;: -MU;!%NVXY;A;A`M'@J%U;]^^7;PK8@5ZZG -M"\$"XBXAQKS`D$$Y6IZ+9L$(`BI4\H>5HI/+W';YO;_5GZWU]SXGW3IM6BV. -MA+X7,+JEAM>S%,+T#>J\ZJ(6`&"(K)#8DET*5D*EJHN@)@S%6'@LB<=Q-CV< -M9O[_\C?^M_@]A_DD(;W^'EX/3+=NWAJZ:LEE#52R+F9JHB!D!F(1@,51DF89 -ML*4$"@6`YE.:"0H0,O7,O7];OGP^Q8AN]3\DG.665-)DER23*"":#"&F=W:6 -M9IG=,.S$%E)MQ'@B:@RUC@!P'4AA4+A/#.@PY,3.+'!G,A`X:)Z.W1_:R?6^ -M/A^B.\.YAZ6&S245550/%G+'Q&.O$\XYQ)XEU?'UB!H#Q892FQ!*HA:#25(9 -M994J;^4XS)JIQYZ.[I/-JU>;L>F&3\;\3?7YKKQ/+U![MXNW++%PMW&>Y`0D -M)!<&=!:@SS41IV+0#L`+%).I(,0FD>P2LLV.>71:6I^AJB_![$F:+J]7:CDC -MD(H1R00.!([C.,))),&Y&J:!W`[H##+%<-UE,IC[EFM0$VI+"P:DPIG1@^T^ -MJ\=R.WL7$;"'!Y%$.I"*1VDGA_`?SFLUFSPKM3T-FD*@H;(4RA(;,#9 -M84BR%2,8I#9BJ39V:H*ZLX=DV=7PML>]_*YO1[1MF_A-S?Q*)B"K,8.+02B& -M+`&&*2HPE28I!I#%PQ5%](ZVBX7T3W#7WT^O^G^57L:].E*HY]O/ESNWFC'GS(RH<1H38!0$U`:8$I@FD<&=F+A5A,@8K1,AV+1%0AP:`Z%,#S -M7Y^ILH2HZB]QP^'\CR^]DEEDRS#K*G>>>=W=)IB8.`L,+P%FS,%X)$02/!R$ -MWE,PDTS2J9H;%81BG6OS=[?HW_.ZVK_6_\^O^5N^'=N]E];=WGV%>O":[2CR -M%>[=N)VAVE4O:">50F![4.-0:UA2NA[2(\C)'E[=9VGSK+#R'D\??]#P]_A] -M<0JB;8[=1FW!2;<@]5H#;(BC(;9%),=)CVZ`6>[MTNDZQ:*-%\0ZV3!?KOL' -MA[511Q6)&D,W1N#<;@I-U!1&W`=R153,4)B,SMC)3"D[-V9MUV'I]C[;[GN[ -M>GU_#AY'1FM:RCIZ;,/7Z8]>RI.D=`TA$"=*!0$2'3`DI3EC"=(=,Y4A@69E -M#;-S*80X(0ROV,]T@I0%F>8A\4^/['C\?UWQOOA\TX3J^=[GFR\<1XR]JS/' -MX\#Q^,\9XPU/V?C1R#QK3*2%B2S(:IJ2A)0"PU!JRF@\/9[>YMG5V?0*.J=4 -M39LU):+$9U06*;+5JD+2'50*!"&R0LBQHJ`5#9#9.(VN'A-.K5Y/KNYZ_Q#B -M_2?*]ST]I],XG&X''3@8\`<4XV;,30IQ6XXG&<4I]_,B!T''#%X\L -MG8-%#, -M:@?M$*-XN\"MX5O-V_?1ORW-JC[>'CO?28:=GOTWRNGVCZ6'T/5_#'R#L]CU?-/0:=QXG=F9NL@S=E@1 -MNS*#!;=@;A"J0P'=A@.)MW;C=J/B;MQN\7Z'T;SD-LW-L]_[C-@))YLF/+A$ -M*IREZ2D8B9A)(&I9AY`PD>:ERQ.99''2<9V!SN9AT'/P5R-\S9I9M2_$2)F% -MK(&1?4HI94AB6M(]\FDFA`F8UF.Q`B.!(PL0)P#=..L`X-$H::99XXTPE*3% -MZ_1J4G7U*L'=>UP8.N<%JBIBJ:A4.J'4/%"8#D)L@,I@I`Y#J=1J$*`2H"BA -MWH>!0034$RG)YY\M&KAK82(B%$6[DD,PW1%!NC]%%$=QV=D9G9J.S69V)V02G -ML&8)V`'7&0.)%I`-B7T6M*L+IOIT\^[W<,*VC:-J;2S:-H-DE#0GA$I\,F$# -M@>&$PDJE?CU[.SQ:K_3W^K\7)9[^SLFRK(6=NFI% -M44,I,D!@9-"LA1!9,F%,A02DPE\04AS&(.>S6/,\3WYZ.'?]C^5ZNF/>ZNH[ -MO27P1=YV=C2=G9F8TT=@/7AB!@!V9@&(TP10GL#[$=CAWSE[!EHVY>?WN_M\ -MW[?HHI34SO0]`4!0[NT[!0AJ&9D@*&`2!J&)T,)4.BB>=(WM -MC"074X>#'P1UU%%%?C:-1D<84FU`B#9`[5:VP$@;8)R"MI''?@)G:33:27@E -M,V*PF':/:[7F'5-_?V+$S[CS\.!Y_B5QQN/"XV&5)Q7A. -MR'B)PCC:8#H1JD8B,P324)QJ@Z*'C<>.LM;?Z'K'9[_/HT:+F*7:I#$PPHQM -M:J7"JA6%J,4(=63B/7!Z\]$;"I=B4]<&69@F`QG)TP5S2KK2R"LY2)6MK(?5 -M_`^%>EEM)I`DM(BE4JU!@&\[)#?&R'!**!6(7>"1B<8K`)DS2!+*[I,X26I2 -M5\`1YD2/U+>\<9=TWS;XLP-#H=`:`T(H"30P*40E%TFBIT2!@FNC,M5`8!9A -MG98Y=F7EA@THPCC2+I<-N]-BFVR;S_!W35*2B_1?TPI*54D.U"(XWB?$63B> -M*;,4P79(85`&(9#5!4BM!V(#4U.R9W03U4E)=IH[L_8KV+$5?%&8B!M#;Z^W -M&-N&+B-#M!:3:!6V*`(0D@SW42(V=KHDT1BED5V]!Y9I;LO%K<&_RX<.'-BS -M7;A=OJO-Z#ROC\KY4P"E\H^2!\MJ!Q/+)080F+,)L"O+EF$'EC3E'E\KY#T= -MN9XO%\O^/EC[IEUY"6/3FU-6,9HV&2`C9@2",8C3,($(-4&@N8'$>7L[7QO@ -M_!,WT,PS.JKF%06/H5*51(;,$8L1`L0ALDV4A20J.=0&;5JA0YT[66YGT8_> -M>UOF]OX8"WQ,;8VCB@ABLK9B'6E!U%UFL`-*Z)"=1T]4#MO"?O]S-KZNOB>FJFI%105"35`5#,Z!U0,B3*JIA%("`LG`JAP91][FYRW+N]PJ&R/W?N7?ZURY[OO79['RH._;M-M-=^6$;B(W.Z('=F#@!NS!,$HW5& -M29FW6C=`6XV?)WWHST7HS@=]&7.0YR'?W?#^IWO1M'+M7,=TLU6K>\D0$BV[ -MN6RVG3.>.D]KQZT&*Y!H#4^.1E/'!E11@!;3""TK:<=EC+@0>FYM4[NWL<(D -M19(H\.31EHPW&49CB[LQ<4H=PKN1R-VL!V2$FD2"0C"/$^.52CUL9R -M[\K\,_6V?8_A>7O;V"S9JWH6L].DJ.FDTR:4C!RHI-(&ED$!=A"4,"@AI0I) -M41%)IFEJJB+F<>>FDK/O>KZ?XO9YSW._.PW[]V[:;C=6Z"MSNB$-UNLD)"W8 -M@Z&D<2C<5N*=V;MV[N+=N[[W#O\_VWU?>UM8GIN[\**A5((D544,E0P]#IFH -M3"$:"!V8H#("S$<4Y60YPUF$$5'(Y&XWW:M^4XNL;'6S38,2DCEDDP2X1Y@4 -MT$TR$,3`),PTJE`G`:2DWA54[^&_/: -MM6IRW&_VN'M7O9GO\MG+T_8^GS\F_LH[#KZNO'*,&"NO,#$ZX**`E.N,D<%R -M7J'KDEZ]=.!U7P&CKT;5O9ZZ-$]/U]?P]8O2<1=DT[UYDB<=VG@B<0F2)F%) -MQAD*WYB&"4<;(,`B.)7;QCB4+65+TE_4LC\'A]SI7C(\=C1B'B,Z#Q$0T2<0 -M:#,R3J"%>P"D*0[$J@["*@[-=G1I"KZ)?1QUTFHTXZ#&[>U2K4 -M5+X5)0*"DPD610+`7O04142I=ED*+E8E#A=J] -M%WM%5O*&\19L4J@:0W4FV+,B1P3LW80&62XD1HD'=/&\CH)&DP/>O]G?J]?3 -M.#M12J5WE4I(T$ -MO+9Q=_:DX)!0;HJ<7/B=Z7SJ$J!S$4I@1R`.8%`IEX*;$:45@PQ1HVL]EAM%ITE+MC)'$*:-LA(I! -M&$8J[@\<5:Q'A>0>&O'N'F:NJ2;UV]J6DIQ5^J9(M..,C:.*-1NXY&$8Q2;5VSDY#`4+0F -MU`VP$!V"2C:VA*,MRJ.0P+=VL1W.6V1S3#S2RRJ4E4J3L*44YF.^2#?8VZ34 -M4++0IO"ET--.\WY8;H,WQ&ZV:]K*+A=![A[GCW?H.X][?>7K+MRXL,2XQ27( -MI%"%X"S%"Y%`4H0$)A>(+-P,>IJV^+7PGNGI]WDT7Y#DU<0\1Y3><.#OUAPW -M[*.`.`7#!]B5P%RR0Q8F3,E,X"9Y(3#JZ.IT(U\E*>Q`""`0,ZL/7.EB1?.EPYN+E+N_?[=Z]=)&E=Y -M;LG!X!PF#?OA#A++5)9B2IOA.`-2;\ZRQ0X3A/2[7A[S[>[X^4W>7><9BF+4 -M*Q#:MA:K$ZHZNO#0FO!K2NA"ET]5UR%`0U#&6F-<5!Q:#I$Z=WR^#OZL,W3A -M>Y>]ZHPJ@L799DHEV2#)%4;T>YR=RO/K0:S;ZVX< -M/%A2XTN.*8T&&-+#B=<9+@-'39`/6!J,@ZR$^U,S!:$H92D-0TLE'L!Z -MQ>MAJU)H(GUHD*%]8;9A\>U(&"GK#]F'K7K?:>MF9LQS#CQFPDEB.SAQ=KN; -MG%:M;F6Y;MA;II*6HH=J0$F'8I=V'&&*6!T,%*I!TU%-%-%#VF@$*JLK(JX> -MWR=B68FPSF&4$)*4G@Y,$PD$KIQD!,[H09`P$0+P1VPO`'@[,,.#T.\X%;22 -M7J[F%^0V_*E+$A'(6[DI+,TR221+,FE0$PR3$TP!2;YV0ZAQ#A-#&RM_#,R# -MR<=W#P[W6Y.R8F[C>L+LNWBW-QN1$EV,(WJ`A%D-@A>&+3>FE"]38*B51@'! -MCP8+PZ/#V.]YVOU>3DQ;>9[-ZBFJF#JH2*G14DJL^`[-4[L5)F@TR01L,819 -M"DC)E5`B!9(6)E64&$!`J80@NWK5IK0M;6N'%FB]MHM?B?I5])AW=QM&8>KI -MP<0H0^R"BCJ"Z>AUU9!J;/7^3TFP[AXCU.][7LNG2XUS&6C/&KV-CIS:O'[7'R<$\'!6OO^IISSZAQ -M]=R3(TLV(4AF&8"A,LZC+KV<0-@&0%`0>S,>SD'H[\##9KQZPU.KTLWIU:N] -MO[VO=Q*;IHN8J"PN!BA+)+DLP62)%-BJEF2\4QO+U11>]ZKJ8%SBUE^V>CV^ -MO?%QV\<>O2I4O30,<;V$)/.)"S")%DNQ:8%03:HC%+MS%P/1-M];GU\_N?=O -MI?)[?+]N.GEZ3@/!EGEV3,SS0SI,Z0I4S'IRST^]/5R\WAZ?2WC#6G5O,;I,1;-K0HA=NEF%D$A9DB!YU4I* -M%A<,871V+6O>[YV/%K^&?/_'[^G/+`PF$<4*(F-1),80Q0$`PM03%DL%("D2 -M8CAMEDW*J8XY<"Y2]]'9[7E^Y]S@WNX]SSAY_E<3E%RM-N\/3Y>I8-+1TC2$C11I#LD-I)+IM2FE>HLE3`(NDFD -MDHI.ANDH3!:VZW-O2,CM7<[?O=WE\L\E^SK;INO4561:]H. -M--.K5*SU1-0B:5`U*$4U)$FG502U.,(&@F$R06W1;M,ZP-KW,2(/6850&20<6RY'+9OX% -MW\.[._O*39R]/(9.UYOKU&GO;.S/+.\Z<<@E.)A,$Z9(81"R'&$9#C+D&)OB -M/?LGB\BX]%=V'9 -MDA)IYT(E,I)+,^7?Y>2[VXRN:1L5_=S6:?-GL9V-LS9&P'LF0NLUFA.Q#80& -M1*`NAH2%$4-"6==]!KW9T;V]T6X^@[AXGA-/3;3=V/7M=VLPW6X#H1W9C0%! -MB[BS=FY=34ZG4-4LX5EGIJLC-3,, -MZI2I)FD9#-(1A'@SL2E#.G'=#50(/!D69Z<.&K!O:I:Y)Y8XT16(E@>.-HU# -MMU@8.W;CJ-2]$CB)L@90VPP;5&F<3)\`21R.\F"(\/L6-B+>NO%92C(FC0B- -M((FZMNI=ILP3%-L(2!2&V!A?!F68B8TG=HV2(V49''H&1HZM:6S[SYE_!EQ9 -MB\KVQ*TJ!22N6(;Y,C!-X1OEP`S,6AR&@88)20)22,5C8BZ]:O>KV+%LM -MW'N$5B)E!X*P,Q8$ZO8]CLV"FAU(RQ;'LUFK3V9KQ^38;KQ^2.'!>[W_-\KI -MW[F.Z,N7#07`T--:**)*A-"+`$#&J4"F1DO12E!L-F:#`QNZ+%%]C1K5L^!B -M.38WEZ_ON]Z/GO/ZG:S;FYL[ES*9+H[O=+MVZ@97+KH,'QR0ODO+(4LIY81A -MU&&8$4>5"9U=:RPKCJU;M]-]DW;TDLFL9IL>:AZTY.MBB`XZH;D\GE$W)Y1` -M3R6!*Y%;7I=3KWJY=(BS:%(6;1-*TS5G9PD4Q -M!5H,X;))3?(4,!NM^8#(4#2&+OG$2J`SDC8732P@^&3"_%-Q=[W$]<.D:)HM -MHH0:+,:)*R'3(9#B'3"$O2GM)TDW5F=/KGAZ?:T'PZ6[BR9-6HJ:J-Q$1%&X -M[$97K0:`"591IDS1K*@<1VUF/L2AH#XL?%@,#;09S#=""NTBYKJ-Z:V"MPQ& -M]O6]0L11#Q(2NMHM$D$:9$8&ZD4!@*!NDEV$$#=9NL*8D-TW1&;NDOEUST=> -MX;2FV[4V6SM(J6VD&*;0&T)3(5`#902;(@A6U0L-FIM*;4KK:LY]&A$M[M9. -MQU/6Z??\GP>AEWZ>79M6K]J^)%M[5M-2BV-;9.G":8A%!A-40+,*"=29I$>I -M1J.!S-1J-<=8-A;'?-3NYI8S(5Y(FBC=AVC0FC`KI(83,[9R3HDU#"[0S$`P -M=GD)C?/`<)WQB/ -M`E"`T30,!P(,G@F:#.[RIB#30K.#LE-=N2%R@GVJ?7W\9TM)%P\?2'0=2'5& -MR-0Z'J"&1V0E)#U&8N2P@TDYI#FD8:XA>/O^Z]YV>3O[&S@X2XKUV%X=%UY& -MEEK6H-6\B"MY$AO@LUOV!L##AT7ICM?-K -MJ0()SBPWRK"C?/`4%_S-2FE3$LSN[*4F@F:-3(0VL*-D;5=Q`=&L4-">`LER -M$@=\P*5#(E2$I3`387=R,DCDPMYO&W7.P98R3+>DD16XRK<;G=MQU.D-T&2X -MH4[(6`(02$2DA)6@[OW)'7"OI.]<"#U=>)#C-($-' -MQH!A>N:2E)-%)W*Z"%=W:"1!(M6[<Y#DG.'+6LUNN4ZU02"ZXBJ"CY@FC+S0Z$,)-0Y+`'FD)\V92FLUJ<.OL' -MGZ\O;W>,\7:[FY?$QQQIF`LQIH2&*,2#)Z#%BA$)3),8&*.PF)CA,3`R6!TG -M?6T\AC@NW,Y>2X\^9AF6%+R -M8"$YSSD.4II71%`LO.B6'EG1HV0;-5S/0'EO0>^?H^]N]OHY./T=\IPQ2Z71 -M,=BB\ED278%"2B1$)C)<8L(R&-5+B4R47"_43CJY3=8'OZV;'P][T?4]3V-[ -M?T\<^/&U.)Z1ZG!-4#U.PBH"IE(P,A@)#)%)3(5"9"(U14C,N"IE:THR%4[O -M@^%VL=''HQ,3%QQQG->K72T+K5AL4+:`WIH:`2%UC)&!=A%(D+HI!`NA25+H -MP2]`\VM->LX=?I^GX?:Z.CWO[V;OT]+;-G%CVML@/=K.[7;;%UU=>Z7;HURZ -M"2'=V+KXX!Y925\L'VLC`%+28/EK,*P+B=0NU@NM=%L[5O3O*Z=;COKDS=VXAQJI@>)-`P(;UXYB&+Q>)QH]^"8G((U#9U#'U>M%BCQ0>*.,2L!%$XXS. -MS$43.DDPR8&<&$$-`D2*:$B;DT=GLF'P^/#V/,?<##`<,\7$QF>/4L6ES8D+ -ME502ZL(D"XJ0$A+@6$R$]F%@B51&T:(JI.KK]O\[S?>[GO:V;=TZJ=RBEJ6I -MH#EPUSV#L4YP%+*=%1$#('T^Q[ -M[T3;-AF*N:JD#/1`R`RF2Y5*A41F0Q@*"PR@+UTDR(4,4`23@.YG0AT63,TN -M?K<_1US]__O?7[5KXW/2-$T:)?1!00#0*D$DT(BB`P*ZB2(.SH9!$-62KQ.A -M%@Y%CBWCN8ML_E%KM]HY/T7RS/5YO5SN8#F_.W<):X:SVNYQ']XYEOO]4[-K8M54U,J2@*$U+` -M[)W&*44ZS"@)3G$0)"SQ\9Q>E^/II>3'&-DCTW1 -M*2A*DTJ$U9$H[EWQ2$`6_'(`P4W5OL6MELM!6R.XY#'D%,1[6/3VIINM\'M5 -M_PSSO<9#U=,T[74JM<\M-:69T)O&'M>T.>UEK,B!,CVB$H2!*4>:%I#(!U:+ -M6FF?4+E8S0<@)75;3U/4X>=UBH\&>?!DY=O/(>O#@!F3*`,F#"<" -M*!P6HI(%B!DL6,A$DL'`!E5%&67`=O-[QWN?7Z=[P_;'^MUR>?J4ST\F["BR -MZJ*K)G)&JK3LK36F23)K0!>T>UFM0L)HD-D!@'M&S$P/:G),]I&:1TG`?\B_ -M#?AG?^)NUO&]NM;SO;"7EZ2]Z2E%Q"7&"D$DO54R*`P+F#0*1DJ#N5Q)J]^Q -M=MG>][H'9Y9HIGZQ8W(BU%;MRRC2LTHA,2DDANB(20W;\I&`RI"6\>'`Q-I? -M%G)X(2XTA(*6_N;9M'5ZF_A]+V7O7Y9>;(T1&A$9&-'$XSC1IEE#1$04%*0O8 -M42$.V2VE$3*)U&W34FOP%92S;$^*CZ7USR.O\/L[7?T-G0VGWQ<4,HFI%@D.(03B8AQ4TJ'$CPTG8.QPZ?C?E3Z -M_ZDNSY_NFT]W;V.LVEM3LVA=ED&MJ[&0A=I020#M*)2E@=M[$N;8C069M#Y& -M2>.+36,\SX7F:_K=7R]AZ_JUO>OW.(ZGJ\5;X6Y#F&VC*9S(ZDT,H4F_O`-]V11)-$9`9"XBA$DT#'0,.6"P6$E8;>-D7)ZLG!*?5 -M^ELEGW?Z8K?[\_ZG#!<4%]QMYOX/1[//Q>0UTZYQ=R+PZ]8:Y#7$@L!8)#7$ -M#4&*^:(BD(1\R^;Y.:\&!I-AGF\W=LSY/G7'R6S!/*R]48IY8@A(3R20'ELC@9L;FX- -MP@QBH."A#CA!P2@1<)"RASENG2ON,!Q^AC(3W8&4A)^C//5EF,7M?:O/[LA\'@X.PFE2)=^932\V8'9E,Z9/F$?'D@#@Q10[)3%=Q&0F -M(%!,)G0.$Q,!O%A1R2%.WV.WER_47+!Q,BB>1WGH>>M8<]G/[CT'V_MF?/_4_OOW -M-]?/IY;MWR'>;]YO@S`WVYH#%=VLP8)`MV4TY(&#^/.ZU#O#1OMYM=>_PK>3 -M9%V3WZJF/M38F1(&9F/(PT6K9 -M)B&^Z(AY&N,4)$*U:?L^8N9O]R[Q=?M<>UMP16(GW6>/64 -MD<4@%4RNZAIDD:-U5&Z,7"6`D@FL($TC.[B3<+1+6#64%8DUMZ7XWRN/ZAC_ -M$K<_P_4^SSGYO.SNO]-?`Y_0_2^S[[P:]YB_>:^=&Z%Y)7B\RO.DF9KB$DDP -M23AMQ!9CR4=2T*).H(`S64AQ37SO/SEG`N=WSVOP_R?E_,A?SOZ?TK3\S.K5 -MN9S.IZONKO`6^FBU::S9W!QVM%2;2V&B66`78(Y,"I`J(Q",CG0B9`64BET6 -M0LJH[9NEE[6;=?=6X=KZ'T^]_M\D]SUU6K>A>YF;WOK=IWYS>)\;>P>,K^ZV -M&_@;!A@-?AA0L,`%A3NS&%DWF@<0\]LUK12,)L)/^F<3O)([I[PPG*`!@XF< -MS1Z>;9,S80K*?Y?)8UO+]U$RJ:+E(3(>8J-34IAI2DT,QYI/-#2"9)#H@,L0 -M/$5XLR3KG$#X\)L_#L`$,%E`BR9\'++.GLAN)6FS=Z7TZJH?SOW'X7S?Q=WY -MSZ&A^9\W._7_CZ-;@YU;0S_O?D^)H>=P8/.;"8,`L`Q@#!:08`>"9BZ24A`U -MTRLAY6"?)%Y/+!Y?T?J^Z/5W9]S_&][DY?]O=M7.'YGC^+^)E)20T:)#MCUO -MD9*T<3I%Q<0XPH1N0C*3T2![:VHQ3VX38&;,]NT)D21('MQ1[>&4TDJY,FJ/->7D7W>;F^B\BOE>`<[A7LU:R[O3-Z-%FD!O#F#3?N4DWL -M0JZ`^J,SUO&)79@XJKDY*SC%!R<`Y.0/'9#C(=6"*,`XT4C).L"*?BF%=#25 -MMB+=S30?'OM3BO?&;,H21HTG? -M$1G,@XF%HZ1I^-,Z!U/68=XP^[!V,:9I*W[I17!U1X9;3JN9'Y+:%\/\R_HO -M6V(0SNAT.9G\_Q.=@PX7\3R/6.)L38C2383$R98G0"1B=#RG?+1DAB!WQ7?+ -MDC"&40R.9@1@H/@]3ZC[2E]54!ZE]50DC[_JS/PMFE1(48;;30PGE%%"=?@PM -MU%@L!DIJQ3WL457XVUUGV:DI])L.PU&12:I2OU)R>OT8WI4YZ1=G=X?9LDO: -MWJXXS#_;.O,:18>$*LMKB:##2S,:RLLZ$*3>R;?HYGMT:O[+;^!_$?@?.!@SLME -ME:CC/#<\M9AQXQAYCX7:BS?J7/[1,R^P0"7P3.74$F&AU.\M<_P/=&PX\V%` -MYY56;R<0JMXU;+X)%QH94;'PCA4ZRJ:V2P5]$RQ+`IL3E`LS9L7K'E,KM/E`XYY"\H\IOA -MI^$'X:\D`9.14$2A\,I(_>990,0$H86IP.,>YZCSRJ@E!E"A1M%#GH,P^<]- -M]^NQN\BMKF>GUEI]YOD86)25S9RJK%S]]QZ^\8/S(SZ;%)?18KRVTJ21A4V+ -MJ3/#.64OG;6!D9T3FW,AP\(L/3.FJNF -MQT_&882=#.R$;SM@)JU/XF.+LAP&^<&?5C']/!]`Q]5F/S_G^%;U2"//6FI= -M#TBXF\S%[9UTQCN>U*0A;_R9^71"DS$SD(<(DJ53_YF7O6*VNVWO64NMAL!X -M[:+60#:TH#[7UD>;K'@-RZLKRVA95MR:E^+S+,X$KM=,&=SQXV3'#Q#-MIG7$GW'@F@NLF<8WD&RX/!SK\IJ'WWP.8+S>P9G'0[LLWQ<]GA"YO)2,B@T5E";(XDXC@^W\"ZA4= -M_*FR5:S3UC)*'N@U5%T6]*Y/H#%Z,:I+C`SKBVRJ3$P\)5R4Y`[-Y;&40[&2 -M`Y>18#,NMB6,=V)9:&IN;$BRP!I6&`^=GE\?C/5\1X8=92'B62>PB,1!).YX -M*+,I4D80\]@@HA$D\#3*$9X/!/D8>'U_#ZGK^`G]MFI/PH]O1J*!E8>]MY7< -M^;?2L5JM%M$` -MUIEBVI5O;M'1<5M*DADH\GW+-6Q)65H:EL-+HE=FI?6`Y+OSQ[';Z_/S^][W -MO>3+M^,^K[)PP\3Y)-;Y!&/DZA`5&**+!)/(J)^QK]8DM`\"##V5#V3OD\IY -M?9]XXS9IBCHB/]AFKP>(]T-C#(>-V=_#^R6#U0QGO,XY7L:NK\>A2[;]5]LY -MK'%L-3RJD,OVP]$N+0/SYS)F6C[+_<;F)F56U)--:PZ34&O-:^WN#>QI,TNH -MW=68'!J:41\,+EQ=GR>3C\?C\6Z3PU7AW=@GL69&54HD\"(BD8$?G8?/B8*$ -MA;,^59#`8_//G:_WOH?0=G#Y_Y7SC]KF%:V!J#N#%!M6^I$,=U-[MJP_ZS)S -M;=M'2=Z(^+3P$_<&ZNP/4&\5F^)F<5]TY9Y\;!*(4T*9*F^O1,OO01REU(M; -MGD$-I4@P?"BC3T*HJ(QDE==T*6GF4_@+[&TL"H_Z9NG"=CD4S?1)Y0QWQ?$:2NUZA0+'[Q -M2WE,5H[QJ-SV#H0KK1I(_!U>5\PC6JA;Z:NONJ@HCNL31S5E.VK//!>S43^^ -MR:G/V=^_ENZ.YXVV48/&K_>GP^B&AKU=?L[:#L]ANR;-9,=E*6^['Q`!3SWS -M*/FJI!`*9OI0L(OF&#-@^<>[)W]R*"%.-(VF@DS6!X'OZ:_W%KHAB:OA969S -M43C,9<4%@/VOPR9?>0.73_BPZJ<*RU'6/5:.F6N`O^-2-5.QYYEKO0*M\U):WF"?[[.^=I&L+ZP)EMG? -MLWAK<7Q7#4M1#$_C^$CLMGO,T%^!SOL]Z3I_4WL._N^-9D-?>U]K`W[?ZQT] -MDN7/(/Y/N3TDN%JU@(>@_F'H+5@?-^L?5UAB'WTS40A]68AOWN9!3(E2-T1` -M1!"I!HN\!%(-D&,\/$&(C^O$&MD/M\4'X3XG_16SOGH`=);1T?75?BY]_:6& -M+FT%^Z7W?9-_TK0D!];^AB(/R$=CHKZG26/T]%JW+P:6,Y;4V!Z9H".;EJ:?'Z((@VO%,U>X;6FAG:!56R'M;Z-1.7$=[KMNMM?QEYO]G -M.23COHYBZ8K$`\0'9#&B?I%>6P.^/OR^;@&6D7/T631$10L+]]'U/O=:#IC! -M?D=&!F&5[MEY(Q-@_4_A,^'9L#'\/9GT#][F4@2E(Q^+B#_N+0>),Y^3&RNR -MTEOQ!36APMM+HG37+@P^']\4WP-Q\M3*\%<:K60_' -MX&92+LOS&'>.-V;AT>LW.$9O,.=#??D*RGB_/JMQLG+2YH[&A,/>+7Y1,[M9\0-6^1R -M=\<18SVQ_.37F&$E#9OEL-/`!-=-9Y@^,BLSX6C4\8*6:F5]6+LNCM*+4O5+ -M-!1;X2L+,S([83MX-/ORULE>KRMN+@'R;*MM*JM2LK,B%H1B,=K-(D".BJJ" -MA`2D2E"*D%D9"(A&)`60(L)!@?+3\:C_%6+*[-!@2?&)#(^/!$9!A^0_^-_+ -M)^0EM+4\/&_6S!O;;[7!WNN!>*/;%10]_#V'\1AW2D5J,2S/.;^=,.1A"W2E/8#J -MU<+M<9^A7F3E:$+HXG7J9#2=3J0LK^'$6[*5[%\W_37+S4\TGP7=4;)Q2G!4 -M[H:@D;6!MZYW)/:/N.CKS'X^3<0OU/H=FT.E(=!X[36&2D71[KW@7KJ!/U,/ -MH%%!+43UF'D/=5]8QF:7PH%;RM<'V#K5RA:>6RZ&MBF"J/QNAT-7CIJN.@+8 -MP=DP8+AH8QF@,[57.7F?R/@6)BSPX?I/TVCX:0^]:H_.0/Y=4444"?EIA9?# -M!0$>(R(;J?H[?SS5'0VKOH-CZ$=;4H^*? -M"[MQL#Y9)--Y>*2_R6J21P'OI\#!W_AUJ;7-<5<'2A -M'99R]BXQ^PX;JA;M@*[+''S>!!B('((BA"E*-OZ4`/"X>AI(>M@8]3^9B(3[-?IA(ILD?>:: -MBTU0QTOE3ACA<3-X]WG,T5@84>:!41KR]1H:A"[/B65Y]) -MYA?BS'ZZ!*JD_6R!@CRB#]=GZ_64C/QHJE_SIUX,\%&K']I^PPT'V1)?"QHS -M#6\-%HC11X$-"RLRD7S?.M(?;XF)Q?`@J0L[?4H)>P4FM]7.)WW$*03=!N;& -MH.\SF62KS\5R.\L&6GG1U2KT2?6A-EFIS>HXVO@KWIM+?5&1G;MA.3_ -MKK%.P8PT^S^^"U[O&\.`D@WRQS]Y.Y_3UPXZY"JV1HU+Z;XL/K%_K81C&^KM -M\(-\_\W[Y[A->IF?X*G[C>^P;B(`D\?#86,8L_49PPR4+W<.:RTM!Y"0W;^Z -MKJH?`TSS%NUNX[G$G8@9]G%^K5&4?Y*&PJZ>EQ-9.:JIZ).3QYJ1\^6+2BI6 -MR8A1O)[5D`J)QBK":D8BB&;;H497&3G-9!2MVQFLA<:ZRD9Z/#[9/F.NUAI= -M89JD73,B4>S6E>H%***JG9%]R,!&9-J,=6Y'-`N4G,9P;GNT,5EE!H9$\6=! -M@8OHY^,+^4U1NE#\H*D)$_*JJ_)S*OU__5FF)R[;$3;2&CVW.UE97,#'JXX0 -M:D!6!PV9,;SR]F,&1WFK[,5,Q!C*.JEX1\BQ-W%K2XV5%2^+"]UE\5?Q@.1R -M7AMH?+G?LX#[#Z'RTG\Y0?6>!L?/1S:AJVAK[W^Q_W8&8:AU#:1JD;&=U6=C -M]^8.L[WM?U=@^VZVWMVF9?[([7+#0RR&(-.A'PY/B1LUK?C'+O]+\MS;UC$\ -MC"P9J'55NY$"%/R:-]XIA6)N+#[E\H9VKW/6S,YXQ_YC29"^>*,X:5N1)R?H.=D99V8:*BQ -M&1X$BSEJSC08#0^O&/7UFON42L(?^ESRY6[E)<; -MQ`\22F?CL?53^ZCZ@4VF8EL-DG.+=:F[8A1FIMB?=9J:CJ948&DL5H:."K'9 -MA?"TKWG8@*98\D%\HV?6ZT@%=RLFC/,<5;F9+7.G:CU"KM6>7+(+6.+J--FN -M@:'6[%W`7TT'LV>XUX!XXM9>2Z8I\^"&R5MG;H#^S*"E/Y_\S]9\0V3$`?&C -M]A\M-F@P1TWGD<$]:/RZB*G_LP,@_-_8I^QUAL_5;#7[+#_/VPPX1NCM;^O. -M./FQFA`\C#(/L[G<'I1^WV>P.U?--D5VQYJ!.G_:CNPOP9QHQ?Z!O[+S<%@W -MSR_\K>C>BD21,8<73+]&G9[W>>H+OXPP6'5H,!XQ.TEVW68%@LB9N.`*G'/7 -M',''2,O[HH]LOF3>YUE+>,4SG$!C!M@`J3*TP>F,WZU@5HT2UX#`7+OD%%1S -MGM&G3OJP4F[?#(MN]=GU#"V37 -M>@Y^KD/)A\V6ZC/;7N3@5FZY+/UQ]9M$D1>Z!/`HACQH),ZXT.GQE?`%M&)6*Q -MGB[K)O(/[7^B/1+>'\ORT(FI(X15F$)FJ&7ETPM:O`3(F[C7',=(OA4TU7O5 -M3A9E46C7^0UM%K\P+^V>[!MG*II`;MC^28+)M&_[LU[G+C);'%*-/N-?48%\ -MZ@+$,[T^PNE]K"^G#]27F;OHO1,>,#X6=XV5GS7^U.4M)HQ1A1E8N_M-F'?: -M'#`FF.DO`4:@"&U-96>9`BO^NAJ,^UV;"0Z]_#;K;N4@+SXQ!H"CB4&."_K( -MP4_;0.?W@8T_J8<5*#P2?N>N\A:UW$B/%HGX']HQZ^:8@!I'^8_"U:$A^NK?^FH3;_B$@',-)T7HUOJ -MR'OHLBT-NOL?QBZ* -M2\K*O]D?*2NH\EG+J_VO\,8N>SJMIQ7ZQ$L<*#W,E<<,:_]N?CCY`4SU@;]AZN!@#8 -MST"]\>`6B[#B1_&GND-DZEK[G?FIUOHH_,Y,P1#8>@4RKE7^RD*VPF^"(D^7 -MS2C(K#ZN7:X'D-!I@=ZVG/"X`6:K$^!M*,Z<2-9TJW#@'SA)Y\E;:U1HF`H^?J!4]X'N5?YPS@2Z:\&47!)R -M;`O'Q@BOUO"VV@%U]3LW$3PRK5K^\$!2$FO]U6QO#7#+X^\\:DN*R=\^0SF^K]!&)CR* -MJ9:0"%H8S"ES>QI*V.L'8K%<$@!(K^5?,CO_/@KJT1I7T/C/9]!5N98:,>O@&8L,K$% -MT;,6P14,DMM-#&!/YZ$^2SB?):D2?C$J'SS%A/YWLT?U7^'>H'VQA?H7R*.I -M5DD'O6?PB-NU@E&",KSPR)J,8>ZFO-D^*V]0@IA!R#L: -M=/2Q)OU,.<=Q)[3ES\%G\I00Y<'`O14"#2IKA1IPWLK^:2_O>KJ6,ZQPZN;A -M>\8L[8X[M]@>WDR5X-;MG74S_3FY\94&,;)R5S2Y%%1^[M;@6ERKAVJ3-=S8$MJDF!!N79% -MY;)^J\4OQ^_TU:TFFG/?6/UOU&-QE^-^0]K73^@ACQ&4S -M;U5T\D`Y(\(I4^??LG"[V(?O!:,]?=&@]^MI!- -M<5;CW_8;$X"`@!J#?W5P\N<'&N\PA?-FK+S6WWQ/0FOUL_%]RWOF9KC?39=C -M\4[VEL)C#P.9DEP,'?'UNI>.@6S=],^GF954%[U-%P]YE,KRS`Z;6F$DP+'[ -M]:]'DT?%&JG2:9#99+;O_JOMM9TN9WI\"G432$RQ^',Q+3LF`YR_]]J5#*M* -MCYIOXMDEZRX=.+ENC30F-'OI%BZV6G3(S`$F8BAH>AU6XLDD;;SA%V<&XYXJ -MG[CX\V,FM5N@#'J_W?2&D,.5/1&$W47ENY8^\#DU* -MW^7!6WE=H9KI;VRU>&TT,O0'"[>SQ*C[;T?H9+A9'L5@(]857IY"E -ME!+ZZ[L6P<+G%,F'R:]@=X=7I-Q*&1T^W(F';ZNA)A@+FY&A"Z8G:J6)MZER -M>6667-Y[#9#7=,[BE`:],6]^APSV;K17V8XQNT*!1$;0M2:-V1?J'Y5"Z;*1 -MW)Z*G)G%85!"-,/VYG`*22+'*W_Z9B-56GBC,*BU?EJG,5/17G,K%D.$I4NL -M'B]:5_BNA%-1SK&I>E_#KI!G(("'^^WZF2V=X!U%4Y/6%N37P%'AI*RA+CU1 -MSI7%F^O/G'233ENB&KG=[@TVDF$_Z=AE8YXHJSY&*?BE\@=TM"5`M_QQ*S97 -M)>O+:FMPE[SR52T'!:";XB\^1L?5W^2MWG\#E3VL#?O*YLQN=*'W.)V"[FPB -M"";-H\>8()>Y)$)4\!S,67%8P[WM5;]]?,5M>LGKBF,&9PR&%^A#!%%+3/<* -M+X0XX>.UL3=\6`HL7P06+OOIQ+K0'IX4W50$>0PV1-4#]6']SJP@G[V#/CM2 -M_JF/S?Q<#;L3N4#A98H\*TQ0_WN^>::P?R>Z)Y.ZXF$F[@":SV/;2B#M0\1G -M^S.$[LW1Z:`"AU#\?V_Y0@8[!/J4SF'YJ7M^KSVJM;_]T,,;`X?&M*6A(*.Z -M8_>S&2SWAL^:N[X\)#`J&8?8-(]G@R22Q&=Z-AF"-T<7$=MUENMN;%QX[3#Q!1X.;X?\CI_.SUND2BB2MH&VOM;Q!4MA$D&>E%S;?+"<+A4_H&H.6Y@L_6VO]T&AH?HE:3M$_QV.I -M7CD&A&FY09.`6:_CI!I&W9G@MC<_X@_HO\AKSYF\W85]A'&'\36-&)U -MN\.;4'`<"%XOX\C27J^^/-*^& -M1C9ZP>S(S57HHXR.W7Y%X4M;F2B/Z^ONZ.%)SOH_#]2UBT8$Q4P1AML^*(`P -M3?1#"T^C&/'OSK3_9Y1VRM>9XS>S_W]D-9C,^R]TPJ -MJ_U]_:'P\0@_77#*89PU,(.M^75TGODAXWKTL6( -M43O0)-!Q.UJ/8P6($A8#P&KUA,"XQ4Z(R8,EYJ^;'P2;#W?,_#V=O(@:OR;8 -MT(8?OA&>J%#)F1IG>Y&&ZF=-TKVG,6]I+X>R?!?I$?F:&&!XP(*%IMMUSSE> -M6:08]B85"[?]'_KU)->WH'(,"!I[[O.X++S$$Z(CA4.!Z!=?;TP'7?3*N%)_O!V-O2RY9OTYD]H(&8+B4.'[>/;$/(WR9XMG8"<,2B77@ -MNIH6E_BZ)7<#LR!6=&<@3?`Q-#H,?J2#E&.IKU=I6QY0600$A(=#!G+P=M.S -M*.77NX!J="T;<:)U._N6(OY@#APKYP."LPX`'?,F`D,Y[#`+W)B5`7779$!"8F=YFP]@5ZL\L" -M6(S/CAF"$Y=[;W_*Y'F^M!*?T>#L>F8COJ'O]G&0CQ^(T%FYF`^7Z8![7%TT -M%F?9`\7G8FM1<<7\/L!PJ6Y=_!=#2WR`5+#WB.TBI:7NC;,B]^L_)L40_-_; -M?\.A?!`%(00K7[*``7(II^+9$2`4A$BE115143,55%1(@%04P`T(20[K]`R! -ML*"?ZD_K-G7_9HGUNP?!BQ40156;A?)],0$@,6Y]!P)_9*LU-SVO,_^ -M(./;XT4O]EGOL_.;@DN4W2G\KL$=9A0X`E-LEVGHNYD`'W -M&/U;K3J21`0'%AU-C%?^\Y[=(YG2&2.`]4U\L;`D\IKY!S%;Q[@T,XY&*9"E -MN)*XGE5]]^2DAW_!P'%F#>9(,CD>,5NFJNQ7=![`4%KOW,/B?4AJM=Q-OBAZ,-*@!: -MK/QWF-@ZG'XXZX@VJ:1$038,#*I<](GB*(R&3`@(RVDRD=6.4>"9AW$JA3P)W6R?X(2+O=A -M@3`N0PJIXEW+$IWLL*B(.)!2_\>+;<"M9/-K+";R6&"QO5_"<#[`N- -M6CO$)`/:[\A"]R@Y3U1Y\M,C,@:M\D55@1$"R1'C:?,^=M@I -M@-TS`N%,RGR-E:=UU>*HE]AYM47(;-^>*CWOJJ2;XSFQ9\"4 -M((-2.U];6QH%(DR:I,`:;1#S]5?3#876*V=OK*,W8,@46MC<;5N'W(1QE/X@ -MXF)KS13VED"LJV1.&QO.6][>K'!X.;-%FH73.AHJZ-SLL*/Z\"KU1P"]7+Q: -MFS8&'F/^UIE(HM;;&(W^$.SER>O^WU=KD7J/$(2MLL*M+^"O,BGWO.H"]5OL -M5$V);;U8'([XHC07/E5[?*\O198X0RQ0[;KCV.Q6G/`EILZU[067?=S($/AS -M)@@#MT9!?3'LU)"UE_]#(W\-5F@1U0H\B+Z^,EV//:=I+SIHA'LSB,N9@>R_ -M.'&/`MQ+(%*R>>FSZ)2!>QLTET0C(BE:U7AH_M9WYXA&&YCP?$V3O@J?#B"]TM,Z'F'"#WVJ>\H3!4FP^$T,Z8W/H@XL -MR&*U42.(G[5)@[5+CM#Y8?OY+E:1G@TE#\2&>8^47]9#-G -M@,/[KE1+D/6]6[1>'"Y-3W0-'GFC\XR8Y%.?(0GK!K7^8T1#A9F*(2O+F/=2 -MNAWHF`'Z&YLJFQ)!?_?SXR5CSH%,I3X#:FZS9&R^34`P>T:!NLL<=`NE^,L! -M)4G[-FR&'O^#9-?7!NGUM4;+0.TX!=AXV!S$.!V:IK$G/P9+RIKRX$4=4>O. -M!GC:KP?.`]*(%;9&!S*\0WZ=M#1J=K1''-FX/)PAV_^Z-&N&B8X/REJL['>L -MV!`=O!V0&5F=*P'P'^YYA>%E.'[U>M`QN^OSP/Z,"5A<3^/'WD)6J81UNW+Y -ML%O?S\W^G#RP3RU=G`&/2`L27L=<]<`Z6G+AN@.!L.]XC9&J6"5"GS&HKRZ/Z.+2)R.D2FO%E -M[_4V!L3>[B@4HWOQHK)>CRS\354Z/@*IX#;KGAY@6<9RS0<_N2=%%8Q/=IUW -MN'2'8_%0!4;"YD.@<`ZRYP`.M.XBX;=YD@R1^.V!MP=]%S/FNZTR75+SRIG2 -MTQ"HJ7.U&F;3I4?:4(R)2O\`I,''>P%ONF5O=E[,IJI\V5#1RQ%[-DQ=5CSL -M^I%^63(O1ZN[Z4>3OU(3\L1/SMOO0?D,T!2^;$^Z.0#4C3P9TAZQ#&&1Y\-6 -M@3D&JZ4VJ9X5]GF\"=!>[[>>RFS@W'`F@`S?4(O,,W/+E0?`>-%>#%,AGO\L -M@"AUJU>GBVE[0@"WDD -MI[K)\Z2-\G88%LUR@AS8M:@IC6'31(SW)*XGKHT%Y%$D!L5'UZR4LSI2ZK?T -M:(E1CQR`(ZUT1KX`4 -M%WG30=OSMB&:S<33<\`=*DQKV;+H0440NM<99Y4OA8.>:FZ$'0/3C9D7AJ<<^;8N' -MX%KS;XA'QQPVS/[<&%`":VX.0H^..E2!$4SM;]QHK`I:YMJ-=OB'>.Y -MMR-TW*(O+Y,6H1D8=WQ#40F-WS\<'.]TR`L[=X;EZ*!.'9X$'0:!"7^?B16. -MXQ.,".%]>$7X8QX/`@M&(">,`W)XTA%8*GF&AL!/':@X&G)^X?X%4<=W:=?!"TNG?&TR#(PH`9X>!X\3OYH^QDQ^4; -ME9,Z=R=R`ZT@XY0WAPX`X$IIL(^+_'D4TRXT\.\V5N"`'?\,ZROLG!EZ,1_@ -M#]GL+8$\S3SE-%^-!:D7NMO-8<(#A:#PXKL#\BR?8)L`*JTGSTR>\,FI.GQ1 -M^8>$OG%D34U8K_M5/`$OFS0_3Y?)7L+^RLJ!KT5T0$\SQ[_HD'#I/&!5]];I -MC]KZ]:;,)0`"L3%VZ.XB$@1A::%Q:$&2:0EG6))&0K[>:/I -M1Q!UJ%^ZT9[A7J.@-NQ(ZUB=^@04'C931XJU$<$>A6^UL[[_GRI*`KO]_Y0_ -M4XR7I,[*7E]KJK_*%D0VVFV-L;8VBA;>D>AWVCO/EZ:S1<9R@E8?]_1[K.Q6 -M!6`;3?(LN#B;/].ET_D@F/^N,\CD[CDY^2A2YM-![A._OKRDS)+S- -M'I^FGGP0A%G>_'[=5)/73K][:X,'0"5-U8[EZJG/:I.\_/MN'SAZ9AS>00D1 -M(DR*[G9VT+@?*`^,!4Y.`S5>`7->J5=J55(>ZG8]N8-:2@\#KZ&>'K-] -MM[W2QEP>!!-3,XF\?FWDIV\#<;F*6'0QO>0=(" -M0ZSIW'^)X?!0?PQ\C@(*EET/SX-GS_?TD&*8E#XZSHH2(+:XTSTMP_MTT.JR -M.K;6Z"HY1``5#L7/PZ3'8]8?/8_,=/3'@"5]A+.*1CV?V;NIW&] -M*[2``8MS0:)O)__$>-^F-`MX%G]=ZC(%V:#/ED1QV/GPJPYT$<(!4!!N8QSF -MPI<*M:)_A_WIG@0TFU^W$?RVU)MF%LFTRP:K):V:0`4SW83`H-:3[&<^R -MN>!"'O_#OO-OA.063TC[^V3F]#QDUHB`$WT?.TO4T-$T)D%OO/)\L^`2_YHA -MVF0)''_)?TT?S%B"G7*)2"(..*V7^01SSEKZF;Z2\(A7??Y^*@97!K6):OL\4=E6)R:I0Z"CWG/M:UEI#\@D'(W^U^E@Z[AM]['T_4`&ZL^U9 -MN^HSR+W7#B[Q^!G.;?]NYX@'&Y7NUT]/%HP2Y,:H)VBL$YM/D0V26U_CM"SY -M[CQ1-J,!M.]O50`KE\>_,XUPO]+$Y'S)!@ZE$1#!^GQNOY`0Z0U!$;B]-7*0 -M`ZN9?%/RA(?W&?Y*1CAF)Y_0D"2(R_@U,AMFO+*LUE_G.9VRHD1`6+[@!*G8 -M-6LTG*'@!IVC`"`/NXH[?SG0`P8W<$WY;=S&4B>JH^NIQ:(@$=A3RFZSU3TR -MCI:N2XEODORF<="1#0)\1UBZ>&/W/)#[FYJO:4(`$&XZ3MV0':I[3>[R29DV -M3'M0D"W*.)P5,N'T9/?\#=)(@OL@(OUL]KS)HJSFFX/P0#\VGP`I^S>!S=Z# -M7?B\SG^`)H=X5!M.;O-MDIPZ>!#&T&'<5N(=(*_D?TB%@B&15G'?4FQW]2IH`!GN3>E -M=:J8DP3OOYW,MNW>+X^`K(/M*DLRJ#>[MHGQ$T:XA!!=4O2V$4!%><'SFR@0 -MXJP\.]1D07GJ5P$(`PN:;=/(74ROQ-P?W,)->)U`0'T[F$!'J2TH<6[G(2+S7F'ZNN7]C=[P\A221X"AWT -MY_U:0[1,-127"0=`"\UOL/##L^DOE[56D-EP82X\LP0&%UOSS_%U\@1JJN:B -M-G20`"TOC4BK\6N:%A/;ZGVQ;L,K]^JE)GP^YKO8S:>]2`%4SLQ,+)>[Q[K) -M\[M)PI`#:^M,S-W``BW+0QW6SC]E]NI@N!P03AD,U'5]I4;&#EK>S_*RE$0= -M75L*\X:O!2+L8.&WX\`.;4D)_SR2^A4,$\11U&!*4W%=Z8,?IUQKY("`QE0] -M+IF!"2Y;/09[,?&J/D7&NB+RUN'#]XS@92:5DV#1@#AP(+S>H3J:@1_*QM%, -M%EWCS@(ZT)W/8OFT]"(`/_TB5;[P!\/--HQ7O/)HDMN0@M!`@8/I;A1)Q\'0 -M7'A?."->7=[3'X*WA6R`#1>D%GCZ+(M10U]R]7!-'(Y/Q0$3E5?W -MM]H`9L-]33<1;SFQG=]Z>,D`#+=7CD5`.FNJ'(UQT"9<78`6GW0J"^G??IC( -M">4J=3.KJ4"$1A1`*!SSS'O>ZHG/R^+;6/Z^_H1@B8.)Z"#!#7*=J@]9@SWC -MY%9(\R"US[ZPVZ;63M)&NA!RA5B2A$8`'XYU002QX>;>>W)L!X$N>:>`_NBL -M.4B1BO.^!ZVW?W78TJ(\1*7( -MF>D012>Y;[XX+_JN6U!"P$XM[QI:F>/26/3+H^I]$DD78`%+DS@M>7":?Z/E -M0-;L60)=::9DLB)>QE\`L6#?33Z&=VNPW[=5)!$&:1Z!)76;M<-S-G2&S5/F -M14_\U?=_[8QB@?`@\S4$6%]GUL_<8)&65,01J(BSG.O""G_.]_LG;;')GP4% -M:J_E`N^#F*++HMMP>:Y;QRBQ[THB"7^M7/`#TW[E -MAM3?&42,-3EY$@`?2.E%7P$)U-#.:#-!R7F(1Z)(GM%.+DNE$`U0DHMLBP5.TUT;J'.II@!D(2A -M94I0T'JM<%"1/.[R9#^)\NZ5JD=*1PX_C$43SA:VF20O[Y!(""^922+\:=HV -M3J<+QUUQZ02+6XJ9R9S(R@)E@9,]NG7)W=]QXJ&2`!FH<`?50]2P.0C?JND? -MU=&188`PI,4DV_'>48+^[*!(!^_YB51V!T6[,-EEM7A(06,^0%+A(] -MJY[8Q1;JF2>\%ZX200V'8E`5O%6*6T,&KGCX&$]Z>.4_."$M2=OZ8B7>ME.@ -M*1(M%BNT>&B4V5E&4RCGOD@`51$HC-+45]:EED,?4(05K5Q:.>!<#,;)22%% -M^]I\$O^2EJ`!EWV47;\5-X*+)H`51)R&7\H'OKOHB"-D2/[1$7N;%:_(1+NQ -M/L9O*FHY"F"^='1D01[^DC<1F?L?1*8%O@W&](MWWW2D/4VBBLY`$,A[D9`N -MR`/QMQOA6A/R?.I!P_F_(!!AH05%,=4FMRB -MYGC#-'0,C?S`()(@OMJ:H;*4XKNW9@(B*AO"*FN8%(LOD=#YZ90@/WU;_RM_ -M8:%-_K)CHLNW2@4GJXN^QX`YZA(064OA.]*F#6A!:T@%KG4\G(0GPB( -M@S];2D30M_45-;R64'B'OA4[3D&O^:%O2]2MH@$N^2].0*$R,@'F*KO3UJE='8:(1)!?:-,0<'9$0 -MT'G?][N@NQZE;4<")2C206+O@4/JA#@*262!=[[5&K2%5 -MWVN59(CLOH:\KX'IG300X-!0@!E\]F3B_.Z2>)#D(\ARG:($`Z4#43J?!"?K -MFF:_J;SB(2VF=O#G]UD>3W4!"VR/5!#V\+\1@G>XAG3Y*%CY)SM\4B'6:G-G -MRW".WDY9_:+`#!4U>\X:YT*-Q;$)",BVC_HT@.K8^>SE*1+C-'C$UN6=`_(R -M`D(TB&LQB5J!$]7S_M83O,B+M>*ZX!%CKU$$2+9\\\7P?N#F^,"'EO?(O=56 -MW![SJ6W-$*N>(G=%QW->Y5HYLB`F#GZA)("EE1VMZE(TI^9('S(@5_S2(6'A -MS]FN#(]#O/'0HC"`BVO=G`0U6OBFW/Z.@JN;:2&B2`$+>"%- -MX)1A\239!5UT@JH@%TQ_2',7-?]HYW:[8?S\]-<<-B$O2.OP@!5,*1 -M;6,@7-FFK&-/E[=K_R/$96($!LL]D]#BMFYU^JZ#&>X'2SO?9T>\3""^\PP! -M8S$RMV\!03.LX.]DO7B802@"VEIMIX@6@1C/[:GS,TC>JM"!8ZX@&SC7GU8A -MN91JAI=)1`IN_Q.B0#7190>6/G$A>/E]\F"T3G7]CH=)K/#AO2H"8''))S?B -MG<)DBF0[)%KLORUMBC@A+F+-8=_I$+$_G(SMJV54@K7/H\J^"'5?*F_T*=^I -M'.]\,5OR(?3=/VW9#(2]'J9*MJ0B!0^(C^>.R9`3S=U!GWM>Y!T\!L%@@%I< -MG[Z[IGWJH@Q)[_UY8B#)45W18%;6Z#.UT5DQ4)0!,01B!+:Y<8]6@#E;'-%# -M$A64Z5*`,PSD0/JM7OY^&F4&0B#RF0S]>0*2Z.VVJ1J0\>MX;^1!]:S:#@JA -MUVSW">?Q^;-?D%@$`]1&+OQ`27&QKIC=&[,"2%R29X2*(DBX^N3Y#5ISL2?( -M:NQ<_UQ2(MJW.VP9J<[-KT?I@"XE)UHE4L,CZ-)VT(>-W%RBIHP1/7F>,?]@ -MF.,)N^5"9%(+^.I`>+H3"1M5_IK`D5!""W?LH(@@5?Z"^NFT_#D`P(BR&F[U *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 12 08:12:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D9B9CABECE; Thu, 12 Jan 2017 08:12:12 +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 6CCB6167D; Thu, 12 Jan 2017 08:12:12 +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 v0C8CBab044101; Thu, 12 Jan 2017 08:12:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C8CBup044100; Thu, 12 Jan 2017 08:12:11 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701120812.v0C8CBup044100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 12 Jan 2017 08:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311967 - stable/11/usr.bin/netstat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 08:12:12 -0000 Author: delphij Date: Thu Jan 12 08:12:11 2017 New Revision: 311967 URL: https://svnweb.freebsd.org/changeset/base/311967 Log: MFC r311762: Fix typo. Modified: stable/11/usr.bin/netstat/route.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/netstat/route.c ============================================================================== --- stable/11/usr.bin/netstat/route.c Thu Jan 12 07:26:39 2017 (r311966) +++ stable/11/usr.bin/netstat/route.c Thu Jan 12 08:12:11 2017 (r311967) @@ -494,7 +494,7 @@ fmt_sockaddr(struct sockaddr *sa, struct cq = buf; slim = sa->sa_len + (u_char *) sa; cqlim = cq + sizeof(buf) - sizeof(" ffff"); - snprintf(cq, sizeof(cq), "(%d)", sa->sa_family); + snprintf(cq, sizeof(buf), "(%d)", sa->sa_family); cq += strlen(cq); while (s < slim && cq < cqlim) { snprintf(cq, sizeof(" ff"), " %02x", *s++); From owner-svn-src-all@freebsd.org Thu Jan 12 08:31:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 985BFCAA706; Thu, 12 Jan 2017 08: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 67D2517B1; Thu, 12 Jan 2017 08: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 v0C8Vgs0053351; Thu, 12 Jan 2017 08:31:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C8VgJJ053350; Thu, 12 Jan 2017 08:31:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701120831.v0C8VgJJ053350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 12 Jan 2017 08:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311968 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 08:31:43 -0000 Author: ngie Date: Thu Jan 12 08:31:42 2017 New Revision: 311968 URL: https://svnweb.freebsd.org/changeset/base/311968 Log: Fix lib/libc/sys/access_test after r311925 sys/param.h needs to be #included in order for __FreeBSD_version to be checked MFC after: 13 days Modified: head/contrib/netbsd-tests/lib/libc/sys/t_access.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_access.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_access.c Thu Jan 12 08:12:11 2017 (r311967) +++ head/contrib/netbsd-tests/lib/libc/sys/t_access.c Thu Jan 12 08:31:42 2017 (r311968) @@ -1,4 +1,4 @@ -/* $NetBSD: t_access.c,v 1.2 2017/01/10 22:36:29 christos Exp $ */ +/* $NetBSD: t_access.c,v 2.2 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -31,6 +31,10 @@ #include __RCSID("$NetBSD: t_access.c,v 1.2 2017/01/10 22:36:29 christos Exp $"); +#ifdef __FreeBSD__ +#include /* For __FreeBSD_version */ +#endif + #include #include From owner-svn-src-all@freebsd.org Thu Jan 12 08:40:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A58BCAA986; Thu, 12 Jan 2017 08:40:54 +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 CDD841C59; Thu, 12 Jan 2017 08:40:53 +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 v0C8erR4053869; Thu, 12 Jan 2017 08:40:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C8eqOV053867; Thu, 12 Jan 2017 08:40:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701120840.v0C8eqOV053867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 12 Jan 2017 08:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311969 - in head: contrib/netbsd-tests/lib/libc/stdlib lib/libc/tests/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 08:40:54 -0000 Author: ngie Date: Thu Jan 12 08:40:52 2017 New Revision: 311969 URL: https://svnweb.freebsd.org/changeset/base/311969 Log: Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile This is to enable support in other testcases Inspired by lib/msun/tests/Makefile . MFC after: 1 week Modified: head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c head/lib/libc/tests/stdlib/Makefile Modified: head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c Thu Jan 12 08:31:42 2017 (r311968) +++ head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c Thu Jan 12 08:40:52 2017 (r311969) @@ -51,10 +51,6 @@ static const char * const inf_strings[] const char *nan_string = "NaN(x)y"; #endif -#ifdef __FreeBSD__ -#define __HAVE_LONG_DOUBLE -#endif - ATF_TC(strtod_basic); ATF_TC_HEAD(strtod_basic, tc) { Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Thu Jan 12 08:31:42 2017 (r311968) +++ head/lib/libc/tests/stdlib/Makefile Thu Jan 12 08:40:52 2017 (r311969) @@ -11,6 +11,14 @@ ATF_TESTS_CXX+= cxa_thread_atexit_test ATF_TESTS_CXX+= cxa_thread_atexit_nothr_test .endif +# Not sure why this isn't defined for all architectures, since most +# have long double. +.if ${MACHINE_CPUARCH} == "aarch64" || \ + ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" +CFLAGS+= -D__HAVE_LONG_DOUBLE +.endif + # TODO: t_getenv_thread, t_mi_vector_hash, t_strtoi NETBSD_ATF_TESTS_C+= abs_test NETBSD_ATF_TESTS_C+= atoi_test From owner-svn-src-all@freebsd.org Thu Jan 12 08:46:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16CBACAABF6; Thu, 12 Jan 2017 08:46:21 +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 E550610E3; Thu, 12 Jan 2017 08:46:20 +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 v0C8kKmQ057632; Thu, 12 Jan 2017 08:46:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C8kJfu057628; Thu, 12 Jan 2017 08:46:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701120846.v0C8kJfu057628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 12 Jan 2017 08:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311970 - in vendor/NetBSD/tests/dist/lib: libm libpthread X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 08:46:21 -0000 Author: ngie Date: Thu Jan 12 08:46:19 2017 New Revision: 311970 URL: https://svnweb.freebsd.org/changeset/base/311970 Log: Add additional testcases missed in r311966 Added: vendor/NetBSD/tests/dist/lib/libm/t_casinh.c (contents, props changed) vendor/NetBSD/tests/dist/lib/libm/t_fe_round.c (contents, props changed) vendor/NetBSD/tests/dist/lib/libm/t_ilogb.c (contents, props changed) vendor/NetBSD/tests/dist/lib/libpthread/t_timedmutex.c (contents, props changed) Added: vendor/NetBSD/tests/dist/lib/libm/t_casinh.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/tests/dist/lib/libm/t_casinh.c Thu Jan 12 08:46:19 2017 (r311970) @@ -0,0 +1,81 @@ +/* $NetBSD: t_casinh.c,v 1.2 2016/09/20 17:19:28 christos Exp $ */ + +/* + * Written by Maya Rashish + * Public domain. + * + * Testing special values of casinh + * Values from ISO/IEC 9899:201x G.6.2.2 + */ + +#include +#include +#include + +#define RE(z) (((double *)(&z))[0]) +#define IM(z) (((double *)(&z))[1]) + +static const struct { + double input_re; + double input_im; + double result_re; + double result_im; +} values[] = { + { +0, +0, +0, +0}, + { +5.032E3, +INFINITY, +INFINITY, +M_PI/2}, + { +INFINITY, +5.023E3, +INFINITY, +0}, + { +INFINITY, +INFINITY, +INFINITY, +M_PI/4}, +#ifdef __HAVE_NANF + { +INFINITY, +NAN, +INFINITY, +NAN}, + { +5.032E3, +NAN, +NAN, +NAN}, /* + FE_INVALID optionally raised */ + { +NAN, +0, +NAN, +0}, + { +NAN, -5.023E3, +NAN, +NAN}, /* + FE_INVALID optionally raised */ + { +NAN, +INFINITY, +INFINITY, +NAN}, /* sign of real part of result unspecified */ + { +NAN, +NAN, +NAN, +NAN}, +#endif +}; + +#ifdef __HAVE_NANF +#define both_nan(a,b) (isnan(a) && isnan(b)) +#else +#define both_nan(a,b) 0 +#endif + +#define crude_equality(a,b) ((a == b) || both_nan(a,b)) + +#define ATF_COMPLEX_EQUAL(a,b) do { \ + complex double ci = casinh(a); \ + ATF_CHECK_MSG(crude_equality(creal(ci),creal(b)) && \ + crude_equality(cimag(ci), cimag(b)), \ + "for casinh([%g,%g]) = [%g,%g] != [%g,%g]", \ + creal(a), cimag(a), creal(ci), cimag(ci), creal(b), cimag(b)); \ +} while (0/*CONSTCOND*/) + + +ATF_TC(casinh); +ATF_TC_HEAD(casinh, tc) +{ + atf_tc_set_md_var(tc, "descr","Check casinh family - special values"); +} + +ATF_TC_BODY(casinh, tc) +{ + complex double input; + complex double result; + unsigned int i; + for (i = 0; i < __arraycount(values); i++) { + RE(input) = values[i].input_re; + IM(input) = values[i].input_im; + RE(result) = values[i].result_re; + IM(result) = values[i].result_im; + ATF_COMPLEX_EQUAL(input, result); + } +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, casinh); + + return atf_no_error(); +} Added: vendor/NetBSD/tests/dist/lib/libm/t_fe_round.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/tests/dist/lib/libm/t_fe_round.c Thu Jan 12 08:46:19 2017 (r311970) @@ -0,0 +1,124 @@ +/* + * Written by Maya Rashish + * Public domain. + * + * Testing IEEE-754 rounding modes (and lrint) + */ + +#include +#include +#ifdef __HAVE_FENV +#include +#include +#include + +/*#pragma STDC FENV_ACCESS ON gcc?? */ + +#define INT 9223L + +#define EPSILON 0.001 + +static const struct { + int round_mode; + double input; + long int expected; +} values[] = { + { FE_DOWNWARD, 3.7, 3}, + { FE_DOWNWARD, -3.7, -4}, + { FE_DOWNWARD, +0, 0}, + { FE_DOWNWARD, -INT-0.01, -INT-1}, + { FE_DOWNWARD, +INT-0.01, INT-1}, + { FE_DOWNWARD, -INT+0.01, -INT}, + { FE_DOWNWARD, +INT+0.01, INT}, +#if 0 /* cpu bugs? */ + { FE_DOWNWARD, -0, -1}, + + { FE_UPWARD, +0, 1}, +#endif + { FE_UPWARD, -0, 0}, + { FE_UPWARD, -123.7, -123}, + { FE_UPWARD, 123.999, 124}, + { FE_UPWARD, -INT-0.01, -INT}, + { FE_UPWARD, +INT-0.01, INT}, + { FE_UPWARD, -INT+0.01, -INT+1}, + { FE_UPWARD, +INT+0.01, INT+1}, + + { FE_TOWARDZERO, 1.99, 1}, + { FE_TOWARDZERO, -1.99, -1}, + { FE_TOWARDZERO, 0.2, 0}, + { FE_TOWARDZERO, INT+0.01, INT}, + { FE_TOWARDZERO, INT-0.01, INT - 1}, + { FE_TOWARDZERO, -INT+0.01, -INT + 1}, + { FE_TOWARDZERO, +0, 0}, + { FE_TOWARDZERO, -0, 0}, + + { FE_TONEAREST, -INT-0.01, -INT}, + { FE_TONEAREST, +INT-0.01, INT}, + { FE_TONEAREST, -INT+0.01, -INT}, + { FE_TONEAREST, +INT+0.01, INT}, + { FE_TONEAREST, -INT-0.501, -INT-1}, + { FE_TONEAREST, +INT-0.501, INT-1}, + { FE_TONEAREST, -INT+0.501, -INT+1}, + { FE_TONEAREST, +INT+0.501, INT+1}, + { FE_TONEAREST, +0, 0}, + { FE_TONEAREST, -0, 0}, +}; + +ATF_TC(fe_round); +ATF_TC_HEAD(fe_round, tc) +{ + atf_tc_set_md_var(tc, "descr","Checking IEEE 754 rounding modes using lrint"); +} + +ATF_TC_BODY(fe_round, tc) +{ + long int received; + + for (unsigned int i = 0; i < __arraycount(values); i++) { + fesetround(values[i].round_mode); + + received = lrint(values[i].input); + ATF_CHECK_MSG( + (labs(received - values[i].expected) < EPSILON), + "lrint rounding wrong, difference too large\n" + "input: %f (index %d): got %ld, expected %ld\n", + values[i].input, i, received, values[i].expected); + + /* Do we get the same rounding mode out? */ + ATF_CHECK_MSG( + (fegetround() == values[i].round_mode), + "Didn't get the same rounding mode out!\n" + "(index %d) fed in %d rounding mode, got %d out\n", + i, fegetround(), values[i].round_mode); + } +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, fe_round); + + return atf_no_error(); +} +#else +ATF_TC(t_nofe_round); + +ATF_TC_HEAD(t_nofe_round, tc) +{ + atf_tc_set_md_var(tc, "descr", + "dummy test case - no fenv.h support"); +} + + +ATF_TC_BODY(t_nofe_round, tc) +{ + atf_tc_skip("no fenv.h support on this architecture"); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, t_nofe_round); + return atf_no_error(); +} + +#endif Added: vendor/NetBSD/tests/dist/lib/libm/t_ilogb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/tests/dist/lib/libm/t_ilogb.c Thu Jan 12 08:46:19 2017 (r311970) @@ -0,0 +1,127 @@ +/* $NetBSD: t_ilogb.c,v 1.6 2016/08/26 08:01:55 christos Exp $ */ + +/*- + * Copyright (c) 2016 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Maya Rashish. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#ifndef __HAVE_FENV + +# define ATF_CHECK_RAISED_INVALID +# define ATF_CHECK_RAISED_NOTHING + +#else +# define ATF_CHECK_RAISED_INVALID do { \ + int r = fetestexcept(FE_ALL_EXCEPT); \ + ATF_CHECK_MSG(r == FE_INVALID, "r=%#x != %#x\n", r, FE_INVALID); \ + (void)feclearexcept(FE_ALL_EXCEPT); \ +} while (/*CONSTCOND*/0) + +# define ATF_CHECK_RAISED_NOTHING do { \ + int r = fetestexcept(FE_ALL_EXCEPT); \ + ATF_CHECK_MSG(r == 0, "r=%#x != 0\n", r); \ + (void)feclearexcept(FE_ALL_EXCEPT); \ +} while (/*CONSTCOND*/0) +#endif + +ATF_TC(ilogb); +ATF_TC_HEAD(ilogb, tc) +{ + atf_tc_set_md_var(tc, "descr","Check ilogb family"); +} + +ATF_TC_BODY(ilogb, tc) +{ + + ATF_CHECK(ilogbf(0) == FP_ILOGB0); + ATF_CHECK_RAISED_INVALID; + ATF_CHECK(ilogb(0) == FP_ILOGB0); + ATF_CHECK_RAISED_INVALID; +#ifdef __HAVE_LONG_DOUBLE + ATF_CHECK(ilogbl(0) == FP_ILOGB0); + ATF_CHECK_RAISED_INVALID; +#endif + + ATF_CHECK(ilogbf(-0) == FP_ILOGB0); + ATF_CHECK_RAISED_INVALID; + ATF_CHECK(ilogb(-0) == FP_ILOGB0); + ATF_CHECK_RAISED_INVALID; +#ifdef __HAVE_LONG_DOUBLE + ATF_CHECK(ilogbl(-0) == FP_ILOGB0); + ATF_CHECK_RAISED_INVALID; +#endif + + ATF_CHECK(ilogbf(INFINITY) == INT_MAX); + ATF_CHECK_RAISED_INVALID; + ATF_CHECK(ilogb(INFINITY) == INT_MAX); + ATF_CHECK_RAISED_INVALID; +#ifdef __HAVE_LONG_DOUBLE + ATF_CHECK(ilogbl(INFINITY) == INT_MAX); + ATF_CHECK_RAISED_INVALID; +#endif + + ATF_CHECK(ilogbf(-INFINITY) == INT_MAX); + ATF_CHECK_RAISED_INVALID; + ATF_CHECK(ilogb(-INFINITY) == INT_MAX); + ATF_CHECK_RAISED_INVALID; +#ifdef __HAVE_LONG_DOUBLE + ATF_CHECK(ilogbl(-INFINITY) == INT_MAX); + ATF_CHECK_RAISED_INVALID; +#endif + + ATF_CHECK(ilogbf(1024) == 10); + ATF_CHECK_RAISED_NOTHING; + ATF_CHECK(ilogb(1024) == 10); + ATF_CHECK_RAISED_NOTHING; +#ifdef __HAVE_LONG_DOUBLE + ATF_CHECK(ilogbl(1024) == 10); + ATF_CHECK_RAISED_NOTHING; +#endif + +#ifndef __vax__ + ATF_CHECK(ilogbf(NAN) == FP_ILOGBNAN); + ATF_CHECK_RAISED_INVALID; + ATF_CHECK(ilogb(NAN) == FP_ILOGBNAN); + ATF_CHECK_RAISED_INVALID; +#ifdef __HAVE_LONG_DOUBLE + ATF_CHECK(ilogbl(NAN) == FP_ILOGBNAN); + ATF_CHECK_RAISED_INVALID; +#endif +#endif +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, ilogb); + + return atf_no_error(); +} Added: vendor/NetBSD/tests/dist/lib/libpthread/t_timedmutex.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/tests/dist/lib/libpthread/t_timedmutex.c Thu Jan 12 08:46:19 2017 (r311970) @@ -0,0 +1,30 @@ +/* $NetBSD: t_timedmutex.c,v 1.2 2016/10/31 16:21:23 christos Exp $ */ + +/* + * Copyright (c) 2008 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#define TIMEDMUTEX +#include "t_mutex.c" From owner-svn-src-all@freebsd.org Thu Jan 12 08:53:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5D30CAC0CD; Thu, 12 Jan 2017 08:53:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9689A17C2; Thu, 12 Jan 2017 08:53:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0C8rAIm061816; Thu, 12 Jan 2017 08:53:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C8rAF3061809; Thu, 12 Jan 2017 08:53:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701120853.v0C8rAF3061809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Jan 2017 08:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311971 - in head/sys: cam/nvme dev/mmc dev/nand dev/nvd geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 08:53:11 -0000 Author: mav Date: Thu Jan 12 08:53:10 2017 New Revision: 311971 URL: https://svnweb.freebsd.org/changeset/base/311971 Log: Report random flash storage as non-rotating to GEOM_DISK. While doing it, introduce respective constants in geom_disk.h. MFC after: 1 week Modified: head/sys/cam/nvme/nvme_da.c head/sys/dev/mmc/mmcsd.c head/sys/dev/nand/nand_geom.c head/sys/dev/nvd/nvd.c head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Thu Jan 12 08:46:19 2017 (r311970) +++ head/sys/cam/nvme/nvme_da.c Thu Jan 12 08:53:10 2017 (r311971) @@ -761,7 +761,7 @@ ndaregister(struct cam_periph *periph, v MIN(sizeof(softc->disk->d_descr), sizeof(cd->mn))); strlcpy(softc->disk->d_ident, cd->sn, MIN(sizeof(softc->disk->d_ident), sizeof(cd->sn))); - disk->d_rotation_rate = 0; /* Spinning rust need not apply */ + disk->d_rotation_rate = DISK_RR_NON_ROTATING; disk->d_open = ndaopen; disk->d_close = ndaclose; disk->d_strategy = ndastrategy; Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Thu Jan 12 08:46:19 2017 (r311970) +++ head/sys/dev/mmc/mmcsd.c Thu Jan 12 08:53:10 2017 (r311971) @@ -170,6 +170,7 @@ mmcsd_attach(device_t dev) d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize; strlcpy(d->d_ident, mmc_get_card_sn_string(dev), sizeof(d->d_ident)); strlcpy(d->d_descr, mmc_get_card_id_string(dev), sizeof(d->d_descr)); + d->d_rotation_rate = DISK_RR_NON_ROTATING; /* * Display in most natural units. There's no cards < 1MB. The SD Modified: head/sys/dev/nand/nand_geom.c ============================================================================== --- head/sys/dev/nand/nand_geom.c Thu Jan 12 08:46:19 2017 (r311970) +++ head/sys/dev/nand/nand_geom.c Thu Jan 12 08:53:10 2017 (r311971) @@ -394,6 +394,7 @@ create_geom_disk(struct nand_chip *chip) snprintf(ndisk->d_ident, sizeof(ndisk->d_ident), "nand: Man:0x%02x Dev:0x%02x", chip->id.man_id, chip->id.dev_id); + ndisk->d_rotation_rate = DISK_RR_NON_ROTATING; disk_create(ndisk, DISK_VERSION); @@ -415,6 +416,7 @@ create_geom_disk(struct nand_chip *chip) snprintf(rdisk->d_ident, sizeof(rdisk->d_ident), "nand_raw: Man:0x%02x Dev:0x%02x", chip->id.man_id, chip->id.dev_id); + disk->d_rotation_rate = DISK_RR_NON_ROTATING; disk_create(rdisk, DISK_VERSION); Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Jan 12 08:46:19 2017 (r311970) +++ head/sys/dev/nvd/nvd.c Thu Jan 12 08:53:10 2017 (r311971) @@ -352,13 +352,11 @@ nvd_new_disk(struct nvme_namespace *ns, */ nvme_strvis(disk->d_ident, nvme_ns_get_serial_number(ns), sizeof(disk->d_ident), NVME_SERIAL_NUMBER_LENGTH); - nvme_strvis(descr, nvme_ns_get_model_number(ns), sizeof(descr), NVME_MODEL_NUMBER_LENGTH); - -#if __FreeBSD_version >= 900034 strlcpy(disk->d_descr, descr, sizeof(descr)); -#endif + + disk->d_rotation_rate = DISK_RR_NON_ROTATING; ndisk->ns = ns; ndisk->disk = disk; Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Thu Jan 12 08:46:19 2017 (r311970) +++ head/sys/geom/geom_disk.c Thu Jan 12 08:53:10 2017 (r311971) @@ -588,12 +588,12 @@ g_disk_dumpconf(struct sbuf *sb, const c * special cases, and there's also a valid range. */ sbuf_printf(sb, "%s", indent); - if (dp->d_rotation_rate == 0) /* Old drives don't */ - sbuf_printf(sb, "unknown"); /* report RPM. */ - else if (dp->d_rotation_rate == 1) /* Since 0 is used */ - sbuf_printf(sb, "0"); /* above, SSDs use 1. */ - else if ((dp->d_rotation_rate >= 0x041) && - (dp->d_rotation_rate <= 0xfffe)) + if (dp->d_rotation_rate == DISK_RR_UNKNOWN) /* Old drives */ + sbuf_printf(sb, "unknown"); /* don't report RPM. */ + else if (dp->d_rotation_rate == DISK_RR_NON_ROTATING) + sbuf_printf(sb, "0"); + else if ((dp->d_rotation_rate >= DISK_RR_MIN) && + (dp->d_rotation_rate <= DISK_RR_MAX)) sbuf_printf(sb, "%u", dp->d_rotation_rate); else sbuf_printf(sb, "invalid"); Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Thu Jan 12 08:46:19 2017 (r311970) +++ head/sys/geom/geom_disk.h Thu Jan 12 08:53:10 2017 (r311971) @@ -119,6 +119,11 @@ struct disk { #define DISKFLAG_DIRECT_COMPLETION 0x20 #define DISKFLAG_CANZONE 0x80 +#define DISK_RR_UNKNOWN 0 +#define DISK_RR_NON_ROTATING 1 +#define DISK_RR_MIN 0x0401 +#define DISK_RR_MAX 0xfffe + struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); void disk_destroy(struct disk *disk); From owner-svn-src-all@freebsd.org Thu Jan 12 09:01:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C0CBCAC467; Thu, 12 Jan 2017 09:01:15 +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 5BABA1AB3; Thu, 12 Jan 2017 09:01: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 v0C91Ehn065112; Thu, 12 Jan 2017 09:01:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C91ExE065111; Thu, 12 Jan 2017 09:01:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701120901.v0C91ExE065111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 12 Jan 2017 09:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311972 - head/lib/libnetbsd/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 09:01:15 -0000 Author: ngie Date: Thu Jan 12 09:01:14 2017 New Revision: 311972 URL: https://svnweb.freebsd.org/changeset/base/311972 Log: Add __BIT and __BITS macros from NetBSD to help support new testcases MFC after: 1 week Modified: head/lib/libnetbsd/sys/cdefs.h Modified: head/lib/libnetbsd/sys/cdefs.h ============================================================================== --- head/lib/libnetbsd/sys/cdefs.h Thu Jan 12 08:53:10 2017 (r311971) +++ head/lib/libnetbsd/sys/cdefs.h Thu Jan 12 09:01:14 2017 (r311972) @@ -71,4 +71,13 @@ */ #define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) +/* __BIT(n): nth bit, where __BIT(0) == 0x1. */ +#define __BIT(__n) \ + (((uintmax_t)(__n) >= NBBY * sizeof(uintmax_t)) ? 0 : \ + ((uintmax_t)1 << (uintmax_t)((__n) & (NBBY * sizeof(uintmax_t) - 1)))) + +/* __BITS(m, n): bits m through n, m < n. */ +#define __BITS(__m, __n) \ + ((__BIT(MAX((__m), (__n)) + 1) - 1) ^ (__BIT(MIN((__m), (__n))) - 1)) + #endif /* _LIBNETBSD_SYS_CDEFS_H_ */ From owner-svn-src-all@freebsd.org Thu Jan 12 10:14:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B41D9CABC53; Thu, 12 Jan 2017 10:14:55 +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 83B891488; Thu, 12 Jan 2017 10:14:55 +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 v0CAEsZT094864; Thu, 12 Jan 2017 10:14:54 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CAEs6j094863; Thu, 12 Jan 2017 10:14:54 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201701121014.v0CAEs6j094863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Thu, 12 Jan 2017 10:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311974 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 10:14:55 -0000 Author: sobomax Date: Thu Jan 12 10:14:54 2017 New Revision: 311974 URL: https://svnweb.freebsd.org/changeset/base/311974 Log: Fix slight type mismatch between so_options defined in sys/socketvar.h and tw_so_options defined here which is supposed to be a copy of the former (short vs u_short respectively). Switch tw_so_options to be "signed short" to match the type of the field it's inherited from. Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Jan 12 09:38:14 2017 (r311973) +++ head/sys/netinet/tcp_var.h Thu Jan 12 10:14:54 2017 (r311974) @@ -452,7 +452,7 @@ struct tcptw { tcp_seq iss; tcp_seq irs; u_short last_win; /* cached window value */ - u_short tw_so_options; /* copy of so_options */ + short tw_so_options; /* copy of so_options */ struct ucred *tw_cred; /* user credentials */ u_int32_t t_recent; u_int32_t ts_offset; /* our timestamp offset */ From owner-svn-src-all@freebsd.org Thu Jan 12 11:25:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDB81CABF70; Thu, 12 Jan 2017 11:25:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wj0-f179.google.com (mail-wj0-f179.google.com [209.85.210.179]) (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 5CBE31665; Thu, 12 Jan 2017 11:25:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wj0-f179.google.com with SMTP id i20so9619529wjn.2; Thu, 12 Jan 2017 03:25:00 -0800 (PST) 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=OqmkezCn5czMvr1EoOGZOaGptIBgKuoZ8jQ716rWpg8=; b=bnhydUK4e5+FvZZrg2kFEJHZNLTlE1K6QbI5pU2ZNZ55JNaVbycF3OrBMr33XczIcY VdZEC/uLMUBibV4meIOXSARph6gs/oPMQvfXlUG7FQ+m2z3ktyr4nkb12DER/8Og20n2 e8RK9awO00SuHAxP/SX2yDKxY0kV25iqnRS3ZKGoqwLVlwNNghkkDxw6y4TCHi31HOR2 l6JsCEfvWgEPPI+Ts0+9gVZasSdpJk01oJhfPoNM8MimSC0YA7ZXe9h7843parPcESjV mdgzsCE/BoB/6QQ9TW5xk2AIgfOsEiT1pza3oNRzP4DdSBNX+pSY/XCpc+TKgfznwI9m puDQ== X-Gm-Message-State: AIkVDXJQcdvZqoMMJl7QH5jT4OWVCjk0WvLge1gHbsqOvlLQvAcMeCxVtY4WPL/d+muGIA== X-Received: by 10.194.67.67 with SMTP id l3mr7752173wjt.151.1484188545618; Wed, 11 Jan 2017 18:35:45 -0800 (PST) Received: from mail-wj0-f182.google.com (mail-wj0-f182.google.com. [209.85.210.182]) by smtp.gmail.com with ESMTPSA id a186sm776372wmh.1.2017.01.11.18.35.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 18:35:44 -0800 (PST) Received: by mail-wj0-f182.google.com with SMTP id kq3so3397584wjc.0; Wed, 11 Jan 2017 18:35:44 -0800 (PST) X-Received: by 10.194.122.231 with SMTP id lv7mr2859274wjb.231.1484188544666; Wed, 11 Jan 2017 18:35:44 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.29.72 with HTTP; Wed, 11 Jan 2017 18:35:44 -0800 (PST) In-Reply-To: <201611242254.uAOMswkb081748@repo.freebsd.org> References: <201611242254.uAOMswkb081748@repo.freebsd.org> From: Conrad Meyer Date: Wed, 11 Jan 2017 18:35:44 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... To: Dimitry Andric Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 11:25:01 -0000 This appears to have broken Chromium[0]: FAILED: obj/services/ui/ws/lib/window_manager_display_root.o clang++39 -MMD -MF obj/services/ui/ws/lib/window_manager_display_root.o.d -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -DV8_DEPRECATION_WARNINGS -DENABLE_MDNS=1 -DENABLE_NOTIFICATIONS -DENABLE_PEPPER_CDMS -DENABLE_PLUGINS=1 -DENABLE_PDF=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_CLIPBOARD_AURAX11=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DENABLE_WEBRTC=1 -DDISABLE_NACL -DENABLE_EXTENSIONS=1 -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DUSE_PROPRIETARY_CODECS -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=278861-1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGL_GLEXT_PROTOTYPES -DUSE_GLX -DUSE_EGL -DSK_IGNORE_DW_GRAY_FIX -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_SUPPORT_GPU=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_NOEXCEPT= -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -I../.. -Igen -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Igen/shim_headers/harfbuzz_shim -I../../third_party/khronos -I../../gpu -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/images -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/include/gpu -I../../third_party/skia/src/gpu -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/mesa/src/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -fcolor-diagnostics -fdebug-prefix-map=/wrkdirs/usr/ports/www/chromium/work/chromium-54.0.2840.100=. -pthread -m64 -march=x86-64 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -O2 -fno-ident -fdata-sections -ffunction-sections -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -fno-rtti -fno-exceptions -c ../../services/ui/ws/window_manager_display_root.cc -o obj/services/ui/ws/lib/window_manager_display_root.o In file included from ../../services/ui/ws/window_manager_display_root.cc:5: In file included from ../../services/ui/ws/window_manager_display_root.h:10: In file included from /usr/include/c++/v1/memory:599: /usr/include/c++/v1/__config:58:2: error: "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead #error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \ ^ 1 error generated. contrib/libc++/include/__config: 309124 dim #ifdef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 309124 dim #error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \ 309124 dim use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead 309124 dim #endif Best, Conrad [0]: http://beefy12.nyi.freebsd.org/data/head-amd64-default/p431044_s311844/logs/errors/chromium-54.0.2840.100_1.log (warning: BIG) On Thu, Nov 24, 2016 at 2:54 PM, Dimitry Andric wrote: > Author: dim > Date: Thu Nov 24 22:54:55 2016 > New Revision: 309124 > URL: https://svnweb.freebsd.org/changeset/base/309124 > > Log: > Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 > release, and add lld 3.9.0. Also completely revamp the build system for > clang, llvm, lldb and their related tools. > > Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 > support to build; see UPDATING for more information. > > Release notes for llvm, clang and lld are available here: > > > > > Thanks to Ed Maste, Bryan Drewery, Andrew Turner, Antoine Brodin and Jan > Beich for their help. From owner-svn-src-all@freebsd.org Thu Jan 12 13:00:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C3D1CABD90; Thu, 12 Jan 2017 13:00:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB09914EE; Thu, 12 Jan 2017 13:00:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0CD0I63062598; Thu, 12 Jan 2017 13:00:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CD0HpJ062595; Thu, 12 Jan 2017 13:00:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701121300.v0CD0HpJ062595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 12 Jan 2017 13:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311977 - in head: share/man/man4 sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 13:00:19 -0000 Author: arybchik Date: Thu Jan 12 13:00:17 2017 New Revision: 311977 URL: https://svnweb.freebsd.org/changeset/base/311977 Log: sfxge(4): add tunable to configure MAC stats update period Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D9151 Modified: head/share/man/man4/sfxge.4 head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_port.c Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Thu Jan 12 11:53:33 2017 (r311976) +++ head/share/man/man4/sfxge.4 Thu Jan 12 13:00:17 2017 (r311977) @@ -158,6 +158,14 @@ The default for each port will be the va .Va hw.sfxge.mcdi_logging. The logging may also be enabled or disabled after the driver is loaded using the sysctl .Va dev.sfxge.%d.mcdi_logging. +.It Va hw.sfxge.stats_update_period_ms +Period in milliseconds to refresh interface statistics from hardware. +The accepted range is 0 to 65535, the default is 1000 (1 second). +Use zero value to disable periodic statistics update. +Supported on SFN8xxx series adapters with firmware v6.2.1.1033 and later and +SFN5xxx and SFN6xxx series adapters. +SFN7xxx series adapters and SFN8xxx series with earlier firmware use a +fixed 1000 milliseconds statistics update period. .El .Sh SUPPORT For general information and support, Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Thu Jan 12 11:53:33 2017 (r311976) +++ head/sys/dev/sfxge/sfxge.h Thu Jan 12 13:00:17 2017 (r311977) @@ -248,6 +248,7 @@ struct sfxge_port { #endif struct sfxge_hw_stats phy_stats; struct sfxge_hw_stats mac_stats; + uint16_t stats_update_period_ms; efx_link_mode_t link_mode; uint8_t mcast_addrs[EFX_MAC_MULTICAST_LIST_MAX * EFX_MAC_ADDR_LEN]; Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Thu Jan 12 11:53:33 2017 (r311976) +++ head/sys/dev/sfxge/sfxge_port.c Thu Jan 12 13:00:17 2017 (r311977) @@ -43,6 +43,15 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" +#define SFXGE_PARAM_STATS_UPDATE_PERIOD_MS \ + SFXGE_PARAM(stats_update_period_ms) +static int sfxge_stats_update_period_ms = SFXGE_STATS_UPDATE_PERIOD_MS; +TUNABLE_INT(SFXGE_PARAM_STATS_UPDATE_PERIOD_MS, + &sfxge_stats_update_period_ms); +SYSCTL_INT(_hw_sfxge, OID_AUTO, stats_update_period_ms, CTLFLAG_RDTUN, + &sfxge_stats_update_period_ms, 0, + "netstat interface statistics update period in milliseconds"); + static int sfxge_phy_cap_mask(struct sfxge_softc *, int, uint32_t *); static int @@ -62,7 +71,7 @@ sfxge_mac_stat_update(struct sfxge_softc goto out; } - min_ticks = (unsigned int)hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000; + min_ticks = (unsigned int)hz * port->stats_update_period_ms / 1000; now = ticks; if ((unsigned int)(now - port->mac_stats.update_time) < min_ticks) { @@ -515,7 +524,7 @@ sfxge_port_start(struct sfxge_softc *sc) /* Update MAC stats by DMA every period */ if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - SFXGE_STATS_UPDATE_PERIOD_MS, + port->stats_update_period_ms, B_FALSE)) != 0) goto fail6; @@ -673,6 +682,26 @@ sfxge_port_fini(struct sfxge_softc *sc) port->sc = NULL; } +static uint16_t +sfxge_port_stats_update_period_ms(struct sfxge_softc *sc) +{ + int period_ms = sfxge_stats_update_period_ms; + + if (period_ms < 0) { + device_printf(sc->dev, + "treat negative stats update period %d as 0 (disable)\n", + period_ms); + period_ms = 0; + } else if (period_ms > UINT16_MAX) { + device_printf(sc->dev, + "treat too big stats update period %d as %u\n", + period_ms, UINT16_MAX); + period_ms = UINT16_MAX; + } + + return period_ms; +} + int sfxge_port_init(struct sfxge_softc *sc) { @@ -721,6 +750,7 @@ sfxge_port_init(struct sfxge_softc *sc) M_SFXGE, M_WAITOK | M_ZERO); if ((rc = sfxge_dma_alloc(sc, EFX_MAC_STATS_SIZE, mac_stats_buf)) != 0) goto fail2; + port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc); sfxge_mac_stat_init(sc); port->init_state = SFXGE_PORT_INITIALIZED; From owner-svn-src-all@freebsd.org Thu Jan 12 14:18:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B6ECCACEEB; Thu, 12 Jan 2017 14:18:53 +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 5AF99191C; Thu, 12 Jan 2017 14:18:53 +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 v0CEIqIH095433; Thu, 12 Jan 2017 14:18:52 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CEIq2N095432; Thu, 12 Jan 2017 14:18:52 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701121418.v0CEIq2N095432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Jan 2017 14:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311978 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 14:18:53 -0000 Author: sbruno Date: Thu Jan 12 14:18:52 2017 New Revision: 311978 URL: https://svnweb.freebsd.org/changeset/base/311978 Log: Attempt to use the "new" BAR address for newer igb(4) devices. This code was dropped during the IFLIB migration. Reported by: olivier Reviewed by: mmacy@nextbsd.org Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 12 13:00:17 2017 (r311977) +++ head/sys/dev/e1000/if_em.c Thu Jan 12 14:18:52 2017 (r311978) @@ -770,6 +770,8 @@ em_if_attach_pre(if_ctx_t ctx) if (adapter->hw.mac.type >= igb_mac_min) { + int try_second_bar; + scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] * sizeof(union e1000_adv_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_adv_rx_desc), EM_DBA_ALIGN); scctx->isc_txrx = &igb_txrx; @@ -779,6 +781,15 @@ em_if_attach_pre(if_ctx_t ctx) if (adapter->hw.mac.type != e1000_82575) scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP; + /* + ** Some new devices, as with ixgbe, now may + ** use a different BAR, so we need to keep + ** track of which is used. + */ + try_second_bar = pci_read_config(dev, scctx->isc_msix_bar, 4); + if (try_second_bar == 0) + scctx->isc_msix_bar += 4; + } else if (adapter->hw.mac.type >= em_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0]* sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN); From owner-svn-src-all@freebsd.org Thu Jan 12 14:28:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76D2BCAB45F; Thu, 12 Jan 2017 14:28:33 +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 4654F1161; Thu, 12 Jan 2017 14:28:33 +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 v0CESW37099813; Thu, 12 Jan 2017 14:28:32 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CESWxp099812; Thu, 12 Jan 2017 14:28:32 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701121428.v0CESWxp099812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Jan 2017 14:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311979 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 14:28:33 -0000 Author: sbruno Date: Thu Jan 12 14:28:32 2017 New Revision: 311979 URL: https://svnweb.freebsd.org/changeset/base/311979 Log: Reset the EIAC register to include the LINK status bit and restore link up/down notifications. Submitted by: Franco Fichtner Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 12 14:18:52 2017 (r311978) +++ head/sys/dev/e1000/if_em.c Thu Jan 12 14:28:32 2017 (r311979) @@ -3117,7 +3117,7 @@ em_if_enable_intr(if_ctx_t ctx) u32 ims_mask = IMS_ENABLE_MASK; if (hw->mac.type == e1000_82574) { - E1000_WRITE_REG(hw, EM_EIAC, adapter->ims); + E1000_WRITE_REG(hw, EM_EIAC, EM_MSIX_MASK); ims_mask |= adapter->ims; } if (adapter->intr_type == IFLIB_INTR_MSIX && hw->mac.type >= igb_mac_min) { u32 mask = (adapter->que_mask | adapter->link_mask); From owner-svn-src-all@freebsd.org Thu Jan 12 14:38:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5776ACAB906; Thu, 12 Jan 2017 14:38:20 +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 322AF1A82; Thu, 12 Jan 2017 14:38:20 +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 v0CEcJp5004194; Thu, 12 Jan 2017 14:38:19 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CEcItI004188; Thu, 12 Jan 2017 14:38:18 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701121438.v0CEcItI004188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Jan 2017 14:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311980 - in head: . sys/conf sys/dev/e1000 sys/modules/em X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 14:38:20 -0000 Author: sbruno Date: Thu Jan 12 14:38:18 2017 New Revision: 311980 URL: https://svnweb.freebsd.org/changeset/base/311980 Log: Deprecate kernel configuration option EM_MULTIQUEUE now that the em(4) driver conforms to iflib. Modified: head/UPDATING head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/dev/e1000/if_em.h head/sys/modules/em/Makefile Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jan 12 14:28:32 2017 (r311979) +++ head/UPDATING Thu Jan 12 14:38:18 2017 (r311980) @@ -51,6 +51,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 ****************************** SPECIAL WARNING: ****************************** +20170112: + The EM_MULTIQUEUE kernel configuration option is deprecated now that + the em(4) driver conforms to iflib specifications. + 20170109: The igb(4), em(4) and lem(4) ethernet drivers are now implemented via IFLIB. If you have a custom kernel configuration that excludes em(4) Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jan 12 14:28:32 2017 (r311979) +++ head/sys/conf/NOTES Thu Jan 12 14:38:18 2017 (r311980) @@ -3055,9 +3055,6 @@ options RANDOM_ENABLE_UMA # slab alloca # Module to enable execution of application via emulators like QEMU options IMAGACT_BINMISC -# Intel em(4) driver -options EM_MULTIQUEUE # Activate multiqueue features/disable MSI-X - # zlib I/O stream support # This enables support for compressed core dumps. options GZIO Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jan 12 14:28:32 2017 (r311979) +++ head/sys/conf/files Thu Jan 12 14:38:18 2017 (r311980) @@ -2139,6 +2139,8 @@ dev/ixgbe/ix_txrx.c optional ix inet | compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_osdep.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_sysctl.c optional ix inet | ixv inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_phy.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_api.c optional ix inet | ixv inet \ Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jan 12 14:28:32 2017 (r311979) +++ head/sys/conf/options Thu Jan 12 14:38:18 2017 (r311980) @@ -986,9 +986,6 @@ RANDOM_LOADABLE opt_global.h # the uma slab allocator. RANDOM_ENABLE_UMA opt_global.h -# Intel em(4) driver -EM_MULTIQUEUE opt_em.h - # BHND(4) driver BHND_LOGLEVEL opt_global.h Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Thu Jan 12 14:28:32 2017 (r311979) +++ head/sys/dev/e1000/if_em.h Thu Jan 12 14:38:18 2017 (r311980) @@ -25,7 +25,6 @@ */ /*$FreeBSD$*/ -#include "opt_em.h" #include "opt_ddb.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -176,11 +175,7 @@ * restoring the network connection. To eliminate the potential * for the hang ensure that EM_RDTR is set to 0. */ -#ifdef EM_MULTIQUEUE -#define EM_RDTR 64 -#else #define EM_RDTR 0 -#endif /* * Receive Interrupt Absolute Delay Timer (Not valid for 82542/82543/82544) @@ -193,11 +188,7 @@ * along with EM_RDTR, may improve traffic throughput in specific network * conditions. */ -#ifdef EM_MULTIQUEUE -#define EM_RADV 128 -#else #define EM_RADV 64 -#endif /* * This parameter controls whether or not autonegotation is enabled. Modified: head/sys/modules/em/Makefile ============================================================================== --- head/sys/modules/em/Makefile Thu Jan 12 14:28:32 2017 (r311979) +++ head/sys/modules/em/Makefile Thu Jan 12 14:38:18 2017 (r311980) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../dev/e1000 KMOD = if_em -SRCS = device_if.h bus_if.h pci_if.h opt_ddb.h opt_em.h opt_inet.h \ +SRCS = device_if.h bus_if.h pci_if.h opt_ddb.h opt_inet.h \ opt_inet6.h ifdi_if.h SRCS += $(CORE_SRC) $(LEGACY_SRC) SRCS += $(COMMON_SHARED) $(LEGACY_SHARED) $(PCIE_SHARED) From owner-svn-src-all@freebsd.org Thu Jan 12 14:44:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D5FBCABD9A; Thu, 12 Jan 2017 14:44:43 +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 E157D11B1; Thu, 12 Jan 2017 14:44:42 +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 v0CEiggD008357; Thu, 12 Jan 2017 14:44:42 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CEigj8008356; Thu, 12 Jan 2017 14:44:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701121444.v0CEigj8008356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 12 Jan 2017 14:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311981 - head/usr.bin/rpcgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 14:44:43 -0000 Author: pfg Date: Thu Jan 12 14:44:41 2017 New Revision: 311981 URL: https://svnweb.freebsd.org/changeset/base/311981 Log: rpcgen(1): Check getrlimit() return for generated code. Obtained from: NetBSD (CVS rev 1.27, 1.28) MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_svcout.c Modified: head/usr.bin/rpcgen/rpc_svcout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_svcout.c Thu Jan 12 14:38:18 2017 (r311980) +++ head/usr.bin/rpcgen/rpc_svcout.c Thu Jan 12 14:44:41 2017 (r311981) @@ -728,7 +728,8 @@ write_timeout_func(void) if (tirpcflag) { f_print(fout, "\t\t\tstruct rlimit rl;\n\n"); f_print(fout, "\t\t\trl.rlim_max = 0;\n"); - f_print(fout, "\t\t\tgetrlimit(RLIMIT_NOFILE, &rl);\n"); + f_print(fout, "\t\t\tif (getrlimit(RLIMIT_NOFILE, &rl) == -1)\n"); + f_print(fout, "\t\t\t\treturn;\n"); f_print(fout, "\t\t\tif ((size = rl.rlim_max) == 0) {\n"); if (mtflag) @@ -902,7 +903,11 @@ write_rpc_svc_fg(const char *infile, con /* get number of file descriptors */ if (tirpcflag) { f_print(fout, "%srl.rlim_max = 0;\n", sp); - f_print(fout, "%sgetrlimit(RLIMIT_NOFILE, &rl);\n", sp); + f_print(fout, "%sif (getrlimit(RLIMIT_NOFILE, &rl) == -1) {\n", + sp); + f_print(fout, "%s\tperror(\"getrlimit\");\n", sp); + f_print(fout, "%s\texit(1);\n", sp); + f_print(fout, "%s}\n", sp); f_print(fout, "%sif ((size = rl.rlim_max) == 0)\n", sp); f_print(fout, "%s\texit(1);\n", sp); } else { From owner-svn-src-all@freebsd.org Thu Jan 12 14:47:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F7CCABEB1; Thu, 12 Jan 2017 14:47:45 +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 3376A14A1; Thu, 12 Jan 2017 14:47:45 +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 v0CEli1j008694; Thu, 12 Jan 2017 14:47:44 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CElih0008693; Thu, 12 Jan 2017 14:47:44 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701121447.v0CElih0008693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Jan 2017 14:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311982 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 14:47:45 -0000 Author: sbruno Date: Thu Jan 12 14:47:44 2017 New Revision: 311982 URL: https://svnweb.freebsd.org/changeset/base/311982 Log: Restore fixup for newer em(4) devices WOL capabilities post iflib integration. PR: 208343 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 12 14:44:41 2017 (r311981) +++ head/sys/dev/e1000/if_em.c Thu Jan 12 14:47:44 2017 (r311982) @@ -3308,6 +3308,8 @@ em_get_wakeup(if_ctx_t ctx) case e1000_ich10lan: case e1000_pchlan: case e1000_pch2lan: + case e1000_pch_lpt: + case e1000_pch_spt: apme_mask = E1000_WUC_APME; adapter->has_amt = TRUE; eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC); @@ -3376,7 +3378,7 @@ em_enable_wakeup(if_ctx_t ctx) struct adapter *adapter = iflib_get_softc(ctx); device_t dev = iflib_get_dev(ctx); if_t ifp = iflib_get_ifp(ctx); - u32 pmc, ctrl, ctrl_ext, rctl; + u32 pmc, ctrl, ctrl_ext, rctl, wuc; u16 status; if ((pci_find_cap(dev, PCIY_PMG, &pmc) != 0)) @@ -3386,7 +3388,9 @@ em_enable_wakeup(if_ctx_t ctx) ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); ctrl |= (E1000_CTRL_SWDPIN2 | E1000_CTRL_SWDPIN3); E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); - E1000_WRITE_REG(&adapter->hw, E1000_WUC, E1000_WUC_PME_EN); + wuc = E1000_READ_REG(&adapter->hw, E1000_WUC); + wuc |= E1000_WUC_PME_EN ; + E1000_WRITE_REG(&adapter->hw, E1000_WUC, wuc); if ((adapter->hw.mac.type == e1000_ich8lan) || (adapter->hw.mac.type == e1000_pchlan) || @@ -3418,7 +3422,9 @@ em_enable_wakeup(if_ctx_t ctx) } if ((adapter->hw.mac.type == e1000_pchlan) || - (adapter->hw.mac.type == e1000_pch2lan)) { + (adapter->hw.mac.type == e1000_pch2lan) || + (adapter->hw.mac.type == e1000_pch_lpt) || + (adapter->hw.mac.type == e1000_pch_spt)) { if (em_enable_phy_wakeup(adapter)) return; } else { From owner-svn-src-all@freebsd.org Thu Jan 12 15:26:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5859BCACC61; Thu, 12 Jan 2017 15:26:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19C211CEA; Thu, 12 Jan 2017 15:26:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0CFQORt025505; Thu, 12 Jan 2017 15:26:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CFQOTD025502; Thu, 12 Jan 2017 15:26:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701121526.v0CFQOTD025502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 12 Jan 2017 15:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311983 - in head: share/man/man4 sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 15:26:25 -0000 Author: arybchik Date: Thu Jan 12 15:26:23 2017 New Revision: 311983 URL: https://svnweb.freebsd.org/changeset/base/311983 Log: sfxge(4): add sysctl to change MAC stats update period The sysctl controls the period per interface. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D9153 Modified: head/share/man/man4/sfxge.4 head/sys/dev/sfxge/sfxge_port.c Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Thu Jan 12 14:47:44 2017 (r311982) +++ head/share/man/man4/sfxge.4 Thu Jan 12 15:26:23 2017 (r311983) @@ -166,6 +166,8 @@ Supported on SFN8xxx series adapters wit SFN5xxx and SFN6xxx series adapters. SFN7xxx series adapters and SFN8xxx series with earlier firmware use a fixed 1000 milliseconds statistics update period. +The period may also be changed after the driver is loaded using the sysctl +.Va dev.sfxge.%d.stats_update_period_ms . .El .Sh SUPPORT For general information and support, Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Thu Jan 12 14:47:44 2017 (r311982) +++ head/sys/dev/sfxge/sfxge_port.c Thu Jan 12 15:26:23 2017 (r311983) @@ -702,6 +702,48 @@ sfxge_port_stats_update_period_ms(struct return period_ms; } +static int +sfxge_port_stats_update_period_ms_handler(SYSCTL_HANDLER_ARGS) +{ + struct sfxge_softc *sc; + struct sfxge_port *port; + unsigned int period_ms; + int error; + + sc = arg1; + port = &sc->port; + + if (req->newptr != NULL) { + error = SYSCTL_IN(req, &period_ms, sizeof(period_ms)); + if (error != 0) + return (error); + + if (period_ms > UINT16_MAX) + return (EINVAL); + + SFXGE_PORT_LOCK(port); + + if (port->stats_update_period_ms != period_ms) { + if (port->init_state == SFXGE_PORT_STARTED) + error = efx_mac_stats_periodic(sc->enp, + &port->mac_stats.dma_buf, + period_ms, B_FALSE); + if (error == 0) + port->stats_update_period_ms = period_ms; + } + + SFXGE_PORT_UNLOCK(port); + } else { + SFXGE_PORT_LOCK(port); + period_ms = port->stats_update_period_ms; + SFXGE_PORT_UNLOCK(port); + + error = SYSCTL_OUT(req, &period_ms, sizeof(period_ms)); + } + + return (error); +} + int sfxge_port_init(struct sfxge_softc *sc) { @@ -753,6 +795,11 @@ sfxge_port_init(struct sfxge_softc *sc) port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc); sfxge_mac_stat_init(sc); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "stats_update_period_ms", CTLTYPE_UINT|CTLFLAG_RW, sc, 0, + sfxge_port_stats_update_period_ms_handler, "IU", + "interface statistics refresh period"); + port->init_state = SFXGE_PORT_INITIALIZED; DBGPRINT(sc->dev, "success"); From owner-svn-src-all@freebsd.org Thu Jan 12 15:54:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6820CAC6E0; Thu, 12 Jan 2017 15:54:04 +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 5C5831CFD; Thu, 12 Jan 2017 15:54:04 +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 v0CFs3bk037305; Thu, 12 Jan 2017 15:54:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CFs3eN037304; Thu, 12 Jan 2017 15:54:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701121554.v0CFs3eN037304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Jan 2017 15:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311984 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 15:54:04 -0000 Author: kib Date: Thu Jan 12 15:54:03 2017 New Revision: 311984 URL: https://svnweb.freebsd.org/changeset/base/311984 Log: For the main binary, postpone enforcing relro read-only protection until copy relocations are done. Newer binutils and lld seems to output copy into relro-protected range. Reported by: Rafael Espц╜ndola via emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Jan 12 15:26:23 2017 (r311983) +++ head/libexec/rtld-elf/rtld.c Thu Jan 12 15:54:03 2017 (r311984) @@ -103,6 +103,7 @@ static int load_needed_objects(Obj_Entry static int load_preload_objects(void); static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); +static int obj_enforce_relro(Obj_Entry *); static Obj_Entry *obj_from_addr(const void *); static void objlist_call_fini(Objlist *, Obj_Entry *, RtldLockState *); static void objlist_call_init(Objlist *, RtldLockState *); @@ -617,6 +618,10 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ if (do_copy_relocations(obj_main) == -1) rtld_die(); + dbg("enforcing main obj relro"); + if (obj_enforce_relro(obj_main) == -1) + rtld_die(); + if (getenv(_LD("DUMP_REL_POST")) != NULL) { dump_relocations(obj_main); exit (0); @@ -2746,14 +2751,8 @@ relocate_object(Obj_Entry *obj, bool bin reloc_non_plt(obj, rtldobj, flags | SYMLOOK_IFUNC, lockstate)) return (-1); - if (obj->relro_size > 0) { - if (mprotect(obj->relro_page, obj->relro_size, - PROT_READ) == -1) { - _rtld_error("%s: Cannot enforce relro protection: %s", - obj->path, rtld_strerror(errno)); - return (-1); - } - } + if (!obj->mainprog && obj_enforce_relro(obj) == -1) + return (-1); /* * Set up the magic number and version in the Obj_Entry. These @@ -5124,6 +5123,19 @@ _rtld_is_dlopened(void *arg) return (res); } +int +obj_enforce_relro(Obj_Entry *obj) +{ + + if (obj->relro_size > 0 && mprotect(obj->relro_page, obj->relro_size, + PROT_READ) == -1) { + _rtld_error("%s: Cannot enforce relro protection: %s", + obj->path, rtld_strerror(errno)); + return (-1); + } + return (0); +} + static void map_stacks_exec(RtldLockState *lockstate) { From owner-svn-src-all@freebsd.org Thu Jan 12 16:16:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97140CACCA2; Thu, 12 Jan 2017 16:16:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (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 60E281719; Thu, 12 Jan 2017 16:16:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x243.google.com with SMTP id 101so2876870iom.0; Thu, 12 Jan 2017 08:16:10 -0800 (PST) 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=lFUeJKoh9lakCvIT/OC6wlL6qZ/bVUvYzFwXT6Cv2m0=; b=Y08t+84bCW4OXk15apbO/BmY+Lx77Jo/KUlTFO209IQ85L8fSHJm/BBIl2V5oR9n7I pGAj5T1fh5NpNaM8Syy0NHYR1MtS75TB9rz/MYxLpFTl0rgG/Ozx/ECnWJB7oAKOVUbE 4XzU+E2cEcJphQqoYW53YBHkSY3ySAxx62LddBGuQnBX9JxYBEsG60Z26VtRzBkO3EcL x6aaPQ38ZQ2jf36AVKOgDuCthA3LYWSFk6dsmSBTWy75MH0lINF6HDoDeT7RobBUd8fe IWEEGAySNMypPCa/hjLmLozvR1Ji4dKDgEJz8iq7cDgtcmWv+UWZ3i29BEB/lp2gaB/3 d0oQ== 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=lFUeJKoh9lakCvIT/OC6wlL6qZ/bVUvYzFwXT6Cv2m0=; b=lK3aj4K6HBFHaawOoQCKVZvQFTq7UkVKapgrPqYnfcsM70nD2ey+KHJZq43vbREzMg ZOXmZe7f61bd/XaJD1qzm/jvtzVUyfmZpfnF4s9fUthpQ4K65LMUr2ot+7XihCMnunmf rUKO+2FQF4PNdk4KBq3d3BIQzuhjPk+OlBagamsEd5jB7jdmwEViirRLRGl25iuMp8nV rvWXyOXsj+Yn+d9hHepQfedg+tmihIfdfOC9hAh8VsnsjJnchY87VVlaWs80PYU9SpCY vePBUh+7mH3/+MWLg2L7RUJoiJkGr5VMaBWjJQshxLfskUG+AiI2fg4GFTQj+TPzwh5I a8lg== X-Gm-Message-State: AIkVDXJ4zYAuzFgJGhYU13k8y5PUL+JXsVU+iWQXLrzTNxsZNAwmsf5rpdvRWmVeUwNnO7YXvRB6b36555f1kQ== X-Received: by 10.107.23.198 with SMTP id 189mr7104283iox.162.1484237769373; Thu, 12 Jan 2017 08:16:09 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.175.159 with HTTP; Thu, 12 Jan 2017 08:15:48 -0800 (PST) In-Reply-To: <201701121554.v0CFs3eN037304@repo.freebsd.org> References: <201701121554.v0CFs3eN037304@repo.freebsd.org> From: Ed Maste Date: Thu, 12 Jan 2017 11:15:48 -0500 X-Google-Sender-Auth: jfffV0ArA5YABXCibfE46pBmtYc Message-ID: Subject: Re: svn commit: r311984 - head/libexec/rtld-elf To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 16:16:10 -0000 On 12 January 2017 at 10:54, Konstantin Belousov wrote: > Author: kib > Date: Thu Jan 12 15:54:03 2017 > New Revision: 311984 > URL: https://svnweb.freebsd.org/changeset/base/311984 > > Log: > For the main binary, postpone enforcing relro read-only protection > until copy relocations are done. > > Newer binutils and lld seems to output copy into relro-protected range. AFAIK no released version of GNU BFD ld or gold have this change yet, but it has been committed to both. There's a long thread with details at https://sourceware.org/ml/libc-alpha/2016-12/msg00914.html From owner-svn-src-all@freebsd.org Thu Jan 12 16:22:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9CAACACF0D; Thu, 12 Jan 2017 16:22:29 +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 B829F1C1A; Thu, 12 Jan 2017 16:22:29 +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 v0CGMSmQ048585; Thu, 12 Jan 2017 16:22:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CGMSTQ048584; Thu, 12 Jan 2017 16:22:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701121622.v0CGMSTQ048584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 12 Jan 2017 16:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311985 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 16:22:30 -0000 Author: asomers Date: Thu Jan 12 16:22:28 2017 New Revision: 311985 URL: https://svnweb.freebsd.org/changeset/base/311985 Log: Fix uninitialized variable CIDs in route6d The variables in question are actually return arguments, but it's still good form to initialize them. Reported by: Coverity CID: 979679 979680 MFC after: 4 weeks Sponsored by: Spectra Logic Corp Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Thu Jan 12 15:54:03 2017 (r311984) +++ head/usr.sbin/route6d/route6d.c Thu Jan 12 16:22:28 2017 (r311985) @@ -1062,6 +1062,7 @@ sendpacket(struct sockaddr_in6 *sin6, in iov[0].iov_len = len; m.msg_iov = iov; m.msg_iovlen = 1; + m.msg_flags = 0; if (!idx) { m.msg_control = NULL; m.msg_controllen = 0; @@ -1126,6 +1127,7 @@ riprecv(void) cm = (struct cmsghdr *)cmsgbuf; m.msg_control = (caddr_t)cm; m.msg_controllen = sizeof(cmsgbuf); + m.msg_flags = 0; if ((len = recvmsg(ripsock, &m, 0)) < 0) { fatal("recvmsg"); /*NOTREACHED*/ From owner-svn-src-all@freebsd.org Thu Jan 12 16:24:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFBE6CACFE9; Thu, 12 Jan 2017 16:24:11 +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 BF6181DF2; Thu, 12 Jan 2017 16:24:11 +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 v0CGOAJ8049350; Thu, 12 Jan 2017 16:24:10 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CGOApg049349; Thu, 12 Jan 2017 16:24:10 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701121624.v0CGOApg049349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Jan 2017 16:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311986 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 16:24:12 -0000 Author: sbruno Date: Thu Jan 12 16:24:10 2017 New Revision: 311986 URL: https://svnweb.freebsd.org/changeset/base/311986 Log: Fix panic on mb_free_ext() due to NULL destructor. This used to happen because of the SET_MBUF_DESTRUCTOR() called on unregif. Submitted by: Vincenzo Maffione Modified: head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Thu Jan 12 16:22:28 2017 (r311985) +++ head/sys/dev/netmap/netmap_generic.c Thu Jan 12 16:24:10 2017 (r311986) @@ -165,12 +165,12 @@ nm_os_get_mbuf(struct ifnet *ifp, int le * has a KASSERT(), checking that the mbuf dtor function is not NULL. */ +static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { } + #define SET_MBUF_DESTRUCTOR(m, fn) do { \ - (m)->m_ext.ext_free = (void *)fn; \ + (m)->m_ext.ext_free = fn ? (void *)fn : (void *)void_mbuf_dtor; \ } while (0) -static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { } - static inline struct mbuf * nm_os_get_mbuf(struct ifnet *ifp, int len) { From owner-svn-src-all@freebsd.org Thu Jan 12 16:30:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96DFDCAC085; Thu, 12 Jan 2017 16:30:28 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0C1101E; Thu, 12 Jan 2017 16:30:28 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0CGURUo049621; Thu, 12 Jan 2017 16:30:27 GMT (envelope-from bms@FreeBSD.org) Received: (from bms@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CGURes049619; Thu, 12 Jan 2017 16:30:27 GMT (envelope-from bms@FreeBSD.org) Message-Id: <201701121630.v0CGURes049619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bms set sender to bms@FreeBSD.org using -f From: Bruce M Simpson Date: Thu, 12 Jan 2017 16:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311987 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 16:30:28 -0000 Author: bms Date: Thu Jan 12 16:30:27 2017 New Revision: 311987 URL: https://svnweb.freebsd.org/changeset/base/311987 Log: Allow uart(4) to use MSI interrupts on single-port PCI instances. Do this here as puc(4) disallows single-port instances; at least one multi-port PCIe UART chip (in this case, the ASIX MCS9922) present separate PCI configuration space (functions) for each UART. Tested using lrzsz and a null-modem cable. The ExpressCard/34 variants containing the MCS9922 should also use MSI with this change. Reviewed by: jhb, imp, rpokala MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D9123 Modified: head/sys/dev/uart/uart_bus_pci.c head/sys/dev/uart/uart_core.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Thu Jan 12 16:24:10 2017 (r311986) +++ head/sys/dev/uart/uart_bus_pci.c Thu Jan 12 16:30:27 2017 (r311987) @@ -45,12 +45,14 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_RCLK 1843200 static int uart_pci_probe(device_t dev); +static int uart_pci_attach(device_t dev); +static int uart_pci_detach(device_t dev); static device_method_t uart_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, uart_pci_probe), - DEVMETHOD(device_attach, uart_bus_attach), - DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_attach, uart_pci_attach), + DEVMETHOD(device_detach, uart_pci_detach), DEVMETHOD(device_resume, uart_bus_resume), DEVMETHOD_END }; @@ -209,4 +211,40 @@ uart_pci_probe(device_t dev) return (result); } +static int +uart_pci_attach(device_t dev) +{ + struct uart_softc *sc; + int count; + + sc = device_get_softc(dev); + + /* + * Use MSI in preference to legacy IRQ if available. + * Whilst some PCIe UARTs support >1 MSI vector, use only the first. + */ + if (pci_msi_count(dev) > 0) { + count = 1; + if (pci_alloc_msi(dev, &count) == 0) { + sc->sc_irid = 1; + device_printf(dev, "Using %d MSI message\n", count); + } + } + + return (uart_bus_attach(dev)); +} + +static int +uart_pci_detach(device_t dev) +{ + struct uart_softc *sc; + + sc = device_get_softc(dev); + + if (sc->sc_irid != 0) + pci_release_msi(dev); + + return (uart_bus_detach(dev)); +} + DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL); Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Thu Jan 12 16:24:10 2017 (r311986) +++ head/sys/dev/uart/uart_core.c Thu Jan 12 16:30:27 2017 (r311987) @@ -677,7 +677,6 @@ uart_bus_attach(device_t dev) * safest thing to do. */ if (filt != FILTER_SCHEDULE_THREAD && !uart_force_poll) { - sc->sc_irid = 0; sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid, RF_ACTIVE | RF_SHAREABLE); } From owner-svn-src-all@freebsd.org Thu Jan 12 16:44:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC04ACAC72E; Thu, 12 Jan 2017 16:44:41 +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 8B94D1C2D; Thu, 12 Jan 2017 16:44:41 +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 v0CGie9C057778; Thu, 12 Jan 2017 16:44:40 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CGielQ057777; Thu, 12 Jan 2017 16:44:40 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701121644.v0CGielQ057777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Jan 2017 16:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311988 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 16:44:41 -0000 Author: sbruno Date: Thu Jan 12 16:44:40 2017 New Revision: 311988 URL: https://svnweb.freebsd.org/changeset/base/311988 Log: Purge EM_MULTIQUEUE references from the man page for em(4). Modified: head/share/man/man4/em.4 Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Thu Jan 12 16:30:27 2017 (r311987) +++ head/share/man/man4/em.4 Thu Jan 12 16:44:40 2017 (r311988) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2015 +.Dd January 12, 2016 .Dt EM 4 .Os .Sh NAME @@ -45,14 +45,6 @@ kernel configuration file: .Cd "device em" .Ed .Pp -Optional multiqueue support is available via the following kernel -compile options: -.Bd -ragged -offset indent -.Cd "options EM_MULTIQUEUE" -.Ed -.Pp -Note: Activating EM_MULTIQUEUE support is not supported by Intel. -.Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : @@ -253,12 +245,6 @@ If .Va hw.em.tx_int_delay is non-zero, this tunable limits the maximum delay in which a transmit interrupt is generated. -.It Va hw.em.num_queues -Number of hardware queues that will be configured on this adapter (maximum of 2) -Defaults to 1. -Only valid with kernel configuration -.Cd "options EM_MULTIQUEUE". -.El .Sh FILES .Bl -tag -width /dev/led/em* .It Pa /dev/led/em* @@ -311,5 +297,3 @@ The .Nm driver was written by .An Intel Corporation Aq Mt freebsd@intel.com . -.Sh BUGS -Activating EM_MULTIQUEUE support requires MSI-X features. From owner-svn-src-all@freebsd.org Thu Jan 12 17:02:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92D0ACAC124; Thu, 12 Jan 2017 17:02:31 +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 53B031976; Thu, 12 Jan 2017 17:02:31 +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 v0CH2U3D065441; Thu, 12 Jan 2017 17:02:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CH2Twi065431; Thu, 12 Jan 2017 17:02:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701121702.v0CH2Twi065431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 Jan 2017 17:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311989 - head/sys/libkern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 17:02:31 -0000 Author: cem Date: Thu Jan 12 17:02:29 2017 New Revision: 311989 URL: https://svnweb.freebsd.org/changeset/base/311989 Log: libkern: Remove obsolete 'register' keyword Sponsored by: Dell EMC Isilon Modified: head/sys/libkern/bcmp.c head/sys/libkern/bsearch.c head/sys/libkern/iconv_ucs.c head/sys/libkern/iconv_xlat16.c head/sys/libkern/memmem.c head/sys/libkern/qdivrem.c head/sys/libkern/qsort.c head/sys/libkern/random.c head/sys/libkern/scanc.c head/sys/libkern/strcmp.c head/sys/libkern/strncpy.c Modified: head/sys/libkern/bcmp.c ============================================================================== --- head/sys/libkern/bcmp.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/bcmp.c Thu Jan 12 17:02:29 2017 (r311989) @@ -44,7 +44,7 @@ typedef const unsigned long *culp; int bcmp(b1, b2, length) const void *b1, *b2; - register size_t length; + size_t length; { #if BYTE_ORDER == LITTLE_ENDIAN /* Modified: head/sys/libkern/bsearch.c ============================================================================== --- head/sys/libkern/bsearch.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/bsearch.c Thu Jan 12 17:02:29 2017 (r311989) @@ -54,16 +54,16 @@ __FBSDID("$FreeBSD$"); */ void * bsearch(key, base0, nmemb, size, compar) - register const void *key; + const void *key; const void *base0; size_t nmemb; - register size_t size; - register int (*compar)(const void *, const void *); + size_t size; + int (*compar)(const void *, const void *); { - register const char *base = base0; - register size_t lim; - register int cmp; - register const void *p; + const char *base = base0; + size_t lim; + int cmp; + const void *p; for (lim = nmemb; lim != 0; lim >>= 1) { p = base + (lim >> 1) * size; Modified: head/sys/libkern/iconv_ucs.c ============================================================================== --- head/sys/libkern/iconv_ucs.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/iconv_ucs.c Thu Jan 12 17:02:29 2017 (r311989) @@ -523,14 +523,14 @@ ucs4_to_utf8(uint32_t ucs4, char *dst, s } static uint32_t -encode_surrogate(register uint32_t code) +encode_surrogate(uint32_t code) { return ((((code - 0x10000) << 6) & 0x3ff0000) | ((code - 0x10000) & 0x3ff) | 0xd800dc00); } static uint32_t -decode_surrogate(register const u_char *ucs) +decode_surrogate(const u_char *ucs) { return ((((ucs[0] & 0x3) << 18) | (ucs[1] << 10) | ((ucs[2] & 0x3) << 8) | ucs[3]) + 0x10000); Modified: head/sys/libkern/iconv_xlat16.c ============================================================================== --- head/sys/libkern/iconv_xlat16.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/iconv_xlat16.c Thu Jan 12 17:02:29 2017 (r311989) @@ -298,10 +298,10 @@ iconv_xlat16_name(struct iconv_converter } static int -iconv_xlat16_tolower(void *d2p, register int c) +iconv_xlat16_tolower(void *d2p, int c) { struct iconv_xlat16 *dp = (struct iconv_xlat16*)d2p; - register int c1, c2, out; + int c1, c2, out; if (c < 0x100) { c1 = C2I1(c << 8); @@ -323,10 +323,10 @@ iconv_xlat16_tolower(void *d2p, register } static int -iconv_xlat16_toupper(void *d2p, register int c) +iconv_xlat16_toupper(void *d2p, int c) { struct iconv_xlat16 *dp = (struct iconv_xlat16*)d2p; - register int c1, c2, out; + int c1, c2, out; if (c < 0x100) { c1 = C2I1(c << 8); Modified: head/sys/libkern/memmem.c ============================================================================== --- head/sys/libkern/memmem.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/memmem.c Thu Jan 12 17:02:29 2017 (r311989) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); void * memmem(const void *l, size_t l_len, const void *s, size_t s_len) { - register char *cur, *last; + char *cur, *last; const char *cl = (const char *)l; const char *cs = (const char *)s; Modified: head/sys/libkern/qdivrem.c ============================================================================== --- head/sys/libkern/qdivrem.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/qdivrem.c Thu Jan 12 17:02:29 2017 (r311989) @@ -59,9 +59,9 @@ typedef u_long digit; * We may assume len >= 0. NOTE THAT THIS WRITES len+1 DIGITS. */ static void -__shl(register digit *p, register int len, register int sh) +__shl(digit *p, int len, int sh) { - register int i; + int i; for (i = 0; i < len; i++) p[i] = LHALF(p[i] << sh) | (p[i + 1] >> (HALF_BITS - sh)); @@ -82,7 +82,7 @@ __qdivrem(uq, vq, arq) { union uu tmp; digit *u, *v, *q; - register digit v1, v2; + digit v1, v2; u_long qhat, rhat, t; int m, n, d, j, i; digit uspace[5], vspace[5], qspace[5]; @@ -192,7 +192,7 @@ __qdivrem(uq, vq, arq) v1 = v[1]; /* for D3 -- note that v[1..n] are constant */ v2 = v[2]; /* for D3 */ do { - register digit uj0, uj1, uj2; + digit uj0, uj1, uj2; /* * D3: Calculate qhat (\^q, in TeX notation). Modified: head/sys/libkern/qsort.c ============================================================================== --- head/sys/libkern/qsort.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/qsort.c Thu Jan 12 17:02:29 2017 (r311989) @@ -48,10 +48,10 @@ static __inline void swapfunc(char *, c */ #define swapcode(TYPE, parmi, parmj, n) { \ long i = (n) / sizeof (TYPE); \ - register TYPE *pi = (TYPE *) (parmi); \ - register TYPE *pj = (TYPE *) (parmj); \ + TYPE *pi = (TYPE *) (parmi); \ + TYPE *pj = (TYPE *) (parmj); \ do { \ - register TYPE t = *pi; \ + TYPE t = *pi; \ *pi++ = *pj; \ *pj++ = t; \ } while (--i > 0); \ Modified: head/sys/libkern/random.c ============================================================================== --- head/sys/libkern/random.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/random.c Thu Jan 12 17:02:29 2017 (r311989) @@ -57,7 +57,7 @@ srandom(seed) u_long random() { - register long x, hi, lo, t; + long x, hi, lo, t; /* * Compute x[n + 1] = (7^5 * x[n]) mod (2^31 - 1). Modified: head/sys/libkern/scanc.c ============================================================================== --- head/sys/libkern/scanc.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/scanc.c Thu Jan 12 17:02:29 2017 (r311989) @@ -37,11 +37,11 @@ __FBSDID("$FreeBSD$"); int scanc(size, cp, table, mask0) u_int size; - register const u_char *cp, table[]; + const u_char *cp, table[]; int mask0; { - register const u_char *end; - register u_char mask; + const u_char *end; + u_char mask; mask = mask0; for (end = &cp[size]; cp < end; ++cp) { Modified: head/sys/libkern/strcmp.c ============================================================================== --- head/sys/libkern/strcmp.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/strcmp.c Thu Jan 12 17:02:29 2017 (r311989) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); */ int strcmp(s1, s2) - register const char *s1, *s2; + const char *s1, *s2; { while (*s1 == *s2++) if (*s1++ == 0) Modified: head/sys/libkern/strncpy.c ============================================================================== --- head/sys/libkern/strncpy.c Thu Jan 12 16:44:40 2017 (r311988) +++ head/sys/libkern/strncpy.c Thu Jan 12 17:02:29 2017 (r311989) @@ -43,8 +43,8 @@ char * strncpy(char * __restrict dst, const char * __restrict src, size_t n) { if (n != 0) { - register char *d = dst; - register const char *s = src; + char *d = dst; + const char *s = src; do { if ((*d++ = *s++) == 0) { From owner-svn-src-all@freebsd.org Thu Jan 12 17:18:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58188CAC872; Thu, 12 Jan 2017 17:18:26 +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 27C86195E; Thu, 12 Jan 2017 17:18:26 +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 v0CHIPOt070727; Thu, 12 Jan 2017 17:18:25 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CHIPnL070726; Thu, 12 Jan 2017 17:18:25 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701121718.v0CHIPnL070726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Jan 2017 17:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311990 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 17:18:26 -0000 Author: sbruno Date: Thu Jan 12 17:18:25 2017 New Revision: 311990 URL: https://svnweb.freebsd.org/changeset/base/311990 Log: Purge surprise change to sys/conf/files for ixgbe(4). Reported by: imp Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jan 12 17:02:29 2017 (r311989) +++ head/sys/conf/files Thu Jan 12 17:18:25 2017 (r311990) @@ -2139,8 +2139,6 @@ dev/ixgbe/ix_txrx.c optional ix inet | compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_osdep.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_sysctl.c optional ix inet | ixv inet \ - compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_phy.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_api.c optional ix inet | ixv inet \ From owner-svn-src-all@freebsd.org Thu Jan 12 18:05:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D146ECADB27; Thu, 12 Jan 2017 18:05:13 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0D711D99; Thu, 12 Jan 2017 18:05:13 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0CI5CjU090737; Thu, 12 Jan 2017 18:05:12 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CI5CYg090736; Thu, 12 Jan 2017 18:05:12 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201701121805.v0CI5CYg090736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Thu, 12 Jan 2017 18:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311993 - head/sys/dev/nand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 18:05:13 -0000 Author: kan Date: Thu Jan 12 18:05:12 2017 New Revision: 311993 URL: https://svnweb.freebsd.org/changeset/base/311993 Log: Fix typo in r311971. Reported by: ohartmann at walstatt.org Modified: head/sys/dev/nand/nand_geom.c Modified: head/sys/dev/nand/nand_geom.c ============================================================================== --- head/sys/dev/nand/nand_geom.c Thu Jan 12 17:54:55 2017 (r311992) +++ head/sys/dev/nand/nand_geom.c Thu Jan 12 18:05:12 2017 (r311993) @@ -416,7 +416,7 @@ create_geom_disk(struct nand_chip *chip) snprintf(rdisk->d_ident, sizeof(rdisk->d_ident), "nand_raw: Man:0x%02x Dev:0x%02x", chip->id.man_id, chip->id.dev_id); - disk->d_rotation_rate = DISK_RR_NON_ROTATING; + rdisk->d_rotation_rate = DISK_RR_NON_ROTATING; disk_create(rdisk, DISK_VERSION); From owner-svn-src-all@freebsd.org Thu Jan 12 18:44:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2A84CAB7BF; Thu, 12 Jan 2017 18:44:59 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A240714C5; Thu, 12 Jan 2017 18:44:59 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0CIiwRZ006943; Thu, 12 Jan 2017 18:44:58 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CIiw5v006942; Thu, 12 Jan 2017 18:44:58 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201701121844.v0CIiw5v006942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 12 Jan 2017 18:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311994 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 18:44:59 -0000 Author: hrs Date: Thu Jan 12 18:44:58 2017 New Revision: 311994 URL: https://svnweb.freebsd.org/changeset/base/311994 Log: - Fix dereference of NULL pointer which could cause a crash [1] - Fix memory leak due to lack of freeaddrinfo() [2] CID: 1018281 [1] CID: 1225057 [2] MFC after: 3 days Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Thu Jan 12 18:05:12 2017 (r311993) +++ head/usr.sbin/route6d/route6d.c Thu Jan 12 18:44:58 2017 (r311994) @@ -684,6 +684,7 @@ init(void) /*NOTREACHED*/ } #endif + freeaddrinfo(res); memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_INET6; @@ -699,6 +700,7 @@ init(void) /*NOTREACHED*/ } memcpy(&ripsin, res->ai_addr, res->ai_addrlen); + freeaddrinfo(res); #ifdef HAVE_POLL_H set[0].fd = ripsock; @@ -788,10 +790,17 @@ ripflush(struct ifc *ifcp, struct sockad error = sendpacket(sin6, RIPSIZE(nrt)); if (error == EAFNOSUPPORT) { /* Protocol not supported */ - tracet(1, "Could not send info to %s (%s): " - "set IFF_UP to 0\n", - ifcp->ifc_name, inet6_n2p(&ifcp->ifc_ripsin.sin6_addr)); - ifcp->ifc_flags &= ~IFF_UP; /* As if down for AF_INET6 */ + if (ifcp != NULL) { + tracet(1, "Could not send info to %s (%s): " + "set IFF_UP to 0\n", + ifcp->ifc_name, + inet6_n2p(&ifcp->ifc_ripsin.sin6_addr)); + /* As if down for AF_INET6 */ + ifcp->ifc_flags &= ~IFF_UP; + } else { + tracet(1, "Could not send info to %s\n", + inet6_n2p(&sin6->sin6_addr)); + } } } From owner-svn-src-all@freebsd.org Thu Jan 12 20:26:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B241CACE7F; Thu, 12 Jan 2017 20:26:03 +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 1ACE71A38; Thu, 12 Jan 2017 20:26:03 +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 v0CKQ2pf050396; Thu, 12 Jan 2017 20:26:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CKQ2eO050395; Thu, 12 Jan 2017 20:26:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201701122026.v0CKQ2eO050395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 12 Jan 2017 20:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311995 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 20:26:03 -0000 Author: glebius Date: Thu Jan 12 20:26:02 2017 New Revision: 311995 URL: https://svnweb.freebsd.org/changeset/base/311995 Log: Fix the contiguity once more. Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Thu Jan 12 18:44:58 2017 (r311994) +++ head/sys/vm/vnode_pager.c Thu Jan 12 20:26:02 2017 (r311995) @@ -974,7 +974,7 @@ vnode_pager_generic_getpages(struct vnod #ifdef INVARIANTS KASSERT(bp->b_npages <= nitems(bp->b_pages), ("%s: buf %p overflowed", __func__, bp)); - for (int j = 1, prev = 1; j < bp->b_npages; j++) { + for (int j = 1, prev = 0; j < bp->b_npages; j++) { if (bp->b_pages[j] == bogus_page) continue; KASSERT(bp->b_pages[j]->pindex - bp->b_pages[prev]->pindex == From owner-svn-src-all@freebsd.org Thu Jan 12 21:18:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 062FDCAC5A6; Thu, 12 Jan 2017 21:18:45 +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 CA173143C; Thu, 12 Jan 2017 21:18:44 +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 v0CLIh3w070476; Thu, 12 Jan 2017 21:18:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CLIhVN070475; Thu, 12 Jan 2017 21:18:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701122118.v0CLIhVN070475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 12 Jan 2017 21:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311996 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 21:18:45 -0000 Author: ian Date: Thu Jan 12 21:18:43 2017 New Revision: 311996 URL: https://svnweb.freebsd.org/changeset/base/311996 Log: Restructure the tty_drain loop so that device-busy is checked one more time after tty_timedwait() returns an error only if the error is EWOULDBLOCK; other errors cause an immediate return. This fixes the case of the tty disappearing while in tty_drain(). Reported by: pho Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Thu Jan 12 20:26:02 2017 (r311995) +++ head/sys/kern/tty.c Thu Jan 12 21:18:43 2017 (r311996) @@ -166,11 +166,9 @@ tty_drain(struct tty *tp, int leaving) return (error); ttydevsw_outwakeup(tp); error = tty_timedwait(tp, &tp->t_outwait, hz / 10); - if (timeout_at == 0 && error == EWOULDBLOCK) - error = 0; - if (error != EWOULDBLOCK) - continue; - if (getsbinuptime() < timeout_at) + if (error != 0 && error != EWOULDBLOCK) + return (error); + else if (timeout_at == 0 || getsbinuptime() < timeout_at) error = 0; else if (leaving && ttyoutq_bytesused(&tp->t_outq) < bytes) { /* In close, making progress, grant an extra second. */ From owner-svn-src-all@freebsd.org Thu Jan 12 21:41:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47193CAD223; Thu, 12 Jan 2017 21:41: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 13AF1145E; Thu, 12 Jan 2017 21:41:01 +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 v0CLf0Ii079920; Thu, 12 Jan 2017 21:41:00 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CLf0tt079919; Thu, 12 Jan 2017 21:41:00 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701122141.v0CLf0tt079919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 12 Jan 2017 21:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311997 - stable/11/bin/ls/tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 21:41:01 -0000 Author: asomers Date: Thu Jan 12 21:41:00 2017 New Revision: 311997 URL: https://svnweb.freebsd.org/changeset/base/311997 Log: MFC r310118 Fix ls_tests:o_flag with ZFS TMPDIR Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is updated. The test must explicitly clear uarch to be portable across filesystems. Also, it doesn't need to run as root. Modified: stable/11/bin/ls/tests/ls_tests.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ls/tests/ls_tests.sh ============================================================================== --- stable/11/bin/ls/tests/ls_tests.sh Thu Jan 12 21:18:43 2017 (r311996) +++ stable/11/bin/ls/tests/ls_tests.sh Thu Jan 12 21:41:00 2017 (r311997) @@ -689,7 +689,6 @@ atf_test_case o_flag o_flag_head() { atf_set "descr" "Verify that the output from ls -o prints out the chflag values or '-' if none are set" - atf_set "require.user" "root" } o_flag_body() @@ -703,6 +702,7 @@ o_flag_body() atf_check -e ignore -o empty -s exit:0 dd if=/dev/zero of=b.file \ bs=$size count=1 atf_check -e empty -o empty -s exit:0 chflags uarch a.file + atf_check -e empty -o empty -s exit:0 chflags 0 b.file atf_check -e empty -o match:"[[:space:]]+uarch[[:space:]]$size+.+a\\.file" \ -s exit:0 ls -lo a.file From owner-svn-src-all@freebsd.org Thu Jan 12 21:46:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5E91CAD505; Thu, 12 Jan 2017 21:46:32 +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 953AC1992; Thu, 12 Jan 2017 21:46:32 +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 v0CLkVX9082975; Thu, 12 Jan 2017 21:46:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CLkVQo082974; Thu, 12 Jan 2017 21:46:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701122146.v0CLkVQo082974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 12 Jan 2017 21:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311998 - stable/10/bin/ls/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 21:46:32 -0000 Author: asomers Date: Thu Jan 12 21:46:31 2017 New Revision: 311998 URL: https://svnweb.freebsd.org/changeset/base/311998 Log: MFC r310118 Fix ls_tests:o_flag with ZFS TMPDIR Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is updated. The test must explicitly clear uarch to be portable across filesystems. Also, it doesn't need to run as root. Modified: stable/10/bin/ls/tests/ls_tests.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ls/tests/ls_tests.sh ============================================================================== --- stable/10/bin/ls/tests/ls_tests.sh Thu Jan 12 21:41:00 2017 (r311997) +++ stable/10/bin/ls/tests/ls_tests.sh Thu Jan 12 21:46:31 2017 (r311998) @@ -689,7 +689,6 @@ atf_test_case o_flag o_flag_head() { atf_set "descr" "Verify that the output from ls -o prints out the chflag values or '-' if none are set" - atf_set "require.user" "root" } o_flag_body() @@ -703,6 +702,7 @@ o_flag_body() atf_check -e ignore -o empty -s exit:0 dd if=/dev/zero of=b.file \ bs=$size count=1 atf_check -e empty -o empty -s exit:0 chflags uarch a.file + atf_check -e empty -o empty -s exit:0 chflags 0 b.file atf_check -e empty -o match:"[[:space:]]+uarch[[:space:]]$size+.+a\\.file" \ -s exit:0 ls -lo a.file From owner-svn-src-all@freebsd.org Thu Jan 12 22:07:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34C37CAD148; Thu, 12 Jan 2017 22:07:01 +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 DF2F91820; Thu, 12 Jan 2017 22:07:00 +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 v0CM70PN091190; Thu, 12 Jan 2017 22:07:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CM6w2c091165; Thu, 12 Jan 2017 22:06:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701122206.v0CM6w2c091165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Jan 2017 22:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311999 - in stable/11: . lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 22:07:01 -0000 Author: jhb Date: Thu Jan 12 22:06:57 2017 New Revision: 311999 URL: https://svnweb.freebsd.org/changeset/base/311999 Log: MFC 307538,307948,308602,308603,311151: Move kdump's mksubr into libsysdecode. 307538: Move mksubr from kdump into libsysdecode. Restructure this script so that it generates a header of tables instead of a source file. The tables are included in a flags.c source file which provides functions to decode various system call arguments. For functions that decode an enumeration, the function returns a pointer to a string for known values and NULL for unknown values. For functions that do more complex decoding (typically of a bitmask), the function accepts a pointer to a FILE object (open_memstream() can be used as a string builder) to which decoded values are written. If the function operates on a bitmask, the function returns true if any bits were decoded or false if the entire value was valid. Additionally, the third argument accepts a pointer to a value to which any undecoded bits are stored. This pointer can be NULL if the caller doesn't care about remaining bits. Convert kdump over to using decoder functions from libsysdecode instead of mksubr. truss also uses decoders from libsysdecode instead of private lookup tables, though lookup tables for objects not decoded by kdump remain in truss for now. Eventually most of these tables should move into libsysdecode as the automated table generation approach from mksubr is less stale than the static tables in truss. Some changes have been made to truss and kdump output: - The flags passed to open() are now properly decoded in that one of O_RDONLY, O_RDWR, O_WRONLY, or O_EXEC is always included in a decoded mask. - Optional arguments to open(), openat(), and fcntl() are only printed in kdump if they exist (e.g. the mode is only printed for open() if O_CREAT is set in the flags). - Print argument to F_GETLK/SETLK/SETLKW in kdump as a pointer, not int. - Include all procctl() commands. - Correctly decode pipe2() flags in truss by not assuming full open()-like flags with O_RDONLY, etc. - Decode file flags passed to *chflags() as file flags (UF_* and SF_*) rather than as a file mode. - Fix decoding of quotactl() commands by splitting out the two command components instead of assuming the raw command value matches the primary command component. In addition, truss and kdump now build without triggering any warnings. All of the sysdecode manpages now include the required headers in the synopsis. 307948: Use binary and (&) instead of logical to extract the mask of a capability. 308602: Generate and use a proper .depend file for tables.h. 308603: Move libsysdecode-specific hack out of buildworld. This should fix the lib32 build since it was not removing the generated ioctl.c. This file is generated by a find(1) call, so cannot use normal dependency tracking methods. 311151: Update libsysdecode for getfsstat() 'flags' argument changing to 'mode'. As a followup to r310638, update libsysdecode (and kdump) to decode the 'mode' argument to getfsstat(). sysdecode_getfsstat_flags() has been renamed to sysdecode_getfsstat_mode() and now treats the argument as an enumerated value rather than a mask of flags. Added: stable/11/lib/libsysdecode/flags.c - copied, changed from r307538, head/lib/libsysdecode/flags.c stable/11/lib/libsysdecode/mktables - copied, changed from r307538, head/lib/libsysdecode/mktables stable/11/lib/libsysdecode/signal.c - copied unchanged from r307538, head/lib/libsysdecode/signal.c stable/11/lib/libsysdecode/sysdecode_cap_rights.3 - copied unchanged from r307538, head/lib/libsysdecode/sysdecode_cap_rights.3 stable/11/lib/libsysdecode/sysdecode_enum.3 - copied, changed from r307538, head/lib/libsysdecode/sysdecode_enum.3 stable/11/lib/libsysdecode/sysdecode_fcntl_arg.3 - copied unchanged from r307538, head/lib/libsysdecode/sysdecode_fcntl_arg.3 stable/11/lib/libsysdecode/sysdecode_mask.3 - copied, changed from r307538, head/lib/libsysdecode/sysdecode_mask.3 stable/11/lib/libsysdecode/sysdecode_quotactl_cmd.3 - copied unchanged from r307538, head/lib/libsysdecode/sysdecode_quotactl_cmd.3 stable/11/lib/libsysdecode/sysdecode_sigcode.3 - copied unchanged from r307538, head/lib/libsysdecode/sysdecode_sigcode.3 stable/11/lib/libsysdecode/sysdecode_sockopt_name.3 - copied unchanged from r307538, head/lib/libsysdecode/sysdecode_sockopt_name.3 Deleted: stable/11/usr.bin/kdump/mksubr Modified: stable/11/Makefile.inc1 stable/11/ObsoleteFiles.inc stable/11/lib/libsysdecode/Makefile stable/11/lib/libsysdecode/errno.c stable/11/lib/libsysdecode/mkioctls stable/11/lib/libsysdecode/syscallnames.c stable/11/lib/libsysdecode/sysdecode.3 stable/11/lib/libsysdecode/sysdecode.h stable/11/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 stable/11/lib/libsysdecode/sysdecode_ioctlname.3 stable/11/lib/libsysdecode/sysdecode_syscallnames.3 stable/11/lib/libsysdecode/sysdecode_utrace.3 stable/11/lib/libsysdecode/utrace.c stable/11/usr.bin/kdump/Makefile stable/11/usr.bin/kdump/kdump.c stable/11/usr.bin/truss/Makefile stable/11/usr.bin/truss/aarch64-cloudabi64.c stable/11/usr.bin/truss/aarch64-freebsd.c stable/11/usr.bin/truss/amd64-cloudabi64.c stable/11/usr.bin/truss/amd64-freebsd.c stable/11/usr.bin/truss/amd64-freebsd32.c stable/11/usr.bin/truss/amd64-linux.c stable/11/usr.bin/truss/amd64-linux32.c stable/11/usr.bin/truss/arm-freebsd.c stable/11/usr.bin/truss/extern.h stable/11/usr.bin/truss/i386-freebsd.c stable/11/usr.bin/truss/i386-linux.c stable/11/usr.bin/truss/main.c stable/11/usr.bin/truss/mips-freebsd.c stable/11/usr.bin/truss/powerpc-freebsd.c stable/11/usr.bin/truss/powerpc64-freebsd.c stable/11/usr.bin/truss/powerpc64-freebsd32.c stable/11/usr.bin/truss/setup.c stable/11/usr.bin/truss/sparc64-freebsd.c stable/11/usr.bin/truss/syscall.h stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Thu Jan 12 21:46:31 2017 (r311998) +++ stable/11/Makefile.inc1 Thu Jan 12 22:06:57 2017 (r311999) @@ -655,9 +655,6 @@ _worldtmp: .PHONY .endif .else rm -rf ${WORLDTMP}/legacy/usr/include -# XXX - These can depend on any header file. - rm -f ${OBJTREE}${.CURDIR}/lib/libsysdecode/ioctl.c - rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c .endif .for _dir in \ lib lib/casper usr legacy/bin legacy/usr Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Thu Jan 12 21:46:31 2017 (r311998) +++ stable/11/ObsoleteFiles.inc Thu Jan 12 22:06:57 2017 (r311999) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20170112: sysdecode_getfsstat_flags() renamed to sysdecode_getfsstat_mode() +OLD_FILES+=usr/share/man/man3/sysdecode_getfsstat_flags.3.gz # 20161217: new clang import which bumps version from 3.9.0 to 3.9.1. OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/asan_interface.h Modified: stable/11/lib/libsysdecode/Makefile ============================================================================== --- stable/11/lib/libsysdecode/Makefile Thu Jan 12 21:46:31 2017 (r311998) +++ stable/11/lib/libsysdecode/Makefile Thu Jan 12 22:06:57 2017 (r311999) @@ -5,20 +5,94 @@ PACKAGE=lib${LIB} LIB= sysdecode -SRCS= errno.c ioctl.c syscallnames.c utrace.c +SRCS= errno.c flags.c ioctl.c signal.c syscallnames.c utrace.c INCS= sysdecode.h +CFLAGS+= -I${.OBJDIR} CFLAGS+= -I${.CURDIR}/../../sys CFLAGS+= -I${.CURDIR}/../../libexec/rtld-elf -MAN+= sysdecode.3 \ +MAN= sysdecode.3 \ sysdecode_abi_to_freebsd_errno.3 \ + sysdecode_cap_rights.3 \ + sysdecode_enum.3 \ + sysdecode_fcntl_arg.3 \ sysdecode_ioctlname.3 \ + sysdecode_mask.3 \ + sysdecode_quotactl_cmd.3 \ + sysdecode_sigcode.3 \ + sysdecode_sockopt_name.3 \ sysdecode_syscallnames.3 \ sysdecode_utrace.3 -MLINKS+= sysdecode_abi_to_freebsd_errno.3 sysdecode_freebsd_to_abi_errno.3 +MLINKS= sysdecode_abi_to_freebsd_errno.3 sysdecode_freebsd_to_abi_errno.3 +MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ + sysdecode_enum.3 sysdecode_atfd.3 \ + sysdecode_enum.3 sysdecode_extattrnamespace.3 \ + sysdecode_enum.3 sysdecode_fadvice.3 \ + sysdecode_enum.3 sysdecode_fcntl_cmd.3 \ + sysdecode_enum.3 sysdecode_getfsstat_mode.3 \ + sysdecode_enum.3 sysdecode_idtype.3 \ + sysdecode_enum.3 sysdecode_ipproto.3 \ + sysdecode_enum.3 sysdecode_kldsym_cmd.3 \ + sysdecode_enum.3 sysdecode_kldunload_flags.3 \ + sysdecode_enum.3 sysdecode_lio_listio_mode.3 \ + sysdecode_enum.3 sysdecode_madvice.3 \ + sysdecode_enum.3 sysdecode_minherit_flags.3 \ + sysdecode_enum.3 sysdecode_msgctl_cmd.3 \ + sysdecode_enum.3 sysdecode_nfssvc_flags.3 \ + sysdecode_enum.3 sysdecode_prio_which.3 \ + sysdecode_enum.3 sysdecode_procctl_cmd.3 \ + sysdecode_enum.3 sysdecode_ptrace_request.3 \ + sysdecode_enum.3 sysdecode_rlimit.3 \ + sysdecode_enum.3 sysdecode_rtprio_function.3 \ + sysdecode_enum.3 sysdecode_scheduler_policy.3 \ + sysdecode_enum.3 sysdecode_semctl_cmd.3 \ + sysdecode_enum.3 sysdecode_shmctl_cmd.3 \ + sysdecode_enum.3 sysdecode_shutdown_how.3 \ + sysdecode_enum.3 sysdecode_sigbus_code.3 \ + sysdecode_enum.3 sysdecode_sigchld_code.3 \ + sysdecode_enum.3 sysdecode_sigfpe_code.3 \ + sysdecode_enum.3 sysdecode_sigill_code.3 \ + sysdecode_enum.3 sysdecode_signal.3 \ + sysdecode_enum.3 sysdecode_sigprocmask_how.3 \ + sysdecode_enum.3 sysdecode_sigsegv_code.3 \ + sysdecode_enum.3 sysdecode_sigtrap_code.3 \ + sysdecode_enum.3 sysdecode_sockaddr_family.3 \ + sysdecode_enum.3 sysdecode_socketdomain.3 \ + sysdecode_enum.3 sysdecode_sockettype.3 \ + sysdecode_enum.3 sysdecode_sockopt_level.3 \ + sysdecode_enum.3 sysdecode_umtx_op.3 \ + sysdecode_enum.3 sysdecode_vmresult.3 \ + sysdecode_enum.3 sysdecode_whence.3 +MLINKS+=sysdecode_fcntl_arg.3 sysdecode_fcntl_arg_p.3 +MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \ + sysdecode_mask.3 sysdecode_capfcntlrights.3 \ + sysdecode_mask.3 sysdecode_fcntl_fileflags.3 \ + sysdecode_mask.3 sysdecode_fileflags.3 \ + sysdecode_mask.3 sysdecode_filemode.3 \ + sysdecode_mask.3 sysdecode_flock_operation.3 \ + sysdecode_mask.3 sysdecode_mlockall_flags.3 \ + sysdecode_mask.3 sysdecode_mmap_flags.3 \ + sysdecode_mask.3 sysdecode_mmap_prot.3 \ + sysdecode_mask.3 sysdecode_mount_flags.3 \ + sysdecode_mask.3 sysdecode_msg_flags.3 \ + sysdecode_mask.3 sysdecode_msync_flags.3 \ + sysdecode_mask.3 sysdecode_open_flags.3 \ + sysdecode_mask.3 sysdecode_pipe2_flags.3 \ + sysdecode_mask.3 sysdecode_reboot_howto.3 \ + sysdecode_mask.3 sysdecode_rfork_flags.3 \ + sysdecode_mask.3 sysdecode_semget_flags.3 \ + sysdecode_mask.3 sysdecode_sendfile_flags.3 \ + sysdecode_mask.3 sysdecode_shmat_flags.3 \ + sysdecode_mask.3 sysdecode_socket_type.3 \ + sysdecode_mask.3 sysdecode_thr_create_flags.3 \ + sysdecode_mask.3 sysdecode_umtx_cvwait_flags.3 \ + sysdecode_mask.3 sysdecode_umtx_rwlock_flags.3 \ + sysdecode_mask.3 sysdecode_vmprot.3 \ + sysdecode_mask.3 sysdecode_wait4_options.3 \ + sysdecode_mask.3 sysdecode_wait6_options.3 -CLEANFILES= ioctl.c +CLEANFILES= ioctl.c tables.h .if defined(COMPAT_32BIT) CPP+= -m32 @@ -36,10 +110,19 @@ CFLAGS.gcc.ioctl.c+= -Wno-unused CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} -ioctl.c: mkioctls +DEPENDOBJS+= tables.h +tables.h: mktables + sh ${.CURDIR}/mktables ${DESTDIR}${INCLUDEDIR} ${.TARGET} + +# mkioctls runs find(1) for headers so needs to rebuild every time. This used +# to be a hack only done in buildworld. +.if !defined(_SKIP_BUILD) +ioctl.c: .PHONY +.endif +ioctl.c: mkioctls .META env MACHINE=${MACHINE} CPP="${CPP}" \ /bin/sh ${.CURDIR}/mkioctls ${DESTDIR}${INCLUDEDIR} > ${.TARGET} -beforedepend: ioctl.c +beforedepend: ioctl.c tables.h .include Modified: stable/11/lib/libsysdecode/errno.c ============================================================================== --- stable/11/lib/libsysdecode/errno.c Thu Jan 12 21:46:31 2017 (r311998) +++ stable/11/lib/libsysdecode/errno.c Thu Jan 12 22:06:57 2017 (r311999) @@ -28,8 +28,11 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include +#include #include #include Copied and modified: stable/11/lib/libsysdecode/flags.c (from r307538, head/lib/libsysdecode/flags.c) ============================================================================== --- head/lib/libsysdecode/flags.c Mon Oct 17 22:37:07 2016 (r307538, copy source) +++ stable/11/lib/libsysdecode/flags.c Thu Jan 12 22:06:57 2017 (r311999) @@ -472,11 +472,15 @@ sysdecode_flock_operation(FILE *fp, int return (print_mask_int(fp, flockops, operation, rem)); } -bool -sysdecode_getfsstat_flags(FILE *fp, int flags, int *rem) +static struct name_table getfsstatmode[] = { + X(MNT_WAIT) X(MNT_NOWAIT) XEND +}; + +const char * +sysdecode_getfsstat_mode(int mode) { - return (print_mask_int(fp, getfsstatflags, flags, rem)); + return (lookup_value(getfsstatmode, mode)); } const char * @@ -959,7 +963,7 @@ sysdecode_umtx_rwlock_flags(FILE *fp, u_ } /* XXX: This should be in */ -#define CAPMASK(right) ((right) && (((uint64_t)1 << 57) - 1)) +#define CAPMASK(right) ((right) & (((uint64_t)1 << 57) - 1)) void sysdecode_cap_rights(FILE *fp, cap_rights_t *rightsp) Modified: stable/11/lib/libsysdecode/mkioctls ============================================================================== --- stable/11/lib/libsysdecode/mkioctls Thu Jan 12 21:46:31 2017 (r311998) +++ stable/11/lib/libsysdecode/mkioctls Thu Jan 12 22:06:57 2017 (r311999) @@ -62,6 +62,7 @@ BEGIN { print "#include " print "#include " print "#include " + print "#include " print "#include " print "#include " print "#include " Copied and modified: stable/11/lib/libsysdecode/mktables (from r307538, head/lib/libsysdecode/mktables) ============================================================================== --- head/lib/libsysdecode/mktables Mon Oct 17 22:37:07 2016 (r307538, copy source) +++ stable/11/lib/libsysdecode/mktables Thu Jan 12 22:06:57 2017 (r311999) @@ -37,11 +37,16 @@ LC_ALL=C; export LC_ALL if [ -z "$1" ] then - echo "usage: sh $0 include-dir" + echo "usage: sh $0 include-dir [output-file]" exit 1 fi include_dir=$1 +if [ -n "$2" ]; then + output_file="$2" + exec > "$output_file" +fi +all_headers= # # Generate a table C #definitions. The including file can define the # TABLE_NAME(n), TABLE_ENTRY(x), and TABLE_END macros to define what @@ -60,6 +65,7 @@ gen_table() else filter="egrep -v" fi + all_headers="${all_headers:+${all_headers} }${file}" cat <<_EOF_ TABLE_START(${name}) _EOF_ @@ -88,7 +94,6 @@ gen_table "extattrns" "EXTATTR_NAM gen_table "fadvisebehav" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h" gen_table "openflags" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h" "O_RDONLY|O_RDWR|O_WRONLY" gen_table "flockops" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h" -gen_table "getfsstatflags" "MNT_[A-Z]+[[:space:]]+[1-9][0-9]*" "sys/mount.h" gen_table "kldsymcmd" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" gen_table "kldunloadfflags" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" gen_table "lio_listiomodes" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h" @@ -142,3 +147,12 @@ gen_table "sigcode" "SI_[A-Z]+[[ gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" + +# Generate a .depend file for our output file +if [ -n "$output_file" ]; then + echo "$output_file: \\" > ".depend.$output_file" + echo "$all_headers" | tr ' ' '\n' | sort -u | + sed -e "s,^, $include_dir/," -e 's,$, \\,' >> \ + ".depend.$output_file" + echo >> ".depend.$output_file" +fi Copied: stable/11/lib/libsysdecode/signal.c (from r307538, head/lib/libsysdecode/signal.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libsysdecode/signal.c Thu Jan 12 22:06:57 2017 (r311999, copy of r307538, head/lib/libsysdecode/signal.c) @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2016 John H. Baldwin + * 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 + +static const char *signames[] = { + [SIGHUP] = "SIGHUP", + [SIGINT] = "SIGINT", + [SIGQUIT] = "SIGQUIT", + [SIGILL] = "SIGILL", + [SIGTRAP] = "SIGTRAP", + [SIGABRT] = "SIGABRT", + [SIGEMT] = "SIGEMT", + [SIGFPE] = "SIGFPE", + [SIGKILL] = "SIGKILL", + [SIGBUS] = "SIGBUS", + [SIGSEGV] = "SIGSEGV", + [SIGSYS] = "SIGSYS", + [SIGPIPE] = "SIGPIPE", + [SIGALRM] = "SIGALRM", + [SIGTERM] = "SIGTERM", + [SIGURG] = "SIGURG", + [SIGSTOP] = "SIGSTOP", + [SIGTSTP] = "SIGTSTP", + [SIGCONT] = "SIGCONT", + [SIGCHLD] = "SIGCHLD", + [SIGTTIN] = "SIGTTIN", + [SIGTTOU] = "SIGTTOU", + [SIGIO] = "SIGIO", + [SIGXCPU] = "SIGXCPU", + [SIGXFSZ] = "SIGXFSZ", + [SIGVTALRM] = "SIGVTALRM", + [SIGPROF] = "SIGPROF", + [SIGWINCH] = "SIGWINCH", + [SIGINFO] = "SIGINFO", + [SIGUSR1] = "SIGUSR1", + [SIGUSR2] = "SIGUSR2", + [SIGTHR] = "SIGTHR", + [SIGLIBRT] = "SIGLIBRT", + + /* XXX: Solaris uses SIGRTMIN, SIGRTMIN+...SIGRTMAX-, SIGRTMAX */ + [SIGRTMIN] = "SIGRT0", + [SIGRTMIN + 1] = "SIGRT1", + [SIGRTMIN + 2] = "SIGRT2", + [SIGRTMIN + 3] = "SIGRT3", + [SIGRTMIN + 4] = "SIGRT4", + [SIGRTMIN + 5] = "SIGRT5", + [SIGRTMIN + 6] = "SIGRT6", + [SIGRTMIN + 7] = "SIGRT7", + [SIGRTMIN + 8] = "SIGRT8", + [SIGRTMIN + 9] = "SIGRT9", + [SIGRTMIN + 10] = "SIGRT10", + [SIGRTMIN + 11] = "SIGRT11", + [SIGRTMIN + 12] = "SIGRT12", + [SIGRTMIN + 13] = "SIGRT13", + [SIGRTMIN + 14] = "SIGRT14", + [SIGRTMIN + 15] = "SIGRT15", + [SIGRTMIN + 16] = "SIGRT16", + [SIGRTMIN + 17] = "SIGRT17", + [SIGRTMIN + 18] = "SIGRT18", + [SIGRTMIN + 19] = "SIGRT19", + [SIGRTMIN + 20] = "SIGRT20", + [SIGRTMIN + 21] = "SIGRT21", + [SIGRTMIN + 22] = "SIGRT22", + [SIGRTMIN + 23] = "SIGRT23", + [SIGRTMIN + 24] = "SIGRT24", + [SIGRTMIN + 25] = "SIGRT25", + [SIGRTMIN + 26] = "SIGRT26", + [SIGRTMIN + 27] = "SIGRT27", + [SIGRTMIN + 28] = "SIGRT28", + [SIGRTMIN + 29] = "SIGRT29", + [SIGRTMIN + 30] = "SIGRT30", + [SIGRTMIN + 31] = "SIGRT31", + [SIGRTMIN + 32] = "SIGRT32", + [SIGRTMIN + 33] = "SIGRT33", + [SIGRTMIN + 34] = "SIGRT34", + [SIGRTMIN + 35] = "SIGRT35", + [SIGRTMIN + 36] = "SIGRT36", + [SIGRTMIN + 37] = "SIGRT37", + [SIGRTMIN + 38] = "SIGRT38", + [SIGRTMIN + 39] = "SIGRT39", + [SIGRTMIN + 40] = "SIGRT40", + [SIGRTMIN + 41] = "SIGRT41", + [SIGRTMIN + 42] = "SIGRT42", + [SIGRTMIN + 43] = "SIGRT43", + [SIGRTMIN + 44] = "SIGRT44", + [SIGRTMIN + 45] = "SIGRT45", + [SIGRTMIN + 46] = "SIGRT46", + [SIGRTMIN + 47] = "SIGRT47", + [SIGRTMIN + 48] = "SIGRT48", + [SIGRTMIN + 49] = "SIGRT49", + [SIGRTMIN + 50] = "SIGRT50", + [SIGRTMIN + 51] = "SIGRT51", + [SIGRTMIN + 52] = "SIGRT52", + [SIGRTMIN + 53] = "SIGRT53", + [SIGRTMIN + 54] = "SIGRT54", + [SIGRTMIN + 55] = "SIGRT55", + [SIGRTMIN + 56] = "SIGRT56", + [SIGRTMIN + 57] = "SIGRT57", + [SIGRTMIN + 58] = "SIGRT58", + [SIGRTMIN + 59] = "SIGRT59", + [SIGRTMIN + 60] = "SIGRT60", + [SIGRTMIN + 61] = "SIGRT61", +}; + +const char * +sysdecode_signal(int sig) +{ + + if ((unsigned)sig < nitems(signames)) + return (signames[sig]); + return (NULL); +} Modified: stable/11/lib/libsysdecode/syscallnames.c ============================================================================== --- stable/11/lib/libsysdecode/syscallnames.c Thu Jan 12 21:46:31 2017 (r311998) +++ stable/11/lib/libsysdecode/syscallnames.c Thu Jan 12 22:06:57 2017 (r311999) @@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$"); */ #include +#include +#include +#include #include #include Modified: stable/11/lib/libsysdecode/sysdecode.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode.3 Thu Jan 12 21:46:31 2017 (r311998) +++ stable/11/lib/libsysdecode/sysdecode.3 Thu Jan 12 22:06:57 2017 (r311999) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2016 +.Dd October 17, 2016 .Dt SYSDECODE 3 .Os .Sh NAME @@ -33,6 +33,10 @@ .Nd system argument decoding library .Sh LIBRARY .Lb libsysdecode +.Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In sysdecode.h .Sh DESCRIPTION The .Nm @@ -65,7 +69,14 @@ A placeholder for use when the ABI is no .El .Sh SEE ALSO .Xr sysdecode_abi_to_freebsd_errno 3 , +.Xr sysdecode_cap_rights 3 , +.Xr sysdecode_enum 3 , +.Xr sysdecode_fcntl_arg 3 , .Xr sysdecode_ioctlname 3 , +.Xr sysdecode_mask 3 , +.Xr sysdecode_quotactl_cmd 3 , +.Xr sysdecode_sigcode 3 , +.Xr sysdecode_sockopt_name 3 , .Xr sysdecode_syscallnames 3 , .Xr sysdecode_utrace 3 .Sh HISTORY Modified: stable/11/lib/libsysdecode/sysdecode.h ============================================================================== --- stable/11/lib/libsysdecode/sysdecode.h Thu Jan 12 21:46:31 2017 (r311998) +++ stable/11/lib/libsysdecode/sysdecode.h Thu Jan 12 22:06:57 2017 (r311999) @@ -39,9 +39,79 @@ enum sysdecode_abi { }; int sysdecode_abi_to_freebsd_errno(enum sysdecode_abi _abi, int _error); +bool sysdecode_access_mode(FILE *_fp, int _mode, int *_rem); +const char *sysdecode_acltype(int _type); +const char *sysdecode_atfd(int _fd); +bool sysdecode_cap_fcntlrights(FILE *_fp, uint32_t _rights, uint32_t *_rem); +void sysdecode_cap_rights(FILE *_fp, cap_rights_t *_rightsp); +const char *sysdecode_extattrnamespace(int _namespace); +const char *sysdecode_fadvice(int _advice); +void sysdecode_fcntl_arg(FILE *_fp, int _cmd, uintptr_t _arg, int _base); +bool sysdecode_fcntl_arg_p(int _cmd); +const char *sysdecode_fcntl_cmd(int _cmd); +bool sysdecode_fcntl_fileflags(FILE *_fp, int _flags, int *_rem); +bool sysdecode_fileflags(FILE *_fp, fflags_t _flags, fflags_t *_rem); +bool sysdecode_filemode(FILE *_fp, int _mode, int *_rem); +bool sysdecode_flock_operation(FILE *_fp, int _operation, int *_rem); int sysdecode_freebsd_to_abi_errno(enum sysdecode_abi _abi, int _error); +const char *sysdecode_getfsstat_mode(int _mode); +const char *sysdecode_idtype(int _idtype); const char *sysdecode_ioctlname(unsigned long _val); +const char *sysdecode_ipproto(int _protocol); +const char *sysdecode_kldsym_cmd(int _cmd); +const char *sysdecode_kldunload_flags(int _flags); +const char *sysdecode_lio_listio_mode(int _mode); +const char *sysdecode_madvice(int _advice); +const char *sysdecode_minherit_inherit(int _inherit); +const char *sysdecode_msgctl_cmd(int _cmd); +bool sysdecode_mlockall_flags(FILE *_fp, int _flags, int *_rem); +bool sysdecode_mmap_flags(FILE *_fp, int _flags, int *_rem); +bool sysdecode_mmap_prot(FILE *_fp, int _prot, int *_rem); +bool sysdecode_mount_flags(FILE *_fp, int _flags, int *_rem); +bool sysdecode_msg_flags(FILE *_fp, int _flags, int *_rem); +bool sysdecode_msync_flags(FILE *_fp, int _flags, int *_rem); +const char *sysdecode_nfssvc_flags(int _flags); +bool sysdecode_open_flags(FILE *_fp, int _flags, int *_rem); +bool sysdecode_pipe2_flags(FILE *_fp, int _flags, int *_rem); +const char *sysdecode_prio_which(int _which); +const char *sysdecode_procctl_cmd(int _cmd); +const char *sysdecode_ptrace_request(int _request); +bool sysdecode_quotactl_cmd(FILE *_fp, int _cmd); +bool sysdecode_reboot_howto(FILE *_fp, int _howto, int *_rem); +bool sysdecode_rfork_flags(FILE *_fp, int _flags, int *_rem); +const char *sysdecode_rlimit(int _resource); +const char *sysdecode_rtprio_function(int _function); +const char *sysdecode_scheduler_policy(int _policy); +const char *sysdecode_semctl_cmd(int _cmd); +bool sysdecode_semget_flags(FILE *_fp, int _flag, int *_rem); +bool sysdecode_sendfile_flags(FILE *_fp, int _flags, int *_rem); +bool sysdecode_shmat_flags(FILE *_fp, int _flags, int *_rem); +const char *sysdecode_shmctl_cmd(int _cmd); +const char *sysdecode_shutdown_how(int _how); +const char *sysdecode_sigbus_code(int _si_code); +const char *sysdecode_sigchld_code(int _si_code); +const char *sysdecode_sigcode(int _sig, int _si_code); +const char *sysdecode_sigfpe_code(int _si_code); +const char *sysdecode_sigill_code(int _si_code); +const char *sysdecode_signal(int _sig); +const char *sysdecode_sigprocmask_how(int _how); +const char *sysdecode_sigsegv_code(int _si_code); +const char *sysdecode_sigtrap_code(int _si_code); +const char *sysdecode_sockaddr_family(int _sa_family); +const char *sysdecode_socketdomain(int _domain); +bool sysdecode_socket_type(FILE *_fp, int _type, int *_rem); +const char *sysdecode_sockopt_level(int _level); +const char *sysdecode_sockopt_name(int _level, int _optname); const char *sysdecode_syscallname(enum sysdecode_abi _abi, unsigned int _code); +bool sysdecode_thr_create_flags(FILE *_fp, int _flags, int *_rem); +bool sysdecode_umtx_cvwait_flags(FILE *_fp, u_long _flags, u_long *_rem); +const char *sysdecode_umtx_op(int _op); +bool sysdecode_umtx_rwlock_flags(FILE *_fp, u_long _flags, u_long *_rem); int sysdecode_utrace(FILE *_fp, void *_buf, size_t _len); +bool sysdecode_vmprot(FILE *_fp, int _type, int *_rem); +const char *sysdecode_vmresult(int _result); +bool sysdecode_wait4_options(FILE *_fp, int _options, int *_rem); +bool sysdecode_wait6_options(FILE *_fp, int _options, int *_rem); +const char *sysdecode_whence(int _whence); #endif /* !__SYSDECODE_H__ */ Modified: stable/11/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 Thu Jan 12 21:46:31 2017 (r311998) +++ stable/11/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 Thu Jan 12 22:06:57 2017 (r311999) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2016 +.Dd October 17, 2016 .Dt sysdecode_abi_to_freebsd_errno 3 .Os .Sh NAME @@ -35,6 +35,9 @@ .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In sysdecode.h .Ft int .Fn sysdecode_abi_to_freebsd_errno "enum sysdecode_abi abi" "int error" .Ft int Copied: stable/11/lib/libsysdecode/sysdecode_cap_rights.3 (from r307538, head/lib/libsysdecode/sysdecode_cap_rights.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libsysdecode/sysdecode_cap_rights.3 Thu Jan 12 22:06:57 2017 (r311999, copy of r307538, head/lib/libsysdecode/sysdecode_cap_rights.3) @@ -0,0 +1,50 @@ +.\" +.\" Copyright (c) 2016 John Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 17, 2016 +.Dt sysdecode_cap_rights 3 +.Os +.Sh NAME +.Nm sysdecode_cap_rights +.Nd output list of capability rights +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In sysdecode.h +.Ft void +.Fn sysdecode_cap_rights "FILE *fp" "cap_rights_t *rightsp" +.Sh DESCRIPTION +The +.Fn sysdecode_cap_rights +function outputs a comma-separated list of capability rights at +.Fa rightsp +to the stream +.Fa fp . +.Sh SEE ALSO +.Xr sysdecode 3 Copied and modified: stable/11/lib/libsysdecode/sysdecode_enum.3 (from r307538, head/lib/libsysdecode/sysdecode_enum.3) ============================================================================== --- head/lib/libsysdecode/sysdecode_enum.3 Mon Oct 17 22:37:07 2016 (r307538, copy source) +++ stable/11/lib/libsysdecode/sysdecode_enum.3 Thu Jan 12 22:06:57 2017 (r311999) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2016 +.Dd January 2, 2017 .Dt sysdecode_enum 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nm sysdecode_extattrnamespace , .Nm sysdecode_fadvice , .Nm sysdecode_fcntl_cmd , +.Nm sysdecode_getfsstat_mode , .Nm sysdecode_idtype , .Nm sysdecode_ipproto , .Nm sysdecode_kldsym_cmd , @@ -86,6 +87,8 @@ .Ft const char * .Fn sysdecode_fcntl_cmd "int cmd" .Ft const char * +.Fn sysdecode_getfsstat_mode "int mode" +.Ft const char * .Fn sysdecode_idtype "int idtype" .Ft const char * .Fn sysdecode_ipproto "int protocol" @@ -168,6 +171,7 @@ Most of these functions decode an argume .It Fn sysdecode_extattrnamespace Ta Xr extattr_get_fd 2 Ta Fa attrnamespace .It Fn sysdecode_fadvice Ta Xr posix_fadvise 2 Ta Fa advice .It Fn sysdecode_fcntl_cmd Ta Xr fcntl 2 Ta Fa cmd +.It Fn sysdecode_getfsstat_mode Ta Xr getfsstat 2 Ta Fa mode .It Fn sysdecode_idtype Ta .Xr procctl 2 , .Xr waitid 2 Copied: stable/11/lib/libsysdecode/sysdecode_fcntl_arg.3 (from r307538, head/lib/libsysdecode/sysdecode_fcntl_arg.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libsysdecode/sysdecode_fcntl_arg.3 Thu Jan 12 22:06:57 2017 (r311999, copy of r307538, head/lib/libsysdecode/sysdecode_fcntl_arg.3) @@ -0,0 +1,121 @@ +.\" +.\" Copyright (c) 2016 John Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 17, 2016 +.Dt sysdecode_fcntl_arg 3 +.Os +.Sh NAME +.Nm sysdecode_fcntl_arg , +.Nm sysdecode_fcntl_arg_p +.Nd output description of fcntl argument +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In sysdecode.h +.Ft void +.Fn sysdecode_fcntl_arg "FILE *fp" "int cmd" "uintptr_t arg" "int base" +.Ft bool +.Fn sysdecode_fcntl_arg_p "int cmd" +.Sh DESCRIPTION +The +.Fn sysdecode_fcntl_arg +function outputs a text description of the optional +.Fa arg +argument to +.Xr fcntl 2 +to the stream +.Fa fp . +The type and format of +.Fa arg +are determined by +.Fa cmd : +.Bl -column ".Dv F_SETLKW" "Vt struct flock *" +.It Sy Command Ta Fa arg Sy Type Ta Sy Output Format +.It +.It Dv F_SETFD Ta Vt int Ta +.Dq FD_CLOEXEC +or the value of +.Fa arg +in the indicated +.Fa base +.Pq one of 8, 10, or 16 . +.It +.It Dv F_SETFL Ta Vt int Ta +File flags as output by +.Xr sysdecode_fcntl_fileflags 3 +with any unknown or remaining bits output in hexadecimal. +.It +.It Dv F_GETLK Ta Vt struct flock * Ta +.It Dv F_SETLK Ta Vt struct flock * Ta +.It Dv F_SETLKW Ta Vt struct flock * Ta +The value of +.Fa arg +using the +.Dq %p +conversion specification. +.It +.It Others Ta Vt int Ta +The value of +.Fa arg +in the indicated +.Fa base +.Pq one of 8, 10, or 16 . +.El +.Pp +The +.Fn sysdecode_fcntl_arg_p +function can be used to determine if a +.Xr fcntl 2 +command uses the optional third argument to +.Xr fcntl 2 . +The function returns +.Dv true +if +.Fa cmd +accepts a third argument to +.Xr fcntl 2 +and +.Dv false +if it does not. +.Sh RETURN VALUES +The +.Nm sysdecode_fcntl_arg_p +function returns +.Dv true +if +.Fa cmd +accepts a third argument to +.Xr fcntl 2 +and +.Dv false +if it does not. +.Sh SEE ALSO +.Xr sysdecode 3 , +.Xr sysdecode_fcntl_cmd 3 , +.Xr sysdecode_fcntl_fileflags 3 Modified: stable/11/lib/libsysdecode/sysdecode_ioctlname.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode_ioctlname.3 Thu Jan 12 21:46:31 2017 (r311998) +++ stable/11/lib/libsysdecode/sysdecode_ioctlname.3 Thu Jan 12 22:06:57 2017 (r311999) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2015 +.Dd October 17, 2016 .Dt sysdecode_ioctlname 3 .Os .Sh NAME @@ -34,6 +34,9 @@ .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In sysdecode.h .Ft conts char * .Fn sysdecode_ioctlname "unsigned long request" .Sh DESCRIPTION Copied and modified: stable/11/lib/libsysdecode/sysdecode_mask.3 (from r307538, head/lib/libsysdecode/sysdecode_mask.3) ============================================================================== --- head/lib/libsysdecode/sysdecode_mask.3 Mon Oct 17 22:37:07 2016 (r307538, copy source) +++ stable/11/lib/libsysdecode/sysdecode_mask.3 Thu Jan 12 22:06:57 2017 (r311999) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2016 +.Dd January 2, 2017 .Dt sysdecode_mask 3 .Os .Sh NAME @@ -36,7 +36,6 @@ .Nm sysdecode_fileflags , .Nm sysdecode_filemode , .Nm sysdecode_flock_operation , -.Nm sysdecode_getfsstat_flags , .Nm sysdecode_mlockall_flags , .Nm sysdecode_mmap_flags , .Nm sysdecode_mmap_prot , @@ -153,7 +152,6 @@ Most of these functions decode an argume .It Fn sysdecode_fileflags Ta Xr chflags 2 Ta Fa flags .It Fn sysdecode_filemode Ta Xr chmod 2 , Xr open 2 Ta mode .It Fn sysdecode_flock_operation Ta Xr flock 2 Ta Fa operation -.It Fn sysdecode_getfsstat_flags Ta Xr getfsstatflags 2 Ta Fa flags .It Fn sysdecode_mlockall_flags Ta Xr mlockall 2 Ta Fa flags .It Fn sysdecode_mmap_flags Ta Xr mmap 2 Ta Fa flags .It Fn sysdecode_mmap_prot Ta Xr mmap 2 Ta Fa prot Copied: stable/11/lib/libsysdecode/sysdecode_quotactl_cmd.3 (from r307538, head/lib/libsysdecode/sysdecode_quotactl_cmd.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libsysdecode/sysdecode_quotactl_cmd.3 Thu Jan 12 22:06:57 2017 (r311999, copy of r307538, head/lib/libsysdecode/sysdecode_quotactl_cmd.3) @@ -0,0 +1,93 @@ +.\" +.\" Copyright (c) 2016 John Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 17, 2016 +.Dt sysdecode_quotactl_cmd 3 +.Os +.Sh NAME +.Nm sysdecode_quotactl_cmd +.Nd output name of quotactl command +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In sysdecode.h +.Ft bool +.Fn sysdecode_quotactl_cmd "FILE *fp" "int cmd" +.Sh DESCRIPTION +The +.Fn sysdecode_quotactl_cmd +function outputs a text description of the +.Fa cmd +argument to +.Xr quotactl 2 +to the stream +.Fa fp . +The description is formatted as an invocation of the +.Dv QCMD +macro defined in the +.In ufs/ufs/quota.h +header. +.Pp +The function first computes the primary and secondary values used by +.Dv QCMD +to construct +.Fa cmd . +If the primary command value does not represent a known constant, +.Fn sysdecode_quotactl_cmd +does not generate any output and returns +.Dv false . +Otherwise, +.Fn sysdecode_quotactl_cmd +outputs text depicting an invocation of +.Dv QCMD +with the associated constants for the primary and secondary command values +and returns +.Dv true . +If the secondary command values does not represent a known constant, +its value is output as a hexadecimal integer. +.Sh RETURN VALUES +The +.Nm sysdecode_quotactl_cmd +function returns +.Dv true +if it outputs a description of +.Fa cmd +and +.Dv false +if it does not. +.Sh EXAMPLES +The statement +.Pp +.Dl sysdecode_quotatcl_cmd(stdout, QCMD(Q_GETQUOTA, USRQUOTA); +.Pp +outputs the text +.Dq QCMD(Q_GETQUOTA, USRQUOTA) +to standard output. +.Sh SEE ALSO +.Xr sysdecode 3 Copied: stable/11/lib/libsysdecode/sysdecode_sigcode.3 (from r307538, head/lib/libsysdecode/sysdecode_sigcode.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libsysdecode/sysdecode_sigcode.3 Thu Jan 12 22:06:57 2017 (r311999, copy of r307538, head/lib/libsysdecode/sysdecode_sigcode.3) @@ -0,0 +1,83 @@ +.\" +.\" Copyright (c) 2016 John Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 17, 2016 +.Dt sysdecode_sigcode 3 +.Os +.Sh NAME +.Nm sysdecode_sigcode +.Nd lookup name of signal code +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In sysdecode.h +.Ft const char * +.Fn sysdecode_sigcode "int signal" "int si_code" +.Sh DESCRIPTION +The +.Fn sysdecode_sigcode +function returns a text description of the +.Fa si_code +field of the +.Vt siginfo_t +object associated with an instance of signal +.Fa sig . +The text description contains the name of the C macro whose value matches +.Fa si_code . +General purpose signal codes such as +.Dv SI_USER +are handled as well as signal-specific codes for +.Dv SIGBUS , +.Dv SIGCHLD , +.Dv SIGFPE , +.Dv SIGILL , +.Dv SIGSEGV +and +.Dv SIGTRAP . +If +.Fa si_code +does not represent a known signal code, +.Fn sysdecode_sigcode +returns +.Dv NULL . +.Sh RETURN VALUES +The +.Fn sysdecode_sigcode +function returns a pointer to a signal code description or +.Dv NULL +if +.Fa si_code +is not a known signal code. +.Sh SEE ALSO +.Xr sysdecode_sigbus_code 3 , +.Xr sysdecode_sigchld_code 3 , +.Xr sysdecode_sigfpe_code 3 , +.Xr sysdecode_sigill_code 3 , +.Xr sysdecode_sigsegv_code 3 , +.Xr sysdecode_sigtrap_code 3 Copied: stable/11/lib/libsysdecode/sysdecode_sockopt_name.3 (from r307538, head/lib/libsysdecode/sysdecode_sockopt_name.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libsysdecode/sysdecode_sockopt_name.3 Thu Jan 12 22:06:57 2017 (r311999, copy of r307538, head/lib/libsysdecode/sysdecode_sockopt_name.3) @@ -0,0 +1,61 @@ +.\" +.\" Copyright (c) 2016 John Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 12 22:36:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E968CADDB2; Thu, 12 Jan 2017 22:36:27 +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 D85191BDB; Thu, 12 Jan 2017 22:36:26 +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 v0CMaQUV003539; Thu, 12 Jan 2017 22:36:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CMaQqj003538; Thu, 12 Jan 2017 22:36:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701122236.v0CMaQqj003538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Jan 2017 22:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312000 - in stable/11/usr.bin: kdump truss X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 22:36:27 -0000 Author: jhb Date: Thu Jan 12 22:36:25 2017 New Revision: 312000 URL: https://svnweb.freebsd.org/changeset/base/312000 Log: MFC 303946: Remove files unused after pulling system call names from libsysdecode. Deleted: stable/11/usr.bin/kdump/linux32_syscalls.conf stable/11/usr.bin/kdump/linux_syscalls.conf stable/11/usr.bin/truss/makesyscallsconf.sh Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Fri Jan 13 01:39:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8862DCACFE6; Fri, 13 Jan 2017 01:39:20 +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 3E1F21599; Fri, 13 Jan 2017 01:39:20 +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 v0D1dJDE076921; Fri, 13 Jan 2017 01:39:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D1dJiR076920; Fri, 13 Jan 2017 01:39:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701130139.v0D1dJiR076920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 13 Jan 2017 01:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312001 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 01:39:20 -0000 Author: pfg Date: Fri Jan 13 01:39:19 2017 New Revision: 312001 URL: https://svnweb.freebsd.org/changeset/base/312001 Log: Remove __nonnull() attributes from x86 machine check architecture. These are of the few cases where we use the GCC non-null attributes in non-header code. As part of a review [1] of our use of such attributes we are replacing such uses of the overly aggressive GCC attribute with clang's _Nonnull attribute. In this case the attributes serve little purpose as they just don't enforce run time checks, If anything the attributes would cause NULL pointer checks to be ignored but there are no such checks so only effect is cosmetic. The references appear to be left over from code development and likely already fulfilled their purpose. Reference [1]: https://reviews.freebsd.org/D9004 Reviewed by: jhb MFC after: 3 weeks Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Thu Jan 12 22:36:25 2017 (r312000) +++ head/sys/x86/x86/mca.c Fri Jan 13 01:39:19 2017 (r312001) @@ -247,7 +247,7 @@ mca_error_mmtype(uint16_t mca_error) return ("???"); } -static int __nonnull(1) +static int mca_mute(const struct mca_record *rec) { @@ -276,7 +276,7 @@ mca_mute(const struct mca_record *rec) } /* Dump details about a single machine check. */ -static void __nonnull(1) +static void mca_log(const struct mca_record *rec) { uint16_t mca_error; @@ -415,7 +415,7 @@ mca_log(const struct mca_record *rec) printf("MCA: Misc 0x%llx\n", (long long)rec->mr_misc); } -static int __nonnull(2) +static int mca_check_status(int bank, struct mca_record *rec) { uint64_t status; @@ -482,7 +482,7 @@ mca_refill(void *context, int pending) mca_fill_freelist(); } -static void __nonnull(2) +static void mca_record_entry(enum scan_mode mode, const struct mca_record *record) { struct mca_internal *rec; From owner-svn-src-all@freebsd.org Fri Jan 13 02:11:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0DA5CADB7D; Fri, 13 Jan 2017 02:11:17 +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 6A76B1529; Fri, 13 Jan 2017 02:11:17 +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 v0D2BGvR092766; Fri, 13 Jan 2017 02:11:16 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D2BGUq092764; Fri, 13 Jan 2017 02:11:16 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201701130211.v0D2BGUq092764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 13 Jan 2017 02:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312002 - in head/sys/dev/rtwn: rtl8188e rtl8192c X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 02:11:17 -0000 Author: kevlo Date: Fri Jan 13 02:11:16 2017 New Revision: 312002 URL: https://svnweb.freebsd.org/changeset/base/312002 Log: Increase retry count to 100 in r88e_fw_cmd() and r92c_fw_cmd(). Modified: head/sys/dev/rtwn/rtl8188e/r88e_fw.c head/sys/dev/rtwn/rtl8192c/r92c_fw.c Modified: head/sys/dev/rtwn/rtl8188e/r88e_fw.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_fw.c Fri Jan 13 01:39:19 2017 (r312001) +++ head/sys/dev/rtwn/rtl8188e/r88e_fw.c Fri Jan 13 02:11:16 2017 (r312002) @@ -69,7 +69,7 @@ r88e_fw_cmd(struct rtwn_softc *sc, uint8 } /* Wait for current FW box to be empty. */ - for (ntries = 0; ntries < 50; ntries++) { + for (ntries = 0; ntries < 100; ntries++) { if (!(rtwn_read_1(sc, R92C_HMETFR) & (1 << sc->fwcur))) break; rtwn_delay(sc, 2000); Modified: head/sys/dev/rtwn/rtl8192c/r92c_fw.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_fw.c Fri Jan 13 01:39:19 2017 (r312001) +++ head/sys/dev/rtwn/rtl8192c/r92c_fw.c Fri Jan 13 02:11:16 2017 (r312002) @@ -80,7 +80,7 @@ r92c_fw_cmd(struct rtwn_softc *sc, uint8 } /* Wait for current FW box to be empty. */ - for (ntries = 0; ntries < 50; ntries++) { + for (ntries = 0; ntries < 100; ntries++) { if (!(rtwn_read_1(sc, R92C_HMETFR) & (1 << sc->fwcur))) break; rtwn_delay(sc, 2000); From owner-svn-src-all@freebsd.org Fri Jan 13 02:12:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF2C3CADD17; Fri, 13 Jan 2017 02:12:59 +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 AFE7F19DE; Fri, 13 Jan 2017 02:12:59 +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 v0D2CwOK092857; Fri, 13 Jan 2017 02:12:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D2Cw0j092852; Fri, 13 Jan 2017 02:12:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701130212.v0D2Cw0j092852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 13 Jan 2017 02:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312003 - head/usr.sbin/fstyp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 02:13:00 -0000 Author: cem Date: Fri Jan 13 02:12:58 2017 New Revision: 312003 URL: https://svnweb.freebsd.org/changeset/base/312003 Log: fstyp(8): Detect exFAT filesystems Simply detect the exFAT filesystem name in the Volume Boot Record (superblock). PR: 214908 Reported by: Added: head/usr.sbin/fstyp/exfat.c (contents, props changed) Modified: head/usr.sbin/fstyp/Makefile head/usr.sbin/fstyp/fstyp.8 head/usr.sbin/fstyp/fstyp.c head/usr.sbin/fstyp/fstyp.h Modified: head/usr.sbin/fstyp/Makefile ============================================================================== --- head/usr.sbin/fstyp/Makefile Fri Jan 13 02:11:16 2017 (r312002) +++ head/usr.sbin/fstyp/Makefile Fri Jan 13 02:12:58 2017 (r312003) @@ -3,7 +3,7 @@ .include PROG= fstyp -SRCS= cd9660.c ext2fs.c fstyp.c geli.c msdosfs.c ntfs.c ufs.c +SRCS= cd9660.c exfat.c ext2fs.c fstyp.c geli.c msdosfs.c ntfs.c ufs.c .if ${MK_ZFS} != "no" SRCS += zfs.c Added: head/usr.sbin/fstyp/exfat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/fstyp/exfat.c Fri Jan 13 02:12:58 2017 (r312003) @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2017 Conrad Meyer + * 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 "fstyp.h" + +struct exfat_vbr { + char ev_jmp[3]; + char ev_fsname[8]; + char ev_zeros[53]; + uint64_t ev_part_offset; + uint64_t ev_vol_length; + uint32_t ev_fat_offset; + uint32_t ev_fat_length; + uint32_t ev_cluster_offset; + uint32_t ev_cluster_count; + uint32_t ev_rootdir_cluster; + uint32_t ev_vol_serial; + uint16_t ev_fs_revision; + uint16_t ev_vol_flags; + uint8_t ev_log_bytes_per_sect; + uint8_t ev_log_sect_per_clust; + uint8_t ev_num_fats; + uint8_t ev_drive_sel; + uint8_t ev_percent_used; +} __packed; + +int +fstyp_exfat(FILE *fp, char *label, size_t size) +{ + struct exfat_vbr *ev; + + ev = (struct exfat_vbr *)read_buf(fp, 0, 512); + if (ev == NULL || strncmp(ev->ev_fsname, "EXFAT ", 8) != 0) + goto fail; + + /* + * Reading the volume label requires walking the root directory to look + * for a special label file. Left as an exercise for the reader. + */ + free(ev); + return (0); + +fail: + free(ev); + return (1); +} Modified: head/usr.sbin/fstyp/fstyp.8 ============================================================================== --- head/usr.sbin/fstyp/fstyp.8 Fri Jan 13 02:11:16 2017 (r312002) +++ head/usr.sbin/fstyp/fstyp.8 Fri Jan 13 02:12:58 2017 (r312003) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2016 +.Dd January 12, 2017 .Dt FSTYP 8 .Os .Sh NAME @@ -43,7 +43,7 @@ The .Nm utility is used to determine the filesystem type on a given device. -It can recognize ISO-9660, Ext2, FAT, NTFS, and UFS filesystems. +It can recognize ISO-9660, exFAT, Ext2, FAT, NTFS, and UFS filesystems. When the .Fl u flag is specified, @@ -61,6 +61,8 @@ as, respectively: .It cd9660 .It +exfat +.It ext2fs .It geli Modified: head/usr.sbin/fstyp/fstyp.c ============================================================================== --- head/usr.sbin/fstyp/fstyp.c Fri Jan 13 02:11:16 2017 (r312002) +++ head/usr.sbin/fstyp/fstyp.c Fri Jan 13 02:12:58 2017 (r312003) @@ -57,6 +57,7 @@ static struct { bool unmountable; } fstypes[] = { { "cd9660", &fstyp_cd9660, false }, + { "exfat", &fstyp_exfat, true }, { "ext2fs", &fstyp_ext2fs, false }, { "geli", &fstyp_geli, true }, { "msdosfs", &fstyp_msdosfs, false }, Modified: head/usr.sbin/fstyp/fstyp.h ============================================================================== --- head/usr.sbin/fstyp/fstyp.h Fri Jan 13 02:11:16 2017 (r312002) +++ head/usr.sbin/fstyp/fstyp.h Fri Jan 13 02:12:58 2017 (r312003) @@ -39,6 +39,7 @@ char *checked_strdup(const char *s); void rtrim(char *label, size_t size); int fstyp_cd9660(FILE *fp, char *label, size_t size); +int fstyp_exfat(FILE *fp, char *label, size_t size); int fstyp_ext2fs(FILE *fp, char *label, size_t size); int fstyp_geli(FILE *fp, char *label, size_t size); int fstyp_msdosfs(FILE *fp, char *label, size_t size); From owner-svn-src-all@freebsd.org Fri Jan 13 02:14:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2FE5CADE7B; Fri, 13 Jan 2017 02:14:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) (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 4DBC71D22; Fri, 13 Jan 2017 02:14:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f67.google.com with SMTP id l2so8152421wml.2; Thu, 12 Jan 2017 18:14:33 -0800 (PST) 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=V6OhUDID8fGQshKAzzuBzrTiN26ycTptzCvZYOl2mDs=; b=E2c9t+nKRn4xFU8YAtOr17xahS8hz7uSvP/zvgFIgaD14B4pYytNtG52lQJlUYHBqI lPtrOXsz1Ag0JQGrD1nzB5qwEaV8fk9C0B+6TFlPrKyO7uaoUJUNkc6bnH75KBOSymfH MwIMkIeA9O06X/B7QfeBx4cyrPpA7gQEkY36F7aDfg3TjcvxzPLiOTbv5gvWF63WC7rK R4YAjz84LwfzLJNRLoSIFqDB+Q5FXlEUTHxhB/bJgAqsDsOxX+9K6LvJNjtpaaWKHmcl hIZ5irVLKZeC8zU6SPAU0RPfe9amPAp17THujQVd4lED4DRtw5cQ9P9EFD6OXIKkztuq kgbg== X-Gm-Message-State: AIkVDXKMsT3hZ4sZjFESdsi7xC0pbCcgn0vTe2LG9iLhUl7dqc6h1Kxz2/xWk7BIwa2rRw== X-Received: by 10.223.151.138 with SMTP id s10mr9594601wrb.65.1484273671947; Thu, 12 Jan 2017 18:14:31 -0800 (PST) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com. [74.125.82.54]) by smtp.gmail.com with ESMTPSA id e14sm516447wmd.14.2017.01.12.18.14.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jan 2017 18:14:31 -0800 (PST) Received: by mail-wm0-f54.google.com with SMTP id c85so45758897wmi.1; Thu, 12 Jan 2017 18:14:31 -0800 (PST) X-Received: by 10.28.6.210 with SMTP id 201mr223428wmg.85.1484273671619; Thu, 12 Jan 2017 18:14:31 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.29.72 with HTTP; Thu, 12 Jan 2017 18:14:31 -0800 (PST) In-Reply-To: <201701130212.v0D2Cw0j092852@repo.freebsd.org> References: <201701130212.v0D2Cw0j092852@repo.freebsd.org> From: Conrad Meyer Date: Thu, 12 Jan 2017 18:14:31 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r312003 - head/usr.sbin/fstyp To: svn-src-head@freebsd.org Cc: src-committers , svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 02:14:34 -0000 Forgot to mention: Documentation: https://www.sans.org/reading-room/whitepapers/forensics/reverse-engineering-microsoft-exfat-file-system-33274 Images for testing: http://www.cfreds.nist.gov/dfr-test-images.html (raw disk images, include partition tables) On Thu, Jan 12, 2017 at 6:12 PM, Conrad E. Meyer wrote: > Author: cem > Date: Fri Jan 13 02:12:58 2017 > New Revision: 312003 > URL: https://svnweb.freebsd.org/changeset/base/312003 > > Log: > fstyp(8): Detect exFAT filesystems > > Simply detect the exFAT filesystem name in the Volume Boot Record > (superblock). > > PR: 214908 > Reported by: > > Added: > head/usr.sbin/fstyp/exfat.c (contents, props changed) > Modified: > head/usr.sbin/fstyp/Makefile > head/usr.sbin/fstyp/fstyp.8 > head/usr.sbin/fstyp/fstyp.c > head/usr.sbin/fstyp/fstyp.h > > Modified: head/usr.sbin/fstyp/Makefile > ============================================================================== > --- head/usr.sbin/fstyp/Makefile Fri Jan 13 02:11:16 2017 (r312002) > +++ head/usr.sbin/fstyp/Makefile Fri Jan 13 02:12:58 2017 (r312003) > @@ -3,7 +3,7 @@ > .include > > PROG= fstyp > -SRCS= cd9660.c ext2fs.c fstyp.c geli.c msdosfs.c ntfs.c ufs.c > +SRCS= cd9660.c exfat.c ext2fs.c fstyp.c geli.c msdosfs.c ntfs.c ufs.c > > .if ${MK_ZFS} != "no" > SRCS += zfs.c > > Added: head/usr.sbin/fstyp/exfat.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/fstyp/exfat.c Fri Jan 13 02:12:58 2017 (r312003) > @@ -0,0 +1,77 @@ > +/* > + * Copyright (c) 2017 Conrad Meyer > + * 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 "fstyp.h" > + > +struct exfat_vbr { > + char ev_jmp[3]; > + char ev_fsname[8]; > + char ev_zeros[53]; > + uint64_t ev_part_offset; > + uint64_t ev_vol_length; > + uint32_t ev_fat_offset; > + uint32_t ev_fat_length; > + uint32_t ev_cluster_offset; > + uint32_t ev_cluster_count; > + uint32_t ev_rootdir_cluster; > + uint32_t ev_vol_serial; > + uint16_t ev_fs_revision; > + uint16_t ev_vol_flags; > + uint8_t ev_log_bytes_per_sect; > + uint8_t ev_log_sect_per_clust; > + uint8_t ev_num_fats; > + uint8_t ev_drive_sel; > + uint8_t ev_percent_used; > +} __packed; > + > +int > +fstyp_exfat(FILE *fp, char *label, size_t size) > +{ > + struct exfat_vbr *ev; > + > + ev = (struct exfat_vbr *)read_buf(fp, 0, 512); > + if (ev == NULL || strncmp(ev->ev_fsname, "EXFAT ", 8) != 0) > + goto fail; > + > + /* > + * Reading the volume label requires walking the root directory to look > + * for a special label file. Left as an exercise for the reader. > + */ > + free(ev); > + return (0); > + > +fail: > + free(ev); > + return (1); > +} > > Modified: head/usr.sbin/fstyp/fstyp.8 > ============================================================================== > --- head/usr.sbin/fstyp/fstyp.8 Fri Jan 13 02:11:16 2017 (r312002) > +++ head/usr.sbin/fstyp/fstyp.8 Fri Jan 13 02:12:58 2017 (r312003) > @@ -27,7 +27,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd February 28, 2016 > +.Dd January 12, 2017 > .Dt FSTYP 8 > .Os > .Sh NAME > @@ -43,7 +43,7 @@ > The > .Nm > utility is used to determine the filesystem type on a given device. > -It can recognize ISO-9660, Ext2, FAT, NTFS, and UFS filesystems. > +It can recognize ISO-9660, exFAT, Ext2, FAT, NTFS, and UFS filesystems. > When the > .Fl u > flag is specified, > @@ -61,6 +61,8 @@ as, respectively: > .It > cd9660 > .It > +exfat > +.It > ext2fs > .It > geli > > Modified: head/usr.sbin/fstyp/fstyp.c > ============================================================================== > --- head/usr.sbin/fstyp/fstyp.c Fri Jan 13 02:11:16 2017 (r312002) > +++ head/usr.sbin/fstyp/fstyp.c Fri Jan 13 02:12:58 2017 (r312003) > @@ -57,6 +57,7 @@ static struct { > bool unmountable; > } fstypes[] = { > { "cd9660", &fstyp_cd9660, false }, > + { "exfat", &fstyp_exfat, true }, > { "ext2fs", &fstyp_ext2fs, false }, > { "geli", &fstyp_geli, true }, > { "msdosfs", &fstyp_msdosfs, false }, > > Modified: head/usr.sbin/fstyp/fstyp.h > ============================================================================== > --- head/usr.sbin/fstyp/fstyp.h Fri Jan 13 02:11:16 2017 (r312002) > +++ head/usr.sbin/fstyp/fstyp.h Fri Jan 13 02:12:58 2017 (r312003) > @@ -39,6 +39,7 @@ char *checked_strdup(const char *s); > void rtrim(char *label, size_t size); > > int fstyp_cd9660(FILE *fp, char *label, size_t size); > +int fstyp_exfat(FILE *fp, char *label, size_t size); > int fstyp_ext2fs(FILE *fp, char *label, size_t size); > int fstyp_geli(FILE *fp, char *label, size_t size); > int fstyp_msdosfs(FILE *fp, char *label, size_t size); > From owner-svn-src-all@freebsd.org Fri Jan 13 03:05:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E93BCAD69F; Fri, 13 Jan 2017 03:05:46 +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 F1EED1F08; Fri, 13 Jan 2017 03:05:45 +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 v0D35jBm014299; Fri, 13 Jan 2017 03:05:45 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D35jSG014298; Fri, 13 Jan 2017 03:05:45 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701130305.v0D35jSG014298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 13 Jan 2017 03:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312004 - stable/11/sbin/pfctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 03:05:46 -0000 Author: loos Date: Fri Jan 13 03:05:44 2017 New Revision: 312004 URL: https://svnweb.freebsd.org/changeset/base/312004 Log: MFC r310707: Fix the parsing of NPt binat rules. In this specific case the src address can be set to any, which was not accepted prior to this commit. pfSense bug report: https://redmine.pfsense.org/issues/6985 Reviewed by: kp Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sbin/pfctl/parse.y Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/pfctl/parse.y ============================================================================== --- stable/11/sbin/pfctl/parse.y Fri Jan 13 02:12:58 2017 (r312003) +++ stable/11/sbin/pfctl/parse.y Fri Jan 13 03:05:44 2017 (r312004) @@ -4191,7 +4191,7 @@ natrule : nataction interface af proto } ; -binatrule : no BINAT natpasslog interface af proto FROM host toipspec tag +binatrule : no BINAT natpasslog interface af proto FROM ipspec toipspec tag tagged rtable redirection { struct pf_rule binat; From owner-svn-src-all@freebsd.org Fri Jan 13 03:08:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF7D6CAD7A0; Fri, 13 Jan 2017 03:08:06 +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 BDDF21197; Fri, 13 Jan 2017 03:08:06 +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 v0D385pq014428; Fri, 13 Jan 2017 03:08:05 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D385O9014427; Fri, 13 Jan 2017 03:08:05 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701130308.v0D385O9014427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 13 Jan 2017 03:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312005 - stable/11/sys/dev/etherswitch X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 03:08:07 -0000 Author: loos Date: Fri Jan 13 03:08:05 2017 New Revision: 312005 URL: https://svnweb.freebsd.org/changeset/base/312005 Log: MFC r311700: Convert etherswitch to use the make_dev_s(9) KPI. This fix a possible race where si_drv1 can be accessed before it gets set. Suggested by: kib Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/dev/etherswitch/etherswitch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/etherswitch/etherswitch.c ============================================================================== --- stable/11/sys/dev/etherswitch/etherswitch.c Fri Jan 13 03:05:44 2017 (r312004) +++ stable/11/sys/dev/etherswitch/etherswitch.c Fri Jan 13 03:08:05 2017 (r312005) @@ -99,17 +99,24 @@ etherswitch_probe(device_t dev) static int etherswitch_attach(device_t dev) { - struct etherswitch_softc *sc = (struct etherswitch_softc *)device_get_softc(dev); + int err; + struct etherswitch_softc *sc; + struct make_dev_args devargs; + sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_devnode = make_dev(ðerswitch_cdevsw, device_get_unit(dev), - UID_ROOT, GID_WHEEL, - 0600, "etherswitch%d", device_get_unit(dev)); - if (sc->sc_devnode == NULL) { + make_dev_args_init(&devargs); + devargs.mda_devsw = ðerswitch_cdevsw; + devargs.mda_uid = UID_ROOT; + devargs.mda_gid = GID_WHEEL; + devargs.mda_mode = 0600; + devargs.mda_si_drv1 = sc; + err = make_dev_s(&devargs, &sc->sc_devnode, "etherswitch%d", + device_get_unit(dev)); + if (err != 0) { device_printf(dev, "failed to create character device\n"); return (ENXIO); } - sc->sc_devnode->si_drv1 = sc; return (0); } From owner-svn-src-all@freebsd.org Fri Jan 13 03:12:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41ABDCADA12; Fri, 13 Jan 2017 03:12:02 +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 0366814DD; Fri, 13 Jan 2017 03:12:01 +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 v0D3C1fi015517; Fri, 13 Jan 2017 03:12:01 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D3C1NP015516; Fri, 13 Jan 2017 03:12:01 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701130312.v0D3C1NP015516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 13 Jan 2017 03:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312006 - stable/11/sys/dev/gpio X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 03:12:02 -0000 Author: loos Date: Fri Jan 13 03:12:00 2017 New Revision: 312006 URL: https://svnweb.freebsd.org/changeset/base/312006 Log: MFC r311701: Convert gpioc to use the make_dev_s(9) KPI. This fix a possible race where si_drv1 can be accessed before it gets set. This was inspired on r311700. Modified: stable/11/sys/dev/gpio/gpioc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/gpio/gpioc.c ============================================================================== --- stable/11/sys/dev/gpio/gpioc.c Fri Jan 13 03:08:05 2017 (r312005) +++ stable/11/sys/dev/gpio/gpioc.c Fri Jan 13 03:12:00 2017 (r312006) @@ -78,18 +78,25 @@ gpioc_probe(device_t dev) static int gpioc_attach(device_t dev) { - struct gpioc_softc *sc = device_get_softc(dev); + int err; + struct gpioc_softc *sc; + struct make_dev_args devargs; + sc = device_get_softc(dev); sc->sc_dev = dev; sc->sc_pdev = device_get_parent(dev); sc->sc_unit = device_get_unit(dev); - sc->sc_ctl_dev = make_dev(&gpioc_cdevsw, sc->sc_unit, - UID_ROOT, GID_WHEEL, 0600, "gpioc%d", sc->sc_unit); - if (!sc->sc_ctl_dev) { + make_dev_args_init(&devargs); + devargs.mda_devsw = &gpioc_cdevsw; + devargs.mda_uid = UID_ROOT; + devargs.mda_gid = GID_WHEEL; + devargs.mda_mode = 0600; + devargs.mda_si_drv1 = sc; + err = make_dev_s(&devargs, &sc->sc_ctl_dev, "gpioc%d", sc->sc_unit); + if (err != 0) { printf("Failed to create gpioc%d", sc->sc_unit); return (ENXIO); } - sc->sc_ctl_dev->si_drv1 = sc; return (0); } From owner-svn-src-all@freebsd.org Fri Jan 13 03:30:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08F18CADDD5; Fri, 13 Jan 2017 03:30: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 AE7641EE7; Fri, 13 Jan 2017 03:30:30 +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 v0D3UTvp022750; Fri, 13 Jan 2017 03:30:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D3UTWQ022749; Fri, 13 Jan 2017 03:30:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130330.v0D3UTWQ022749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 03:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312007 - vendor/NetBSD/tests/01.11.2017_23.20 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 03:30:31 -0000 Author: ngie Date: Fri Jan 13 03:30:29 2017 New Revision: 312007 URL: https://svnweb.freebsd.org/changeset/base/312007 Log: Copy ^/vendor/NetBSD/tests/dist to .../01.11.2017_23.20 for incoming snapshot update Added: vendor/NetBSD/tests/01.11.2017_23.20/ - copied from r312006, vendor/NetBSD/tests/dist/ From owner-svn-src-all@freebsd.org Fri Jan 13 03:33:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F940CADF75; Fri, 13 Jan 2017 03:33:59 +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 D90E51301; Fri, 13 Jan 2017 03:33:58 +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 v0D3XwKJ026404; Fri, 13 Jan 2017 03:33:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D3XvWJ026399; Fri, 13 Jan 2017 03:33:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130333.v0D3XvWJ026399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 03:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312008 - in head: contrib/netbsd-tests contrib/netbsd-tests/crypto/libcrypto contrib/netbsd-tests/dev/audio contrib/netbsd-tests/dev/cgd contrib/netbsd-tests/fs/ffs contrib/netbsd-test... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 03:33:59 -0000 Author: ngie Date: Fri Jan 13 03:33:57 2017 New Revision: 312008 URL: https://svnweb.freebsd.org/changeset/base/312008 Log: Upgrade NetBSD tests to 01.11.2017_23.20 snapshot This contains some new testcases in /usr/tests/...: - .../lib/libc - .../lib/libthr - .../lib/msun - .../sys/kern Tested on: amd64, i386 MFC after: 1 month Added: head/contrib/netbsd-tests/dev/cgd/t_cgd_3des.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/dev/cgd/t_cgd_3des.c head/contrib/netbsd-tests/dev/cgd/t_cgd_aes.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/dev/cgd/t_cgd_aes.c head/contrib/netbsd-tests/dev/cgd/t_cgd_blowfish.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/dev/cgd/t_cgd_blowfish.c head/contrib/netbsd-tests/kernel/msg.h - copied unchanged from r311966, vendor/NetBSD/tests/dist/kernel/msg.h head/contrib/netbsd-tests/kernel/t_ptrace.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/kernel/t_ptrace.c head/contrib/netbsd-tests/kernel/t_ptrace_wait.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.c head/contrib/netbsd-tests/kernel/t_ptrace_wait.h - copied unchanged from r311966, vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.h head/contrib/netbsd-tests/kernel/t_ptrace_wait3.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/kernel/t_ptrace_wait3.c head/contrib/netbsd-tests/kernel/t_ptrace_wait4.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/kernel/t_ptrace_wait4.c head/contrib/netbsd-tests/kernel/t_ptrace_wait6.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/kernel/t_ptrace_wait6.c head/contrib/netbsd-tests/kernel/t_ptrace_waitid.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/kernel/t_ptrace_waitid.c head/contrib/netbsd-tests/kernel/t_ptrace_waitpid.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/kernel/t_ptrace_waitpid.c head/contrib/netbsd-tests/lib/libc/sys/t_clock_nanosleep.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/lib/libc/sys/t_clock_nanosleep.c head/contrib/netbsd-tests/lib/libc/sys/t_wait_noproc.c - copied, changed from r311966, vendor/NetBSD/tests/dist/lib/libc/sys/t_wait_noproc.c head/contrib/netbsd-tests/lib/libc/sys/t_wait_noproc_wnohang.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/lib/libc/sys/t_wait_noproc_wnohang.c head/contrib/netbsd-tests/lib/libm/t_casinh.c - copied unchanged from r311970, vendor/NetBSD/tests/dist/lib/libm/t_casinh.c head/contrib/netbsd-tests/lib/libm/t_fe_round.c - copied unchanged from r311970, vendor/NetBSD/tests/dist/lib/libm/t_fe_round.c head/contrib/netbsd-tests/lib/libm/t_ilogb.c - copied, changed from r311970, vendor/NetBSD/tests/dist/lib/libm/t_ilogb.c head/contrib/netbsd-tests/lib/libpthread/t_timedmutex.c - copied unchanged from r311970, vendor/NetBSD/tests/dist/lib/libpthread/t_timedmutex.c head/contrib/netbsd-tests/net/net/t_mtudisc.sh - copied unchanged from r311966, vendor/NetBSD/tests/dist/net/net/t_mtudisc.sh head/contrib/netbsd-tests/net/net/t_mtudisc6.sh - copied unchanged from r311966, vendor/NetBSD/tests/dist/net/net/t_mtudisc6.sh head/contrib/netbsd-tests/net/net/t_ping6_opts.sh - copied unchanged from r311966, vendor/NetBSD/tests/dist/net/net/t_ping6_opts.sh head/contrib/netbsd-tests/net/net_common.sh - copied unchanged from r311966, vendor/NetBSD/tests/dist/net/net_common.sh head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_union.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/usr.bin/xlint/lint1/d_c99_anon_union.c head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_cast.c - copied unchanged from r311966, vendor/NetBSD/tests/dist/usr.bin/xlint/lint1/d_c99_union_cast.c Modified: head/contrib/netbsd-tests/crypto/libcrypto/t_libcrypto.sh head/contrib/netbsd-tests/crypto/libcrypto/t_pubkey.sh head/contrib/netbsd-tests/dev/audio/h_pad.c head/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue head/contrib/netbsd-tests/fs/ffs/ffs_common.sh head/contrib/netbsd-tests/fs/fifofs/t_fifo.c head/contrib/netbsd-tests/fs/psshfs/t_psshfs.sh head/contrib/netbsd-tests/fs/puffs/t_basic.c head/contrib/netbsd-tests/fs/vfs/t_vnops.c head/contrib/netbsd-tests/h_macros.h head/contrib/netbsd-tests/kernel/t_mqueue.c head/contrib/netbsd-tests/lib/libc/arch/sparc64/exec_prot_support.c head/contrib/netbsd-tests/lib/libc/arch/sparc64/return_one.S head/contrib/netbsd-tests/lib/libc/db/h_db.c head/contrib/netbsd-tests/lib/libc/db/t_db.sh head/contrib/netbsd-tests/lib/libc/gen/t_dir.c head/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c head/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c head/contrib/netbsd-tests/lib/libc/string/t_memmem.c head/contrib/netbsd-tests/lib/libc/sync/cpp_atomic_ops_linkable.cc head/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c head/contrib/netbsd-tests/lib/libm/t_ldexp.c head/contrib/netbsd-tests/lib/libm/t_precision.c head/contrib/netbsd-tests/lib/libpthread/h_common.h head/contrib/netbsd-tests/lib/libpthread/t_mutex.c head/contrib/netbsd-tests/lib/librumpclient/h_execthr.c head/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh head/contrib/netbsd-tests/lib/libusbhid/t_usbhid.c head/contrib/netbsd-tests/net/arp/t_arp.sh head/contrib/netbsd-tests/net/arp/t_dad.sh head/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh head/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh head/contrib/netbsd-tests/net/if/t_compat.c head/contrib/netbsd-tests/net/if/t_ifconfig.sh head/contrib/netbsd-tests/net/if_bridge/t_bridge.sh head/contrib/netbsd-tests/net/if_gif/t_gif.sh head/contrib/netbsd-tests/net/if_pppoe/t_pppoe.sh head/contrib/netbsd-tests/net/if_tap/t_tap.sh head/contrib/netbsd-tests/net/mcast/t_mcast.sh head/contrib/netbsd-tests/net/ndp/t_dad.sh head/contrib/netbsd-tests/net/ndp/t_ndp.sh head/contrib/netbsd-tests/net/ndp/t_ra.sh head/contrib/netbsd-tests/net/net/t_forwarding.sh head/contrib/netbsd-tests/net/net/t_ipaddress.sh head/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh head/contrib/netbsd-tests/net/net/t_ipv6address.sh head/contrib/netbsd-tests/net/route/t_change.sh head/contrib/netbsd-tests/net/route/t_flags.sh head/contrib/netbsd-tests/net/route/t_flags6.sh head/contrib/netbsd-tests/net/route/t_route.sh head/contrib/netbsd-tests/rump/modautoload/t_modautoload.c head/contrib/netbsd-tests/rump/rumpkern/t_lwproc.c head/contrib/netbsd-tests/sys/net/t_print.c head/contrib/netbsd-tests/usr.bin/config/t_config.sh head/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh head/lib/libc/tests/db/Makefile head/lib/libc/tests/gen/Makefile head/lib/libc/tests/sys/Makefile head/lib/libthr/tests/Makefile head/lib/msun/tests/Makefile Directory Properties: head/contrib/netbsd-tests/ (props changed) Modified: head/contrib/netbsd-tests/crypto/libcrypto/t_libcrypto.sh ============================================================================== --- head/contrib/netbsd-tests/crypto/libcrypto/t_libcrypto.sh Fri Jan 13 03:30:29 2017 (r312007) +++ head/contrib/netbsd-tests/crypto/libcrypto/t_libcrypto.sh Fri Jan 13 03:33:57 2017 (r312008) @@ -1,4 +1,4 @@ -# $NetBSD: t_libcrypto.sh,v 1.3 2010/11/08 19:06:12 pooka Exp $ +# $NetBSD: t_libcrypto.sh,v 1.4 2016/10/13 09:25:37 martin Exp $ # # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -49,7 +49,7 @@ atf_test_case bn bn_head() { atf_set "descr" "Checks BIGNUM library" - atf_set "timeout" "300" + atf_set "timeout" "360" } bn_body() { Modified: head/contrib/netbsd-tests/crypto/libcrypto/t_pubkey.sh ============================================================================== --- head/contrib/netbsd-tests/crypto/libcrypto/t_pubkey.sh Fri Jan 13 03:30:29 2017 (r312007) +++ head/contrib/netbsd-tests/crypto/libcrypto/t_pubkey.sh Fri Jan 13 03:33:57 2017 (r312008) @@ -1,4 +1,4 @@ -# $NetBSD: t_pubkey.sh,v 1.3 2011/06/09 05:25:21 spz Exp $ +# $NetBSD: t_pubkey.sh,v 1.4 2016/10/13 09:25:37 martin Exp $ # # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -49,7 +49,7 @@ atf_test_case rsa rsa_head() { atf_set "descr" "Checks RSA" - atf_set "timeout" "300" + atf_set "timeout" "420" } rsa_body() { @@ -60,7 +60,7 @@ atf_test_case ec ec_head() { atf_set "descr" "Checks EC cipher" - atf_set "timeout" "300" + atf_set "timeout" "480" } ec_body() { @@ -81,7 +81,7 @@ atf_test_case ecdsa ecdsa_head() { atf_set "descr" "Checks ECDSA algorithm" - atf_set "timeout" "300" + atf_set "timeout" "480" } ecdsa_body() { Modified: head/contrib/netbsd-tests/dev/audio/h_pad.c ============================================================================== --- head/contrib/netbsd-tests/dev/audio/h_pad.c Fri Jan 13 03:30:29 2017 (r312007) +++ head/contrib/netbsd-tests/dev/audio/h_pad.c Fri Jan 13 03:33:57 2017 (r312008) @@ -1,4 +1,4 @@ -/* $NetBSD: h_pad.c,v 1.1 2010/08/04 13:15:15 pooka Exp $ */ +/* $NetBSD: h_pad.c,v 1.2 2016/10/15 07:08:06 nat Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -56,14 +56,14 @@ main(int argc, char *argv[]) ssize_t n; rump_init(); - audiofd = rump_sys_open("/dev/audio0", O_RDWR); - if (audiofd == -1) - err(1, "open audio"); - padfd = rump_sys_open("/dev/pad0", O_RDONLY); if (padfd == -1) err(1, "open pad"); + audiofd = rump_sys_open("/dev/audio0", O_RDWR); + if (audiofd == -1) + err(1, "open audio"); + if ((n = rump_sys_write(audiofd, musa, sizeof(musa))) != sizeof(musa)) err(1, "write"); Modified: head/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue ============================================================================== --- head/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue Fri Jan 13 03:30:29 2017 (r312007) +++ head/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue Fri Jan 13 03:33:57 2017 (r312008) @@ -1,1035 +1,1040 @@ begin 644 t_pad_output.bz2 -M0EIH.3%!629369%IQ#X`MT#FU'+1O7<;MT;NYNNYW<[N[OO;K>W7+>^Y[M;[LV]??=M] -MYZ[MMMO>WO;6=W.KIOKNUF:EFEJVK5I"+:J;8:B5K1JJIJVUJV,K6IK5MJJ6 -M--%5FJLS55K158M5K:U5FU4RVMJ(K0BK-6Q0-L+6JVLJ6MK559M5556*M54J -MJMIMFS-"U6LJRUBRJJRV;55::M6U[G=0JI5-4W66J=KVZ]LNW=]W=FW=S;YM -MDO<]LW>Z[WW%E@WUOD-[G!SN<'=W$CD8@[KN<36:PVO=W;*I*E%4SC -MV]XE)5!54*"@*JJMH)J0H*`4&V4`!11(``!4BJI27O>Z(]5()`22)**%4``I -M0`!*B5`D(DB*5@:5``AH`"8F3"8`F0#3(Q,FF@#1H&(&C)H-#3330!ID,C`C -M!-,F)IIA`TQ-,!,33$831@@R9&$T`!,`@TD@FC$``````&@```:-`3`F$P0T -M,$!@`$``#03T!H-`U,`33$TTQJ-,$P$P%/$R8",!-02FDI"!$QJ>S,`0`$!H -M:!#":$Q-,28$V@0-`34]$:;*:>D]1I[0H'HGDRC:AD&@]0&@/4`]0R`R,AH- -M!H`VHS2`:`(4E)*)&R>J-^GBGL!2,:::2;48GI$IO%)Y)Y)[3TE/U1^FFC*C -MQ&H>IZC$T,AIZAZF31H>4``'J!DTTT---```#U```-`9#0T``T!(I((28-)B -M>A3TTF>14]3VT&IJ>R,@F$TQ'DT3&@FU3\4GFDT>J>333&IBFTPF$T]$-,32 -MGM-4]IDTR)ZI^1I3V332;(93-4_5/R>D#":GDU-D:FIZ>IM3U-HTH)-25)%1 -MM3:3]L/-2$FWD4S4U-B:::FB;4V3"4_4R4>H>U0;4]JGJ&33T]4T`#(T-&0] -M0!HT-`_5`!Z@T````9!IH:```````_Q$/Z:,D&8X$&L.'B.D00+!M12TQ2"> -MGH4)$$U776'(,NA5T"`@H&+#%`;<'^;2<4$`CK#I>?6\SY]KTOQX,LDD%=#] -M=K=W[.S5.*PD:9EE+#8V,8RRL@"_3]+%\'Y\OE<[XY25)9,&QL(&#!(B3@T. -MCTYNF5=LVA0D0'QD+"T]J]AX/R0)P"P$\13QX$Q,/GR(O5_U5.R7J.DE`0K( -MEC0PL$_ONQ0)A@@60_";^_OE&;Q_:\_3BPGL8?\=O:KUNG!-MF0A03X9PPMX -MF'WE;&SK)O(N2J"`80_J9Y6*=6(?DZ7*_=I%;(JB,Q$/X5S@P$*M6IZ6$>F. -M&L;Y&C($S\KC'O`Q#')%M:;\FTP-4ET5[;UV7JU<$0D7*H[&KC\]MFO+$`\& -MK%L^,?8,8N-=10VF1`%ZT<0V#-6C#OCSQ<+:D1!\*'M+14@>!P\/!T&+LDA` -MM>S!`Y))"PU-A7RRF1#XLD2TAAXFXPES0HB!="\G,MI5;+<6\:#8!?:^9F[% -ME',L8MFO;T)7.GR!;_`/D0:1+;UF7Y[3=J&V"``O/U.NE!"#*9$.X86#N,8I -M`#2>Y2VR.+WM3?[`$7UIE`R.12-/ADE3=;A$1!:]O_:**7`0NS1[]JFWB&;, -M9H]?3J1$29(D`##!T*ZI]K?Y2?W`!+<"-:V[)FM&)64CY`27=R&1(43Q0:.3 -M57.RL\G5'0B!%DUBC6R2:/8GH36'00V/_3FF$$BHG7;+O%I3X!8&S2LK'/>1 -M8OS=Z#;4Y$43X>>W=G@!;JCZJXZ+CG@"_SV[O7ZI=P8DJ:+_5D',I4)`;G=/ -M'LMX@K6`@UZ4;>CQD0!>G1L^>LPH@:>W<=.CS^7@)?+I``+POTESZ]3/ZA2! -M75?3@*BYG9V,AZN4Q4&IJ@(<=6[N*2:B4T)ITB]VC:@%[*8[4SK5EZR_]5WDD@B*BP]Z -MM&`(P"9NX?<(%_4:IX/(`!5M=`Y*J0ALV/=9UEH,?/)])PN4S.3Q*JX(OE@. -M2:Z?"+C-^RQK#(AH^YZF'"(N4H(.K.`QOV&@=HI"`,-P0@1,W5)#ZE916Z/V -MDMCV8^`4YS\-7R*L!D&Y@OT/@[O\HB+8?+K:EP*>6KQIHI#9&]*\I@AOG`B[ -ME!(1^\3.":TV[8($^"X\PV,D"7'@5IA -M_&HS5?4^K5(@17-'D>"%FJ8^%HE-%-GP07=Y"M@$+JL?O=<_H_;+X"$$)/+$ -M(#&Y%>VSVDIS6@!!PH[W&3U(!SXV;RV<\".VZ\"A!%NDZM&LY*JMTR0+GH5% -M-UD0(OWQ1PM=G=;!V2D>(AEP2@)MH6&EBU77QS:R7B0`5P)?N)=]4'"%!``L -M6>;IEY>3]?^J#F8Y((@VJ'9(3=(Y;EL/U*W3_M""&*6LOPA)`2G2\;XHZ?,1 -MN@9?--I!`7BU)`)6&?V2\RV=GPPO_+AI`13_]&!9NI8WF&D8=EAD>=1@A]-M -M2*,@.#^UP_^]`1,'Y@7\>&O=GPWW86]K`46*"9"107H9R&2FIS4QC(C9?S9E -M0`/+,`K\G03>F3F0D&K]O^I"WC##9]90$6;P/K*\,L":#V^TRY\OGS?!Z.>D -M($R4A>S*K^+BN!7^#D(`!):^.YO0(#Y_7L:3*O#7:[G5>S#2DD#:[ZDW8'GX -M2)284[['@*/]+TCLR$C2\R=8*W5,5CI?!P%6`2B(:+04!>;6K6S6]](_;T]*B(`QH.-:D+F0Y(DOX[O8A^D&ZOMFWV'@4'P8^/`G6' -M4MT7D&'K95`"'TM;8HC'LCRM8)T%MM8^D+N/=;2(V#3NCX`4ISMR_2ZY!(<< -MODMH/*.`-_8\FLT9T`6L6N;B -ML+\].#\V8R;3BE920@#2V1+PA(E.R3ONAYKUN//A^GSGB+*OAX\D`:G4 -M:N6A>'`4Q\%%^V;+*\"K@=4D2`OFKMZ-$0*_[`*>S-)N7WOTB9UK:P8!A_-* -M!#IK6Q(LWF_4F>(UJO>>(9:Z7`0D,+EMF0/N3>?#*1()V)O8Z86&8^!<^ZRS=X!-^V>ZVP;`ZT!\%Z,_M4O]>(!*Q -M%78V.MY[N[_RBAL(JLA?)W_"-+S/ZED0 -M;/3I;2@T6N\'?(;S])2EU,C6-+$@`&SZ+)688"[5QVM98;-GB%YN\`AY&9IE -MW6!=**T2J@+$5]."ANQ]8K\>S;J0'=Q541?&&5H]>H.:O/8H/BC(H+5TL-!% -MC&+N0$H<`3/0LN='R;P@R<.!'<-C*;7FPP#W3-Z"8=_X,P_=A -MXHKO&(2"G=D,QU$C((T6%6GP&!#S"XF5-4V6YAT`'5EB!2_H5R+\+"TB'N$` -M+T%X4&3]-]G#I0>*@2%GIH7 -MSW9O]0D`OIGB+^\1)&P36=Y]RD/%JD1%"5@`[_O_LUM7*JV1\K6;+I3/![/Q -M.#`S2;N_U[:(B>+8XRN,SF.'J%WW8:0"&DUMP7D:"XONX&O-1"LFTT^RG -MR+S^5?!8/;3Y9K[##DDM+1(B+E*B/MD%:Y4H%W4-P>!,]+^'3!:;H\PZRRFC -M,*N]1$`Y3OHLIC/@I?18G7MEW5J04*WZE9NVEJCX]O3A@!"*.^XTQR#K_H+B -MK`_GST-]:GHOXGP6;!7_\>WC/V4[-<>[Y"(A'>SUX`+BNS=W40.$/SF;@#%7 -M/G9ZN`.E)(9E.O"`OX'_/=0TANWS\@%ZGZ"Q`@[-KB[#G4C"?(+B9O2!?3V? -MU(RWC7&#H]VG6T@"3_+P0#-+4"/+:-K195`'/]=0!>5EY/E\%"0EO%WYN;I\ -M,!92L^L[-@(=H^*F`-%2+>M'^T?2W -M'C:U,6=Z7MD- -M!S,3Y&RP>BX!RT^M!(O4_R)^"A]\?+TU4;M'@"5;;:ZIS@]DEP@`GW#)=.K] -MO\7W&3'^J?:TH`>FSXA%M?%/2O67]%.K"6EKOD22)U:K(B^/TNND%OAGR,>$A17>EHS;U89'SEZ,TK*[C@G2H>W_/QJP2&S5GGO -MJE2]X=O]U=K22`\/)G.A*\;1D5Y8TB9-1"S]]V@!)?#_OC6ZNP(-L@?M71N) -MF5SY`+]]\X//8((6RI`6'=Q>`,79HH,_*7BDQ5B$ -MF#C;\$,9E\_=O%KQ8180+*XJ:0$1[TM:]]/]?3>UY$I,\SDOR,#I1E=JFS"! -M)D6KO$6H8D4OU,[!)!$>B\C[>U3$!Z^KJW(<\.5K:U&!G41!!%$5_Y/6QC+5MNVCN4"&]Z]DJO`(9_'6]7?*ZF8/$&+R1H`D$,1>.+._G@W*)DDB;]VG`*5YF7 -MWD]IU[X\&5T,-")):A_]LR"]=;MJN5!LX6;D=]@@KQ`@^-G`>;-=H$6+3?0; -MYG3YLP?<=K)H?)5`"JW_5R6!`Q9OZ8Z#_17/+4<,$0*_:]M -M['1B(#.(QC+-;7CH'N\LREOH(>W0-/OY\=&_S[F9)"7_77XA@06;X>OJ&IOK -M]_"/D$]\6"(#S']/.AK:OAKS"CC7-%WN:`*S+_$Q\,^Z5>:9-EA;.ZD`(GSF -MIQ:L*`\3U-]F](KQ2F<&;.+!Y/Y?&`$JI5%RF94'0/-]9,`:CO;'C<7'S6Y/ -MC(IK?C@3Z*)/UJ'6-^%6!`"074SY(^7^GX$0[^K\-)/;:';#_=4R9TB+O0^G -M[]]7D3#&W$Q$WJ'_>WZV-KK`!WGEP^O)3UHKSY6'>%*ZJN$_$'M>40"Y'4TKT[6!UHFC)`&?/)6ALNE4_=YKB+#=*OU0?%/4DSB6RY5I(*1T -MBS_(D<8`16E0,O"KK9W:_/'P9`7LW2]VZ=L6P&CX1W4GLP1+"_P[R>#N[U"/ -M6WJ(6I\K#MUC,*=$& -M1:KI+^\1_-\P/5`$`\H[779:X^25NX"RC<8`-!NW(+E)7#8<-$0NNC.=8%;Y -M""W5''H1A\USP=7IXRZHLP`5SU[KII-+72^YR&2"Z82`/&[YW!C^'UK5S(MO -MW&B.-PG"G%8BH=8XL2#/=7#/E$X>/AR(5Z^AT]%#>CG.$(E5&]2?[<@D>*0/ -MLZ<&PTK&10ST<\S7A0!X<3B>_3^EJE_\RHP"TFVYCEX^77UK9&C9T20A*]99 -M7K6E``:<-TKEE8"N>WK92J@43N+VH+CGZ#],-YHU(37CX]<0)-RJOCFS%/>< -MAQN%3[ZBT6R(:O24[5N6@(0PW=6K8XBYT._;F*0;7N`AGO:TU&>^N%)?1CJ+ -MGA$!F/HR`O_,-OQ]:S+*EE+7F; -M)8:Y8$Z23!0[=.AU<55;Y+G00EZ:%X+;4.QH1$7K^V(=S>;QJF5!%*(66:M6 -M[]<2>?+NA5:@B'.L/3K#D=IF8CCD"I:=]2]C(V:VB`Z -MOS\_5M\P`2K/>9)C:#G,^D1A32(@7>9.&JW(0D0'@NOJ*)ZVW.3&/)46P09QKXZA5D`53`!D=\)LX*R1 -M!$VM(PTC]$J02F,8P,".;C\K*?9X_7%;MH6>P6<2HYV8U=JFL3)L0P;&-M=6 -MQ"QWM=K46:O@8B=]_\<9C+E\'NRM?3;$*AU\"9&FVFFQH!@"],<7:RQP[:(X -M(.&1#:N&(>`2H-SY3E0:Q```RU<;/1R="%-3!('Y%^`@'U3/^:?U'4DDD^2K -M_QSJ>F@<3(!_5_39XX%+[S0)3Q!$2G$(CR,W5,0ALWVR5@^PNW\Z?G(" -M`E5V)'F?/MYL@H'05?I>U/0;5$JNX(9@PLAMWF/]5Y=G2)KZA/W]\6KGP7TW -M=W;`93G$(W[@47APG.]9PXDV619K+/GQ=Y"H#*8MA2K<.U0:]J -M:[P_S0(`0S@3L$R/6W=-GT;+A'"+='OL8`Z36_XSN)T+M;(@*I\0Q$P[W.QU -M75`U^S3T[*WDD"J.S-BXH)4"-NVA`QPE7A^H`7^G#K^Y#]GW?Z@6;MLN!LH;Y8V[TBAUSY!77`-3DZ).?CA%NN(3U]N[8L)PO7=2[[? -MK?+IP4G)+./7E[L39T%%XY?YT$-0U[8TLY4Z3UDGQ6P.(=`BEAE9/#\#15F/ -M`>_ME9OM"".@E3DR84IGAU)L@Y9W1:M_[OX_)?[G)6:Y=`;!--*(GTMVGOC@ -M"M.:85V$\*TYC78\0T]2+KO*6=_-F75H3!"RI[5E%MF-L:((=8,M2&70#ZW- -M$O9J/0@H[BV!#T_DCO-3-M>J1$32[58X'"UIXHV&4I<18I##UHY6XXEJN&P/ -M[+_)I,DH:BVYVQQZ_O,X=!-]/8)XA,][37V[KG"[%TA.S(Y(\1:.1<'+8>P! -MTC2B]U(SYL#9%1^*\-#T-R]I/8`]M.T2RK3'>,$!HM`\3#=>9@\`-?GY`S\] -M'^7GF;T%I/11:4V6BU8@[1!]C9"PV\A^?P9`WL8!?79D"YCUK:`64G<=<^![ -MM#C.5F/_>8BBW!5>]G?,QPK`MOE8>+$X\S@'%B3EB66;K,\3Q-+A\#K:&\@;TVTVP'I=^: -MY=HX3U'3"E-E/-<7;]7*'2RO(T-)_@5+]/#*EW,7;/R1#'2:/\X@06H4X2+? -M`);^=S>ZPX(A-FAP#!KYMMM\W+;4D_I/>>`'+KI;G\$G;W7IKB3!)@6L?=9B -M8*,D]4:LO-(+-(:$GC_"'/22E/38XZ!EYB]IL#7&,F0SV+_9H#_L$NH_NN$; -M`YY;>`WRW)2(R_EGS0Y>4R/2%0UT!H>XOSJ#,5UEL#1:S819LJ2Y9YXR$;:* -M+2R9H5&H;4'TW\@&]O?C08ZIYG"M.?O$WF_L;$_+KZ/I@,;.8VO8-DAQLE_@ -M*F+&8>S(8K^[BR.2[.:J/%0B[B^IOZ/H"=7ELT(5Z3P-M%;0Y0'"PW0%B^-L -M^CHCB]9>CRF/0VMBJ084\S(]"?`EVGY&D]WJF)<7_849]9\T%NQU1^_WH&,_ -M5^:^K6L2FR(J\PH/W*3)P.C^9',6$)OO0-%D1.;GY>Z%(/[H^5!\IJCTY>TVV!=^XZ] -M/D?;R_(6)'WW?`>S2].TI:(%$?*%L3XD%Z`_[1*CVU3[S"EBV,S3O&V(D7C? -MCX7#((A-/5OOM."4.=)P3%-$'!ZQ;SBG8+&8(;Y]WO/QB!8>_ -M1`09PN#_L;#77^>^Z%CSS_RF*D%4_LM6Y\0W(7R&+SJ10?Z[!0X^R(2VMM<7 -MZ#@QIZ_ML697.F[D/>_WWC^,Z;,J'`[$<)J(QAJ.R^W['JQ@*YSF!LV#'(0G -MINP0WMHSPE6@)+;2#N0I#RQP\XZOY8'[VWX$,"E;-W,?+W,3.!;[=@838['X -MN'5^;;`/^,,G%+:5H+V&^EX>L`)7RZ=4\T.LI[4M4,2"M_G>?%I`_EHW'7=U -M+'\NP(?YXV&)GD&EZ'@@71ZH48<^!BD^E^U2EAOE3@"A4:9C6">_N/?-+AH: -MV$R>6I6S($%7H_C2_"R$&>,CKU`#E3X^\=.6!@_1^I.?=:Q_$04>S+1J?7[P -MOT8K<\G7.YV1#T(@W_3_Y[^,B6: -MEF)6-335TB(-Y'S(@B&TWK?H@"KS3:49A_AC%$T#$SB3$_&C7A%PGX%@U%E# -MH3OAQ,#V+C%%TJMF6WRU[G>I.+H?NE^<7ZO7[4$JNYWJ7W[J"60W_3]NLWF+ -MRZ7*TDY,V)/9C`GOL=[=+.]8$$0`E5TIH!H:),G*`Y\F'SZ6&"/IHYD84M7- -MB@SK9"-\W8^A%&3A-3T0L_8UBV6.(/_'+6Y_4<_W0:X/95G9K[]6,VW;)RW[BL&"4QI*+FQIL3-;]0MTG,P&5];4I-/<#MZ[$G6F\QXH3/S1?6PP?`?+Q$ -M]R*YE='TQ>X[,Z+H34N>&#L0FK==ON$!U>%8>&^_LQ7N:&03DMT_&/"P/5EL4ZUQPD"B_ -M&<%C2OQET?ZHSC`WFH*3S?D6R3B,6V'?[-W>B$Q@W>M,_N;\<`M2)=NG;C07 -M>9]X%OU`=]09"9P(UX,A^TM<,V7&O82A?MG/#`EKFD#9CS(HRZ_O6S(@.2:6 -M92'[SCA]-D@A0XX!P&6[(P'*M+1[4=/><0R]>^8MH)B>5ZXD?R9(8"OG#+]/ -MXU#^`[.XMGMC-!X*,,;J-L\ZJ[9JT&"-'.[P5%`A]1L53J-Z8O^1B&F(?/F? -MEZ6-.7H;)E,M&+ISG+`U?ZT)VCVXY'G]3\C'Y&&]UV(.+R!'\3#[M"',]^NSG/W!-`R+(=B;KN?>=B0!7YM]TGPN?R]6>&E? -M2\]9^5R5!!-?`^QG\F?HCEEH)^F(2RF_6)I0OS;,8,&8'4?ISN> -M4>5)YWW/\][[2T/#PW\^+!DC(RF'_+C\3NG0WN\FGH(:C?6_:G#U_-QO`]/L -MS0O9V;_2/OARD3*]*Q#?(@?>WP$_1TUJX%51#[8U%HU5L747&5+ST6H,!2 -M$X;-DZ;MV/:X!CJ#M-XM6U]D;/`Z@0PP% -MF8::)8Q5B+;K[!7`EGD7FR+Y68,^N&P?O`G.GY'PAY'?!EACMOFL9%XRW$LB -M2'AGMOZ+&XPU;+URN9\?W'D-6+ZHR5Y\[7_/)CNNL@J\UM&A5Q%+NN]]&.=% -M$U4\8`_>`>'`,HH/SN[`*'XE]#\?44AD&_N:@Q(@E("%]S%59Y!(SB/1:].4 -MW5K]Z+_CFN-\O"ZRF5<<61,*,QBBQXIKL0[ZB\?,S(&W)JZN4#'B-$WN"P)EZU%:7!\\_ -MG(CG+4Z09+L97)['"&1WNL:^#0DW7G*"RRF!3,OP,:)>2;LNA)RV"3ZU,^R* -M4.IG6(!CK#(+B8.'T2_W^NROX2A*1LH=*[VT&VU\\HRN/SG/#=KGH['/O<.# -M:MD,GO^/']`S!X]Q"]Y&MNP8FX^)U,5ME6[+T>)FM#Q2_S3_%VXB)5LUEX -M>+7;'D@[U-(:=6'&SD-&)[Z=DZAX<8/0;,9:/#^/J'9@J"U5#Z%&CSR(T0)V -MS.Y84,1>/W<3VO2T.].F:1;VG!XQH@Z)_,\(KV&\\PX%;;=Y/2.8S_ZS4_/=LX2 -MVN:NW,>H7RAPLCFW?KW"Q0#G0^A/!= -MP<([\FPL?J-D>"ZJB[,K_26\6@VQVD7L_`CR2IQ76S4JX\.6S6#&)2VE,7G+ -M3%:>?-AUK$ZV[*N&],3ZW.J+FV#:*#KV,^YD]6>2I*C$JJL2\7L&MZ:5Y\?> -MFZC=+!FI!PQTM68V@V7$888RN<*)`:TP=[R\]U$&_C;4F:,-':'75;7BZ?)[ -M:->K&P^#J_ZP.M(R$//!/IKX:D:#WJ/O*#T_!J)VF3#.,JZ\9GIRTY"\23IL -M[7GQWV+W#DZXJ?S*:M^Z^94<4.IJO:%]CN=[Q=&N1;J5O3Q6`BS@%]",K!&? -M;D]5YWW9KDY8FPV5)@E1M^=X="Z=95@N+B?B8A2[V.&;T3V!F^:R\7J"K&^5 -M>B4GI=!W*.@Q0$I:WC\K%/[R=-92FE"N;C72E0_U$DRCA%.MAXU7G#%G=*5W -MI'''Q@<"!KUFH=&EX?'G-2+BX\H72GD2#6;J3 -M[M!IO)0^%X\.1R"A\;JB^=/["Q?9"(*5_A_;RO;D:8MIG2$S]>8SN=@NGQZ!RY9'U7`WG;M>";K1[:9B$VB\<#)XCYV; -M=D8C`ZWY0NRS5^#$]6^RGZ#%!X6[A\IPI9-IA:KV)FG'(/%)6F0^4=H#ORE_ -M*0>K[,L;Z_OVL8YXT+^_I!BDS)"A]8R=)C$#HPW9[!%AT8K$*`W/?%^($=7/ -M/-ZT&8!)T'',A*Z_B'#V'B]3DQ^DB%LP^Q@P=[K[VNN&\-&V'3QK#)OQF7R\ -MFB_T=B?K>K6-_0.T;6*KK4E4X#0C.>C4:EL'),%X?6]^.;BY*,:3(RVI;K0V -MI[FDQ7J;,?GN#^M[3F%'KBU\L#)1LG0X1[*W:)RE3#6CW,.?@//J)#2\"S.7 -M\V1XS`6JQ\L>$'K==I'+F\KS.N7_RHPC6R$*9!3;CI.^%Q=1UM%9F-Q?P-S> -M(&DQZ8'4\=.>PAJ9Y&'[81 -MBU!XS]NLQK6PEH;8R@A[%F-;+C15JNUH\4:WSVWW3D58ZQC'T*'*;JUU&XJ] -M#N=&QG:27'&21/0F)\3F"IFV').61IE7[!M*A;^'0B$[B$\*?;3:B4PT!,MM -MV]HA%3>-R?[A1Y@YT&.I$4SEF+:OI;\2-Z= -ML]CLQ!48G=#\+[HFA=8$Z`M'\!.(#Y[H%J!SPR$VV6OSF^<;N#%^;%&+/.9X -M<1/#3.YW.`TMZ^`)[L%G??@EE0P*+I1[JR1HX-+>6VK/.YF!JF1=*7EX2< -M&\7:DPEVSXTW??#PV/G7),\&,=;;=K]5#?].'AT6,RM<:`P/@U)IC%WH198Q -MC8S]Z`=Z<\:7=5](-56M?`RKAS^Z6_U>.S9=BA> -M)FZ)9&HQ^$]0W`M`C@`MH[9.[]RRC`@'1U3UI.T)PQ?1`T>:%K'RVC:S61OF -M96XXV.DU^PY,-S60)MG3"YC3OQ1/0^5!`.$YAEIHL@@R(=G'A:'QT<;8&&6B0)61_[4IJ!K'%5).TB*[WJ(['O&K_"$ -MP$-C#YE/FZP?AHLWGK#.ZO)7=WF;NSUC]+%,.U^W9IENONCJG0L,UFK*QS+I -M%S&LUI;]C3FAE2]T<$T!A,?%YRAGK\H[/*_Q)?;TJN)Q11Z^0ZXM@CO`,Q7B1->Q(S2S3NE6Q,$\^N-[]M -M1#Z^YM_X?!J&J"7*?,7LP:X$1;"MH6LVCJPR95[HKIT&G2N8VCU_J>[:,:=I -MJ#/6K>VTNSHABWO(Z7/Y-";,/35L^NXO69)D49Q#L]CE5QHC(,4+Q,T.9E6@ -M:5,#D!PM!]1[$]'\A\OH^![X>_)[X(P_1H3YA^>2:6T0BP#\<`OX=I&,1(?2 -ML7WQ4]NC\&D])_,[`,]4^F]_R_(,!I-!(`.QYJ5Y<\^:0[1&>5F:=3<86763 -M!N/,2PEV>JAC'AO9<=`8_-=]Z#%(C&5/W9CQ+BE0`- -M.9S0/H5)3M.4S:$9%/._OL]QH;?'^,3RS')<,<\?MF9[#C7.+@:5Z]ZEO,KR -ME&C4<'I%0M]O&,0GL[;V9P,XS?P2[@;&REA!(_8PSB01DFHU7")L([$DQ&<\`-5A(EH'/YZ& -M=,[$\]=\SCN#4*CN^;=T#K3V883?\TMN,R.2\4'>;]@ZS_72Y[?)_"W>'L7< -M6S9N9LKFPQX5>+Q[H."G=U6,'0O>D]RQTDUN/$"'[M9/W[T+`N8A!'?APTSB -MUX-PK>+,MGQ&37<+7?8)Z6O:AA4LBV5&3&998%K7DR'LO32L%#.]P:9?V-WN -M5F"FOXC?#\V_(()7\#XSU)[\7J,M%BE,%9#(/;5&H!5ML6(*M/+*UHXU]<#U(GFTE* -MIAIAV7%BBJF6EJ'QU#M"4C4X343C7D\K6(DS]"^KIX/PIJ;[N]&0_;AO"[MW -M1YGT_YZW*_/\5:_R -M@.?#1+X.-.[U4RU-((0^J_)?%17?S*GO@H5/`-LFI3L]0&&\"&M>> -MK3+DQ&F*>4+\=]-4F,H*JJJBEFR,^VJH-*J&VQ55U?=10H7!N*"'0$E,@8?D -M0<]8&>G6D=/Z?+9K_1DT?J-A(F!@1WXT)R4QD1AT^U7G946<)I]*P]2=QG[4 -M?J*3?,"%^*QR;#>]SV6%A?:S4VEMRJA.W1CV!+^`G?']ZBKBM1MXM7@4U,X7 -M^:-=#C%L<>8VH1\Y*&+2%M12J_`ALFD'S9_^S,=]FY3N?\74R_+_6+D#0K`- -MT996(1ZC!"&>_NE(M;>W#?"*WR<\F;P<:,$==RB8?65C6S-",BY")BF^G<*: -M^01=&:?=^"];C^^CO_V)=K"JHI^[6K87'QF7-<+]9E -MCXU-JIP89K=QN6ZV+HZJ_%\\^ZQ7M^RFI@CRYG!])\`F+C>`TK]HQSK*WYW_ -M>S(4V@?L.P5IF"2+BJF^D/-8"SE.1BXW,+[-XL."9%:OKI%"RDF>VR>>GEH; -MJ-?AXUC\+B)TS7N7IZ#^P-1^*8PYL\([&0QD6L0FR7W80IY-&(ZM/`O,#(,4 -M6$\C/6FHI[\5ZAU=1J\#V.K?;26[DZ>H3IZAJEA3*FI@(S%>X"@T/W6W\/55 -M`'U`*B3[R1_OYH+QC?'/MQM2M -MQ]E>Y&()C1, -M\JZ-O^KYF1&Y,L$N+Z-X3L\`PK+H\0ZT.LH>'D]K/._PL&MQ<:^N;K`\:%B# -MTD?I(+1L#TB/'3T_.P$4R3L[AY8GZWWZ50??!-3]]JQ`@BB;PX*,5L-A_:I(TIALLN=V?KPE63I3Z#68#WDT#*0 -M""I&=IDJE4$?6:_-4$-UWUDY -M*LR^RI'^7TO'-RPH'381J9M:5V>Z9<8O,$<U!QB!YP79`\>/!3-*Q(*#Z09/T@DE/A&J@HD#Z26L< -MOI9`2@,:;2Y+2P6<1@FE7QM7:*,N'"&"P:9@Y8N_>Y[!6`,1X6X5Z>`?TE3R -MY1ZJN(Y7N3UKJF)57>OWMAGD^E4O_?+VRJ+/(,4H!@;)1&PSZRR(6S4(/UPV -M;NN+-;=)77]FW -M85FS>;!F.S)_5")LW'2CW'RZ+IT="*+5:Z.N.'/D1=]'H;B2'AN<37AXKL+T*Z_9KOR7,/I=-+1_+?NCBO&6NVI^-ITR6QVBZC:97@K&2^6_JV -MF(2A@,"Q3<7%_SXJ]:P2%4H0:7CG#')";RDM,^?+9U3#21D':*7=*RJD5"M# -MDON*3<,;#HE^;A9%@<$+2BA7Q_=E_-IH9B+CM%)'22X<(N=-F[]F?L[WOYX^ -MO?%_!^NE$>+PX_@TQ)T?7#W1=_=&I%:&,*DV$-(EQ.[TY7,RU-I&A+".'68<*R6U[G4 -M:5"4/:5=4B@_RNQWM>EV[4%*:3QRUOC+JW@I=MUU#N,:Q'I/Q/FNY@-'+Q_8 -MR6*,8YE^C@U[.O5SL)H='FT^/@HDZ,USGWLF+\^GYGM-#M&W)Y/:@;7M)W/) -M\EH6.PR'"TEJ\TE>8J,\T6"*(0L`QD/,0Q@8XX1YB!HX""!C0XCK0TJ\ON9Y -M\5(R-SU;YR3\Q]Y$JLKBM(_QAL[!@JXPGA2V[E=JERN_#Q'E;N+I]?/:]@6% -MAA1K*L;7+:TJ/M^##4LS[3&8#C4S\$V'J/!ZMGJLQO%\LE/<^6:M2?+JHHA/ -M?6UBQM&TG,"'$F`@EJ)MH;$_K-Y9]34,[\_V#^#G9M7H$N;ZVK=M6JKM3YJO -M!K?P@3RYE3#I+LIJ?3:K9]?8+;UL&UG%32(SZRQ'VE7_&3LJO -M]_Q^4\@4UA'UVW>L;TP*ZNKJR\KZC3+J1_7%PT^@K>'[+8F1;+%/4TVS'*LPR@H4,,L,PQCU0 -M/[63`H)YB@X!.SR@X!/3S+F=\.DWUABBNIU7.WE`4%W[QV(N_'T>2R*0?+4Q -M7AB5@(3UN?\ND$VJ3-H[MZS.LJ_^_[P#2N+JU[UI>>.N%5@A&1?782V0H>K\ -M[?:VO.OZS7J>I.KO+/30Z83I#NT5"=,!G2T+(`J`&(Q`!`1\!Z3!,8)CB/GP -M>ERR"9^?CGUN?*E\M#JG.R/YK_^4Y6WWV[5I+[QQF6NE&L07E;V/:A-($MF3 -M9[U)?V,DI+">K(3JDLIZB;Z0;YC&2-\$D)54AWP[]5$12!1$8I#OC&3X0=^3UCUL4UC;:C\Y,UE'G^ -MKGAV>S_PO?Q#-AO2[I3XQ__(=FP6?24:T(+8Y8(?"E)E:J*2@E*6=HR<[Z]C -M@]B/I0EK2Q19]?G:7RMI;7WAKMKLMA/OU>)K<>WYZD26[Z5M"]ZLHGC[_'QA -MY7:SZEFD_7S'S/BHNK*)5\?HYVAT>?XGC^1T?'[?17R-3'[O%6R`^3"-A,1B -M<@[LR=,[IQ5(^<"AH0\X$D>>!\^M:)="><^[/J8.=0Z#OL[N-4'2UY7;2)_: -MXWALJV0D`I0N^IUIW;-EI104$;71QVZ.34/"R'/J]-R.!94"2UYVVQ:'*;-,?2HT"5(>+SNAT/%Y_/. -MAT?]W.^?^J1]UZM[%B/44&QH$D8PY^/$C$F!\9WZQ#2$,5$@;!G9:T9"'H39 -MKOQ&0F,`F0B#)GF6XS^?]^^^59,<^4OO!UJ+GN_??DI,1+/0$:84$A`C.(D1 -M])26$[,^I]H^]>UR>;S3FY:.:C<:>8.8YN8G-(C!!('(![D&665K,E#220ON -M20_(`]S,Q/<`Z.X=CHX6P?%YX#OPLAJZ;.JM\?K*C3FU3W90Z58.0*7O4S*Z -M155T:O9/+-$/7D:GH6,.,,=]\)BAB/$Q0$V)H`03H8Q,"$(3,W>!)44#WMY\ -MPS%\^N]-FR'8?,_6?XV?Q9];Y!YOK<>LX$LX,YI#3_JX_^6)E.0AADV+C"-QT$ -M%OWF[P_3;0AL^+S. -M=[:MM[;<\+(K+6K*+53L[0$DDF"TP)`-@!B1233`1DS(LTG!14X(:=(L:SD( -M?@UOHG!'#1X":+-3?:_.8/5R>NIH3FM`CZB0R)--34;-"M#8X'!P;VV:R*A>@297S%1F!T4'F^"[C#R7W67;^\U\' -M^[_&=_]I^A_Y_V]G\WYW,SL^'@^=X;_VY:*BAKEEV03E0E2G3.#4C"$0E>0, -M30/,:/;UH-49*'B6CQ2E4F20;0]DL[:VW>VK1R6_?W-S[#_/K?@^1G?1T/MS -M0S_QO4S]@RJK+GZ)G,UK-3,BS@EJRM*'882TFTE(@R`[,A,%10AT/2FJI"F?9,_R_V!^Z-#SNU;^#[K*^)]E(N7B_X\"\7AKI -M>82&+PD-:S**:$.T*I8A3M&[;"(UCBA$AMQX`-%K+87$T/4R=]RCY-9A8W-( -MV^C..RYZNN43Z_P9HFJ+V?9B/@.SCG)X\.08E!R62-2,+,%`'GS_*R<]J(99 -M5*A0+D(SQ9AXU/5]5/6/'W_F?+_*_TN?]OKD/Q>E9SXWKBYL'9@O(/UG[ -MWJZS:-JYH.%LR6[0K;F>]M"4>.@]H?'X]:-9B&EO'K0&#!-`'Q%/#!P:VQ;: -MU;!%NVXY;A;A`M'@J%U;]^^7;PK8@5ZZG -M"\$"XBXAQKS`D$$Y6IZ+9L$(`BI4\H>5HI/+W';YO;_5GZWU]SXGW3IM6BV. -MA+X7,+JEAM>S%,+T#>J\ZJ(6`&"(K)#8DET*5D*EJHN@)@S%6'@LB<=Q-CV< -M9O[_\C?^M_@]A_DD(;W^'EX/3+=NWAJZ:LEE#52R+F9JHB!D!F(1@,51DF89 -ML*4$"@6`YE.:"0H0,O7,O7];OGP^Q8AN]3\DG.665-)DER23*"":#"&F=W:6 -M9IG=,.S$%E)MQ'@B:@RUC@!P'4AA4+A/#.@PY,3.+'!G,A`X:)Z.W1_:R?6^ -M/A^B.\.YAZ6&S245550/%G+'Q&.O$\XYQ)XEU?'UB!H#Q892FQ!*HA:#25(9 -M994J;^4XS)JIQYZ.[I/-JU>;L>F&3\;\3?7YKKQ/+U![MXNW++%PMW&>Y`0D -M)!<&=!:@SS41IV+0#L`+%).I(,0FD>P2LLV.>71:6I^AJB_![$F:+J]7:CDC -MD(H1R00.!([C.,))),&Y&J:!W`[H##+%<-UE,IC[EFM0$VI+"P:DPIG1@^T^ -MJ\=R.WL7$;"'!Y%$.I"*1VDGA_`?SFLUFSPKM3T-FD*@H;(4RA(;,#9 -M84BR%2,8I#9BJ39V:H*ZLX=DV=7PML>]_*YO1[1MF_A-S?Q*)B"K,8.+02B& -M+`&&*2HPE28I!I#%PQ5%](ZVBX7T3W#7WT^O^G^57L:].E*HY]O/ESNWFC'GS(RH<1H38!0$U`:8$I@FD<&=F+A5A,@8K1,AV+1%0AP:`Z%,#S -M7Y^ILH2HZB]QP^'\CR^]DEEDRS#K*G>>>=W=)IB8.`L,+P%FS,%X)$02/!R$ -MWE,PDTS2J9H;%81BG6OS=[?HW_.ZVK_6_\^O^5N^'=N]E];=WGV%>O":[2CR -M%>[=N)VAVE4O:">50F![4.-0:UA2NA[2(\C)'E[=9VGSK+#R'D\??]#P]_A] -M<0JB;8[=1FW!2;<@]5H#;(BC(;9%),=)CVZ`6>[MTNDZQ:*-%\0ZV3!?KOL' -MA[511Q6)&D,W1N#<;@I-U!1&W`=R153,4)B,SMC)3"D[-V9MUV'I]C[;[GN[ -M>GU_#AY'1FM:RCIZ;,/7Z8]>RI.D=`TA$"=*!0$2'3`DI3EC"=(=,Y4A@69E -M#;-S*80X(0ROV,]T@I0%F>8A\4^/['C\?UWQOOA\TX3J^=[GFR\<1XR]JS/' -MX\#Q^,\9XPU/V?C1R#QK3*2%B2S(:IJ2A)0"PU!JRF@\/9[>YMG5V?0*.J=4 -M39LU):+$9U06*;+5JD+2'50*!"&R0LBQHJ`5#9#9.(VN'A-.K5Y/KNYZ_Q#B -M_2?*]ST]I],XG&X''3@8\`<4XV;,30IQ6XXG&<4I]_,B!T''#%X\L -MG8-%#, -M:@?M$*-XN\"MX5O-V_?1ORW-JC[>'CO?28:=GOTWRNGVCZ6'T/5_#'R#L]CU?-/0:=QXG=F9NL@S=E@1 -MNS*#!;=@;A"J0P'=A@.)MW;C=J/B;MQN\7Z'T;SD-LW-L]_[C-@))YLF/+A$ -M*IREZ2D8B9A)(&I9AY`PD>:ERQ.99''2<9V!SN9AT'/P5R-\S9I9M2_$2)F% -MK(&1?4HI94AB6M(]\FDFA`F8UF.Q`B.!(PL0)P#=..L`X-$H::99XXTPE*3% -MZ_1J4G7U*L'=>UP8.N<%JBIBJ:A4.J'4/%"8#D)L@,I@I`Y#J=1J$*`2H"BA -MWH>!0034$RG)YY\M&KAK82(B%$6[DD,PW1%!NC]%%$=QV=D9G9J.S69V)V02G -ML&8)V`'7&0.)%I`-B7T6M*L+IOIT\^[W<,*VC:-J;2S:-H-DE#0GA$I\,F$# -M@>&$PDJE?CU[.SQ:K_3W^K\7)9[^SLFRK(6=NFI% -M44,I,D!@9-"LA1!9,F%,A02DPE\04AS&(.>S6/,\3WYZ.'?]C^5ZNF/>ZNH[ -MO27P1=YV=C2=G9F8TT=@/7AB!@!V9@&(TP10GL#[$=CAWSE[!EHVY>?WN_M\ -MW[?HHI34SO0]`4!0[NT[!0AJ&9D@*&`2!J&)T,)4.BB>=(WM -MC"074X>#'P1UU%%%?C:-1D<84FU`B#9`[5:VP$@;8)R"MI''?@)G:33:27@E -M,V*PF':/:[7F'5-_?V+$S[CS\.!Y_B5QQN/"XV&5)Q7A. -MR'B)PCC:8#H1JD8B,P324)QJ@Z*'C<>.LM;?Z'K'9[_/HT:+F*7:I#$PPHQM -M:J7"JA6%J,4(=63B/7!Z\]$;"I=B4]<&69@F`QG)TP5S2KK2R"LY2)6MK(?5 -M_`^%>EEM)I`DM(BE4JU!@&\[)#?&R'!**!6(7>"1B<8K`)DS2!+*[I,X26I2 -M5\`1YD2/U+>\<9=TWS;XLP-#H=`:`T(H"30P*40E%TFBIT2!@FNC,M5`8!9A -MG98Y=F7EA@THPCC2+I<-N]-BFVR;S_!W35*2B_1?TPI*54D.U"(XWB?$63B> -M*;,4P79(85`&(9#5!4BM!V(#4U.R9W03U4E)=IH[L_8KV+$5?%&8B!M#;Z^W -M&-N&+B-#M!:3:!6V*`(0D@SW42(V=KHDT1BED5V]!Y9I;LO%K<&_RX<.'-BS -M7;A=OJO-Z#ROC\KY4P"E\H^2!\MJ!Q/+)080F+,)L"O+EF$'EC3E'E\KY#T= -MN9XO%\O^/EC[IEUY"6/3FU-6,9HV&2`C9@2",8C3,($(-4&@N8'$>7L[7QO@ -M_!,WT,PS.JKF%06/H5*51(;,$8L1`L0ALDV4A20J.=0&;5JA0YT[66YGT8_> -M>UOF]OX8"WQ,;8VCB@ABLK9B'6E!U%UFL`-*Z)"=1T]4#MO"?O]S-KZNOB>FJFI%105"35`5#,Z!U0,B3*JIA%("`LG`JAP91][FYRW+N]PJ&R/W?N7?ZURY[OO79['RH._;M-M-=^6$;B(W.Z('=F#@!NS!,$HW5& -M29FW6C=`6XV?)WWHST7HS@=]&7.0YR'?W?#^IWO1M'+M7,=TLU6K>\D0$BV[ -MN6RVG3.>.D]KQZT&*Y!H#4^.1E/'!E11@!;3""TK:<=EC+@0>FYM4[NWL<(D -M19(H\.31EHPW&49CB[LQ<4H=PKN1R-VL!V2$FD2"0C"/$^.52CUL9R -M[\K\,_6V?8_A>7O;V"S9JWH6L].DJ.FDTR:4C!RHI-(&ED$!=A"4,"@AI0I) -M41%)IFEJJB+F<>>FDK/O>KZ?XO9YSW._.PW[]V[:;C=6Z"MSNB$-UNLD)"W8 -M@Z&D<2C<5N*=V;MV[N+=N[[W#O\_VWU?>UM8GIN[\**A5((D544,E0P]#IFH -M3"$:"!V8H#("S$<4Y60YPUF$$5'(Y&XWW:M^4XNL;'6S38,2DCEDDP2X1Y@4 -MT$TR$,3`),PTJE`G`:2DWA54[^&_/: -MM6IRW&_VN'M7O9GO\MG+T_8^GS\F_LH[#KZNO'*,&"NO,#$ZX**`E.N,D<%R -M7J'KDEZ]=.!U7P&CKT;5O9ZZ-$]/U]?P]8O2<1=DT[UYDB<=VG@B<0F2)F%) -MQAD*WYB&"4<;(,`B.)7;QCB4+65+TE_4LC\'A]SI7C(\=C1B'B,Z#Q$0T2<0 -M:#,R3J"%>P"D*0[$J@["*@[-=G1I"KZ)?1QUTFHTXZ#&[>U2K4 -M5+X5)0*"DPD610+`7O04142I=ED*+E8E#A=J] -M%WM%5O*&\19L4J@:0W4FV+,B1P3LW80&62XD1HD'=/&\CH)&DP/>O]G?J]?3 -M.#M12J5WE4I(T$ -MO+9Q=_:DX)!0;HJ<7/B=Z7SJ$J!S$4I@1R`.8%`IEX*;$:45@PQ1HVL]EAM%ITE+MC)'$*:-LA(I! -M&$8J[@\<5:Q'A>0>&O'N'F:NJ2;UV]J6DIQ5^J9(M..,C:.*-1NXY&$8Q2;5VSDY#`4+0F -MU`VP$!V"2C:VA*,MRJ.0P+=VL1W.6V1S3#S2RRJ4E4J3L*44YF.^2#?8VZ34 -M4++0IO"ET--.\WY8;H,WQ&ZV:]K*+A=![A[GCW?H.X][?>7K+MRXL,2XQ27( -MI%"%X"S%"Y%`4H0$)A>(+-P,>IJV^+7PGNGI]WDT7Y#DU<0\1Y3><.#OUAPW -M[*.`.`7#!]B5P%RR0Q8F3,E,X"9Y(3#JZ.IT(U\E*>Q`""`0,ZL/7.EB1?.EPYN+E+N_?[=Z]=)&E=Y -M;LG!X!PF#?OA#A++5)9B2IOA.`-2;\ZRQ0X3A/2[7A[S[>[X^4W>7><9BF+4 -M*Q#:MA:K$ZHZNO#0FO!K2NA"ET]5UR%`0U#&6F-<5!Q:#I$Z=WR^#OZL,W3A -M>Y>]ZHPJ@L799DHEV2#)%4;T>YR=RO/K0:S;ZVX< -M/%A2XTN.*8T&&-+#B=<9+@-'39`/6!J,@ZR$^U,S!:$H92D-0TLE'L!Z -MQ>MAJU)H(GUHD*%]8;9A\>U(&"GK#]F'K7K?:>MF9LQS#CQFPDEB.SAQ=KN; -MG%:M;F6Y;MA;II*6HH=J0$F'8I=V'&&*6!T,%*I!TU%-%-%#VF@$*JLK(JX> -MWR=B68FPSF&4$)*4G@Y,$PD$KIQD!,[H09`P$0+P1VPO`'@[,,.#T.\X%;22 -M7J[F%^0V_*E+$A'(6[DI+,TR221+,FE0$PR3$TP!2;YV0ZAQ#A-#&RM_#,R# -MR<=W#P[W6Y.R8F[C>L+LNWBW-QN1$EV,(WJ`A%D-@A>&+3>FE"]38*B51@'! -MCP8+PZ/#V.]YVOU>3DQ;>9[-ZBFJF#JH2*G14DJL^`[-4[L5)F@TR01L,819 -M"DC)E5`B!9(6)E64&$!`J80@NWK5IK0M;6N'%FB]MHM?B?I5])AW=QM&8>KI -MP<0H0^R"BCJ"Z>AUU9!J;/7^3TFP[AXCU.][7LNG2XUS&6C/&KV-CIS:O'[7'R<$\'!6OO^IISSZAQ -M]=R3(TLV(4AF&8"A,LZC+KV<0-@&0%`0>S,>SD'H[\##9KQZPU.KTLWIU:N] -MO[VO=Q*;IHN8J"PN!BA+)+DLP62)%-BJEF2\4QO+U11>]ZKJ8%SBUE^V>CV^ -MO?%QV\<>O2I4O30,<;V$)/.)"S")%DNQ:8%03:HC%+MS%P/1-M];GU\_N?=O -MI?)[?+]N.GEZ3@/!EGEV3,SS0SI,Z0I4S'IRST^]/5R\WAZ?2WC#6G5O,;I,1;-K0HA=NEF%D$A9DB!YU4I* -M%A<,871V+6O>[YV/%K^&?/_'[^G/+`PF$<4*(F-1),80Q0$`PM03%DL%("D2 -M8CAMEDW*J8XY<"Y2]]'9[7E^Y]S@WNX]SSAY_E<3E%RM-N\/3Y>I8-+1TC2$C11I#LD-I)+IM2FE>HLE3`(NDFD -MDHI.ANDH3!:VZW-O2,CM7<[?O=WE\L\E^SK;INO4561:]H. -M--.K5*SU1-0B:5`U*$4U)$FG502U.,(&@F$R06W1;M,ZP-KW,2(/6850&20<6RY'+9OX% -MW\.[._O*39R]/(9.UYOKU&GO;.S/+.\Z<<@E.)A,$Z9(81"R'&$9#C+D&)OB -M/?LGB\BX]%=V'9 -MDA)IYT(E,I)+,^7?Y>2[VXRN:1L5_=S6:?-GL9V-LS9&P'LF0NLUFA.Q#80& -M1*`NAH2%$4-"6==]!KW9T;V]T6X^@[AXGA-/3;3=V/7M=VLPW6X#H1W9C0%! -MB[BS=FY=34ZG4-4LX5EGIJLC-3,, -MZI2I)FD9#-(1A'@SL2E#.G'=#50(/!D69Z<.&K!O:I:Y)Y8XT16(E@>.-HU# -MMU@8.W;CJ-2]$CB)L@90VPP;5&F<3)\`21R.\F"(\/L6-B+>NO%92C(FC0B- -M((FZMNI=ILP3%-L(2!2&V!A?!F68B8TG=HV2(V49''H&1HZM:6S[SYE_!EQ9 -MB\KVQ*TJ!22N6(;Y,C!-X1OEP`S,6AR&@88)20)22,5C8BZ]:O>KV+%LM -MW'N$5B)E!X*P,Q8$ZO8]CLV"FAU(RQ;'LUFK3V9KQ^38;KQ^2.'!>[W_-\KI -MW[F.Z,N7#07`T--:**)*A-"+`$#&J4"F1DO12E!L-F:#`QNZ+%%]C1K5L^!B -M.38WEZ_ON]Z/GO/ZG:S;FYL[ES*9+H[O=+MVZ@97+KH,'QR0ODO+(4LIY81A -MU&&8$4>5"9U=:RPKCJU;M]-]DW;TDLFL9IL>:AZTY.MBB`XZH;D\GE$W)Y1` -M3R6!*Y%;7I=3KWJY=(BS:%(6;1-*TS5G9PD4Q -M!5H,X;))3?(4,!NM^8#(4#2&+OG$2J`SDC8732P@^&3"_%-Q=[W$]<.D:)HM -MHH0:+,:)*R'3(9#B'3"$O2GM)TDW5F=/KGAZ?:T'PZ6[BR9-6HJ:J-Q$1%&X -M[$97K0:`"591IDS1K*@<1VUF/L2AH#XL?%@,#;09S#=""NTBYKJ-Z:V"MPQ& -M]O6]0L11#Q(2NMHM$D$:9$8&ZD4!@*!NDEV$$#=9NL*8D-TW1&;NDOEUST=> -MX;2FV[4V6SM(J6VD&*;0&T)3(5`#902;(@A6U0L-FIM*;4KK:LY]&A$M[M9. -MQU/6Z??\GP>AEWZ>79M6K]J^)%M[5M-2BV-;9.G":8A%!A-40+,*"=29I$>I -M1J.!S-1J-<=8-A;'?-3NYI8S(5Y(FBC=AVC0FC`KI(83,[9R3HDU#"[0S$`P -M=GD)C?/`<)WQB/ -M`E"`T30,!P(,G@F:#.[RIB#30K.#LE-=N2%R@GVJ?7W\9TM)%P\?2'0=2'5& -MR-0Z'J"&1V0E)#U&8N2P@TDYI#FD8:XA>/O^Z]YV>3O[&S@X2XKUV%X=%UY& -MEEK6H-6\B"MY$AO@LUOV!L##AT7ICM?-K -MJ0()SBPWRK"C?/`4%_S-2FE3$LSN[*4F@F:-3(0VL*-D;5=Q`=&L4-">`LER -M$@=\P*5#(E2$I3`387=R,DCDPMYO&W7.P98R3+>DD16XRK<;G=MQU.D-T&2X -MH4[(6`(02$2DA)6@[OW)'7"OI.]<"#U=>)#C-($-' -MQH!A>N:2E)-%)W*Z"%=W:"1!(M6[<Y#DG.'+6LUNN4ZU02"ZXBJ"CY@FC+S0Z$,)-0Y+`'FD)\V92FLUJ<.OL' -MGZ\O;W>,\7:[FY?$QQQIF`LQIH2&*,2#)Z#%BA$)3),8&*.PF)CA,3`R6!TG -M?6T\AC@NW,Y>2X\^9AF6%+R -M8"$YSSD.4II71%`LO.B6'EG1HV0;-5S/0'EO0>^?H^]N]OHY./T=\IPQ2Z71 -M,=BB\ED278%"2B1$)C)<8L(R&-5+B4R47"_43CJY3=8'OZV;'P][T?4]3V-[ -M?T\<^/&U.)Z1ZG!-4#U.PBH"IE(P,A@)#)%)3(5"9"(U14C,N"IE:THR%4[O -M@^%VL=''HQ,3%QQQG->K72T+K5AL4+:`WIH:`2%UC)&!=A%(D+HI!`NA25+H -MP2]`\VM->LX=?I^GX?:Z.CWO[V;OT]+;-G%CVML@/=K.[7;;%UU=>Z7;HURZ -M"2'=V+KXX!Y925\L'VLC`%+28/EK,*P+B=0NU@NM=%L[5O3O*Z=;COKDS=VXAQJI@>)-`P(;UXYB&+Q>)QH]^"8G((U#9U#'U>M%BCQ0>*.,2L!%$XXS. -MS$43.DDPR8&<&$$-`D2*:$B;DT=GLF'P^/#V/,?<##`<,\7$QF>/4L6ES8D+ -ME502ZL(D"XJ0$A+@6$R$]F%@B51&T:(JI.KK]O\[S?>[GO:V;=TZJ=RBEJ6I -MH#EPUSV#L4YP%+*=%1$#('T^Q[ -M[T3;-AF*N:JD#/1`R`RF2Y5*A41F0Q@*"PR@+UTDR(4,4`23@.YG0AT63,TN -M?K<_1US]__O?7[5KXW/2-$T:)?1!00#0*D$DT(BB`P*ZB2(.SH9!$-62KQ.A -M%@Y%CBWCN8ML_E%KM]HY/T7RS/5YO5SN8#F_.W<):X:SVNYQ']XYEOO]4[-K8M54U,J2@*$U+` -M[)W&*44ZS"@)3G$0)"SQ\9Q>E^/II>3'&-DCTW1 -M*2A*DTJ$U9$H[EWQ2$`6_'(`P4W5OL6MELM!6R.XY#'D%,1[6/3VIINM\'M5 -M_PSSO<9#U=,T[74JM<\M-:69T)O&'M>T.>UEK,B!,CVB$H2!*4>:%I#(!U:+ -M6FF?4+E8S0<@)75;3U/4X>=UBH\&>?!DY=O/(>O#@!F3*`,F#"<" -M*!P6HI(%B!DL6,A$DL'`!E5%&67`=O-[QWN?7Z=[P_;'^MUR>?J4ST\F["BR -MZJ*K)G)&JK3LK36F23)K0!>T>UFM0L)HD-D!@'M&S$P/:G),]I&:1TG`?\B_ -M#?AG?^)NUO&]NM;SO;"7EZ2]Z2E%Q"7&"D$DO54R*`P+F#0*1DJ#N5Q)J]^Q -M=MG>][H'9Y9HIGZQ8W(BU%;MRRC2LTHA,2DDANB(20W;\I&`RI"6\>'`Q-I? -M%G)X(2XTA(*6_N;9M'5ZF_A]+V7O7Y9>;(T1&A$9&-'$XSC1IEE#1$04%*0O8 -M42$.V2VE$3*)U&W34FOP%92S;$^*CZ7USR.O\/L[7?T-G0VGWQ<4,HFI%@D.(03B8AQ4TJ'$CPTG8.QPZ?C?E3Z -M_ZDNSY_NFT]W;V.LVEM3LVA=ED&MJ[&0A=I020#M*)2E@=M[$N;8C069M#Y& -M2>.+36,\SX7F:_K=7R]AZ_JUO>OW.(ZGJ\5;X6Y#F&VC*9S(ZDT,H4F_O`-]V11)-$9`9"XBA$DT#'0,.6"P6$E8;>-D7)ZLG!*?5 -M^ELEGW?Z8K?[\_ZG#!<4%]QMYOX/1[//Q>0UTZYQ=R+PZ]8:Y#7$@L!8)#7$ -M#4&*^:(BD(1\R^;Y.:\&!I-AGF\W=LSY/G7'R6S!/*R]48IY8@A(3R20'ELC@9L;FX- -MP@QBH."A#CA!P2@1<)"RASENG2ON,!Q^AC(3W8&4A)^C//5EF,7M?:O/[LA\'@X.PFE2)=^932\V8'9E,Z9/F$?'D@#@Q10[)3%=Q&0F -M(%!,)G0.$Q,!O%A1R2%.WV.WER_47+!Q,BB>1WGH>>M8<]G/[CT'V_MF?/_4_OOW -M-]?/IY;MWR'>;]YO@S`WVYH#%=VLP8)`MV4TY(&#^/.ZU#O#1OMYM=>_PK>3 -M9%V3WZJF/M38F1(&9F/(PT6K9 -M)B&^Z(AY&N,4)$*U:?L^8N9O]R[Q=?M<>UMP16(GW6>/64 -MD<4@%4RNZAIDD:-U5&Z,7"6`D@FL($TC.[B3<+1+6#64%8DUMZ7XWRN/ZAC_ -M$K<_P_4^SSGYO.SNO]-?`Y_0_2^S[[P:]YB_>:^=&Z%Y)7B\RO.DF9KB$DDP -M23AMQ!9CR4=2T*).H(`S64AQ37SO/SEG`N=WSVOP_R?E_,A?SOZ?TK3\S.K5 -MN9S.IZONKO`6^FBU::S9W!QVM%2;2V&B66`78(Y,"I`J(Q",CG0B9`64BET6 -M0LJH[9NEE[6;=?=6X=KZ'T^]_M\D]SUU6K>A>YF;WOK=IWYS>)\;>P>,K^ZV -M&_@;!A@-?AA0L,`%A3NS&%DWF@<0\]LUK12,)L)/^F<3O)([I[PPG*`!@XF< -MS1Z>;9,S80K*?Y?)8UO+]U$RJ:+E(3(>8J-34IAI2DT,QYI/-#2"9)#H@,L0 -M/$5XLR3KG$#X\)L_#L`$,%E`BR9\'++.GLAN)6FS=Z7TZJH?SOW'X7S?Q=WY -MSZ&A^9\W._7_CZ-;@YU;0S_O?D^)H>=P8/.;"8,`L`Q@#!:08`>"9BZ24A`U -MTRLAY6"?)%Y/+!Y?T?J^Z/5W9]S_&][DY?]O=M7.'YGC^+^)E)20T:)#MCUO -MD9*T<3I%Q<0XPH1N0C*3T2![:VHQ3VX38&;,]NT)D21('MQ1[>&4TDJY,FJ/->7D7W>;F^B\BOE>`<[A7LU:R[O3-Z-%FD!O#F#3?N4DWL -M0JZ`^J,SUO&)79@XJKDY*SC%!R<`Y.0/'9#C(=6"*,`XT4C).L"*?BF%=#25 -MMB+=S30?'OM3BO?&;,H21HTG? -M$1G,@XF%HZ1I^-,Z!U/68=XP^[!V,:9I*W[I17!U1X9;3JN9'Y+:%\/\R_HO -M6V(0SNAT.9G\_Q.=@PX7\3R/6.)L38C2383$R98G0"1B=#RG?+1DAB!WQ7?+ -MDC"&40R.9@1@H/@]3ZC[2E]54!ZE]50DC[_JS/PMFE1(48;;30PGE%%"=?@PM -MU%@L!DIJQ3WL457XVUUGV:DI])L.PU&12:I2OU)R>OT8WI4YZ1=G=X?9LDO: -MWJXXS#_;.O,:18>$*LMKB:##2S,:RLLZ$*3>R;?HYGMT:O[+;^!_$?@?.!@SLME -ME:CC/#<\M9AQXQAYCX7:BS?J7/[1,R^P0"7P3.74$F&AU.\M<_P/=&PX\V%` -MYY56;R<0JMXU;+X)%QH94;'PCA4ZRJ:V2P5]$RQ+`IL3E`LS9L7K'E,KM/E`XYY"\H\IOA -MI^$'X:\D`9.14$2A\,I(_>990,0$H86IP.,>YZCSRJ@E!E"A1M%#GH,P^<]- -M]^NQN\BMKF>GUEI]YOD86)25S9RJK%S]]QZ^\8/S(SZ;%)?18KRVTJ21A4V+ -MJ3/#.64OG;6!D9T3FW,AP\(L/3.FJNF -MQT_&882=#.R$;SM@)JU/XF.+LAP&^<&?5C']/!]`Q]5F/S_G^%;U2"//6FI= -M#TBXF\S%[9UTQCN>U*0A;_R9^71"DS$SD(<(DJ53_YF7O6*VNVWO64NMAL!X -M[:+60#:TH#[7UD>;K'@-RZLKRVA95MR:E^+S+,X$KM=,&=SQXV3'#Q#-MIG7$GW'@F@NLF<8WD&RX/!SK\IJ'WWP.8+S>P9G'0[LLWQ<]GA"YO)2,B@T5E";(XDXC@^W\"ZA4= -M_*FR5:S3UC)*'N@U5%T6]*Y/H#%Z,:I+C`SKBVRJ3$P\)5R4Y`[-Y;&40[&2 -M`Y>18#,NMB6,=V)9:&IN;$BRP!I6&`^=GE\?C/5\1X8=92'B62>PB,1!).YX -M*+,I4D80\]@@HA$D\#3*$9X/!/D8>'U_#ZGK^`G]MFI/PH]O1J*!E8>]MY7< -M^;?2L5JM%M$` -MUIEBVI5O;M'1<5M*DADH\GW+-6Q)65H:EL-+HE=FI?6`Y+OSQ[';Z_/S^][W -MO>3+M^,^K[)PP\3Y)-;Y!&/DZA`5&**+!)/(J)^QK]8DM`\"##V5#V3OD\IY -M?9]XXS9IBCHB/]AFKP>(]T-C#(>-V=_#^R6#U0QGO,XY7L:NK\>A2[;]5]LY -MK'%L-3RJD,OVP]$N+0/SYS)F6C[+_<;F)F56U)--:PZ34&O-:^WN#>QI,TNH -MW=68'!J:41\,+EQ=GR>3C\?C\6Z3PU7AW=@GL69&54HD\"(BD8$?G8?/B8*$ -MA;,^59#`8_//G:_WOH?0=G#Y_Y7SC]KF%:V!J#N#%!M6^I$,=U-[MJP_ZS)S -M;=M'2=Z(^+3P$_<&ZNP/4&\5F^)F<5]TY9Y\;!*(4T*9*F^O1,OO01REU(M; -MGD$-I4@P?"BC3T*HJ(QDE==T*6GF4_@+[&TL"H_Z9NG"=CD4S?1)Y0QWQ?$:2NUZA0+'[Q -M2WE,5H[QJ-SV#H0KK1I(_!U>5\PC6JA;Z:NONJ@HCNL31S5E.VK//!>S43^^ -MR:G/V=^_ENZ.YXVV48/&K_>GP^B&AKU=?L[:#L]ANR;-9,=E*6^['Q`!3SWS -M*/FJI!`*9OI0L(OF&#-@^<>[)W]R*"%.-(VF@DS6!X'OZ:_W%KHAB:OA969S -M43C,9<4%@/VOPR9?>0.73_BPZJ<*RU'6/5:.F6N`O^-2-5.QYYEKO0*M\U):WF"?[[.^=I&L+ZP)EMG? -MLWAK<7Q7#4M1#$_C^$CLMGO,T%^!SOL]Z3I_4WL._N^-9D-?>U]K`W[?ZQT] -MDN7/(/Y/N3TDN%JU@(>@_F'H+5@?-^L?5UAB'WTS40A]68AOWN9!3(E2-T1` -M1!"I!HN\!%(-D&,\/$&(C^O$&MD/M\4'X3XG_16SOGH`=);1T?75?BY]_:6& -M+FT%^Z7W?9-_TK0D!];^AB(/R$=CHKZG26/T]%JW+P:6,Y;4V!Z9H".;EJ:?'Z((@VO%,U>X;6FAG:!56R'M;Z-1.7$=[KMNMM?QEYO]G -M.23COHYBZ8K$`\0'9#&B?I%>6P.^/OR^;@&6D7/T631$10L+]]'U/O=:#IC! -M?D=&!F&5[MEY(Q-@_4_A,^'9L#'\/9GT#][F4@2E(Q^+B#_N+0>),Y^3&RNR -MTEOQ!36APMM+HG37+@P^']\4WP-Q\M3*\%<:K60_' -MX&92+LOS&'>.-V;AT>LW.$9O,.=#??D*RGB_/JMQLG+2YH[&A,/>+7Y1,[M9\0-6^1R -M=\<18SVQ_.37F&$E#9OEL-/`!-=-9Y@^,BLSX6C4\8*6:F5]6+LNCM*+4O5+ -M-!1;X2L+,S([83MX-/ORULE>KRMN+@'R;*MM*JM2LK,B%H1B,=K-(D".BJJ" -MA`2D2E"*D%D9"(A&)`60(L)!@?+3\:C_%6+*[-!@2?&)#(^/!$9!A^0_^-_+ -M)^0EM+4\/&_6S!O;;[7!WNN!>*/;%10]_#V'\1AW2D5J,2S/.;^=,.1A"W2E/8#J -MU<+M<9^A7F3E:$+HXG7J9#2=3J0LK^'$6[*5[%\W_37+S4\TGP7=4;)Q2G!4 -M[H:@D;6!MZYW)/:/N.CKS'X^3<0OU/H=FT.E(=!X[36&2D71[KW@7KJ!/U,/ -MH%%!+43UF'D/=5]8QF:7PH%;RM<'V#K5RA:>6RZ&MBF"J/QNAT-7CIJN.@+8 -MP=DP8+AH8QF@,[57.7F?R/@6)BSPX?I/TVCX:0^]:H_.0/Y=4444"?EIA9?# -M!0$>(R(;J?H[?SS5'0VKOH-CZ$=;4H^*? -M"[MQL#Y9)--Y>*2_R6J21P'OI\#!W_AUJ;7-<5<'2A -M'99R]BXQ^PX;JA;M@*[+''S>!!B('((BA"E*-OZ4`/"X>AI(>M@8]3^9B(3[-?IA(ILD?>:: -MBTU0QTOE3ACA<3-X]WG,T5@84>:!41KR]1H:A"[/B65Y]) -MYA?BS'ZZ!*JD_6R!@CRB#]=GZ_64C/QHJE_SIUX,\%&K']I^PPT'V1)?"QHS -M#6\-%HC11X$-"RLRD7S?.M(?;XF)Q?`@J0L[?4H)>P4FM]7.)WW$*03=!N;& -MH.\SF62KS\5R.\L&6GG1U2KT2?6A-EFIS>HXVO@KWIM+?5&1G;MA.3_ -MKK%.P8PT^S^^"U[O&\.`D@WRQS]Y.Y_3UPXZY"JV1HU+Z;XL/K%_K81C&^KM -M\(-\_\W[Y[A->IF?X*G[C>^P;B(`D\?#86,8L_49PPR4+W<.:RTM!Y"0W;^Z -MKJH?`TSS%NUNX[G$G8@9]G%^K5&4?Y*&PJZ>EQ-9.:JIZ).3QYJ1\^6+2BI6 -MR8A1O)[5D`J)QBK":D8BB&;;H497&3G-9!2MVQFLA<:ZRD9Z/#[9/F.NUAI= -M89JD73,B4>S6E>H%***JG9%]R,!&9-J,=6Y'-`N4G,9P;GNT,5EE!H9$\6=! -M@8OHY^,+^4U1NE#\H*D)$_*JJ_)S*OU__5FF)R[;$3;2&CVW.UE97,#'JXX0 -M:D!6!PV9,;SR]F,&1WFK[,5,Q!C*.JEX1\BQ-W%K2XV5%2^+"]UE\5?Q@.1R -M7AMH?+G?LX#[#Z'RTG\Y0?6>!L?/1S:AJVAK[W^Q_W8&8:AU#:1JD;&=U6=C -M]^8.L[WM?U=@^VZVWMVF9?[([7+#0RR&(-.A'PY/B1LUK?C'+O]+\MS;UC$\ -MC"P9J'55NY$"%/R:-]XIA6)N+#[E\H9VKW/6S,YXQ_YC29"^>*,X:5N1)R?H.=D99V8:*BQ -M&1X$BSEJSC08#0^O&/7UFON42L(?^ESRY6[E)<; -MQ`\22F?CL?53^ZCZ@4VF8EL-DG.+=:F[8A1FIMB?=9J:CJ948&DL5H:."K'9 -MA?"TKWG8@*98\D%\HV?6ZT@%=RLFC/,<5;F9+7.G:CU"KM6>7+(+6.+J--FN -M@:'6[%W`7TT'LV>XUX!XXM9>2Z8I\^"&R5MG;H#^S*"E/Y_\S]9\0V3$`?&C -M]A\M-F@P1TWGD<$]:/RZB*G_LP,@_-_8I^QUAL_5;#7[+#_/VPPX1NCM;^O. -M./FQFA`\C#(/L[G<'I1^WV>P.U?--D5VQYJ!.G_:CNPOP9QHQ?Z!O[+S<%@W -MSR_\K>C>BD21,8<73+]&G9[W>>H+OXPP6'5H,!XQ.TEVW68%@LB9N.`*G'/7 -M',''2,O[HH]LOF3>YUE+>,4SG$!C!M@`J3*TP>F,WZU@5HT2UX#`7+OD%%1S -MGM&G3OJP4F[?#(MN]=GU#"V37 -M>@Y^KD/)A\V6ZC/;7N3@5FZY+/UQ]9M$D1>Z!/`HACQH),ZXT.GQE?`%M&)6*Q -MGB[K)O(/[7^B/1+>'\ORT(FI(X15F$)FJ&7ETPM:O`3(F[C7',=(OA4TU7O5 -M3A9E46C7^0UM%K\P+^V>[!MG*II`;MC^28+)M&_[LU[G+C);'%*-/N-?48%\ -MZ@+$,[T^PNE]K"^G#]27F;OHO1,>,#X6=XV5GS7^U.4M)HQ1A1E8N_M-F'?: -M'#`FF.DO`4:@"&U-96>9`BO^NAJ,^UV;"0Z]_#;K;N4@+SXQ!H"CB4&."_K( -MP4_;0.?W@8T_J8<5*#P2?N>N\A:UW$B/%HGX']HQZ^:8@!I'^8_"U:$A^NK?^FH3;_B$@',-)T7HUOJ -MR'OHLBT-NOL?QBZ* -M2\K*O]D?*2NH\EG+J_VO\,8N>SJMIQ7ZQ$L<*#W,E<<,:_]N?CCY`4SU@;]AZN!@#8 -MST"]\>`6B[#B1_&GND-DZEK[G?FIUOHH_,Y,P1#8>@4RKE7^RD*VPF^"(D^7 -MS2C(K#ZN7:X'D-!I@=ZVG/"X`6:K$^!M*,Z<2-9TJW#@'SA)Y\E;:U1HF`H^?J!4]X'N5?YPS@2Z:\&47!)R -M;`O'Q@BOUO"VV@%U]3LW$3PRK5K^\$!2$FO]U6QO#7#+X^\\:DN*R=\^0SF^K]!&)CR* -MJ9:0"%H8S"ES>QI*V.L'8K%<$@!(K^5?,CO_/@KJT1I7T/C/9]!5N98:,>O@&8L,K$% -MT;,6P14,DMM-#&!/YZ$^2SB?):D2?C$J'SS%A/YWLT?U7^'>H'VQA?H7R*.I -M5DD'O6?PB-NU@E&",KSPR)J,8>ZFO-D^*V]0@IA!R#L: -M=/2Q)OU,.<=Q)[3ES\%G\I00Y<'`O14"#2IKA1IPWLK^:2_O>KJ6,ZQPZN;A -M>\8L[8X[M]@>WDR5X-;MG74S_3FY\94&,;)R5S2Y%%1^[M;@6ERKAVJ3-=S8$MJDF!!N79% -MY;)^J\4OQ^_TU:TFFG/?6/UOU&-QE^-^0]K73^@ACQ&4S -M;U5T\D`Y(\(I4^??LG"[V(?O!:,]?=&@]^MI!- -M<5;CW_8;$X"`@!J#?W5P\N<'&N\PA?-FK+S6WWQ/0FOUL_%]RWOF9KC?39=C -M\4[VEL)C#P.9DEP,'?'UNI>.@6S=],^GF954%[U-%P]YE,KRS`Z;6F$DP+'[ -M]:]'DT?%&JG2:9#99+;O_JOMM9TN9WI\"G432$RQ^',Q+3LF`YR_]]J5#*M* -MCYIOXMDEZRX=.+ENC30F-'OI%BZV6G3(S`$F8BAH>AU6XLDD;;SA%V<&XYXJ -MG[CX\V,FM5N@#'J_W?2&D,.5/1&$W47ENY8^\#DU* -MW^7!6WE=H9KI;VRU>&TT,O0'"[>SQ*C[;T?H9+A9'L5@(]857IY"E -ME!+ZZ[L6P<+G%,F'R:]@=X=7I-Q*&1T^W(F';ZNA)A@+FY&A"Z8G:J6)MZER -M>6667-Y[#9#7=,[BE`:],6]^APSV;K17V8XQNT*!1$;0M2:-V1?J'Y5"Z;*1 -MW)Z*G)G%85!"-,/VYG`*22+'*W_Z9B-56GBC,*BU?EJG,5/17G,K%D.$I4NL -M'B]:5_BNA%-1SK&I>E_#KI!G(("'^^WZF2V=X!U%4Y/6%N37P%'AI*RA+CU1 -MSI7%F^O/G'233ENB&KG=[@TVDF$_Z=AE8YXHJSY&*?BE\@=TM"5`M_QQ*S97 -M)>O+:FMPE[SR52T'!:";XB\^1L?5W^2MWG\#E3VL#?O*YLQN=*'W.)V"[FPB -M"";-H\>8()>Y)$)4\!S,67%8P[WM5;]]?,5M>LGKBF,&9PR&%^A#!%%+3/<* -M+X0XX>.UL3=\6`HL7P06+OOIQ+K0'IX4W50$>0PV1-4#]6']SJP@G[V#/CM2 -M_JF/S?Q<#;L3N4#A98H\*TQ0_WN^>::P?R>Z)Y.ZXF$F[@":SV/;2B#M0\1G -M^S.$[LW1Z:`"AU#\?V_Y0@8[!/J4SF'YJ7M^KSVJM;_]T,,;`X?&M*6A(*.Z -M8_>S&2SWAL^:N[X\)#`J&8?8-(]G@R22Q&=Z-AF"-T<7$=MUENMN;%QX[3#Q!1X.;X?\CI_.SUND2BB2MH&VOM;Q!4MA$D&>E%S;?+"<+A4_H&H.6Y@L_6VO]T&AH?HE:3M$_QV.I -M7CD&A&FY09.`6:_CI!I&W9G@MC<_X@_HO\AKSYF\W85]A'&'\36-&)U -MN\.;4'`<"%XOX\C27J^^/-*^& -M1C9ZP>S(S57HHXR.W7Y%X4M;F2B/Z^ONZ.%)SOH_#]2UBT8$Q4P1AML^*(`P -M3?1#"T^C&/'OSK3_9Y1VRM>9XS>S_W]D-9C,^R]TPJ -MJ_U]_:'P\0@_77#*89PU,(.M^75TGODAXWKTL6( -M43O0)-!Q.UJ/8P6($A8#P&KUA,"XQ4Z(R8,EYJ^;'P2;#W?,_#V=O(@:OR;8 -MT(8?OA&>J%#)F1IG>Y&&ZF=-TKVG,6]I+X>R?!?I$?F:&&!XP(*%IMMUSSE> -M6:08]B85"[?]'_KU)->WH'(,"!I[[O.X++S$$Z(CA4.!Z!=?;TP'7?3*N%)_O!V-O2RY9OTYD]H(&8+B4.'[>/;$/(WR9XMG8"<,2B77@ -MNIH6E_BZ)7<#LR!6=&<@3?`Q-#H,?J2#E&.IKU=I6QY0600$A(=#!G+P=M.S -M*.77NX!J="T;<:)U._N6(OY@#APKYP."LPX`'?,F`D,Y[#`+W)B5`7779$!"8F=YFP]@5ZL\L" -M6(S/CAF"$Y=[;W_*Y'F^M!*?T>#L>F8COJ'O]G&0CQ^(T%FYF`^7Z8![7%TT -M%F?9`\7G8FM1<<7\/L!PJ6Y=_!=#2WR`5+#WB.TBI:7NC;,B]^L_)L40_-_; -M?\.A?!`%(00K7[*``7(II^+9$2`4A$BE115143,55%1(@%04P`T(20[K]`R! -ML*"?ZD_K-G7_9HGUNP?!BQ40156;A?)],0$@,6Y]!P)_9*LU-SVO,_^ -M(./;XT4O]EGOL_.;@DN4W2G\KL$=9A0X`E-LEVGHNYD`'W -M&/U;K3J21`0'%AU-C%?^\Y[=(YG2&2.`]4U\L;`D\IKY!S%;Q[@T,XY&*9"E -MN)*XGE5]]^2DAW_!P'%F#>9(,CD>,5NFJNQ7=![`4%KOW,/B?4AJM=Q-OBAZ,-*@!: -MK/QWF-@ZG'XXZX@VJ:1$038,#*I<](GB*(R&3`@(RVDRD=6.4>"9AW$JA3P)W6R?X(2+O=A -M@3`N0PJIXEW+$IWLL*B(.)!2_\>+;<"M9/-K+";R6&"QO5_"<#[`N- -M6CO$)`/:[\A"]R@Y3U1Y\M,C,@:M\D55@1$"R1'C:?,^=M@I -M@-TS`N%,RGR-E:=UU>*HE]AYM47(;-^>*CWOJJ2;XSFQ9\"4 -M((-2.U];6QH%(DR:I,`:;1#S]5?3#876*V=OK*,W8,@46MC<;5N'W(1QE/X@ -MXF)KS13VED"LJV1.&QO.6][>K'!X.;-%FH73.AHJZ-SLL*/Z\"KU1P"]7+Q: -MFS8&'F/^UIE(HM;;&(W^$.SER>O^WU=KD7J/$(2MLL*M+^"O,BGWO.H"]5OL -M5$V);;U8'([XHC07/E5[?*\O198X0RQ0[;KCV.Q6G/`EILZU[067?=S($/AS -M)@@#MT9!?3'LU)"UE_]#(W\-5F@1U0H\B+Z^,EV//:=I+SIHA'LSB,N9@>R_ -M.'&/`MQ+(%*R>>FSZ)2!>QLTET0C(BE:U7AH_M9WYXA&&YCP?$V3O@J?#B"]TM,Z'F'"#WVJ>\H3!4FP^$T,Z8W/H@XL -MR&*U42.(G[5)@[5+CM#Y8?OY+E:1G@TE#\2&>8^47]9#-G -M@,/[KE1+D/6]6[1>'"Y-3W0-'GFC\XR8Y%.?(0GK!K7^8T1#A9F*(2O+F/=2 -MNAWHF`'Z&YLJFQ)!?_?SXR5CSH%,I3X#:FZS9&R^34`P>T:!NLL<=`NE^,L! -M)4G[-FR&'O^#9-?7!NGUM4;+0.TX!=AXV!S$.!V:IK$G/P9+RIKRX$4=4>O. -M!GC:KP?.`]*(%;9&!S*\0WZ=M#1J=K1''-FX/)PAV_^Z-&N&B8X/REJL['>L -MV!`=O!V0&5F=*P'P'^YYA>%E.'[U>M`QN^OSP/Z,"5A<3^/'WD)6J81UNW+Y -ML%O?S\W^G#RP3RU=G`&/2`L27L=<]<`Z6G+AN@.!L.]XC9&J6"5"GS&HKRZ/Z.+2)R.D2FO%E -M[_4V!L3>[B@4HWOQHK)>CRS\354Z/@*IX#;KGAY@6<9RS0<_N2=%%8Q/=IUW -MN'2'8_%0!4;"YD.@<`ZRYP`.M.XBX;=YD@R1^.V!MP=]%S/FNZTR75+SRIG2 -MTQ"HJ7.U&F;3I4?:4(R)2O\`I,''>P%ONF5O=E[,IJI\V5#1RQ%[-DQ=5CSL -M^I%^63(O1ZN[Z4>3OU(3\L1/SMOO0?D,T!2^;$^Z.0#4C3P9TAZQ#&&1Y\-6 -M@3D&JZ4VJ9X5]GF\"=!>[[>>RFS@W'`F@`S?4(O,,W/+E0?`>-%>#%,AGO\L -M@"AUJU>GBVE[0@"WDD -MI[K)\Z2-\G88%LUR@AS8M:@IC6'31(SW)*XGKHT%Y%$D!L5'UZR4LSI2ZK?T -M:(E1CQR`(ZUT1KX`4 -M%WG30=OSMB&:S<33<\`=*DQKV;+H0440NM<99Y4OA8.>:FZ$'0/3C9D7AJ<<^;8N' -MX%KS;XA'QQPVS/[<&%`":VX.0H^..E2!$4SM;]QHK`I:YMJ-=OB'>.Y -MMR-TW*(O+Y,6H1D8=WQ#40F-WS\<'.]TR`L[=X;EZ*!.'9X$'0:!"7^?B16. -MXQ.,".%]>$7X8QX/`@M&(">,`W)XTA%8*GF&AL!/':@X&G)^X?X%4<=W:=?!"TNG?&TR#(PH`9X>!X\3OYH^QDQ^4; -ME9,Z=R=R`ZT@XY0WAPX`X$IIL(^+_'D4TRXT\.\V5N"`'?\,ZROLG!EZ,1_@ -M#]GL+8$\S3SE-%^-!:D7NMO-8<(#A:#PXKL#\BR?8)L`*JTGSTR>\,FI.GQ1 -M^8>$OG%D34U8K_M5/`$OFS0_3Y?)7L+^RLJ!KT5T0$\SQ[_HD'#I/&!5]];I -MC]KZ]:;,)0`"L3%VZ.XB$@1A::%Q:$&2:0EG6))&0K[>:/I -M1Q!UJ%^ZT9[A7J.@-NQ(ZUB=^@04'C931XJU$<$>A6^UL[[_GRI*`KO]_Y0_ -M4XR7I,[*7E]KJK_*%D0VVFV-L;8VBA;>D>AWVCO/EZ:S1<9R@E8?]_1[K.Q6 -M!6`;3?(LN#B;/].ET_D@F/^N,\CD[CDY^2A2YM-![A._OKRDS)+S- -M'I^FGGP0A%G>_'[=5)/73K][:X,'0"5-U8[EZJG/:I.\_/MN'SAZ9AS>00D1 -M(DR*[G9VT+@?*`^,!4Y.`S5>`7->J5=J55(>ZG8]N8-:2@\#KZ&>'K-] -MM[W2QEP>!!-3,XF\?FWDIV\#<;F*6'0QO>0=(" -M0ZSIW'^)X?!0?PQ\C@(*EET/SX-GS_?TD&*8E#XZSHH2(+:XTSTMP_MTT.JR -M.K;6Z"HY1``5#L7/PZ3'8]8?/8_,=/3'@"5]A+.*1CV?V;NIW&] -M*[2``8MS0:)O)__$>-^F-`MX%G]=ZC(%V:#/ED1QV/GPJPYT$<(!4!!N8QSF -MPI<*M:)_A_WIG@0TFU^W$?RVU)MF%LFTRP:K):V:0`4SW83`H-:3[&<^R -MN>!"'O_#OO-OA.063TC[^V3F]#QDUHB`$WT?.TO4T-$T)D%OO/)\L^`2_YHA -MVF0)''_)?TT?S%B"G7*)2"(..*V7^01SSEKZF;Z2\(A7??Y^*@97!K6):OL\4=E6)R:I0Z"CWG/M:UEI#\@D'(W^U^E@Z[AM]['T_4`&ZL^U9 -MN^HSR+W7#B[Q^!G.;?]NYX@'&Y7NUT]/%HP2Y,:H)VBL$YM/D0V26U_CM"SY -M[CQ1-J,!M.]O50`KE\>_,XUPO]+$Y'S)!@ZE$1#!^GQNOY`0Z0U!$;B]-7*0 -M`ZN9?%/RA(?W&?Y*1CAF)Y_0D"2(R_@U,AMFO+*LUE_G.9VRHD1`6+[@!*G8 -M-6LTG*'@!IVC`"`/NXH[?SG0`P8W<$WY;=S&4B>JH^NIQ:(@$=A3RFZSU3TR -MCI:N2XEODORF<="1#0)\1UBZ>&/W/)#[FYJO:4(`$&XZ3MV0':I[3>[R29DV -M3'M0D"W*.)P5,N'T9/?\#=)(@OL@(OUL]KS)HJSFFX/P0#\VGP`I^S>!S=Z# -M7?B\SG^`)H=X5!M.;O-MDIPZ>!#&T&'<5N(=(*_D?TB%@B&15G'?4FQW]2IH`!GN3>E -M=:J8DP3OOYW,MNW>+X^`K(/M*DLRJ#>[MHGQ$T:XA!!=4O2V$4!%><'SFR@0 -MXJP\.]1D07GJ5P$(`PN:;=/(74ROQ-P?W,)->)U`0'T[F$!'J2TH<6[G(2+S7F'ZNN7]C=[P\A221X"AWT -MY_U:0[1,-127"0=`"\UOL/##L^DOE[56D-EP82X\LP0&%UOSS_%U\@1JJN:B -M-G20`"TOC4BK\6N:%A/;ZGVQ;L,K]^JE)GP^YKO8S:>]2`%4SLQ,+)>[Q[K) -M\[M)PI`#:^M,S-W``BW+0QW6SC]E]NI@N!P03AD,U'5]I4;&#EK>S_*RE$0= -M75L*\X:O!2+L8.&WX\`.;4D)_SR2^A4,$\11U&!*4W%=Z8,?IUQKY("`QE0] -M+IF!"2Y;/09[,?&J/D7&NB+RUN'#]XS@92:5DV#1@#AP(+S>H3J:@1_*QM%, -M%EWCS@(ZT)W/8OFT]"(`/_TB5;[P!\/--HQ7O/)HDMN0@M!`@8/I;A1)Q\'0 -M7'A?."->7=[3'X*WA6R`#1>D%GCZ+(M10U]R]7!-'(Y/Q0$3E5?W -MM]H`9L-]33<1;SFQG=]Z>,D`#+=7CD5`.FNJ'(UQT"9<78`6GW0J"^G??IC( -M">4J=3.KJ4"$1A1`*!SSS'O>ZHG/R^+;6/Z^_H1@B8.)Z"#!#7*=J@]9@SWC -MY%9(\R"US[ZPVZ;63M)&NA!RA5B2A$8`'XYU002QX>;>>W)L!X$N>:>`_NBL -M.4B1BO.^!ZVW?W78TJ(\1*7( -MF>D012>Y;[XX+_JN6U!"P$XM[QI:F>/26/3+H^I]$DD78`%+DS@M>7":?Z/E -M0-;L60)=::9DLB)>QE\`L6#?33Z&=VNPW[=5)!$&:1Z!)76;M<-S-G2&S5/F -M14_\U?=_[8QB@?`@\S4$6%]GUL_<8)&65,01J(BSG.O""G_.]_LG;;')GP4% -M:J_E`N^#F*++HMMP>:Y;QRBQ[THB"7^M7/`#TW[E -MAM3?&42,-3EY$@`?2.E%7P$)U-#.:#-!R7F(1Z)(GM%.+DNE$`U0DHMLBP5.TUT;J'.II@!D(2A -M94I0T'JM<%"1/.[R9#^)\NZ5JD=*1PX_C$43SA:VF20O[Y!(""^922+\:=HV -M3J<+QUUQZ02+6XJ9R9S(R@)E@9,]NG7)W=]QXJ&2`!FH<`?50]2P.0C?JND? -MU=&188`PI,4DV_'>48+^[*!(!^_YB51V!T6[,-EEM7A(06,^0%+A(] -MJY[8Q1;JF2>\%ZX200V'8E`5O%6*6T,&KGCX&$]Z>.4_."$M2=OZ8B7>ME.@ -M*1(M%BNT>&B4V5E&4RCGOD@`51$HC-+45]:EED,?4(05K5Q:.>!<#,;)22%% -M^]I\$O^2EJ`!EWV47;\5-X*+)H`51)R&7\H'OKOHB"-D2/[1$7N;%:_(1+NQ -M/L9O*FHY"F"^='1D01[^DC<1F?L?1*8%O@W&](MWWW2D/4VBBLY`$,A[D9`N -MR`/QMQOA6A/R?.I!P_F_(!!AH05%,=4FMRB -MYGC#-'0,C?S`()(@OMJ:H;*4XKNW9@(B*AO"*FN8%(LOD=#YZ90@/WU;_RM_ -M8:%-_K)CHLNW2@4GJXN^QX`YZA(064OA.]*F#6A!:T@%KG4\G(0GPB( -M@S];2D30M_45-;R64'B'OA4[3D&O^:%O2]2MH@$N^2].0*$R,@'F*KO3UJE='8:(1)!?:-,0<'9$0 -MT'G?][N@NQZE;4<")2C206+O@4/JA#@*262!=[[5&K2%5 -MWVN59(CLOH:\KX'IG300X-!0@!E\]F3B_.Z2>)#D(\ARG:($`Z4#43J?!"?K -MFF:_J;SB(2VF=O#G]UD>3W4!"VR/5!#V\+\1@G>XAG3Y*%CY)SM\4B'6:G-G -MRW".WDY9_:+`#!4U>\X:YT*-Q;$)",BVC_HT@.K8^>SE*1+C-'C$UN6=`_(R -M`D(TB&LQB5J!$]7S_M83O,B+M>*ZX!%CKU$$2+9\\\7P?N#F^,"'EO?(O=56 -MW![SJ6W-$*N>(G=%QW->Y5HYLB`F#GZA)("EE1VMZE(TI^9('S(@5_S2(6'A -MS]FN#(]#O/'0HC"`BVO=G`0U6OBFW/Z.@JN;:2&B2`$+>"%- -MX)1A\239!5UT@JH@%TQ_2',7-?]HYW:[8?S\]-<<-B$O2.OP@!5,*1 -M;6,@7-FFK&-/E[=K_R/$96($!LL]D]#BMFYU^JZ#&>X'2SO?9T>\3""^\PP! -M8S$RMV\!03.LX.]DO7B802@"VEIMIX@6@1C/[:GS,TC>JM"!8ZX@&SC7GU8A -MN91JAI=)1`IN_Q.B0#7190>6/G$A>/E]\F"T3G7]CH=)K/#AO2H"8''))S?B -MG<)DBF0[)%KLORUMBC@A+F+-8=_I$+$_G(SMJV54@K7/H\J^"'5?*F_T*=^I -M'.]\,5OR(?3=/VW9#(2]'J9*MJ0B!0^(C^>.R9`3S=U!GWM>Y!T\!L%@@%I< -MG[Z[IGWJH@Q)[_UY8B#)45W18%;6Z#.UT5DQ4)0!,01B!+:Y<8]6@#E;'-%# -M$A64Z5*`,PSD0/JM7OY^&F4&0B#RF0S]>0*2Z.VVJ1J0\>MX;^1!]:S:#@JA -MUVSW">?Q^;-?D%@$`]1&+OQ`27&QKIC=&[,"2%R29X2*(DBX^N3Y#5ISL2?( -M:NQ<_UQ2(MJW.VP9J<[-KT?I@"XE)UHE4L,CZ-)VT(>-W%RBIHP1/7F>,?]@ -MF.,)N^5"9%(+^.I`>+H3"1M5_IK`D5!""W?LH(@@5?Z"^NFT_#D`P(BR&F[U -MB`*_V^:!O-C%A#LK93!02&:``K*"T8+9D;74T^./JD8Z$1_7^7O\T:X=!$MI -M]!IU77]E.-K.I,H0-E41\7787$.@ABM#':CU(K[-S#G#1Z07VHO\D*K^L60& -M_FOO^L$UR2D578:+-D06K*AN<.G1RM;&BOTJ0A$$2N[N]?$R*)J/EC9O.D1: -MK9X'5-1=ZI#JGQXZO+<\B+RR=?O9_PYJSV+[/&00#0XY^5C?'4?!I2W46D=$ -MX(MBV*OIZ?YS[[FX=4+2XKC44PQ@B;*%^_:,J&(;*/"F&$81P"K]^$"*$R'` -MNZ-)GC`RBR>0`9SHKOFX.,`)>2Z3`2H@PE+SH@#5):^HB;1:(`1HD7=0IDO= -M'3*8ZKJNB"B[`B=MOV4MYN^NA&75TU$0C-;[+.XPE$$!S6GC,*NCQC](^[+Q -M[C$*I-+>8B((?VA%."V6X6;$P8O#`N(9G(.*N"]G@I[_/^=>5TKZ7=,99KIW -MDHF,^QKSX)ZE_NR1J!W/XT@.WU44%G5IEWA\NW_4Y[VF!.9?)@` -MH/1?W^?@?/=E"(F=';L*D<O7,&Y2%2N.MM_)SWER%]2H@":=@QZSN-*%"*1OCY;ZJ-A7+-:J`B#( -M9U56UH,+TV=ZU%"'ZM$FJSD:0HI5GOK_QX`@R.%94^3^%)+;#Y9.JU"[?0:W -MX7M`""(O=553(ZNYT)+MG>P;(@0%&8!,!@`EXPO]'">>%47\GMYU:^+(!^%! -M]:[I_CI%/P8U=15T0?HVQIC;6P:X=3+\"CI\!\_&Y4L!!UK,#O0/%Q,SIU4_.H@" -M"B1%>=6T4D!P1)@B('T&8,>[-W6G/$"$*VFS00@=%Q-110A5WC(_OC'@,-E' -MVW'NTSLOD_+;:SMI6]Z-Y#544T4-3*X*C[F%'F:_:,?7>WK8]!)N]-F-M9+C -M'BE^OM:;$VFQV6$&6P80@7RT=JJ^)'>3'/L_>=7U;33 -M$PY[K;)#P-WI_,SKB=(@]L3WOIEVT=OU]_L@6*,%T$U9O(K`T`/``-FFZ?EO -M^W[*/LK-NG$N<:._G+1;K_1ROO=BD$`'9-V@]9]C\)A-$V*!>]:#WS^C\B'[TLBW0&38H``"*E\]\EL%DN5PAHV.P4H;]VD0Q- -M[>U.*60`YV^^;MT,/6C@37+I&L;4`LI.3J>)V*VR:";D4$0ZJ_%P1NCX(KRT[&SOUN"RY*SU.,6G[*)B<"! -M3]#\:?1&\U/?!J9\:D;D0`"2R[FR_:9RF:G0]V4E=9WZ^+XD`-+SW5V4"-GZ -M^26[/5SR(`57$Y-OWTXG:>LW8QLXW-+ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 13 03:42:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32299CAD27B; Fri, 13 Jan 2017 03:42:53 +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 E050F1907; Fri, 13 Jan 2017 03:42:52 +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 v0D3gqB3030750; Fri, 13 Jan 2017 03:42:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D3gqdX030749; Fri, 13 Jan 2017 03:42:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130342.v0D3gqdX030749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 03:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312009 - head/usr.sbin/fstyp/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 03:42:53 -0000 Author: ngie Date: Fri Jan 13 03:42:51 2017 New Revision: 312009 URL: https://svnweb.freebsd.org/changeset/base/312009 Log: Add license preamble for r286964; credit to asomers While here, clean up trailing whitespace MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/fstyp/tests/fstyp_test.sh Modified: head/usr.sbin/fstyp/tests/fstyp_test.sh ============================================================================== --- head/usr.sbin/fstyp/tests/fstyp_test.sh Fri Jan 13 03:33:57 2017 (r312008) +++ head/usr.sbin/fstyp/tests/fstyp_test.sh Fri Jan 13 03:42:51 2017 (r312009) @@ -1,3 +1,29 @@ +#!/bin/sh +# +# Copyright (c) 2015 Alan Somers +# 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 cd9660 @@ -9,7 +35,7 @@ cd9660_body() { atf_check -s exit:0 -o ignore makefs -t cd9660 -Z -s 64m cd9660.img dir atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img atf_check -s exit:0 -o inline:"cd9660\n" fstyp -l cd9660.img -} +} atf_test_case cd9660_label cd9660_label_head() { @@ -21,7 +47,7 @@ cd9660_label_body() { atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img # Note: cd9660 labels are always upper case atf_check -s exit:0 -o inline:"cd9660 FOO\n" fstyp -l cd9660.img -} +} atf_test_case dir dir_head() { @@ -177,7 +203,7 @@ ufs2_label_body() { atf_check -s exit:0 mkdir dir atf_check -s exit:0 -o ignore makefs -o version=2,label="foo" -Z -s 64m ufs.img dir atf_check -s exit:0 -o inline:"ufs foo\n" fstyp -l ufs.img -} +} atf_test_case ufs_on_device cleanup ufs_on_device_head() { From owner-svn-src-all@freebsd.org Fri Jan 13 03:57:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41381CAD503; Fri, 13 Jan 2017 03:57:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E31E1EBC; Fri, 13 Jan 2017 03:57:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id 127so6283928pfg.0; Thu, 12 Jan 2017 19:57:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=EyawoXSejkhKj/5DPm3wZUR/Bcrh2cO67KQsyph2DgY=; b=lBG2vUiJfsFFrjMu2ZZpG6UgOOLuF6IkxH4saDjJ4dGOE1twwJZY2VPs8aUhE0cKZa 4V9dBu+88jr6ZV6SjCPJsFH0/xXHUI718Rlx1yKkWx6e/Bhm2oaMJww72mwTF1P7GyOd lp2Uzs4onysZ5h/ljs5mgg/RXgb7FecNVCpLB8BOw4zMT+6Ln0pdHA0QcrBUAFCCBgJI DXyPOV+uQ3iK5s2AbxmKMSsoQ1CLUtxOIOOkDcLxR7yn4w1yB4RvbdUsU4M/nOdq1fSD dJHE2WIIdEmSMvzUTLOZToWfIsZXwO7Lvg67uRgz3hfMPI2HqGleqrIozLAh9/JsInvQ ssSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=EyawoXSejkhKj/5DPm3wZUR/Bcrh2cO67KQsyph2DgY=; b=jG+1oIulbszl/9l49nvrInLpART91NMoiQSbiD3v9+Xt53uvaRn1nSg6bAY1njHX/7 Af8fUU3UKWaWPhzeI/bY8FMiMfbOsG/M3ffMjPQOrqzdo6r0e4EIUO2Q3nmW2PD1kAS9 Mgrd9Vs5pIrNh64J8hDEnFXjiUXM36lPq25kY5YcvP37YG5zRs3Fy/U+lascm3lETTcU 20iKJ+HAgiA1GPycZnfLXUFAYgmcXVoPLMQ9/BCWnYuoBe5HzGMkhSFDYipdKptQ97xB UH4HyxnVSm0Czu4e0n/yFFMLAoVUTqTHZuLpG0lMBfzzdBEmkxSCPWdzuZaZSFmARn2j R+pA== X-Gm-Message-State: AIkVDXLvg7un37qW/7Cvrsw2v13k7rhrAe6HzfoqDxoVHqf7ZvKFL4sXdQd6Mv7u+zKDZA== X-Received: by 10.84.210.107 with SMTP id z98mr26589943plh.171.1484279856380; Thu, 12 Jan 2017 19:57:36 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id t129sm24980253pgc.32.2017.01.12.19.57.35 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 19:57:35 -0800 (PST) Subject: Re: svn commit: r312003 - head/usr.sbin/fstyp Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_53F30B36-DB56-4B19-9AD9-4A405802F80B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Thu, 12 Jan 2017 19:57:34 -0800 Cc: svn-src-head@freebsd.org, src-committers , svn-src-all@freebsd.org Message-Id: <5DFBA40B-3B06-448A-9AD3-A70D3EC8BB16@gmail.com> References: <201701130212.v0D2Cw0j092852@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 03:57:37 -0000 --Apple-Mail=_53F30B36-DB56-4B19-9AD9-4A405802F80B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 12, 2017, at 18:14, Conrad Meyer wrote: >=20 > Forgot to mention: >=20 > Documentation: = https://www.sans.org/reading-room/whitepapers/forensics/reverse-engineerin= g-microsoft-exfat-file-system-33274 >=20 > Images for testing: http://www.cfreds.nist.gov/dfr-test-images.html > (raw disk images, include partition tables) This commit doesn=E2=80=99t work as advertised: $ fstyp dfr-01-xfat.img fstyp: dfr-01-xfat.img: filesystem not recognized $ grep exfat `which fstyp` Binary file /usr/sbin/fstyp matches -Ngie --Apple-Mail=_53F30B36-DB56-4B19-9AD9-4A405802F80B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYeFAuAAoJEPWDqSZpMIYV2U8P/2B0Ex223y70EZbX4XD/AiA1 1BE+/JAdmfiJp3ZYGTM052LIbvwJ7QhiMzXQ1FaShzwOtbP2gY+Y6hA/bXw1D+Us 4SfD3HEts3cK1iptRZOiYpOU/hXygxbEUFxCyXdhLZ111K9xdsNvN4zcK1F5V/Nq YETV6jU6RkB8j/QnhEOGeLB5KOc+az7iHqKqLP9OZ2RFgbZkC2+5mEpkIaxvTsrl DW9YgPVltpo6hLAfs03URqAcfSDHoI71maRWIFRAkh9JuJrqV0CZ/dyfe9an+1ju SirmFmApHB1sQkDOYreZo+luXJD1cNlgPosb/hqvdrgwNZ3qdnMSAwvXqgMAtiZ8 4O9YbM7D0nZXZvQsEbUlLyO/fZf6eodUvwbyf4qQ1csbaUDIJWhLCWOY2wRBIKb8 o1pEMfBU+eNeuiKdQvIT+DbqMZISqv9YGB3QYRIAEpW9aXNJUFW+ISwhuijwo+KH 5nlwGQuMYOKLxAjNEMjpM1y5TF6BcawSXd2PLVZ7L7xr4MpDwZrziyA593ipyrME JhPMWRTaWcFUi/gCS/BYrdBpMUH+NX4I2Svfse8FTI103sTNG47sD/pVK/UefEOM xIIdqOVRqqhWJEvc9SKHjP5R6D0epOht0QbI4fcIM1OoNIT6p75zyAvVNFyI5Sa5 Mnyveb0jIG9S/vEKgh+A =+wTi -----END PGP SIGNATURE----- --Apple-Mail=_53F30B36-DB56-4B19-9AD9-4A405802F80B-- From owner-svn-src-all@freebsd.org Fri Jan 13 03:58:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60283CAD5A0; Fri, 13 Jan 2017 03:58:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (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 2CBBC105E; Fri, 13 Jan 2017 03:58:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id y143so6307117pfb.1; Thu, 12 Jan 2017 19:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=luHXc5ZrrJyeKxDZfu34BVI0elyDiFTKOT9liu/O+zA=; b=tEIkRW3uNXdjMRK3njr8z5ewhRTG2eLIChpAYGcYM28pjPP8qtx7NMWmHKj2vBypN0 9ZjtqpqecNNI/FFwQ85PzqRqHpLV3oCcrMlAr/QanKE3EHiAtaG0w1ZZDvpbrbsJBWmr kw310cQlqJBGVnkqBtkwW4GYCdPzvrFnmRsSNumd3BYLaAbVfTep6ksSGEGH4cs+aJvc qMZU9LVLG3eE9juN942ZBKhQJZyw/3fs250qE5kZAivifGq+6kvL3unMifBQkN5wQANl X/vS0hZH5vyiw+AnES0qiaibT+Z80wtIjiWZ98xxXVTcH5gP0C1VNDuRBikNupMwrppM u3jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=luHXc5ZrrJyeKxDZfu34BVI0elyDiFTKOT9liu/O+zA=; b=MikiejyFiE+2zeclyUNBh887jwPMSVc4Rd9iAjixSArdrXvE7b0cLlpMt8qm4zYy/w 2tBPLcszUBswvBRLeKmxBY9yC+Ga5YqbLqK9dvebTZYfbKKVB8DZLoJVNSm1HKynS0+S AorZTyLT0Q0GDmea/zyltvtuokzcxHc1WxeVJVJwWUBufM0jPGzmPe2G8Oow3Iuvp/Gk VQy4h2xTMHRdnjn/U42se1kc58zBv6CCCPrp7rOqOpQ4mNInq4ULVB7m2bJw1tNfCRR0 NbK4oun+LsgufZcYuJne75lmT+8h0cvFeXgezw8LRZpeB3ap6jL3wscyiCfgUGEV4VNr 4RgQ== X-Gm-Message-State: AIkVDXKwaBL/SU7DGCQs5LSJ6Za6EqZ36M96JsJxLBk/iDMeQvSbRsJ6TtFkngVZrB5FZQ== X-Received: by 10.84.142.70 with SMTP id 64mr26543117plw.177.1484279903581; Thu, 12 Jan 2017 19:58:23 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id t129sm24980253pgc.32.2017.01.12.19.58.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 19:58:23 -0800 (PST) Subject: Re: svn commit: r312003 - head/usr.sbin/fstyp Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_DEEAEC0F-D73D-4634-9005-ADA91E7ABE26"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <5DFBA40B-3B06-448A-9AD3-A70D3EC8BB16@gmail.com> Date: Thu, 12 Jan 2017 19:58:22 -0800 Cc: svn-src-head@freebsd.org, src-committers , svn-src-all@freebsd.org Message-Id: <6F52AA68-EBD4-4FD1-B2BB-D5831D5B0777@gmail.com> References: <201701130212.v0D2Cw0j092852@repo.freebsd.org> <5DFBA40B-3B06-448A-9AD3-A70D3EC8BB16@gmail.com> To: cem@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 03:58:24 -0000 --Apple-Mail=_DEEAEC0F-D73D-4634-9005-ADA91E7ABE26 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 12, 2017, at 19:57, Ngie Cooper (yaneurabeya) = wrote: >=20 >=20 >> On Jan 12, 2017, at 18:14, Conrad Meyer wrote: >>=20 >> Forgot to mention: >>=20 >> Documentation: = https://www.sans.org/reading-room/whitepapers/forensics/reverse-engineerin= g-microsoft-exfat-file-system-33274 >>=20 >> Images for testing: http://www.cfreds.nist.gov/dfr-test-images.html >> (raw disk images, include partition tables) >=20 > This commit doesn=E2=80=99t work as advertised: >=20 > $ fstyp dfr-01-xfat.img > fstyp: dfr-01-xfat.img: filesystem not recognized > $ grep exfat `which fstyp` > Binary file /usr/sbin/fstyp matches >=20 > -Ngie Also: $ file dfr-01-xfat.img dfr-01-xfat.img: DOS/MBR boot sector $ hexdump -C dfr-01-xfat.img | head -n 2 00000000 eb 76 90 45 58 46 41 54 20 20 20 00 00 00 00 00 |.v.EXFAT = .....| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 = |................| --Apple-Mail=_DEEAEC0F-D73D-4634-9005-ADA91E7ABE26 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYeFBeAAoJEPWDqSZpMIYVERgQAIsNLsk4eY7fUOhnyG1UNPmr Dw3gVpxvm/6W0VEzr+nqpyHC5D9As0PAuBKmiIhaw+ysF3OEG0UKNkBEkgcIzM5P dJJY5xH0W1HqIwWMXi4h+smc801sBggN7jRnLXTXm3cj8bi+R5W2wTVFL9SFzR9a maLObOo3jPDVVYXBIp5rasokcfkBDGN8+0HY63mR84tzK8ujs0NzNvC+LwuXxmu9 iyG/57i4CNnEQa22+Ht03IdmMSpSwd57S9Cl6DfJ0/QrTX6amlNWA+SOQEWeMD6C HLScGnL8KJPYQe7KHLrXor+DKdTLjbPe+sKjITk0n+Q7H719OegDdvQukw3iQb0A xI57giswATtkKPNqDp3iECj56VClHgZJsaP1lI2lYjxSx2q2SP67S/mqXVzd+J75 4aXJOybfDy2Rb7A//GRnDJR36aNvI8CfoPEy31jvmcfSVOzCYBt4X93JP2frroiB rSt4ptbM+f8T1uYNRgv8zj+Ljowpng+f6+A4hFhPZj+CG7O3Mm8BH+/t2pgaVz4q ZLwYBzwV0fE3LTO6CNTEIzBniVxEXBU6TXZKhdjU6Ylg/ArGcAeiEfKjsb8ohgoW KWk7EGmIIi2ymyusvUVjYCxhLpyUNXwkxLn83zo26ncPx4Fa/f+xgKtWTnQ0eBZu 9IHF2EYRmjIS5YX0R6LP =A/0V -----END PGP SIGNATURE----- --Apple-Mail=_DEEAEC0F-D73D-4634-9005-ADA91E7ABE26-- From owner-svn-src-all@freebsd.org Fri Jan 13 04:02:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EC18CAD7E2; Fri, 13 Jan 2017 04:02:10 +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 252C115C3; Fri, 13 Jan 2017 04:02:10 +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 v0D429qn038497; Fri, 13 Jan 2017 04:02:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D429BI038495; Fri, 13 Jan 2017 04:02:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130402.v0D429BI038495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 04:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312010 - head/usr.sbin/fstyp/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 04:02:10 -0000 Author: ngie Date: Fri Jan 13 04:02:09 2017 New Revision: 312010 URL: https://svnweb.freebsd.org/changeset/base/312010 Log: Add testcase for exFAT that currently fails Disk image obtained from: http://www.cfreds.nist.gov/dfr-images/dfr-01-xfat.dd.bz2 -- was ripped off the first GPT partition and verified to be a FAT-like partition with file(1)/hexdump. This testcase currently fails PR: 214908 Sponsored by: Dell EMC Isilon Added: head/usr.sbin/fstyp/tests/dfr-01-xfat.img.bz2 (contents, props changed) Modified: head/usr.sbin/fstyp/tests/Makefile head/usr.sbin/fstyp/tests/fstyp_test.sh Modified: head/usr.sbin/fstyp/tests/Makefile ============================================================================== --- head/usr.sbin/fstyp/tests/Makefile Fri Jan 13 03:42:51 2017 (r312009) +++ head/usr.sbin/fstyp/tests/Makefile Fri Jan 13 04:02:09 2017 (r312010) @@ -4,6 +4,7 @@ PACKAGE= tests ATF_TESTS_SH= fstyp_test +${PACKAGE}FILES+= dfr-01-xfat.img.bz2 ${PACKAGE}FILES+= ext2.img.bz2 ${PACKAGE}FILES+= ext3.img.bz2 ${PACKAGE}FILES+= ext4.img.bz2 Added: head/usr.sbin/fstyp/tests/dfr-01-xfat.img.bz2 ============================================================================== Binary file. No diff available. Modified: head/usr.sbin/fstyp/tests/fstyp_test.sh ============================================================================== --- head/usr.sbin/fstyp/tests/fstyp_test.sh Fri Jan 13 03:42:51 2017 (r312009) +++ head/usr.sbin/fstyp/tests/fstyp_test.sh Fri Jan 13 04:02:09 2017 (r312010) @@ -58,6 +58,15 @@ dir_body() { atf_check -s exit:1 -e match:"not a disk" fstyp dir } +atf_test_case exfat +exfat_head() { + atf_set "descr" "fstyp(8) can detect exFAT filesystems" +} +exfat_body() { + bzcat $(atf_get_srcdir)/dfr-01-xfat.dd.bz2 > exfat.img + atf_check -s exit:0 -o inline:"exfat\n" fstyp exfat.img +} + atf_test_case empty empty_head() { atf_set "descr" "fstyp(8) should fail on an empty file" @@ -242,6 +251,7 @@ atf_init_test_cases() { atf_add_test_case cd9660_label atf_add_test_case dir atf_add_test_case empty + atf_add_test_case exfat atf_add_test_case ext2 atf_add_test_case ext3 atf_add_test_case ext4 From owner-svn-src-all@freebsd.org Fri Jan 13 04:04:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 481B2CAD8F8; Fri, 13 Jan 2017 04:04:49 +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 178FF183E; Fri, 13 Jan 2017 04:04:49 +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 v0D44mOi038636; Fri, 13 Jan 2017 04:04:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D44mjX038635; Fri, 13 Jan 2017 04:04:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130404.v0D44mjX038635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 04:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312011 - head/usr.sbin/fstyp/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 04:04:49 -0000 Author: ngie Date: Fri Jan 13 04:04:48 2017 New Revision: 312011 URL: https://svnweb.freebsd.org/changeset/base/312011 Log: Use dfr-01-xfat.img.bz2, not dfr-01-xfat.dd.bz2 (the latter case was the full disk image from the website, which was never checked in to svn) Regardless, the testcase still fails PR: 214908 Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/fstyp/tests/fstyp_test.sh Modified: head/usr.sbin/fstyp/tests/fstyp_test.sh ============================================================================== --- head/usr.sbin/fstyp/tests/fstyp_test.sh Fri Jan 13 04:02:09 2017 (r312010) +++ head/usr.sbin/fstyp/tests/fstyp_test.sh Fri Jan 13 04:04:48 2017 (r312011) @@ -63,7 +63,7 @@ exfat_head() { atf_set "descr" "fstyp(8) can detect exFAT filesystems" } exfat_body() { - bzcat $(atf_get_srcdir)/dfr-01-xfat.dd.bz2 > exfat.img + bzcat $(atf_get_srcdir)/dfr-01-xfat.img.bz2 > exfat.img atf_check -s exit:0 -o inline:"exfat\n" fstyp exfat.img } From owner-svn-src-all@freebsd.org Fri Jan 13 04:08:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A48D2CAD9DF; Fri, 13 Jan 2017 04:08:33 +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 5AE381A4F; Fri, 13 Jan 2017 04:08:32 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id RtA7cHDVlrvfERtA8c9FPJ; Thu, 12 Jan 2017 21:08:25 -0700 X-Authority-Analysis: v=2.2 cv=UeUhcOaN c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=IgFoBzBjUZAA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=rYTwfTTU08m81dicfpcA:9 a=CjuIK1q_8ugA: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 2D33D250; Thu, 12 Jan 2017 20:08:23 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v0D48MKN097520; Thu, 12 Jan 2017 20:08:22 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201701130408.v0D48MKN097520@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: "Bjoern A. Zeeb" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311950 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message from "Bjoern A. Zeeb" of "Thu, 12 Jan 2017 00:01:02 +0000." <201701120001.v0C012XL041489@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 12 Jan 2017 20:08:22 -0800 X-CMAE-Envelope: MS4wfLj2JEkSZx+OD0se8wmAaBLxej+KooLTWaan7ti+fdJWUxevYKJ8gAAb48TKXB7xrzQlTbdK9eNGx6rg0wksj5L8Sm/H/bDtudcwbG8vq/uCj5J1esmc SBBclOY6xTlHohC2qqTbQBO9wYkinpYLBcB9mv77XtH9YcWVorbE04zg+JfItItU9IZC8EoJWUAW6qN7Lg7U3yG6ElXZdN2HYPqDxL6SEQTbdo+ZSBdq4Tg6 cIC6O5nyLQWb9eyePU4B8ZjobKjpgQsJCIoMYeiG1MuAKQx8epoxivTeEfp0Uz4H X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 04:08:33 -0000 In message <201701120001.v0C012XL041489@repo.freebsd.org>, "Bjoern A. Zeeb" wri tes: > Author: bz > Date: Thu Jan 12 00:01:02 2017 > New Revision: 311950 > URL: https://svnweb.freebsd.org/changeset/base/311950 > > Log: > Get rid of a compiler warning which I saw too often. > Include netinet/in.h before ip_compat.t which will then check if > IPPROTO_IPIP is defined or not. Doing it the other way round, > ip_compat.h would not find it defined and netinet/in.h then > redefine it. > > Modified: > head/sys/contrib/ipfilter/netinet/ip_fil.h > > Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h > ============================================================================= > = > --- head/sys/contrib/ipfilter/netinet/ip_fil.h Wed Jan 11 23:48:17 201 > 7 (r311949) > +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jan 12 00:01:02 201 > 7 (r311950) > @@ -11,6 +11,10 @@ > #ifndef __IP_FIL_H__ > #define __IP_FIL_H__ > > +#if !defined(linux) || !defined(_KERNEL) > +# include > +#endif > + > #include "netinet/ip_compat.h" > #include "netinet/ipf_rb.h" > #if NETBSD_GE_REV(104040000) > @@ -24,10 +28,6 @@ > # endif > #endif > > -#if !defined(linux) || !defined(_KERNEL) > -# include > -#endif > - > #ifndef SOLARIS > # if defined(sun) && (defined(__svr4__) || defined(__SVR4)) > # define SOLARIS 1 > > Thanks Bjoern. Would you mind MFCing this at some point? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Fri Jan 13 04:14:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1881CADCF8; Fri, 13 Jan 2017 04:14:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 6B8701F3D; Fri, 13 Jan 2017 04:14:27 +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 mail107.syd.optusnet.com.au (Postfix) with ESMTPS id C2568D42035; Fri, 13 Jan 2017 14:51:05 +1100 (AEDT) Date: Fri, 13 Jan 2017 14:51:04 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311952 - head/sys/ddb In-Reply-To: <201701120022.v0C0MaHq053076@repo.freebsd.org> Message-ID: <20170113131948.P1465@besplex.bde.org> References: <201701120022.v0C0MaHq053076@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=o77a8znaaZYo2PnXqRUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 04:14:28 -0000 On Thu, 12 Jan 2017, Mark Johnston wrote: > Log: > Enable the use of ^C and ^S/^Q in DDB. > > This lets one interrupt DDB's output, which is useful if paging is > disabled and the output device is slow. This is quite broken. It removes the code that was necessary for avoiding loss of input. > Modified: head/sys/ddb/db_input.c > ============================================================================== > --- head/sys/ddb/db_input.c Thu Jan 12 00:09:31 2017 (r311951) > +++ head/sys/ddb/db_input.c Thu Jan 12 00:22:36 2017 (r311952) > @@ -63,7 +63,6 @@ static int db_lhist_nlines; > #define BLANK ' ' > #define BACKUP '\b' > > -static int cnmaygetc(void); > static void db_delete(int n, int bwd); > static int db_inputchar(int c); > static void db_putnchars(int c, int count); > @@ -291,12 +290,6 @@ db_inputchar(c) > return (0); > } > > -static int > -cnmaygetc() > -{ > - return (-1); > -} > - BSD never had a usable console API (function) for checking for input. cncheckc() is the correct name for such a function. The actual cncheckc() returns any input that it finds. This is not the main problem here. The input will have to be read here anyway to determine what it is. The problems are that there is no console API at all for ungetting characters in the input stream, and this function doesn't even use a stub cnungetc(), but drops the input on the floor. It does document this behaviour in a comment, but doesn't say that it is wrong. > int > db_readline(lstart, lsize) > char * lstart; > @@ -350,7 +343,7 @@ db_check_interrupt(void) > { > int c; > > - c = cnmaygetc(); > + c = cncheckc(); > switch (c) { > case -1: /* no character */ > return; The stub function always returns -1, so db_check_interrupt() is turned into a no-op. db_check_interrupt() now eats the first byte of any input on every call. > @@ -361,7 +354,7 @@ db_check_interrupt(void) > > case CTRL('s'): > do { > - c = cnmaygetc(); > + c = cncheckc(); > if (c == CTRL('c')) > db_error((char *)0); > } while (c != CTRL('q')); This is now a bad implementation of xon/xoff. It doesn't support ixany, but busy-waits for ^Q or ^C using cncheckc(). It should at least busy-wait using cngetc(), since that might be do a smarter busy wait. cngetc() is actually only slightly smarter -- it uses busy-waiting too, but with cpu_spinwait() in the loop. This cpu_spinwait() makes little difference since cncheckc() tends to be a heavyweight function. Only cpu_spinwait()s in the innermost loops of cncheckc(), if any, are likely to have much effect. Multiple consoles complicate this a bit. db_check_interrupt() is called after every db_putc() of a newline. So the breakage is mainly for type-ahead while writing many lines. Control processing belongs in the lowest level of console drivers, and at least the xon/xoff part is very easy to do. This makes it work for contexts like boot messages -- this can only be controlled now by booting with -p, which gives something like an automatic ^S after every line, but the control characters for this mode are unusual and there is no way to get back to -p mode after turning it off or not starting with it. -p mode also crashes if you don't turn it off before the (syscons) keyboard is attached, since attachment temporarily breaks the input needed to control the mode. ddb control should worry about this even more. Multiple consoles complicate this more than a bit. For console driver development/debugging, I needed xon-xoff type control and more (discard) at the driver level, especially when i/o to one of the multiple consoles is unreachable to avoid deadlock, or too active. It was easy to write primitive xon/xoff but not to avoid deadlocks in this. Hackish code looks like this: diff -u2 syscons.c~ syscons.c X --- syscons.c~ 2016-09-01 19:20:38.263745000 +0000 X +++ syscons.c 2016-10-14 07:12:18.947461000 +0000 X ... X +static void X +ec_wait(void) ec_wait() is called to give time to read transient output about certain errors (mainly in near-deadlock conditions). The error message is written directly to the frame buffer and will be overwritten if the deadlock condition clears enough to allow normal output. X +{ X + int c; X + int timeout; X + X + if (ec_kill_ec_wait) X + return; X + c = inb(0xe060); 0xe060 is an otherwise-unused serial port which I can write control characters too. X + if (ec_wait_verbose) X + ec_puts("\r\nec: hit any key to abort wait of 10 seconds..."); X + for (timeout = 0; timeout < ec_wait_delay; timeout++) { X + // if (cncheckc() != -1) X + // break; Early versions used simply cncheckc(). This checks all consoles, so can deadlock too easily, and it doesn't keep the input streams separate enough for easy control of the per-console output streams. X + if (inb(0xe060) != c) X + break; X + if (sc_consptr != NULL) X + DELAY(1000); X + cn_progress++; X + } X + if (ec_wait_verbose) X + ec_puts("done\r\n"); X +} X ... X @@ -1896,5 +2025,8 @@ X sizeof(sc_cnputc_log)) X continue; X + if (inb(0xe060) == 'O' - '@') X + continue; X sc_puts(scp, buf, 1, 1); X + cn_progress++; X } X This uses ^O (default termios VDISCARD) to enter a mode in which all output is dropped (input is sticky in the serial port, so this mode is sticky and is left by typing any other character which should be chosen to be non-control to avoid controlling other operations). Another driver uses ^P instead of ^Q. xon/xoff is normally per-char in termios, but buffering tends to make it per-buffer. In ddb, it is per-line, and this is better than per-char for kernel uses. I have used and implemented a weird ^S mode for scrolling system messages, where ^S works like the "any" character in -p mode -- ^S stops output, and subsequent ^S's restart output and then stop it after 1 more line. This is convenient for scrolling by holding down the ^S key -- much easier than typing ^S/^Q. This was on a 1980's 8-bit system, and is even more needed now -- you cannot type ^S/^Q fast enough to prevent a few thousand lines from scrolling past between the characters, except with slow output devices or pessimized console drivers. Simple xon/xoff at the cnputc() level would work well enough ones the deadlock problems are fixed. It allows the sysadmin to stop all printf()s on the system for arbitrarily long just by typing ^S (^S might also be in line noise). This looks as bad as deadlock to threads trying to do the printf()s, though it is only actual deadlock for certain i/o in console drivers. The cn_progress++ lines in the above are to tell my version of printf() to not time out and blow open its locks when console output is making progress or just stopped. Bruce From owner-svn-src-all@freebsd.org Fri Jan 13 04:21:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6289ECADE2A; Fri, 13 Jan 2017 04:21:10 +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 2E50512AE; Fri, 13 Jan 2017 04:21:10 +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 v0D4L9cq045254; Fri, 13 Jan 2017 04:21:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D4L93f045253; Fri, 13 Jan 2017 04:21:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130421.v0D4L93f045253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 04:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312012 - head/lib/msun/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 04:21:10 -0000 Author: ngie Date: Fri Jan 13 04:21:09 2017 New Revision: 312012 URL: https://svnweb.freebsd.org/changeset/base/312012 Log: fmaxmin_test still fails with clang 3.9.x.. bypass the test MFC after: 3 days PR: 208703 Sponsored by: Dell EMC Isilon Modified: head/lib/msun/tests/Makefile Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Fri Jan 13 04:04:48 2017 (r312011) +++ head/lib/msun/tests/Makefile Fri Jan 13 04:21:09 2017 (r312012) @@ -56,7 +56,7 @@ TAP_TESTS_C+= exponential_test TAP_TESTS_C+= fenv_test TAP_TESTS_C+= fma_test # clang 3.8.0 fails always fails this test. See: bug 208703 -.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} == 30800) +.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30800) TAP_TESTS_C+= fmaxmin_test .endif TAP_TESTS_C+= ilogb2_test From owner-svn-src-all@freebsd.org Fri Jan 13 06:22:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2A52CADCDC; Fri, 13 Jan 2017 06:22:50 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5205A137C; Fri, 13 Jan 2017 06:22:50 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D6MnD4094764; Fri, 13 Jan 2017 06:22:49 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D6Mnnc094763; Fri, 13 Jan 2017 06:22:49 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201701130622.v0D6Mnnc094763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Fri, 13 Jan 2017 06:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312013 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 06:22:50 -0000 Author: hrs Date: Fri Jan 13 06:22:49 2017 New Revision: 312013 URL: https://svnweb.freebsd.org/changeset/base/312013 Log: - Add static for functions and variables with internal linkage. - Quiet down -Wcast-align warnings. - Remove dead code. There is no functionality change. Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Fri Jan 13 04:21:09 2017 (r312012) +++ head/usr.sbin/route6d/route6d.c Fri Jan 13 06:22:49 2017 (r312013) @@ -100,7 +100,7 @@ struct ifc { /* Configuration of an in TAILQ_HEAD(, iff) ifc_iff_head; /* list of filters */ int ifc_joined; /* joined to ff02::9 */ }; -TAILQ_HEAD(, ifc) ifc_head = TAILQ_HEAD_INITIALIZER(ifc_head); +static TAILQ_HEAD(, ifc) ifc_head = TAILQ_HEAD_INITIALIZER(ifc_head); struct ifac { /* Adddress associated to an interface */ TAILQ_ENTRY(ifac) ifac_next; @@ -120,21 +120,21 @@ struct iff { /* Filters for an interfa int iff_plen; }; -struct ifc **index2ifc; -unsigned int nindex2ifc; -struct ifc *loopifcp = NULL; /* pointing to loopback */ +static struct ifc **index2ifc; +static unsigned int nindex2ifc; +static struct ifc *loopifcp = NULL; /* pointing to loopback */ #ifdef HAVE_POLL_H -struct pollfd set[2]; +static struct pollfd set[2]; #else -fd_set *sockvecp; /* vector to select() for receiving */ -fd_set *recvecp; -int fdmasks; -int maxfd; /* maximum fd for select() */ +static fd_set *sockvecp; /* vector to select() for receiving */ +static fd_set *recvecp; +static int fdmasks; +static int maxfd; /* maximum fd for select() */ #endif -int rtsock; /* the routing socket */ -int ripsock; /* socket to send/receive RIP datagram */ +static int rtsock; /* the routing socket */ +static int ripsock; /* socket to send/receive RIP datagram */ -struct rip6 *ripbuf; /* packet buffer for sending */ +static struct rip6 *ripbuf; /* packet buffer for sending */ /* * Maintain the routes in a linked list. When the number of the routes @@ -159,41 +159,43 @@ struct riprt { time_t rrt_t; /* when the route validated */ int rrt_index; /* ifindex from which this route got */ }; -TAILQ_HEAD(, riprt) riprt_head = TAILQ_HEAD_INITIALIZER(riprt_head); +static TAILQ_HEAD(, riprt) riprt_head = TAILQ_HEAD_INITIALIZER(riprt_head); -int dflag = 0; /* debug flag */ -int qflag = 0; /* quiet flag */ -int nflag = 0; /* don't update kernel routing table */ -int aflag = 0; /* age out even the statically defined routes */ -int hflag = 0; /* don't split horizon */ -int lflag = 0; /* exchange site local routes */ -int Pflag = 0; /* don't age out routes with RTF_PROTO[123] */ -int Qflag = RTF_PROTO2; /* set RTF_PROTO[123] flag to routes by RIPng */ -int sflag = 0; /* announce static routes w/ split horizon */ -int Sflag = 0; /* announce static routes to every interface */ -unsigned long routetag = 0; /* route tag attached on originating case */ - -char *filter[MAXFILTER]; -int filtertype[MAXFILTER]; -int nfilter = 0; - -pid_t pid; - -struct sockaddr_storage ripsin; - -int interval = 1; -time_t nextalarm = 0; -time_t sup_trig_update = 0; +static int dflag = 0; /* debug flag */ +static int qflag = 0; /* quiet flag */ +static int nflag = 0; /* don't update kernel routing table */ +static int aflag = 0; /* age out even the statically defined routes */ +static int hflag = 0; /* don't split horizon */ +static int lflag = 0; /* exchange site local routes */ +static int Pflag = 0; /* don't age out routes with RTF_PROTO[123] */ +static int Qflag = RTF_PROTO2; /* set RTF_PROTO[123] flag to routes by RIPng */ +static int sflag = 0; /* announce static routes w/ split horizon */ +static int Sflag = 0; /* announce static routes to every interface */ +static unsigned long routetag = 0; /* route tag attached on originating case */ + +static char *filter[MAXFILTER]; +static int filtertype[MAXFILTER]; +static int nfilter = 0; -FILE *rtlog = NULL; +static pid_t pid; -int logopened = 0; +static struct sockaddr_storage ripsin; + +static int interval = 1; +static time_t nextalarm = 0; +#if 0 +static time_t sup_trig_update = 0; +#endif + +static FILE *rtlog = NULL; + +static int logopened = 0; static int seq = 0; -volatile sig_atomic_t seenalrm; -volatile sig_atomic_t seenquit; -volatile sig_atomic_t seenusr1; +static volatile sig_atomic_t seenalrm; +static volatile sig_atomic_t seenquit; +static volatile sig_atomic_t seenusr1; #define RRTF_AGGREGATE 0x08000000 #define RRTF_NOADVERTISE 0x10000000 @@ -202,66 +204,67 @@ volatile sig_atomic_t seenusr1; #define RRTF_CHANGED 0x80000000 int main(int, char **); -void sighandler(int); -void ripalarm(void); -void riprecv(void); -void ripsend(struct ifc *, struct sockaddr_in6 *, int); -int out_filter(struct riprt *, struct ifc *); -void init(void); -void sockopt(struct ifc *); -void ifconfig(void); -int ifconfig1(const char *, const struct sockaddr *, struct ifc *, int); -void rtrecv(void); -int rt_del(const struct sockaddr_in6 *, const struct sockaddr_in6 *, +static void sighandler(int); +static void ripalarm(void); +static void riprecv(void); +static void ripsend(struct ifc *, struct sockaddr_in6 *, int); +static int out_filter(struct riprt *, struct ifc *); +static void init(void); +static void ifconfig(void); +static int ifconfig1(const char *, const struct sockaddr *, struct ifc *, int); +static void rtrecv(void); +static int rt_del(const struct sockaddr_in6 *, const struct sockaddr_in6 *, const struct sockaddr_in6 *); -int rt_deladdr(struct ifc *, const struct sockaddr_in6 *, +static int rt_deladdr(struct ifc *, const struct sockaddr_in6 *, const struct sockaddr_in6 *); -void filterconfig(void); -int getifmtu(int); -const char *rttypes(struct rt_msghdr *); -const char *rtflags(struct rt_msghdr *); -const char *ifflags(int); -int ifrt(struct ifc *, int); -void ifrt_p2p(struct ifc *, int); -void applymask(struct in6_addr *, struct in6_addr *); -void applyplen(struct in6_addr *, int); -void ifrtdump(int); -void ifdump(int); -void ifdump0(FILE *, const struct ifc *); -void ifremove(int); -void rtdump(int); -void rt_entry(struct rt_msghdr *, int); -void rtdexit(void); -void riprequest(struct ifc *, struct netinfo6 *, int, +static void filterconfig(void); +static int getifmtu(int); +static const char *rttypes(struct rt_msghdr *); +static const char *rtflags(struct rt_msghdr *); +static const char *ifflags(int); +static int ifrt(struct ifc *, int); +static void ifrt_p2p(struct ifc *, int); +static void applyplen(struct in6_addr *, int); +static void ifrtdump(int); +static void ifdump(int); +static void ifdump0(FILE *, const struct ifc *); +static void ifremove(int); +static void rtdump(int); +static void rt_entry(struct rt_msghdr *, int); +static void rtdexit(void); +static void riprequest(struct ifc *, struct netinfo6 *, int, struct sockaddr_in6 *); -void ripflush(struct ifc *, struct sockaddr_in6 *, int, struct netinfo6 *np); -void sendrequest(struct ifc *); -int sin6mask2len(const struct sockaddr_in6 *); -int mask2len(const struct in6_addr *, int); -int sendpacket(struct sockaddr_in6 *, int); -int addroute(struct riprt *, const struct in6_addr *, struct ifc *); -int delroute(struct netinfo6 *, struct in6_addr *); -struct in6_addr *getroute(struct netinfo6 *, struct in6_addr *); -void krtread(int); -int tobeadv(struct riprt *, struct ifc *); -char *allocopy(char *); -char *hms(void); -const char *inet6_n2p(const struct in6_addr *); -struct ifac *ifa_match(const struct ifc *, const struct in6_addr *, int); -struct in6_addr *plen2mask(int); -struct riprt *rtsearch(struct netinfo6 *); -int ripinterval(int); -time_t ripsuptrig(void); -void fatal(const char *, ...) +static void ripflush(struct ifc *, struct sockaddr_in6 *, int, struct netinfo6 *np); +static void sendrequest(struct ifc *); +static int sin6mask2len(const struct sockaddr_in6 *); +static int mask2len(const struct in6_addr *, int); +static int sendpacket(struct sockaddr_in6 *, int); +static int addroute(struct riprt *, const struct in6_addr *, struct ifc *); +static int delroute(struct netinfo6 *, struct in6_addr *); +#if 0 +static struct in6_addr *getroute(struct netinfo6 *, struct in6_addr *); +#endif +static void krtread(int); +static int tobeadv(struct riprt *, struct ifc *); +static char *allocopy(char *); +static char *hms(void); +static const char *inet6_n2p(const struct in6_addr *); +static struct ifac *ifa_match(const struct ifc *, const struct in6_addr *, int); +static struct in6_addr *plen2mask(int); +static struct riprt *rtsearch(struct netinfo6 *); +static int ripinterval(int); +#if 0 +static time_t ripsuptrig(void); +#endif +static void fatal(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); -void trace(int, const char *, ...) +static void trace(int, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -void tracet(int, const char *, ...) +static void tracet(int, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -unsigned int if_maxindex(void); -struct ifc *ifc_find(char *); -struct iff *iff_find(struct ifc *, int); -void setindex2ifc(int, struct ifc *); +static struct ifc *ifc_find(char *); +static struct iff *iff_find(struct ifc *, int); +static void setindex2ifc(int, struct ifc *); #define MALLOC(type) ((type *)malloc(sizeof(type))) @@ -523,7 +526,7 @@ main(int argc, char *argv[]) } } -void +static void sighandler(int signo) { @@ -547,7 +550,7 @@ sighandler(int signo) * gracefully exits after resetting sockopts. */ /* ARGSUSED */ -void +static void rtdexit(void) { struct riprt *rrt; @@ -574,7 +577,7 @@ rtdexit(void) * routes more precisely. */ /* ARGSUSED */ -void +static void ripalarm(void) { struct ifc *ifcp; @@ -602,7 +605,7 @@ ripalarm(void) alarm(ripinterval(SUPPLY_INTERVAL6)); } -void +static void init(void) { int error; @@ -752,7 +755,7 @@ init(void) /* * ripflush flushes the rip datagram stored in the rip buffer */ -void +static void ripflush(struct ifc *ifcp, struct sockaddr_in6 *sin6, int nrt, struct netinfo6 *np) { int i; @@ -807,7 +810,7 @@ ripflush(struct ifc *ifcp, struct sockad /* * Generate RIP6_RESPONSE packets and send them. */ -void +static void ripsend(struct ifc *ifcp, struct sockaddr_in6 *sin6, int flag) { struct riprt *rrt; @@ -948,7 +951,7 @@ ripsend(struct ifc *ifcp, struct sockadd /* * outbound filter logic, per-route/interface. */ -int +static int out_filter(struct riprt *rrt, struct ifc *ifcp) { struct iff *iffp; @@ -1019,7 +1022,7 @@ out_filter(struct riprt *rrt, struct ifc * Determine if the route is to be advertised on the specified interface. * It checks options specified in the arguments and the split horizon rule. */ -int +static int tobeadv(struct riprt *rrt, struct ifc *ifcp) { @@ -1044,14 +1047,14 @@ tobeadv(struct riprt *rrt, struct ifc *i /* * Send a rip packet actually. */ -int +static int sendpacket(struct sockaddr_in6 *sin6, int len) { struct msghdr m; struct cmsghdr *cm; struct iovec iov[2]; - u_char cmsgbuf[256]; struct in6_pktinfo *pi; + u_char cmsgbuf[256]; int idx; struct sockaddr_in6 sincopy; @@ -1077,14 +1080,14 @@ sendpacket(struct sockaddr_in6 *sin6, in m.msg_controllen = 0; } else { memset(cmsgbuf, 0, sizeof(cmsgbuf)); - cm = (struct cmsghdr *)cmsgbuf; + cm = (struct cmsghdr *)(void *)cmsgbuf; m.msg_control = (caddr_t)cm; m.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo)); cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); cm->cmsg_level = IPPROTO_IPV6; cm->cmsg_type = IPV6_PKTINFO; - pi = (struct in6_pktinfo *)CMSG_DATA(cm); + pi = (struct in6_pktinfo *)(void *)CMSG_DATA(cm); memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr)); /*::*/ pi->ipi6_ifindex = idx; } @@ -1101,7 +1104,7 @@ sendpacket(struct sockaddr_in6 *sin6, in * Receive and process RIP packets. Update the routes/kernel forwarding * table if necessary. */ -void +static void riprecv(void) { struct ifc *ifcp, *ic; @@ -1133,7 +1136,7 @@ riprecv(void) iov[0].iov_len = sizeof(buf); m.msg_iov = iov; m.msg_iovlen = 1; - cm = (struct cmsghdr *)cmsgbuf; + cm = (struct cmsghdr *)(void *)cmsgbuf; m.msg_control = (caddr_t)cm; m.msg_controllen = sizeof(cmsgbuf); m.msg_flags = 0; @@ -1154,7 +1157,7 @@ riprecv(void) "invalid cmsg length for IPV6_PKTINFO\n"); return; } - pi = (struct in6_pktinfo *)(CMSG_DATA(cm)); + pi = (struct in6_pktinfo *)(void *)CMSG_DATA(cm); idx = pi->ipi6_ifindex; break; case IPV6_HOPLIMIT: @@ -1163,7 +1166,7 @@ riprecv(void) "invalid cmsg length for IPV6_HOPLIMIT\n"); return; } - hlimp = (int *)CMSG_DATA(cm); + hlimp = (int *)(void *)CMSG_DATA(cm); break; } } @@ -1188,7 +1191,7 @@ riprecv(void) nh = fsock.sin6_addr; nn = (len - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); - rp = (struct rip6 *)buf; + rp = (struct rip6 *)(void *)buf; np = rp->rip6_nets; if (rp->rip6_vers != RIP6_VERSION) { @@ -1449,7 +1452,7 @@ riprecv(void) /* * Send all routes request packet to the specified interface. */ -void +static void sendrequest(struct ifc *ifcp) { struct netinfo6 *np; @@ -1477,7 +1480,7 @@ sendrequest(struct ifc *ifcp) /* * Process a RIP6_REQUEST packet. */ -void +static void riprequest(struct ifc *ifcp, struct netinfo6 *np, int nn, @@ -1508,7 +1511,7 @@ riprequest(struct ifc *ifcp, /* * Get information of each interface. */ -void +static void ifconfig(void) { struct ifaddrs *ifap, *ifa; @@ -1583,7 +1586,7 @@ ifconfig(void) freeifaddrs(ifap); } -int +static int ifconfig1(const char *name, const struct sockaddr *sa, struct ifc *ifcp, @@ -1595,7 +1598,7 @@ ifconfig1(const char *name, int plen; char buf[BUFSIZ]; - sin6 = (const struct sockaddr_in6 *)sa; + sin6 = (const struct sockaddr_in6 *)(const void *)sa; if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && !lflag) return (-1); ifr.ifr_addr = *sin6; @@ -1663,7 +1666,7 @@ ifconfig1(const char *name, return 0; } -void +static void ifremove(int ifindex) { struct ifc *ifcp; @@ -1691,7 +1694,7 @@ ifremove(int ifindex) * Receive and process routing messages. * Update interface information as necesssary. */ -void +static void rtrecv(void) { char buf[BUFSIZ]; @@ -1730,33 +1733,34 @@ rtrecv(void) fprintf(stderr, "\n"); } - for (p = buf; p - buf < len; p += ((struct rt_msghdr *)p)->rtm_msglen) { - if (((struct rt_msghdr *)p)->rtm_version != RTM_VERSION) + for (p = buf; p - buf < len; p += + ((struct rt_msghdr *)(void *)p)->rtm_msglen) { + if (((struct rt_msghdr *)(void *)p)->rtm_version != RTM_VERSION) continue; /* safety against bogus message */ - if (((struct rt_msghdr *)p)->rtm_msglen <= 0) { + if (((struct rt_msghdr *)(void *)p)->rtm_msglen <= 0) { trace(1, "bogus rtmsg: length=%d\n", - ((struct rt_msghdr *)p)->rtm_msglen); + ((struct rt_msghdr *)(void *)p)->rtm_msglen); break; } rtm = NULL; ifam = NULL; ifm = NULL; - switch (((struct rt_msghdr *)p)->rtm_type) { + switch (((struct rt_msghdr *)(void *)p)->rtm_type) { case RTM_NEWADDR: case RTM_DELADDR: - ifam = (struct ifa_msghdr *)p; + ifam = (struct ifa_msghdr *)(void *)p; addrs = ifam->ifam_addrs; q = (char *)(ifam + 1); break; case RTM_IFINFO: - ifm = (struct if_msghdr *)p; + ifm = (struct if_msghdr *)(void *)p; addrs = ifm->ifm_addrs; q = (char *)(ifm + 1); break; case RTM_IFANNOUNCE: - ifan = (struct if_announcemsghdr *)p; + ifan = (struct if_announcemsghdr *)(void *)p; switch (ifan->ifan_what) { case IFAN_ARRIVAL: iface++; @@ -1768,7 +1772,7 @@ rtrecv(void) } break; default: - rtm = (struct rt_msghdr *)p; + rtm = (struct rt_msghdr *)(void *)p; addrs = rtm->rtm_addrs; q = (char *)(rtm + 1); if (rtm->rtm_version != RTM_VERSION) { @@ -1788,16 +1792,16 @@ rtrecv(void) memset(&rta, 0, sizeof(rta)); for (i = 0; i < RTAX_MAX; i++) { if (addrs & (1 << i)) { - rta[i] = (struct sockaddr_in6 *)q; + rta[i] = (struct sockaddr_in6 *)(void *)q; q += ROUNDUP(rta[i]->sin6_len); } } trace(1, "rtsock: %s (addrs=%x)\n", - rttypes((struct rt_msghdr *)p), addrs); + rttypes((struct rt_msghdr *)(void *)p), addrs); if (dflag >= 2) { for (i = 0; - i < ((struct rt_msghdr *)p)->rtm_msglen; + i < ((struct rt_msghdr *)(void *)p)->rtm_msglen; i++) { fprintf(stderr, "%02x ", p[i] & 0xff); if (i % 16 == 15) fprintf(stderr, "\n"); @@ -1811,7 +1815,7 @@ rtrecv(void) * We may be able to optimize by using ifm->ifm_index or * ifam->ifam_index. For simplicity we don't do that here. */ - switch (((struct rt_msghdr *)p)->rtm_type) { + switch (((struct rt_msghdr *)(void *)p)->rtm_type) { case RTM_NEWADDR: case RTM_IFINFO: iface++; @@ -1852,7 +1856,7 @@ rtrecv(void) #endif /* hard ones */ - switch (((struct rt_msghdr *)p)->rtm_type) { + switch (((struct rt_msghdr *)(void *)p)->rtm_type) { case RTM_NEWADDR: case RTM_IFINFO: case RTM_ADD: @@ -1940,7 +1944,7 @@ rtrecv(void) /* * remove specified route from the internal routing table. */ -int +static int rt_del(const struct sockaddr_in6 *sdst, const struct sockaddr_in6 *sgw, const struct sockaddr_in6 *smask) @@ -2038,7 +2042,7 @@ rt_del(const struct sockaddr_in6 *sdst, /* * remove specified address from internal interface/routing table. */ -int +static int rt_deladdr(struct ifc *ifcp, const struct sockaddr_in6 *sifa, const struct sockaddr_in6 *smask) @@ -2139,7 +2143,7 @@ rt_deladdr(struct ifc *ifcp, * Get each interface address and put those interface routes to the route * list. */ -int +static int ifrt(struct ifc *ifcp, int again) { struct ifac *ifac; @@ -2250,7 +2254,7 @@ ifrt(struct ifc *ifcp, int again) * you pick one. it looks that gated behavior fits best with BSDs, * since BSD kernels do not look at prefix length on p2p interfaces. */ -void +static void ifrt_p2p(struct ifc *ifcp, int again) { struct ifac *ifac; @@ -2414,7 +2418,7 @@ ifrt_p2p(struct ifc *ifcp, int again) #undef P2PADVERT_MAX } -int +static int getifmtu(int ifindex) { int mib[6]; @@ -2441,7 +2445,7 @@ getifmtu(int ifindex) fatal("sysctl NET_RT_IFLIST"); /*NOTREACHED*/ } - ifm = (struct if_msghdr *)buf; + ifm = (struct if_msghdr *)(void *)buf; mtu = ifm->ifm_data.ifi_mtu; if (ifindex != ifm->ifm_index) { fatal("ifindex does not match with ifm_index"); @@ -2451,7 +2455,7 @@ getifmtu(int ifindex) return mtu; } -const char * +static const char * rttypes(struct rt_msghdr *rtm) { #define RTTYPE(s, f) \ @@ -2486,7 +2490,7 @@ do { \ return NULL; } -const char * +static const char * rtflags(struct rt_msghdr *rtm) { static char buf[BUFSIZ]; @@ -2546,7 +2550,7 @@ do { \ return buf; } -const char * +static const char * ifflags(int flags) { static char buf[BUFSIZ]; @@ -2582,7 +2586,7 @@ do { \ return buf; } -void +static void krtread(int again) { int mib[6]; @@ -2631,13 +2635,13 @@ krtread(int again) lim = buf + msize; for (p = buf; p < lim; p += rtm->rtm_msglen) { - rtm = (struct rt_msghdr *)p; + rtm = (struct rt_msghdr *)(void *)p; rt_entry(rtm, again); } free(buf); } -void +static void rt_entry(struct rt_msghdr *rtm, int again) { struct sockaddr_in6 *sin6_dst, *sin6_gw, *sin6_mask; @@ -2674,22 +2678,22 @@ rt_entry(struct rt_msghdr *rtm, int agai /* Destination */ if ((rtm->rtm_addrs & RTA_DST) == 0) return; /* ignore routes without destination address */ - sin6_dst = (struct sockaddr_in6 *)rtmp; + sin6_dst = (struct sockaddr_in6 *)(void *)rtmp; rtmp += ROUNDUP(sin6_dst->sin6_len); if (rtm->rtm_addrs & RTA_GATEWAY) { - sin6_gw = (struct sockaddr_in6 *)rtmp; + sin6_gw = (struct sockaddr_in6 *)(void *)rtmp; rtmp += ROUNDUP(sin6_gw->sin6_len); } if (rtm->rtm_addrs & RTA_NETMASK) { - sin6_mask = (struct sockaddr_in6 *)rtmp; + sin6_mask = (struct sockaddr_in6 *)(void *)rtmp; rtmp += ROUNDUP(sin6_mask->sin6_len); } if (rtm->rtm_addrs & RTA_GENMASK) { - sin6_genmask = (struct sockaddr_in6 *)rtmp; + sin6_genmask = (struct sockaddr_in6 *)(void *)rtmp; rtmp += ROUNDUP(sin6_genmask->sin6_len); } if (rtm->rtm_addrs & RTA_IFP) { - sin6_ifp = (struct sockaddr_in6 *)rtmp; + sin6_ifp = (struct sockaddr_in6 *)(void *)rtmp; rtmp += ROUNDUP(sin6_ifp->sin6_len); } @@ -2798,7 +2802,7 @@ rt_entry(struct rt_msghdr *rtm, int agai TAILQ_INSERT_HEAD(&riprt_head, rrt, rrt_next); } -int +static int addroute(struct riprt *rrt, const struct in6_addr *gw, struct ifc *ifcp) @@ -2823,7 +2827,7 @@ addroute(struct riprt *rrt, return 0; memset(buf, 0, sizeof(buf)); - rtm = (struct rt_msghdr *)buf; + rtm = (struct rt_msghdr *)(void *)buf; rtm->rtm_type = RTM_ADD; rtm->rtm_version = RTM_VERSION; rtm->rtm_seq = ++seq; @@ -2833,24 +2837,24 @@ addroute(struct riprt *rrt, rtm->rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK; rtm->rtm_rmx.rmx_hopcount = np->rip6_metric - 1; rtm->rtm_inits = RTV_HOPCOUNT; - sin6 = (struct sockaddr_in6 *)&buf[sizeof(struct rt_msghdr)]; + sin6 = (struct sockaddr_in6 *)(void *)&buf[sizeof(struct rt_msghdr)]; /* Destination */ sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_family = AF_INET6; sin6->sin6_addr = np->rip6_dest; - sin6 = (struct sockaddr_in6 *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); + sin6 = (struct sockaddr_in6 *)(void *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); /* Gateway */ sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_family = AF_INET6; sin6->sin6_addr = *gw; if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) sin6->sin6_scope_id = ifcp->ifc_index; - sin6 = (struct sockaddr_in6 *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); + sin6 = (struct sockaddr_in6 *)(void *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); /* Netmask */ sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_family = AF_INET6; sin6->sin6_addr = *(plen2mask(np->rip6_plen)); - sin6 = (struct sockaddr_in6 *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); + sin6 = (struct sockaddr_in6 *)(void *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); len = (char *)sin6 - (char *)buf; rtm->rtm_msglen = len; @@ -2873,7 +2877,7 @@ addroute(struct riprt *rrt, return -1; } -int +static int delroute(struct netinfo6 *np, struct in6_addr *gw) { u_char buf[BUFSIZ], buf2[BUFSIZ]; @@ -2891,7 +2895,7 @@ delroute(struct netinfo6 *np, struct in6 return 0; memset(buf, 0, sizeof(buf)); - rtm = (struct rt_msghdr *)buf; + rtm = (struct rt_msghdr *)(void *)buf; rtm->rtm_type = RTM_DELETE; rtm->rtm_version = RTM_VERSION; rtm->rtm_seq = ++seq; @@ -2901,22 +2905,22 @@ delroute(struct netinfo6 *np, struct in6 if (np->rip6_plen == sizeof(struct in6_addr) * 8) rtm->rtm_flags |= RTF_HOST; rtm->rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK; - sin6 = (struct sockaddr_in6 *)&buf[sizeof(struct rt_msghdr)]; + sin6 = (struct sockaddr_in6 *)(void *)&buf[sizeof(struct rt_msghdr)]; /* Destination */ sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_family = AF_INET6; sin6->sin6_addr = np->rip6_dest; - sin6 = (struct sockaddr_in6 *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); + sin6 = (struct sockaddr_in6 *)(void *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); /* Gateway */ sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_family = AF_INET6; sin6->sin6_addr = *gw; - sin6 = (struct sockaddr_in6 *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); + sin6 = (struct sockaddr_in6 *)(void *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); /* Netmask */ sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_family = AF_INET6; sin6->sin6_addr = *(plen2mask(np->rip6_plen)); - sin6 = (struct sockaddr_in6 *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); + sin6 = (struct sockaddr_in6 *)(void *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); len = (char *)sin6 - (char *)buf; rtm->rtm_msglen = len; @@ -2939,7 +2943,8 @@ delroute(struct netinfo6 *np, struct in6 return -1; } -struct in6_addr * +#if 0 +static struct in6_addr * getroute(struct netinfo6 *np, struct in6_addr *gw) { u_char buf[BUFSIZ]; @@ -2948,7 +2953,7 @@ getroute(struct netinfo6 *np, struct in6 struct rt_msghdr *rtm; struct sockaddr_in6 *sin6; - rtm = (struct rt_msghdr *)buf; + rtm = (struct rt_msghdr *)(void *)buf; len = sizeof(struct rt_msghdr) + sizeof(struct sockaddr_in6); memset(rtm, 0, len); rtm->rtm_type = RTM_GET; @@ -2957,7 +2962,7 @@ getroute(struct netinfo6 *np, struct in6 rtm->rtm_seq = myseq; rtm->rtm_addrs = RTA_DST; rtm->rtm_msglen = len; - sin6 = (struct sockaddr_in6 *)&buf[sizeof(struct rt_msghdr)]; + sin6 = (struct sockaddr_in6 *)(void *)&buf[sizeof(struct rt_msghdr)]; sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_family = AF_INET6; sin6->sin6_addr = np->rip6_dest; @@ -2972,11 +2977,11 @@ getroute(struct netinfo6 *np, struct in6 perror("read from rtsock"); exit(1); } - rtm = (struct rt_msghdr *)buf; + rtm = (struct rt_msghdr *)(void *)buf; } while (rtm->rtm_seq != myseq || rtm->rtm_pid != pid); - sin6 = (struct sockaddr_in6 *)&buf[sizeof(struct rt_msghdr)]; + sin6 = (struct sockaddr_in6 *)(void *)&buf[sizeof(struct rt_msghdr)]; if (rtm->rtm_addrs & RTA_DST) { - sin6 = (struct sockaddr_in6 *) + sin6 = (struct sockaddr_in6 *)(void *) ((char *)sin6 + ROUNDUP(sin6->sin6_len)); } if (rtm->rtm_addrs & RTA_GATEWAY) { @@ -2985,8 +2990,9 @@ getroute(struct netinfo6 *np, struct in6 } return NULL; } +#endif -const char * +static const char * inet6_n2p(const struct in6_addr *p) { static char buf[BUFSIZ]; @@ -2994,7 +3000,7 @@ inet6_n2p(const struct in6_addr *p) return inet_ntop(AF_INET6, (const void *)p, buf, sizeof(buf)); } -void +static void ifrtdump(int sig) { @@ -3002,7 +3008,7 @@ ifrtdump(int sig) rtdump(sig); } -void +static void ifdump(int sig) { struct ifc *ifcp; @@ -3041,7 +3047,7 @@ ifdump(int sig) fclose(dump); } -void +static void ifdump0(FILE *dump, const struct ifc *ifcp) { struct ifac *ifac; @@ -3097,7 +3103,7 @@ ifdump0(FILE *dump, const struct ifc *if fprintf(dump, "\n"); } -void +static void rtdump(int sig) { struct riprt *rrt; @@ -3146,7 +3152,7 @@ rtdump(int sig) * syntax: -A 5f09:c400::/32,ef0,ef1 (aggregate) * -O 5f09:c400::/32,ef0,ef1 (only when match) */ -void +static void filterconfig(void) { int i; @@ -3277,7 +3283,7 @@ ifonly: * Returns a pointer to ifac whose address and prefix length matches * with the address and prefix length specified in the arguments. */ -struct ifac * +static struct ifac * ifa_match(const struct ifc *ifcp, const struct in6_addr *ia, int plen) @@ -3298,7 +3304,7 @@ ifa_match(const struct ifc *ifcp, * matches with the address and prefix length found in the argument. * Note: This is not a rtalloc(). Therefore exact match is necessary. */ -struct riprt * +static struct riprt * rtsearch(struct netinfo6 *np) { struct riprt *rrt; @@ -3313,7 +3319,7 @@ rtsearch(struct netinfo6 *np) return (rrt); } -int +static int sin6mask2len(const struct sockaddr_in6 *sin6) { @@ -3321,7 +3327,7 @@ sin6mask2len(const struct sockaddr_in6 * sin6->sin6_len - offsetof(struct sockaddr_in6, sin6_addr)); } -int +static int mask2len(const struct in6_addr *addr, int lenlim) { int i = 0, j; @@ -3348,22 +3354,11 @@ mask2len(const struct in6_addr *addr, in return i; } -void -applymask(struct in6_addr *addr, struct in6_addr *mask) -{ - int i; - u_long *p, *q; - - p = (u_long *)addr; q = (u_long *)mask; - for (i = 0; i < 4; i++) - *p++ &= *q++; -} - static const u_char plent[8] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe }; -void +static void applyplen(struct in6_addr *ia, int plen) { u_char *p; @@ -3383,7 +3378,7 @@ static const int pl2m[9] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff }; -struct in6_addr * +static struct in6_addr * plen2mask(int n) { static struct in6_addr ia; @@ -3403,7 +3398,7 @@ plen2mask(int n) return &ia; } -char * +static char * allocopy(char *p) { int len = strlen(p) + 1; @@ -3418,7 +3413,7 @@ allocopy(char *p) return q; } -char * +static char * hms(void) { static char buf[BUFSIZ]; @@ -3437,7 +3432,7 @@ hms(void) #define RIPRANDDEV 1.0 /* 30 +- 15, max - min = 30 */ -int +static int ripinterval(int timer) { double r = rand(); @@ -3447,7 +3442,8 @@ ripinterval(int timer) return interval; } -time_t +#if 0 +static time_t ripsuptrig(void) { time_t t; @@ -3458,8 +3454,9 @@ ripsuptrig(void) sup_trig_update = time(NULL) + t; return t; } +#endif -void +static void #ifdef __STDC__ fatal(const char *fmt, ...) #else @@ -3486,7 +3483,7 @@ fatal(fmt, va_alist) rtdexit(); } -void +static void #ifdef __STDC__ tracet(int level, const char *fmt, ...) #else @@ -3522,7 +3519,7 @@ tracet(level, fmt, va_alist) } } -void +static void *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 13 06:53:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D5B9CAC669; Fri, 13 Jan 2017 06:53:57 +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 365A811B8; Fri, 13 Jan 2017 06:53:57 +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 v0D6ruqu007085; Fri, 13 Jan 2017 06:53:56 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D6ruDn007084; Fri, 13 Jan 2017 06:53:56 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701130653.v0D6ruDn007084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 13 Jan 2017 06:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312014 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 06:53:57 -0000 Author: adrian Date: Fri Jan 13 06:53:56 2017 New Revision: 312014 URL: https://svnweb.freebsd.org/changeset/base/312014 Log: [net80211] initial, somewhat incomplete VHT channel setup code and attach path. This sets up: * vht capabilities in vaps; * calls vht_announce to announce VHT capabilities if any; * sets up vht20, vht40 and vht80 channels, assuming the regulatory code does the right thing with 80MHz available ranges; * adds support to the ieee80211_add_channel_list_5ghz() code to populate VHT channels, as this is the API my ath10k driver is using; * add support for the freq1/freq2 field population and lookup that VHT channels require. The VHT80 code assumes that the regulatory domain already has limited VHT80 bands to, well, 80MHz wide chunks. Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Jan 13 06:22:49 2017 (r312013) +++ head/sys/net80211/ieee80211.c Fri Jan 13 06:53:56 2017 (r312014) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #include @@ -119,6 +120,8 @@ static const struct ieee80211_rateset ie { 12, { B(2), B(4), B(11), B(22), 12, 18, 24, 36, 48, 72, 96, 108 } }; #undef B +static int set_vht_extchan(struct ieee80211_channel *c); + /* * Fill in 802.11 available channel set, mark * all available channels as active, and pick @@ -150,10 +153,23 @@ ieee80211_chan_init(struct ieee80211com */ if (c->ic_ieee == 0) c->ic_ieee = ieee80211_mhz2ieee(c->ic_freq,c->ic_flags); + + /* + * Setup the HT40/VHT40 upper/lower bits. + * The VHT80 math is done elsewhere. + */ if (IEEE80211_IS_CHAN_HT40(c) && c->ic_extieee == 0) c->ic_extieee = ieee80211_mhz2ieee(c->ic_freq + (IEEE80211_IS_CHAN_HT40U(c) ? 20 : -20), c->ic_flags); + + /* Update VHT math */ + /* + * XXX VHT again, note that this assumes VHT80 channels + * are legit already + */ + set_vht_extchan(c); + /* default max tx power to max regulatory */ if (c->ic_maxpower == 0) c->ic_maxpower = 2*c->ic_maxregpower; @@ -343,6 +359,7 @@ ieee80211_ifattach(struct ieee80211com * ieee80211_superg_attach(ic); #endif ieee80211_ht_attach(ic); + ieee80211_vht_attach(ic); ieee80211_scan_attach(ic); ieee80211_regdomain_attach(ic); ieee80211_dfs_attach(ic); @@ -386,6 +403,7 @@ ieee80211_ifdetach(struct ieee80211com * #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_superg_detach(ic); #endif + ieee80211_vht_detach(ic); ieee80211_ht_detach(ic); /* NB: must be called before ieee80211_node_detach */ ieee80211_proto_detach(ic); @@ -515,8 +533,15 @@ ieee80211_vap_setup(struct ieee80211com vap->iv_flags_ext = ic->ic_flags_ext; vap->iv_flags_ven = ic->ic_flags_ven; vap->iv_caps = ic->ic_caps &~ IEEE80211_C_OPMODE; + + /* 11n capabilities - XXX methodize */ vap->iv_htcaps = ic->ic_htcaps; vap->iv_htextcaps = ic->ic_htextcaps; + + /* 11ac capabilities - XXX methodize */ + vap->iv_vhtcaps = ic->ic_vhtcaps; + vap->iv_vhtextcaps = ic->ic_vhtextcaps; + vap->iv_opmode = opmode; vap->iv_caps |= ieee80211_opcap[opmode]; IEEE80211_ADDR_COPY(vap->iv_myaddr, ic->ic_macaddr); @@ -601,6 +626,7 @@ ieee80211_vap_setup(struct ieee80211com ieee80211_superg_vattach(vap); #endif ieee80211_ht_vattach(vap); + ieee80211_vht_vattach(vap); ieee80211_scan_vattach(vap); ieee80211_regdomain_vattach(vap); ieee80211_radiotap_vattach(vap); @@ -737,6 +763,7 @@ ieee80211_vap_detach(struct ieee80211vap #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_superg_vdetach(vap); #endif + ieee80211_vht_vdetach(vap); ieee80211_ht_vdetach(vap); /* NB: must be before ieee80211_node_vdetach */ ieee80211_proto_vdetach(vap); @@ -1081,6 +1108,110 @@ set_extchan(struct ieee80211_channel *c) c->ic_extieee = 0; } +/* + * Populate the freq1/freq2 fields as appropriate for VHT channels. + * + * This for now uses a hard-coded list of 80MHz wide channels. + * + * For HT20/HT40, freq1 just is the centre frequency of the 40MHz + * wide channel we've already decided upon. + * + * For VHT80 and VHT160, there are only a small number of fixed + * 80/160MHz wide channels, so we just use those. + * + * This is all likely very very wrong - both the regulatory code + * and this code needs to ensure that all four channels are + * available and valid before the VHT80 (and eight for VHT160) channel + * is created. + */ + +struct vht_chan_range { + uint16_t freq_start; + uint16_t freq_end; +}; + +struct vht_chan_range vht80_chan_ranges[] = { + { 5170, 5250 }, + { 5250, 5330 }, + { 5490, 5570 }, + { 5570, 5650 }, + { 5650, 5730 }, + { 5735, 5815 }, + { 0, 0, } +}; + +static int +set_vht_extchan(struct ieee80211_channel *c) +{ + int i; + + if (! IEEE80211_IS_CHAN_VHT(c)) { + return (0); + } + + if (IEEE80211_IS_CHAN_VHT20(c)) { + c->ic_vht_ch_freq1 = c->ic_ieee; + return (1); + } + + if (IEEE80211_IS_CHAN_VHT40(c)) { + if (IEEE80211_IS_CHAN_HT40U(c)) + c->ic_vht_ch_freq1 = c->ic_ieee + 2; + else if (IEEE80211_IS_CHAN_HT40D(c)) + c->ic_vht_ch_freq1 = c->ic_ieee - 2; + else + return (0); + return (1); + } + + if (IEEE80211_IS_CHAN_VHT80(c)) { + for (i = 0; vht80_chan_ranges[i].freq_start != 0; i++) { + if (c->ic_freq >= vht80_chan_ranges[i].freq_start && + c->ic_freq < vht80_chan_ranges[i].freq_end) { + int midpoint; + + midpoint = vht80_chan_ranges[i].freq_start + 40; + c->ic_vht_ch_freq1 = + ieee80211_mhz2ieee(midpoint, c->ic_flags); + c->ic_vht_ch_freq2 = 0; +#if 0 + printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n", + __func__, c->ic_ieee, c->ic_freq, midpoint, + c->ic_vht_ch_freq1, c->ic_vht_ch_freq2); +#endif + return (1); + } + } + return (0); + } + + printf("%s: unknown VHT channel type (ieee=%d, flags=0x%08x)\n", + __func__, + c->ic_ieee, + c->ic_flags); + + return (0); +} + +/* + * Return whether the current channel could possibly be a part of + * a VHT80 channel. + * + * This doesn't check that the whole range is in the allowed list + * according to regulatory. + */ +static int +is_vht80_valid_freq(uint16_t freq) +{ + int i; + for (i = 0; vht80_chan_ranges[i].freq_start != 0; i++) { + if (freq >= vht80_chan_ranges[i].freq_start && + freq < vht80_chan_ranges[i].freq_end) + return (1); + } + return (0); +} + static int addchan(struct ieee80211_channel chans[], int maxchans, int *nchans, uint8_t ieee, uint16_t freq, int8_t maxregpower, uint32_t flags) @@ -1090,13 +1221,25 @@ addchan(struct ieee80211_channel chans[] if (*nchans >= maxchans) return (ENOBUFS); +#if 0 + printf("%s: %d: ieee=%d, freq=%d, flags=0x%08x\n", + __func__, + *nchans, + ieee, + freq, + flags); +#endif + c = &chans[(*nchans)++]; c->ic_ieee = ieee; c->ic_freq = freq != 0 ? freq : ieee80211_ieee2mhz(ieee, flags); c->ic_maxregpower = maxregpower; c->ic_maxpower = 2 * maxregpower; c->ic_flags = flags; + c->ic_vht_ch_freq1 = 0; + c->ic_vht_ch_freq2 = 0; set_extchan(c); + set_vht_extchan(c); return (0); } @@ -1112,14 +1255,27 @@ copychan_prev(struct ieee80211_channel c if (*nchans >= maxchans) return (ENOBUFS); +#if 0 + printf("%s: %d: flags=0x%08x\n", + __func__, + *nchans, + flags); +#endif + c = &chans[(*nchans)++]; c[0] = c[-1]; c->ic_flags = flags; + c->ic_vht_ch_freq1 = 0; + c->ic_vht_ch_freq2 = 0; set_extchan(c); + set_vht_extchan(c); return (0); } +/* + * XXX VHT-2GHz + */ static void getflags_2ghz(const uint8_t bands[], uint32_t flags[], int ht40) { @@ -1140,35 +1296,73 @@ getflags_2ghz(const uint8_t bands[], uin } static void -getflags_5ghz(const uint8_t bands[], uint32_t flags[], int ht40) +getflags_5ghz(const uint8_t bands[], uint32_t flags[], int ht40, int vht80) { int nmodes; + /* + * the addchan_list function seems to expect the flags array to + * be in channel width order, so the VHT bits are interspersed + * as appropriate to maintain said order. + * + * It also assumes HT40U is before HT40D. + */ nmodes = 0; + + /* 20MHz */ if (isset(bands, IEEE80211_MODE_11A)) flags[nmodes++] = IEEE80211_CHAN_A; if (isset(bands, IEEE80211_MODE_11NA)) flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT20; + if (isset(bands, IEEE80211_MODE_VHT_5GHZ)) { + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT20 | + IEEE80211_CHAN_VHT20; + + /* 40MHz */ if (ht40) { flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U; + } + if (ht40 && isset(bands, IEEE80211_MODE_VHT_5GHZ)) { + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U + | IEEE80211_CHAN_VHT40U; + } + if (ht40) { flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D; } + if (ht40 && isset(bands, IEEE80211_MODE_VHT_5GHZ)) { + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D + | IEEE80211_CHAN_VHT40D; + } + + /* 80MHz */ + if (vht80 && isset(bands, IEEE80211_MODE_VHT_5GHZ)) { + flags[nmodes++] = IEEE80211_CHAN_A | + IEEE80211_CHAN_HT40U | IEEE80211_CHAN_VHT80; + flags[nmodes++] = IEEE80211_CHAN_A | + IEEE80211_CHAN_HT40D | IEEE80211_CHAN_VHT80; + } + } + + /* XXX VHT80+80 */ + /* XXX VHT160 */ flags[nmodes] = 0; } static void -getflags(const uint8_t bands[], uint32_t flags[], int ht40) +getflags(const uint8_t bands[], uint32_t flags[], int ht40, int vht80) { flags[0] = 0; if (isset(bands, IEEE80211_MODE_11A) || - isset(bands, IEEE80211_MODE_11NA)) { + isset(bands, IEEE80211_MODE_11NA) || + isset(bands, IEEE80211_MODE_VHT_5GHZ)) { if (isset(bands, IEEE80211_MODE_11B) || isset(bands, IEEE80211_MODE_11G) || - isset(bands, IEEE80211_MODE_11NG)) + isset(bands, IEEE80211_MODE_11NG) || + isset(bands, IEEE80211_MODE_VHT_2GHZ)) return; - getflags_5ghz(bands, flags, ht40); + getflags_5ghz(bands, flags, ht40, vht80); } else getflags_2ghz(bands, flags, ht40); } @@ -1176,6 +1370,7 @@ getflags(const uint8_t bands[], uint32_t /* * Add one 20 MHz channel into specified channel list. */ +/* XXX VHT */ int ieee80211_add_channel(struct ieee80211_channel chans[], int maxchans, int *nchans, uint8_t ieee, uint16_t freq, int8_t maxregpower, @@ -1184,7 +1379,7 @@ ieee80211_add_channel(struct ieee80211_c uint32_t flags[IEEE80211_MODE_MAX]; int i, error; - getflags(bands, flags, 0); + getflags(bands, flags, 0, 0); KASSERT(flags[0] != 0, ("%s: no correct mode provided\n", __func__)); error = addchan(chans, maxchans, nchans, ieee, freq, maxregpower, @@ -1218,6 +1413,7 @@ findchannel(struct ieee80211_channel cha /* * Add 40 MHz channel pair into specified channel list. */ +/* XXX VHT */ int ieee80211_add_channel_ht40(struct ieee80211_channel chans[], int maxchans, int *nchans, uint8_t ieee, int8_t maxregpower, uint32_t flags) @@ -1275,11 +1471,17 @@ ieee80211_get_channel_center_freq(const * For 80+80MHz channels this will be the centre of the primary * 80MHz channel; the secondary 80MHz channel will be center_freq2(). */ - uint32_t ieee80211_get_channel_center_freq1(const struct ieee80211_channel *c) { + /* + * VHT - use the pre-calculated centre frequency + * of the given channel. + */ + if (IEEE80211_IS_CHAN_VHT(c)) + return (ieee80211_ieee2mhz(c->ic_vht_ch_freq1, c->ic_flags)); + if (IEEE80211_IS_CHAN_HT40U(c)) { return (c->ic_freq + 10); } @@ -1291,12 +1493,15 @@ ieee80211_get_channel_center_freq1(const } /* - * For now, no 80+80 support; this is zero. + * For now, no 80+80 support; it will likely always return 0. */ uint32_t ieee80211_get_channel_center_freq2(const struct ieee80211_channel *c) { + if (IEEE80211_IS_CHAN_VHT(c) && (c->ic_vht_ch_freq2 != 0)) + return (ieee80211_ieee2mhz(c->ic_vht_ch_freq2, c->ic_flags)); + return (0); } @@ -1310,16 +1515,70 @@ add_chanlist(struct ieee80211_channel ch { uint16_t freq; int i, j, error; + int is_vht; for (i = 0; i < nieee; i++) { freq = ieee80211_ieee2mhz(ieee[i], flags[0]); for (j = 0; flags[j] != 0; j++) { + /* + * Notes: + * + HT40 and VHT40 channels occur together, so + * we need to be careful that we actually allow that. + * + VHT80, VHT160 will coexist with HT40/VHT40, so + * make sure it's not skipped because of the overlap + * check used for (V)HT40. + */ + is_vht = !! (flags[j] & IEEE80211_CHAN_VHT); + + /* + * Test for VHT80. + * XXX This is all very broken right now. + * What we /should/ do is: + * + * + check that the frequency is in the list of + * allowed VHT80 ranges; and + * + the other 3 channels in the list are actually + * also available. + */ + if (is_vht && flags[j] & IEEE80211_CHAN_VHT80) + if (! is_vht80_valid_freq(freq)) + continue; + + /* + * Test for (V)HT40. + * + * This is also a fall through from VHT80; as we only + * allow a VHT80 channel if the VHT40 combination is + * also valid. If the VHT40 form is not valid then + * we certainly can't do VHT80.. + */ if (flags[j] & IEEE80211_CHAN_HT40D) + /* + * Can't have a "lower" channel if we are the + * first channel. + * + * Can't have a "lower" channel if it's below/ + * within 20MHz of the first channel. + * + * Can't have a "lower" channel if the channel + * below it is not 20MHz away. + */ if (i == 0 || ieee[i] < ieee[0] + 4 || freq - 20 != ieee80211_ieee2mhz(ieee[i] - 4, flags[j])) continue; if (flags[j] & IEEE80211_CHAN_HT40U) + /* + * Can't have an "upper" channel if we are + * the last channel. + * + * Can't have an "upper" channel be above the + * last channel in the list. + * + * Can't have an "upper" channel if the next + * channel according to the math isn't 20MHz + * away. (Likely for channel 13/14.) + */ if (i == nieee - 1 || ieee[i] + 4 > ieee[nieee - 1] || freq + 20 != @@ -1348,6 +1607,7 @@ ieee80211_add_channel_list_2ghz(struct i { uint32_t flags[IEEE80211_MODE_MAX]; + /* XXX no VHT for now */ getflags_2ghz(bands, flags, ht40); KASSERT(flags[0] != 0, ("%s: no correct mode provided\n", __func__)); @@ -1360,8 +1620,15 @@ ieee80211_add_channel_list_5ghz(struct i int ht40) { uint32_t flags[IEEE80211_MODE_MAX]; + int vht80 = 0; + + /* + * For now, assume VHT == VHT80 support as a minimum. + */ + if (isset(bands, IEEE80211_MODE_VHT_5GHZ)) + vht80 = 1; - getflags_5ghz(bands, flags, ht40); + getflags_5ghz(bands, flags, ht40, vht80); KASSERT(flags[0] != 0, ("%s: no correct mode provided\n", __func__)); return (add_chanlist(chans, maxchans, nchans, ieee, nieee, flags)); @@ -1662,6 +1929,7 @@ ieee80211_announce(struct ieee80211com * printf("\n"); } ieee80211_ht_announce(ic); + ieee80211_vht_announce(ic); } void From owner-svn-src-all@freebsd.org Fri Jan 13 07:02:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A332CAC9CE; Fri, 13 Jan 2017 07:02:06 +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 4643D18F4; Fri, 13 Jan 2017 07:02:06 +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 v0D7257u009018; Fri, 13 Jan 2017 07:02:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D724S1009010; Fri, 13 Jan 2017 07:02:04 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701130702.v0D724S1009010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 13 Jan 2017 07:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312015 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 07:02:06 -0000 Author: adrian Date: Fri Jan 13 07:02:04 2017 New Revision: 312015 URL: https://svnweb.freebsd.org/changeset/base/312015 Log: [net80211] Initial VHT node upgrade/downgrade support and initial IE parsing. This is the bulk of the magic to start enabling VHT channel negotiation. It is absolutely, positively not yet even a complete VHT wave-1 implementation. * parse IEs in scan, assoc req/resp, probe req/resp; * break apart the channel upgrade from the HT IE parsing - do it after the VHT IEs are parsed; * (dirty! sigh) add channel width decision making in ieee80211_ht.c htinfo_update_chw(). This is the main bit where negotiated channel promotion through IEs occur. * Shoehorn in VHT node init ,teardown, rate control, etc calls like the HT versions; * Do VHT channel adjustment where appropriate Tested: * monitor mode, ath10k port * STA mode, ath10k port - VHT20, VHT40, VHT80 modes TODO: * IBSS; * hostap; * (ignore mesh, wds for now); * finish 11n state engine - channel width change, opmode notifications, SMPS, etc; * VHT basic rate negotiation and acceptance criteria when scanning, associating, etc; * VHT control/management frame handling (group managment and operating mode being the two big ones); * Verify TX/RX VHT rate negotiation is actually working correctly. Whilst here, add some comments about seqno allocation and locking. To achieve the full VHT rates I need to push seqno allocation into the drivers and finally remove the IEEE80211_TX_LOCK() I added years ago to fix issues. :/ Modified: head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ht.h head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Fri Jan 13 06:53:56 2017 (r312014) +++ head/sys/net80211/ieee80211_adhoc.c Fri Jan 13 07:02:04 2017 (r312015) @@ -822,10 +822,14 @@ adhoc_recv_mgmt(struct ieee80211_node *n #if 0 if (scan.htcap != NULL && scan.htinfo != NULL && (vap->iv_flags_ht & IEEE80211_FHT_HT)) { - if (ieee80211_ht_updateparams(ni, + ieee80211_ht_updateparams(ni, + scan.htcap, scan.htinfo)); + if (ieee80211_ht_updateparams_final(ni, scan.htcap, scan.htinfo)) ht_state_change = 1; } + + /* XXX same for VHT? */ #endif if (ni != NULL) { IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Fri Jan 13 06:53:56 2017 (r312014) +++ head/sys/net80211/ieee80211_hostap.c Fri Jan 13 07:02:04 2017 (r312015) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) @@ -1745,6 +1746,7 @@ hostap_recv_mgmt(struct ieee80211_node * struct ieee80211_frame *wh; uint8_t *frm, *efrm, *sfrm; uint8_t *ssid, *rates, *xrates, *wpa, *rsn, *wme, *ath, *htcap; + uint8_t *vhtcap, *vhtinfo; int reassoc, resp; uint8_t rate; @@ -2042,6 +2044,7 @@ hostap_recv_mgmt(struct ieee80211_node * if (reassoc) frm += 6; /* ignore current AP info */ ssid = rates = xrates = wpa = rsn = wme = ath = htcap = NULL; + vhtcap = vhtinfo = NULL; sfrm = frm; while (efrm - frm > 1) { IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); @@ -2061,6 +2064,12 @@ hostap_recv_mgmt(struct ieee80211_node * case IEEE80211_ELEMID_HTCAP: htcap = frm; break; + case IEEE80211_ELEMID_VHT_CAP: + vhtcap = frm; + break; + case IEEE80211_ELEMID_VHT_OPMODE: + vhtinfo = frm; + break; case IEEE80211_ELEMID_VENDOR: if (iswpaoui(frm)) wpa = frm; @@ -2135,10 +2144,22 @@ hostap_recv_mgmt(struct ieee80211_node * vap->iv_stats.is_rx_assoc_norate++; return; } + /* * Do HT rate set handling and setup HT node state. */ ni->ni_chan = vap->iv_bss->ni_chan; + + /* VHT */ + if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) { + /* XXX TODO; see below */ + printf("%s: VHT TODO!\n", __func__); + ieee80211_vht_node_init(ni); + ieee80211_vht_update_cap(ni, vhtcap, vhtinfo); + } else if (ni->ni_flags & IEEE80211_NODE_VHT) + ieee80211_vht_node_cleanup(ni); + + /* HT */ if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && htcap != NULL) { rate = ieee80211_setup_htrates(ni, htcap, IEEE80211_F_DOFMCS | IEEE80211_F_DONEGO | @@ -2153,6 +2174,12 @@ hostap_recv_mgmt(struct ieee80211_node * ieee80211_ht_updatehtcap(ni, htcap); } else if (ni->ni_flags & IEEE80211_NODE_HT) ieee80211_ht_node_cleanup(ni); + + /* Finally - this will use HT/VHT info to change node channel */ + if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && htcap != NULL) { + ieee80211_ht_updatehtcap_final(ni); + } + #ifdef IEEE80211_SUPPORT_SUPERG /* Always do ff node cleanup; for A-MSDU */ ieee80211_ff_node_cleanup(ni); Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Fri Jan 13 06:53:56 2017 (r312014) +++ head/sys/net80211/ieee80211_ht.c Fri Jan 13 07:02:04 2017 (r312015) @@ -1490,52 +1490,117 @@ ieee80211_parse_htinfo(struct ieee80211_ } /* - * Handle 11n channel switch. Use the received HT ie's to - * identify the right channel to use. If we cannot locate it - * in the channel table then fallback to legacy operation. + * Handle 11n/11ac channel switch. + * + * Use the received HT/VHT ie's to identify the right channel to use. + * If we cannot locate it in the channel table then fallback to + * legacy operation. + * * Note that we use this information to identify the node's * channel only; the caller is responsible for insuring any * required channel change is done (e.g. in sta mode when * parsing the contents of a beacon frame). */ static int -htinfo_update_chw(struct ieee80211_node *ni, int htflags) +htinfo_update_chw(struct ieee80211_node *ni, int htflags, int vhtflags) { struct ieee80211com *ic = ni->ni_ic; struct ieee80211_channel *c; int chanflags; int ret = 0; - chanflags = (ni->ni_chan->ic_flags &~ IEEE80211_CHAN_HT) | htflags; - if (chanflags != ni->ni_chan->ic_flags) { - /* XXX not right for ht40- */ - c = ieee80211_find_channel(ic, ni->ni_chan->ic_freq, chanflags); - if (c == NULL && (htflags & IEEE80211_CHAN_HT40)) { - /* - * No HT40 channel entry in our table; fall back - * to HT20 operation. This should not happen. - */ - c = findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT20); + /* + * First step - do HT/VHT only channel lookup based on operating mode + * flags. This involves masking out the VHT flags as well. + * Otherwise we end up doing the full channel walk each time + * we trigger this, which is expensive. + */ + chanflags = (ni->ni_chan->ic_flags &~ + (IEEE80211_CHAN_HT | IEEE80211_CHAN_VHT)) | htflags | vhtflags; + + if (chanflags == ni->ni_chan->ic_flags) + goto done; + + /* + * If HT /or/ VHT flags have changed then check both. + * We need to start by picking a HT channel anyway. + */ + + c = NULL; + chanflags = (ni->ni_chan->ic_flags &~ + (IEEE80211_CHAN_HT | IEEE80211_CHAN_VHT)) | htflags; + /* XXX not right for ht40- */ + c = ieee80211_find_channel(ic, ni->ni_chan->ic_freq, chanflags); + if (c == NULL && (htflags & IEEE80211_CHAN_HT40)) { + /* + * No HT40 channel entry in our table; fall back + * to HT20 operation. This should not happen. + */ + c = findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT20); #if 0 - IEEE80211_NOTE(ni->ni_vap, - IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, ni, - "no HT40 channel (freq %u), falling back to HT20", - ni->ni_chan->ic_freq); + IEEE80211_NOTE(ni->ni_vap, + IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, ni, + "no HT40 channel (freq %u), falling back to HT20", + ni->ni_chan->ic_freq); #endif - /* XXX stat */ - } - if (c != NULL && c != ni->ni_chan) { - IEEE80211_NOTE(ni->ni_vap, - IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, ni, - "switch station to HT%d channel %u/0x%x", - IEEE80211_IS_CHAN_HT40(c) ? 40 : 20, - c->ic_freq, c->ic_flags); - ni->ni_chan = c; - ret = 1; - } - /* NB: caller responsible for forcing any channel change */ + /* XXX stat */ } - /* update node's tx channel width */ + + /* Nothing found - leave it alone; move onto VHT */ + if (c == NULL) + c = ni->ni_chan; + + /* + * If it's non-HT, then bail out now. + */ + if (! IEEE80211_IS_CHAN_HT(c)) { + IEEE80211_NOTE(ni->ni_vap, + IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, ni, + "not HT; skipping VHT check (%u/0x%x)", + c->ic_freq, c->ic_flags); + goto done; + } + + /* + * Next step - look at the current VHT flags and determine + * if we need to upgrade. Mask out the VHT and HT flags since + * the vhtflags field will already have the correct HT + * flags to use. + */ + if (IEEE80211_CONF_VHT(ic) && ni->ni_vhtcap != 0 && vhtflags != 0) { + chanflags = (c->ic_flags + &~ (IEEE80211_CHAN_HT | IEEE80211_CHAN_VHT)) + | vhtflags; + IEEE80211_NOTE(ni->ni_vap, + IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, + ni, + "%s: VHT; chanwidth=0x%02x; vhtflags=0x%08x", + __func__, ni->ni_vht_chanwidth, vhtflags); + + IEEE80211_NOTE(ni->ni_vap, + IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, + ni, + "%s: VHT; trying lookup for %d/0x%08x", + __func__, c->ic_freq, chanflags); + c = ieee80211_find_channel(ic, c->ic_freq, chanflags); + } + + /* Finally, if it's changed */ + if (c != NULL && c != ni->ni_chan) { + IEEE80211_NOTE(ni->ni_vap, + IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, ni, + "switch station to %s%d channel %u/0x%x", + IEEE80211_IS_CHAN_VHT(c) ? "VHT" : "HT", + IEEE80211_IS_CHAN_VHT80(c) ? 80 : + (IEEE80211_IS_CHAN_HT40(c) ? 40 : 20), + c->ic_freq, c->ic_flags); + ni->ni_chan = c; + ret = 1; + } + /* NB: caller responsible for forcing any channel change */ + +done: + /* update node's (11n) tx channel width */ ni->ni_chw = IEEE80211_IS_CHAN_HT40(ni->ni_chan)? 40 : 20; return (ret); } @@ -1587,15 +1652,18 @@ htcap_update_shortgi(struct ieee80211_no /* * Parse and update HT-related state extracted from * the HT cap and info ie's. + * + * This is called from the STA management path and + * the ieee80211_node_join() path. It will take into + * account the IEs discovered during scanning and + * adjust things accordingly. */ -int +void ieee80211_ht_updateparams(struct ieee80211_node *ni, const uint8_t *htcapie, const uint8_t *htinfoie) { struct ieee80211vap *vap = ni->ni_vap; const struct ieee80211_ie_htinfo *htinfo; - int htflags; - int ret = 0; ieee80211_parse_htcap(ni, htcapie); if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS) @@ -1607,8 +1675,115 @@ ieee80211_ht_updateparams(struct ieee802 htinfo = (const struct ieee80211_ie_htinfo *) htinfoie; htinfo_parse(ni, htinfo); + /* + * Defer the node channel change; we need to now + * update VHT parameters before we do it. + */ + + if ((htinfo->hi_byte1 & IEEE80211_HTINFO_RIFSMODE_PERM) && + (vap->iv_flags_ht & IEEE80211_FHT_RIFS)) + ni->ni_flags |= IEEE80211_NODE_RIFS; + else + ni->ni_flags &= ~IEEE80211_NODE_RIFS; +} + +static uint32_t +ieee80211_vht_get_vhtflags(struct ieee80211_node *ni, uint32_t htflags) +{ + struct ieee80211vap *vap = ni->ni_vap; + uint32_t vhtflags = 0; + + vhtflags = 0; + if (ni->ni_flags & IEEE80211_NODE_VHT && vap->iv_flags_vht & IEEE80211_FVHT_VHT) { + if ((ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_160MHZ) && + /* XXX 2 means "160MHz and 80+80MHz", 1 means "160MHz" */ + (MS(vap->iv_vhtcaps, + IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) >= 1) && + (vap->iv_flags_vht & IEEE80211_FVHT_USEVHT160)) { + vhtflags = IEEE80211_CHAN_VHT160; + /* Mirror the HT40 flags */ + if (htflags == IEEE80211_CHAN_HT40U) { + vhtflags |= IEEE80211_CHAN_HT40U; + } else if (htflags == IEEE80211_CHAN_HT40D) { + vhtflags |= IEEE80211_CHAN_HT40D; + } + } else if ((ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_80P80MHZ) && + /* XXX 2 means "160MHz and 80+80MHz" */ + (MS(vap->iv_vhtcaps, + IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == 2) && + (vap->iv_flags_vht & IEEE80211_FVHT_USEVHT80P80)) { + vhtflags = IEEE80211_CHAN_VHT80_80; + /* Mirror the HT40 flags */ + if (htflags == IEEE80211_CHAN_HT40U) { + vhtflags |= IEEE80211_CHAN_HT40U; + } else if (htflags == IEEE80211_CHAN_HT40D) { + vhtflags |= IEEE80211_CHAN_HT40D; + } + } else if ((ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_80MHZ) && + (vap->iv_flags_vht & IEEE80211_FVHT_USEVHT80)) { + vhtflags = IEEE80211_CHAN_VHT80; + /* Mirror the HT40 flags */ + if (htflags == IEEE80211_CHAN_HT40U) { + vhtflags |= IEEE80211_CHAN_HT40U; + } else if (htflags == IEEE80211_CHAN_HT40D) { + vhtflags |= IEEE80211_CHAN_HT40D; + } + } else if (ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_USE_HT) { + /* Mirror the HT40 flags */ + /* + * XXX TODO: if ht40 is disabled, but vht40 isn't + * disabled then this logic will get very, very sad. + * It's quite possible the only sane thing to do is + * to not have vht40 as an option, and just obey + * 'ht40' as that flag. + */ + if ((htflags == IEEE80211_CHAN_HT40U) && + (vap->iv_flags_vht & IEEE80211_FVHT_USEVHT40)) { + vhtflags = IEEE80211_CHAN_VHT40U + | IEEE80211_CHAN_HT40U; + } else if (htflags == IEEE80211_CHAN_HT40D && + (vap->iv_flags_vht & IEEE80211_FVHT_USEVHT40)) { + vhtflags = IEEE80211_CHAN_VHT40D + | IEEE80211_CHAN_HT40D; + } else if (htflags == IEEE80211_CHAN_HT20) { + vhtflags = IEEE80211_CHAN_VHT20 + | IEEE80211_CHAN_HT20; + } + } else { + vhtflags = IEEE80211_CHAN_VHT20; + } + } + return (vhtflags); +} + +/* + * Final part of updating the HT parameters. + * + * This is called from the STA management path and + * the ieee80211_node_join() path. It will take into + * account the IEs discovered during scanning and + * adjust things accordingly. + * + * This is done after a call to ieee80211_ht_updateparams() + * because it (and the upcoming VHT version of updateparams) + * needs to ensure everything is parsed before htinfo_update_chw() + * is called - which will change the channel config for the + * node for us. + */ +int +ieee80211_ht_updateparams_final(struct ieee80211_node *ni, + const uint8_t *htcapie, const uint8_t *htinfoie) +{ + struct ieee80211vap *vap = ni->ni_vap; + const struct ieee80211_ie_htinfo *htinfo; + int htflags, vhtflags; + int ret = 0; + + htinfo = (const struct ieee80211_ie_htinfo *) htinfoie; + htflags = (vap->iv_flags_ht & IEEE80211_FHT_HT) ? IEEE80211_CHAN_HT20 : 0; + /* NB: honor operating mode constraint */ if ((htinfo->hi_byte1 & IEEE80211_HTINFO_TXWIDTH_2040) && (vap->iv_flags_ht & IEEE80211_FHT_USEHT40)) { @@ -1617,14 +1792,16 @@ ieee80211_ht_updateparams(struct ieee802 else if (ni->ni_ht2ndchan == IEEE80211_HTINFO_2NDCHAN_BELOW) htflags = IEEE80211_CHAN_HT40D; } - if (htinfo_update_chw(ni, htflags)) - ret = 1; - if ((htinfo->hi_byte1 & IEEE80211_HTINFO_RIFSMODE_PERM) && - (vap->iv_flags_ht & IEEE80211_FHT_RIFS)) - ni->ni_flags |= IEEE80211_NODE_RIFS; - else - ni->ni_flags &= ~IEEE80211_NODE_RIFS; + /* + * VHT flags - do much the same; check whether VHT is available + * and if so, what our ideal channel use would be based on our + * capabilities and the (pre-parsed) VHT info IE. + */ + vhtflags = ieee80211_vht_get_vhtflags(ni, htflags); + + if (htinfo_update_chw(ni, htflags, vhtflags)) + ret = 1; return (ret); } @@ -1632,17 +1809,31 @@ ieee80211_ht_updateparams(struct ieee802 /* * Parse and update HT-related state extracted from the HT cap ie * for a station joining an HT BSS. + * + * This is called from the hostap path for each station. */ void ieee80211_ht_updatehtcap(struct ieee80211_node *ni, const uint8_t *htcapie) { struct ieee80211vap *vap = ni->ni_vap; - int htflags; ieee80211_parse_htcap(ni, htcapie); if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS) htcap_update_mimo_ps(ni); htcap_update_shortgi(ni); +} + +/* + * Called once HT and VHT capabilities are parsed in hostap mode - + * this will adjust the channel configuration of the given node + * based on the configuration and capabilities. + */ +void +ieee80211_ht_updatehtcap_final(struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + int htflags; + int vhtflags; /* NB: honor operating mode constraint */ /* XXX 40 MHz intolerant */ @@ -1655,7 +1846,14 @@ ieee80211_ht_updatehtcap(struct ieee8021 else if (IEEE80211_IS_CHAN_HT40D(vap->iv_bss->ni_chan)) htflags = IEEE80211_CHAN_HT40D; } - (void) htinfo_update_chw(ni, htflags); + /* + * VHT flags - do much the same; check whether VHT is available + * and if so, what our ideal channel use would be based on our + * capabilities and the (pre-parsed) VHT info IE. + */ + vhtflags = ieee80211_vht_get_vhtflags(ni, htflags); + + (void) htinfo_update_chw(ni, htflags, vhtflags); } /* @@ -2135,6 +2333,7 @@ ht_recv_action_ht_txchwidth(struct ieee8 "%s: HT txchwidth, width %d%s", __func__, chw, ni->ni_chw != chw ? "*" : ""); if (chw != ni->ni_chw) { + /* XXX does this need to change the ht40 station count? */ ni->ni_chw = chw; /* XXX notify on change */ } @@ -2229,6 +2428,10 @@ ieee80211_ampdu_request(struct ieee80211 dialogtoken = (tokens+1) % 63; /* XXX */ tid = tap->txa_tid; + + /* + * XXX TODO: This is racy with any other parallel TX going on. :( + */ tap->txa_start = ni->ni_txseqs[tid]; args[0] = dialogtoken; Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Fri Jan 13 06:53:56 2017 (r312014) +++ head/sys/net80211/ieee80211_ht.h Fri Jan 13 07:02:04 2017 (r312015) @@ -201,9 +201,12 @@ void ieee80211_htprot_update(struct ieee void ieee80211_ht_timeout(struct ieee80211com *); void ieee80211_parse_htcap(struct ieee80211_node *, const uint8_t *); void ieee80211_parse_htinfo(struct ieee80211_node *, const uint8_t *); -int ieee80211_ht_updateparams(struct ieee80211_node *, const uint8_t *, +void ieee80211_ht_updateparams(struct ieee80211_node *, const uint8_t *, const uint8_t *); +int ieee80211_ht_updateparams_final(struct ieee80211_node *, + const uint8_t *, const uint8_t *); void ieee80211_ht_updatehtcap(struct ieee80211_node *, const uint8_t *); +void ieee80211_ht_updatehtcap_final(struct ieee80211_node *); int ieee80211_ampdu_request(struct ieee80211_node *, struct ieee80211_tx_ampdu *); void ieee80211_ampdu_stop(struct ieee80211_node *, Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Fri Jan 13 06:53:56 2017 (r312014) +++ head/sys/net80211/ieee80211_input.c Fri Jan 13 07:02:04 2017 (r312015) @@ -494,6 +494,8 @@ ieee80211_parse_beacon(struct ieee80211_ scan->status = 0; /* * beacon/probe response frame format + * + * XXX Update from 802.11-2012 - eg where HT is * [8] time stamp * [2] beacon interval * [2] capability information @@ -508,6 +510,8 @@ ieee80211_parse_beacon(struct ieee80211_ * [tlv] WPA or RSN * [tlv] HT capabilities * [tlv] HT information + * [tlv] VHT capabilities + * [tlv] VHT information * [tlv] Atheros capabilities * [tlv] Mesh ID * [tlv] Mesh Configuration @@ -585,6 +589,12 @@ ieee80211_parse_beacon(struct ieee80211_ case IEEE80211_ELEMID_HTCAP: scan->htcap = frm; break; + case IEEE80211_ELEMID_VHT_CAP: + scan->vhtcap = frm; + break; + case IEEE80211_ELEMID_VHT_OPMODE: + scan->vhtopmode = frm; + break; case IEEE80211_ELEMID_RSN: scan->rsn = frm; break; @@ -718,6 +728,19 @@ ieee80211_parse_beacon(struct ieee80211_ sizeof(struct ieee80211_ie_htinfo)-2, scan->htinfo = NULL); } + + /* Process VHT IEs */ + if (scan->vhtcap != NULL) { + IEEE80211_VERIFY_LENGTH(scan->vhtcap[1], + sizeof(struct ieee80211_ie_vhtcap) - 2, + scan->vhtcap = NULL); + } + if (scan->vhtopmode != NULL) { + IEEE80211_VERIFY_LENGTH(scan->vhtopmode[1], + sizeof(struct ieee80211_ie_vht_operation) - 2, + scan->vhtopmode = NULL); + } + return scan->status; } @@ -838,6 +861,9 @@ ieee80211_parse_action(struct ieee80211_ } break; #endif + case IEEE80211_ACTION_CAT_VHT: + printf("%s: TODO: VHT handling!\n", __func__); + break; } return 0; } Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Fri Jan 13 06:53:56 2017 (r312014) +++ head/sys/net80211/ieee80211_node.c Fri Jan 13 07:02:04 2017 (r312015) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -412,7 +413,11 @@ ieee80211_create_ibss(struct ieee80211va /* XXX TODO: other bits and pieces - eg fast-frames? */ /* If we're an 11n channel then initialise the 11n bits */ - if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) { + /* XXX what else? */ + ieee80211_ht_node_init(ni); + ieee80211_vht_node_init(ni); + } else if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { /* XXX what else? */ ieee80211_ht_node_init(ni); } @@ -708,9 +713,42 @@ gethtadjustflags(struct ieee80211com *ic } /* + * Calculate VHT channel promotion flags for all vaps. + * This assumes ni_chan have been setup for each vap. + */ +static int +getvhtadjustflags(struct ieee80211com *ic) +{ + struct ieee80211vap *vap; + int flags; + + flags = 0; + /* XXX locking */ + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + if (vap->iv_state < IEEE80211_S_RUN) + continue; + switch (vap->iv_opmode) { + case IEEE80211_M_WDS: + case IEEE80211_M_STA: + case IEEE80211_M_AHDEMO: + case IEEE80211_M_HOSTAP: + case IEEE80211_M_IBSS: + case IEEE80211_M_MBSS: + flags |= ieee80211_vhtchanflags(vap->iv_bss->ni_chan); + break; + default: + break; + } + } + return flags; +} + +/* * Check if the current channel needs to change based on whether * any vap's are using HT20/HT40. This is used to sync the state * of ic_curchan after a channel width change on a running vap. + * + * Same applies for VHT. */ void ieee80211_sync_curchan(struct ieee80211com *ic) @@ -718,6 +756,8 @@ ieee80211_sync_curchan(struct ieee80211c struct ieee80211_channel *c; c = ieee80211_ht_adjust_channel(ic, ic->ic_curchan, gethtadjustflags(ic)); + c = ieee80211_vht_adjust_channel(ic, c, getvhtadjustflags(ic)); + if (c != ic->ic_curchan) { ic->ic_curchan = c; ic->ic_curmode = ieee80211_chan2mode(ic->ic_curchan); @@ -743,10 +783,23 @@ ieee80211_setupcurchan(struct ieee80211c * set of running vap's. This assumes we are called * after ni_chan is setup for each vap. */ + /* XXX VHT? */ /* NB: this assumes IEEE80211_FHT_USEHT40 > IEEE80211_FHT_HT */ if (flags > ieee80211_htchanflags(c)) c = ieee80211_ht_adjust_channel(ic, c, flags); } + + /* + * VHT promotion - this will at least promote to VHT20/40 + * based on what HT has done; it may further promote the + * channel to VHT80 or above. + */ + if (ic->ic_vhtcaps != 0) { + int flags = getvhtadjustflags(ic); + if (flags > ieee80211_vhtchanflags(c)) + c = ieee80211_vht_adjust_channel(ic, c, flags); + } + ic->ic_bsschan = ic->ic_curchan = c; ic->ic_curmode = ieee80211_chan2mode(ic->ic_curchan); ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); @@ -849,6 +902,7 @@ ieee80211_sta_join(struct ieee80211vap * { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni; + int do_ht = 0; ni = ieee80211_alloc_node(&ic->ic_sta, vap, se->se_macaddr); if (ni == NULL) { @@ -896,9 +950,13 @@ ieee80211_sta_join(struct ieee80211vap * if (ni->ni_ies.tdma_ie != NULL) ieee80211_parse_tdma(ni, ni->ni_ies.tdma_ie); #endif + if (ni->ni_ies.vhtcap_ie != NULL) + ieee80211_parse_vhtcap(ni, ni->ni_ies.vhtcap_ie); + if (ni->ni_ies.vhtopmode_ie != NULL) + ieee80211_parse_vhtopmode(ni, ni->ni_ies.vhtopmode_ie); - /* XXX parse VHT IEs */ /* XXX parse BSSLOAD IE */ + /* XXX parse TXPWRENV IE */ /* XXX parse APCHANREP IE */ } @@ -926,10 +984,43 @@ ieee80211_sta_join(struct ieee80211vap * ieee80211_ht_updateparams(ni, ni->ni_ies.htcap_ie, ni->ni_ies.htinfo_ie); + do_ht = 1; + } + + /* + * Setup VHT state for this node if it's available. + * Same as the above. + * + * For now, don't allow 2GHz VHT operation. + */ + if (ni->ni_ies.vhtopmode_ie != NULL && + ni->ni_ies.vhtcap_ie != NULL && + vap->iv_flags_vht & IEEE80211_FVHT_VHT) { + if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) { + printf("%s: BSS %6D: 2GHz channel, VHT info; ignoring\n", + __func__, + ni->ni_macaddr, + ":"); + } else { + ieee80211_vht_node_init(ni); + ieee80211_vht_updateparams(ni, + ni->ni_ies.vhtcap_ie, + ni->ni_ies.vhtopmode_ie); + ieee80211_setup_vht_rates(ni, ni->ni_ies.vhtcap_ie, + ni->ni_ies.vhtopmode_ie); + do_ht = 1; + } + } + + /* Finally do the node channel change */ + if (do_ht) { + ieee80211_ht_updateparams_final(ni, ni->ni_ies.htcap_ie, + ni->ni_ies.htinfo_ie); ieee80211_setup_htrates(ni, ni->ni_ies.htcap_ie, IEEE80211_F_JOIN | IEEE80211_F_DOBRS); ieee80211_setup_basic_htrates(ni, ni->ni_ies.htinfo_ie); } + /* XXX else check for ath FF? */ /* XXX QoS? Difficult given that WME config is specific to a master */ @@ -1102,8 +1193,10 @@ node_cleanup(struct ieee80211_node *ni) "power save mode off, %u sta's in ps mode", vap->iv_ps_sta); } /* - * Cleanup any HT-related state. + * Cleanup any VHT and HT-related state. */ + if (ni->ni_flags & IEEE80211_NODE_VHT) + ieee80211_vht_node_cleanup(ni); if (ni->ni_flags & IEEE80211_NODE_HT) ieee80211_ht_node_cleanup(ni); #ifdef IEEE80211_SUPPORT_SUPERG @@ -1423,6 +1516,7 @@ ieee80211_node_create_wds(struct ieee802 if (vap->iv_flags & IEEE80211_F_FF) ni->ni_flags |= IEEE80211_NODE_FF; #endif + /* XXX VHT */ if ((ic->ic_htcaps & IEEE80211_HTC_HT) && (vap->iv_flags_ht & IEEE80211_FHT_HT)) { /* @@ -1431,6 +1525,9 @@ ieee80211_node_create_wds(struct ieee802 * ni_chan will be adjusted to an HT channel. */ ieee80211_ht_wds_init(ni); + if (vap->iv_flags_vht & IEEE80211_FVHT_VHT) { + printf("%s: TODO: vht_wds_init\n", __func__); + } } else { struct ieee80211_channel *c = ni->ni_chan; /* @@ -1638,7 +1735,7 @@ ieee80211_init_neighbor(struct ieee80211 const struct ieee80211_frame *wh, const struct ieee80211_scanparams *sp) { - int do_ht_setup = 0; + int do_ht_setup = 0, do_vht_setup = 0; ni->ni_esslen = sp->ssid[1]; memcpy(ni->ni_essid, sp->ssid + 2, sp->ssid[1]); @@ -1670,11 +1767,23 @@ ieee80211_init_neighbor(struct ieee80211 if (ni->ni_ies.htinfo_ie != NULL) ieee80211_parse_htinfo(ni, ni->ni_ies.htinfo_ie); + if (ni->ni_ies.vhtcap_ie != NULL) + ieee80211_parse_vhtcap(ni, ni->ni_ies.vhtcap_ie); + if (ni->ni_ies.vhtopmode_ie != NULL) + ieee80211_parse_vhtopmode(ni, ni->ni_ies.vhtopmode_ie); + if ((ni->ni_ies.htcap_ie != NULL) && (ni->ni_ies.htinfo_ie != NULL) && (ni->ni_vap->iv_flags_ht & IEEE80211_FHT_HT)) { do_ht_setup = 1; } + + if ((ni->ni_ies.vhtcap_ie != NULL) && + (ni->ni_ies.vhtopmode_ie != NULL) && + (ni->ni_vap->iv_flags_vht & IEEE80211_FVHT_VHT)) { + do_vht_setup = 1; + } + } /* NB: must be after ni_chan is setup */ @@ -1692,15 +1801,40 @@ ieee80211_init_neighbor(struct ieee80211 ieee80211_ht_updateparams(ni, ni->ni_ies.htcap_ie, ni->ni_ies.htinfo_ie); + + if (do_vht_setup) { + if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) { + printf("%s: BSS %6D: 2GHz channel, VHT info; ignoring\n", + __func__, + ni->ni_macaddr, + ":"); + } else { + ieee80211_vht_node_init(ni); + ieee80211_vht_updateparams(ni, + ni->ni_ies.vhtcap_ie, + ni->ni_ies.vhtopmode_ie); + ieee80211_setup_vht_rates(ni, + ni->ni_ies.vhtcap_ie, + ni->ni_ies.vhtopmode_ie); + } + } + + /* + * Finally do the channel upgrade/change based + * on the HT/VHT configuration. + */ + ieee80211_ht_updateparams_final(ni, ni->ni_ies.htcap_ie, + ni->ni_ies.htinfo_ie); ieee80211_setup_htrates(ni, ni->ni_ies.htcap_ie, IEEE80211_F_JOIN | IEEE80211_F_DOBRS); ieee80211_setup_basic_htrates(ni, ni->ni_ies.htinfo_ie); + ieee80211_node_setuptxparms(ni); ieee80211_ratectl_node_init(ni); - /* Reassociate; we're now 11n */ + /* Reassociate; we're now 11n/11ac */ /* * XXX TODO: this is the wrong thing to do - * we're calling it with isnew=1 so the ath(4) @@ -2365,6 +2499,7 @@ ieee80211_node_timeout(void *arg) IEEE80211_LOCK(ic); ieee80211_erp_timeout(ic); ieee80211_ht_timeout(ic); + ieee80211_vht_timeout(ic); IEEE80211_UNLOCK(ic); } callout_reset(&ic->ic_inact, IEEE80211_INACT_WAIT*hz, @@ -2462,8 +2597,12 @@ ieee80211_dump_node(struct ieee80211_nod printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n", ni->ni_htcap, ni->ni_htparam, ni->ni_htctlchan, ni->ni_ht2ndchan); - printf("\thtopmode %x htstbc %x chw %u\n", + printf("\thtopmode %x htstbc %x htchw %u\n", ni->ni_htopmode, ni->ni_htstbc, ni->ni_chw); + printf("\tvhtcap %x freq1 %d freq2 %d vhtbasicmcs %x\n", + ni->ni_vhtcap, (int) ni->ni_vht_chan1, (int) ni->ni_vht_chan2, + (int) ni->ni_vht_basicmcs); + /* XXX VHT state */ } void @@ -2594,6 +2733,8 @@ ieee80211_node_join(struct ieee80211_nod if (IEEE80211_IS_CHAN_HT(ic->ic_bsschan)) ieee80211_ht_node_join(ni); + if (IEEE80211_IS_CHAN_VHT(ic->ic_bsschan)) + ieee80211_vht_node_join(ni); if (IEEE80211_IS_CHAN_ANYG(ic->ic_bsschan) && IEEE80211_IS_CHAN_FULL(ic->ic_bsschan)) ieee80211_node_join_11g(ni); @@ -2603,6 +2744,9 @@ ieee80211_node_join(struct ieee80211_nod } else newassoc = 0; + /* + * XXX VHT - should log VHT channel width, etc + */ IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG, ni, "station associated at aid %d: %s preamble, %s slot time%s%s%s%s%s%s%s%s", IEEE80211_NODE_AID(ni), @@ -2610,6 +2754,7 @@ ieee80211_node_join(struct ieee80211_nod ic->ic_flags & IEEE80211_F_SHSLOT ? "short" : "long", ic->ic_flags & IEEE80211_F_USEPROT ? ", protection" : "", ni->ni_flags & IEEE80211_NODE_QOS ? ", QoS" : "", + /* XXX update for VHT string */ ni->ni_flags & IEEE80211_NODE_HT ? (ni->ni_chw == 40 ? ", HT40" : ", HT20") : "", ni->ni_flags & IEEE80211_NODE_AMPDU ? " (+AMPDU)" : "", @@ -2774,6 +2919,8 @@ ieee80211_node_leave(struct ieee80211_no vap->iv_sta_assoc--; ic->ic_sta_assoc--; + if (IEEE80211_IS_CHAN_VHT(ic->ic_bsschan)) + ieee80211_vht_node_leave(ni); if (IEEE80211_IS_CHAN_HT(ic->ic_bsschan)) ieee80211_ht_node_leave(ni); if (IEEE80211_IS_CHAN_ANYG(ic->ic_bsschan) && Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Jan 13 06:53:56 2017 (r312014) +++ head/sys/net80211/ieee80211_output.c Fri Jan 13 07:02:04 2017 (r312015) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #if defined(INET) || defined(INET6) #include @@ -764,6 +765,16 @@ ieee80211_send_setup( } *(uint16_t *)&wh->i_dur[0] = 0; + /* + * XXX TODO: this is what the TX lock is for. + * Here we're incrementing sequence numbers, and they + * need to be in lock-step with what the driver is doing + * both in TX ordering and crypto encap (IV increment.) + * + * If the driver does seqno itself, then we can skip + * assigning sequence numbers here, and we can avoid + * requiring the TX lock. + */ tap = &ni->ni_tx_ampdu[tid]; if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap)) m->m_flags |= M_AMPDU_MPDU; @@ -1542,6 +1553,11 @@ ieee80211_encap(struct ieee80211vap *vap if (is_amsdu) qos[0] |= IEEE80211_QOS_AMSDU; + /* + * XXX TODO TX lock is needed for atomic updates of sequence + * numbers. If the driver does it, then don't do it here; + * and we don't need the TX lock held. + */ if ((m->m_flags & M_AMPDU_MPDU) == 0) { /* * NB: don't assign a sequence # to potential @@ -1561,6 +1577,11 @@ ieee80211_encap(struct ieee80211vap *vap M_SEQNO_SET(m, seqno); } } else { + /* + * XXX TODO TX lock is needed for atomic updates of sequence + * numbers. If the driver does it, then don't do it here; + * and we don't need the TX lock held. + */ seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; *(uint16_t *)wh->i_seq = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); @@ -2065,6 +2086,7 @@ ieee80211_add_qos(uint8_t *frm, const st * Send a probe request frame with the specified ssid * and any optional information element data. */ +/* XXX VHT? */ int ieee80211_send_probereq(struct ieee80211_node *ni, const uint8_t sa[IEEE80211_ADDR_LEN], @@ -2111,6 +2133,7 @@ ieee80211_send_probereq(struct ieee80211 * [tlv] RSN (optional) * [tlv] extended supported rates * [tlv] HT cap (optional) + * [tlv] VHT cap (optional) * [tlv] WPA (optional) * [tlv] user-specified ie's */ @@ -2119,7 +2142,8 @@ ieee80211_send_probereq(struct ieee80211 2 + IEEE80211_NWID_LEN + 2 + IEEE80211_RATE_SIZE + sizeof(struct ieee80211_ie_htcap) - + sizeof(struct ieee80211_ie_htinfo) + + sizeof(struct ieee80211_ie_vhtcap) + + sizeof(struct ieee80211_ie_htinfo) /* XXX not needed? */ + sizeof(struct ieee80211_ie_wpa) + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + sizeof(struct ieee80211_ie_wpa) @@ -2159,6 +2183,21 @@ ieee80211_send_probereq(struct ieee80211 frm = ieee80211_add_htcap_ch(frm, vap, c); } + /* + * XXX TODO: need to figure out what/how to update the + * VHT channel. + */ +#if 0 + (vap->iv_flags_vht & IEEE80211_FVHT_VHT) { + struct ieee80211_channel *c; + + c = ieee80211_ht_adjust_channel(ic, ic->ic_curchan, + vap->iv_flags_ht); + c = ieee80211_vht_adjust_channel(ic, c, vap->iv_flags_vht); + frm = ieee80211_add_vhtcap_ch(frm, vap, c); + } +#endif + frm = ieee80211_add_wpa(frm, vap); if (vap->iv_appie_probereq != NULL) frm = add_appie(frm, vap->iv_appie_probereq); @@ -2357,6 +2396,7 @@ ieee80211_send_mgmt(struct ieee80211_nod case IEEE80211_FC0_SUBTYPE_ASSOC_REQ: case IEEE80211_FC0_SUBTYPE_REASSOC_REQ: + /* XXX VHT? */ /* * asreq frame format * [2] capability information @@ -2368,6 +2408,7 @@ ieee80211_send_mgmt(struct ieee80211_nod * [4] power capability (optional) * [28] supported channels (optional) * [tlv] HT capabilities + * [tlv] VHT capabilities * [tlv] WME (optional) * [tlv] Vendor OUI HT capabilities (optional) * [tlv] Atheros capabilities (if negotiated) @@ -2385,6 +2426,7 @@ ieee80211_send_mgmt(struct ieee80211_nod + 2 + 26 + sizeof(struct ieee80211_wme_info) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 13 07:08:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3966CACAA8; Fri, 13 Jan 2017 07:08:15 +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 70A131B35; Fri, 13 Jan 2017 07:08:15 +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 v0D78EZ9011578; Fri, 13 Jan 2017 07:08:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D78EPw011577; Fri, 13 Jan 2017 07:08:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701130708.v0D78EPw011577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 13 Jan 2017 07:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312016 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 07:08:15 -0000 Author: adrian Date: Fri Jan 13 07:08:14 2017 New Revision: 312016 URL: https://svnweb.freebsd.org/changeset/base/312016 Log: [net80211] begin laying the groundwork for drivers to do their own sequence number management. I added IEEE80211_TX_LOCK() a few years ago because there were races between seqno allocation, driver queuing and crypto IV allocation. This meant that they'd appear out of sequence and the receiver would drop them, leading to terrible performance or flat out traffic hangs. This flag should be set by drivers that do their own sequence number allocation for all frames it needs to happen for, including beacon frames. Eventually this should lead to the driver taking care of locking for allocating seqno and other traffic-triggered events (eg addba setup.) Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Fri Jan 13 07:02:04 2017 (r312015) +++ head/sys/net80211/ieee80211_var.h Fri Jan 13 07:08:14 2017 (r312016) @@ -629,11 +629,12 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FEXT_PROBECHAN 0x00020000 /* CONF: probe passive channel*/ #define IEEE80211_FEXT_UNIQMAC 0x00040000 /* CONF: user or computed mac */ #define IEEE80211_FEXT_SCAN_OFFLOAD 0x00080000 /* CONF: scan is fully offloaded */ +#define IEEE80211_FEXT_SEQNO_OFFLOAD 0x00100000 /* CONF: driver does seqno insertion/allocation */ #define IEEE80211_FEXT_BITS \ "\20\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \ "\0114ADDR\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\16STATEWAIT\17REINIT" \ - "\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC\24SCAN_OFFLOAD" + "\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC\24SCAN_OFFLOAD\25SEQNO_OFFLOAD" /* ic_flags_ht/iv_flags_ht */ #define IEEE80211_FHT_NONHT_PR 0x00000001 /* STATUS: non-HT sta present */ From owner-svn-src-all@freebsd.org Fri Jan 13 07:24:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79006CAD143; Fri, 13 Jan 2017 07:24:59 +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 4944A1697; Fri, 13 Jan 2017 07:24:59 +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 v0D7Owji020247; Fri, 13 Jan 2017 07:24:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D7OwkD020246; Fri, 13 Jan 2017 07:24:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701130724.v0D7OwkD020246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 13 Jan 2017 07:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312017 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 07:24:59 -0000 Author: adrian Date: Fri Jan 13 07:24:58 2017 New Revision: 312017 URL: https://svnweb.freebsd.org/changeset/base/312017 Log: [net80211] add a macro to check this configuration option. Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Fri Jan 13 07:08:14 2017 (r312016) +++ head/sys/net80211/ieee80211_var.h Fri Jan 13 07:24:58 2017 (r312017) @@ -95,6 +95,9 @@ */ #define IEEE80211_CONF_VHT(ic) ((ic)->ic_vhtcaps != 0) +#define IEEE80211_CONF_SEQNO_OFFLOAD(ic) \ + ((ic)->ic_flags_ext & IEEE80211_FEXT_SEQNO_OFFLOAD) + /* * 802.11 control state is split into a common portion that maps * 1-1 to a physical device and one or more "Virtual AP's" (VAP) From owner-svn-src-all@freebsd.org Fri Jan 13 08:01:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 832D2CAD324; Fri, 13 Jan 2017 08:01:28 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31D911A02; Fri, 13 Jan 2017 08:01:28 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D81R1e034099; Fri, 13 Jan 2017 08:01:27 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D81RME034098; Fri, 13 Jan 2017 08:01:27 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201701130801.v0D81RME034098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Fri, 13 Jan 2017 08:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312018 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:01:28 -0000 Author: hrs Date: Fri Jan 13 08:01:27 2017 New Revision: 312018 URL: https://svnweb.freebsd.org/changeset/base/312018 Log: Purge varargs.h in favor of stdarg.h. Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Fri Jan 13 07:24:58 2017 (r312017) +++ head/usr.sbin/route6d/route6d.c Fri Jan 13 08:01:27 2017 (r312018) @@ -57,11 +57,7 @@ static const char _rcsid[] = "$KAME: rou #endif #include #include -#ifdef __STDC__ #include -#else -#include -#endif #include #include #include @@ -203,7 +199,6 @@ static volatile sig_atomic_t seenusr1; #define RRTF_SENDANYWAY 0x40000000 #define RRTF_CHANGED 0x80000000 -int main(int, char **); static void sighandler(int); static void ripalarm(void); static void riprecv(void); @@ -3457,22 +3452,12 @@ ripsuptrig(void) #endif static void -#ifdef __STDC__ fatal(const char *fmt, ...) -#else -fatal(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; char buf[1024]; -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); perror(buf); @@ -3484,33 +3469,18 @@ fatal(fmt, va_alist) } static void -#ifdef __STDC__ tracet(int level, const char *fmt, ...) -#else -tracet(level, fmt, va_alist) - int level; - char *fmt; - va_dcl -#endif { va_list ap; if (level <= dflag) { -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif fprintf(stderr, "%s: ", hms()); vfprintf(stderr, fmt, ap); va_end(ap); } if (dflag) { -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif if (level > 0) vsyslog(LOG_DEBUG, fmt, ap); else @@ -3520,32 +3490,17 @@ tracet(level, fmt, va_alist) } static void -#ifdef __STDC__ trace(int level, const char *fmt, ...) -#else -trace(level, fmt, va_alist) - int level; - char *fmt; - va_dcl -#endif { va_list ap; if (level <= dflag) { -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif vfprintf(stderr, fmt, ap); va_end(ap); } if (dflag) { -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif if (level > 0) vsyslog(LOG_DEBUG, fmt, ap); else From owner-svn-src-all@freebsd.org Fri Jan 13 08:15:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46CA4CAD915; Fri, 13 Jan 2017 08:15: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 15BCE129A; Fri, 13 Jan 2017 08:15: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 v0D8FWg5040421; Fri, 13 Jan 2017 08:15:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8FWVu040420; Fri, 13 Jan 2017 08:15:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130815.v0D8FWVu040420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312019 - stable/11/tools/build/options X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:15:33 -0000 Author: ngie Date: Fri Jan 13 08:15:32 2017 New Revision: 312019 URL: https://svnweb.freebsd.org/changeset/base/312019 Log: MFC r311548: Carry over r311520 to tools/build/options/WITHOUT_USB_GADGET_EXAMPLES Discussed with: wblock r311520: Fix src.conf(5) description of WITHOUT_USB_GADGET_EXAMPLES. PR: 215831 Modified: stable/11/tools/build/options/WITHOUT_USB_GADGET_EXAMPLES Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/options/WITHOUT_USB_GADGET_EXAMPLES ============================================================================== --- stable/11/tools/build/options/WITHOUT_USB_GADGET_EXAMPLES Fri Jan 13 08:01:27 2017 (r312018) +++ stable/11/tools/build/options/WITHOUT_USB_GADGET_EXAMPLES Fri Jan 13 08:15:32 2017 (r312019) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to build USB gadget kernel modules. +Set to not build USB gadget kernel modules. From owner-svn-src-all@freebsd.org Fri Jan 13 08:19:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED7ACCADAA8; Fri, 13 Jan 2017 08:19:53 +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 BC47115AE; Fri, 13 Jan 2017 08:19:53 +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 v0D8JqcS040672; Fri, 13 Jan 2017 08:19:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8Jq0q040671; Fri, 13 Jan 2017 08:19:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130819.v0D8Jq0q040671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312020 - stable/11/usr.bin/top X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:19:54 -0000 Author: ngie Date: Fri Jan 13 08:19:52 2017 New Revision: 312020 URL: https://svnweb.freebsd.org/changeset/base/312020 Log: MFC r311710: Style fixes - Delete trailing whitespace - Use nitems(mib) instead of hardcoding the mib length Modified: stable/11/usr.bin/top/machine.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/top/machine.c ============================================================================== --- stable/11/usr.bin/top/machine.c Fri Jan 13 08:15:32 2017 (r312019) +++ stable/11/usr.bin/top/machine.c Fri Jan 13 08:19:52 2017 (r312020) @@ -413,7 +413,7 @@ format_header(char *uname_field) { static char Header[128]; const char *prehead; - + if (ps.jail) jidlength = TOP_JID_LEN + 1; /* +1 for extra left space. */ else @@ -559,7 +559,7 @@ get_system_info(struct system_info *si) arc_stats[5] = arc_stat >> 10; si->arc = arc_stats; } - + /* set arrays and strings */ if (pcpu_stats) { si->cpustates = pcpu_cpu_states; @@ -585,7 +585,7 @@ get_system_info(struct system_info *si) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(boottime); - if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && + if (sysctl(mib, nitems(mib), &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) { si->boottime = boottime; } else { @@ -1072,7 +1072,7 @@ format_next_process(caddr_t handle, char } } - if (ps.jail == 0) + if (ps.jail == 0) jid_buf[0] = '\0'; else snprintf(jid_buf, sizeof(jid_buf), "%*d", From owner-svn-src-all@freebsd.org Fri Jan 13 08:24:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24B5CCADD7D; Fri, 13 Jan 2017 08:24: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 CA03F1B09; Fri, 13 Jan 2017 08:24:42 +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 v0D8Of7I044685; Fri, 13 Jan 2017 08:24:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8OfKb044684; Fri, 13 Jan 2017 08:24:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130824.v0D8OfKb044684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312021 - stable/10/usr.bin/top X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:24:43 -0000 Author: ngie Date: Fri Jan 13 08:24:41 2017 New Revision: 312021 URL: https://svnweb.freebsd.org/changeset/base/312021 Log: MFC r266773,r280680,r311710: r266773 (by jhb): Fix a couple of size_t != int warnings. r280680 (by kevlo): Print size_t's with %zu rather than "%zd. r311710: Style fixes - Delete trailing whitespace - Use nitems(mib) instead of hardcoding the mib length Modified: stable/10/usr.bin/top/machine.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/top/machine.c ============================================================================== --- stable/10/usr.bin/top/machine.c Fri Jan 13 08:19:52 2017 (r312020) +++ stable/10/usr.bin/top/machine.c Fri Jan 13 08:24:41 2017 (r312021) @@ -363,7 +363,7 @@ machine_init(struct statics *statics, ch size = sizeof(long) * maxcpu * CPUSTATES; times = malloc(size); if (times == NULL) - err(1, "malloc %zd bytes", size); + err(1, "malloc %zu bytes", size); if (sysctlbyname("kern.cp_times", times, &size, NULL, 0) == -1) err(1, "sysctlbyname kern.cp_times"); pcpu_cp_time = calloc(1, size); @@ -396,7 +396,7 @@ format_header(char *uname_field) { static char Header[128]; const char *prehead; - + if (ps.jail) jidlength = TOP_JID_LEN + 1; /* +1 for extra left space. */ else @@ -536,7 +536,7 @@ get_system_info(struct system_info *si) arc_stats[5] = arc_stat >> 10; si->arc = arc_stats; } - + /* set arrays and strings */ if (pcpu_stats) { si->cpustates = pcpu_cpu_states; @@ -562,7 +562,7 @@ get_system_info(struct system_info *si) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(boottime); - if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && + if (sysctl(mib, nitems(mib), &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) { si->boottime = boottime; } else { @@ -917,7 +917,7 @@ format_next_process(caddr_t handle, char argbuflen = cmdlen * 4; argbuf = (char *)malloc(argbuflen + 1); if (argbuf == NULL) { - warn("malloc(%d)", argbuflen + 1); + warn("malloc(%zu)", argbuflen + 1); free(cmdbuf); return NULL; } @@ -970,7 +970,7 @@ format_next_process(caddr_t handle, char } } - if (ps.jail == 0) + if (ps.jail == 0) jid_buf[0] = '\0'; else snprintf(jid_buf, sizeof(jid_buf), "%*d", @@ -1026,7 +1026,7 @@ format_next_process(caddr_t handle, char thr_buf[0] = '\0'; else snprintf(thr_buf, sizeof(thr_buf), "%*d ", - sizeof(thr_buf) - 2, pp->ki_numthreads); + (int)(sizeof(thr_buf) - 2), pp->ki_numthreads); snprintf(fmt, sizeof(fmt), proc_fmt, pp->ki_pid, From owner-svn-src-all@freebsd.org Fri Jan 13 08:27:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F1A5CADF08; Fri, 13 Jan 2017 08:27:09 +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 ED69C1D49; Fri, 13 Jan 2017 08:27:08 +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 v0D8R8p3044907; Fri, 13 Jan 2017 08:27:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8R8pb044906; Fri, 13 Jan 2017 08:27:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130827.v0D8R8pb044906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312022 - stable/11/usr.sbin/route6d X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:27:09 -0000 Author: ngie Date: Fri Jan 13 08:27:07 2017 New Revision: 312022 URL: https://svnweb.freebsd.org/changeset/base/312022 Log: MFC r311711,r311712,r311713: r311711: Clean up trailing whitespace r311712: Sort #includes r311713: Use nitems(mib) instead of hardcoding mib's length Modified: stable/11/usr.sbin/route6d/route6d.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/route6d/route6d.c ============================================================================== --- stable/11/usr.sbin/route6d/route6d.c Fri Jan 13 08:24:41 2017 (r312021) +++ stable/11/usr.sbin/route6d/route6d.c Fri Jan 13 08:27:07 2017 (r312022) @@ -4,7 +4,7 @@ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,7 +16,7 @@ * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 @@ -34,44 +34,40 @@ static const char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itojun Exp $"; #endif -#include - -#include -#include -#include -#include -#include -#include -#ifdef __STDC__ -#include -#else -#include -#endif -#include -#include -#include -#include -#ifdef HAVE_POLL_H -#include -#endif - -#include #include #include -#include #include +#include #include #include +#include #include #include #include #include #include #include -#include +#include +#include +#include #include - -#include +#include +#ifdef HAVE_POLL_H +#include +#endif +#include +#include +#ifdef __STDC__ +#include +#else +#include +#endif +#include +#include +#include +#include +#include +#include #include "route6d.h" @@ -106,7 +102,7 @@ struct ifc { /* Configuration of an in }; TAILQ_HEAD(, ifc) ifc_head = TAILQ_HEAD_INITIALIZER(ifc_head); -struct ifac { /* Adddress associated to an interface */ +struct ifac { /* Adddress associated to an interface */ TAILQ_ENTRY(ifac) ifac_next; struct ifc *ifac_ifc; /* back pointer */ @@ -673,7 +669,7 @@ init(void) fatal("rip IPV6_PKTINFO"); /*NOTREACHED*/ } -#endif +#endif #ifdef IPV6_RECVPKTINFO if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, @@ -819,8 +815,8 @@ ripsend(struct ifc *ifcp, struct sockadd * Request from non-link local address is not * a regular route6d update. */ - maxrte = (IFMINMTU - sizeof(struct ip6_hdr) - - sizeof(struct udphdr) - + maxrte = (IFMINMTU - sizeof(struct ip6_hdr) - + sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); nh = NULL; @@ -868,8 +864,8 @@ ripsend(struct ifc *ifcp, struct sockadd return; } - maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) - - sizeof(struct udphdr) - + maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) - + sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); @@ -953,13 +949,13 @@ out_filter(struct riprt *rrt, struct ifc /* * -A: filter out less specific routes, if we have aggregated * route configured. - */ + */ TAILQ_FOREACH(iffp, &ifcp->ifc_iff_head, iff_next) { if (iffp->iff_type != 'A') continue; if (rrt->rrt_info.rip6_plen <= iffp->iff_plen) continue; - ia = rrt->rrt_info.rip6_dest; + ia = rrt->rrt_info.rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) return 0; @@ -995,7 +991,7 @@ out_filter(struct riprt *rrt, struct ifc continue; if (rrt->rrt_info.rip6_plen < iffp->iff_plen) continue; - ia = rrt->rrt_info.rip6_dest; + ia = rrt->rrt_info.rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) { ok = 1; @@ -1195,8 +1191,8 @@ riprecv(void) } else { riprequest(NULL, np, nn, &fsock); } - return; - } + return; + } if (!IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr)) { trace(1, "Response from non-ll addr: %s\n", @@ -1223,7 +1219,7 @@ riprecv(void) * source address to be forwarded to a different link. * So we also check whether the destination address is a link-local * address or the hop limit is 255. Note that RFC2080 does not require - * the specific hop limit for a unicast response, so we cannot assume + * the specific hop limit for a unicast response, so we cannot assume * the limitation. */ if (!IN6_IS_ADDR_LINKLOCAL(&pi->ipi6_addr) && *hlimp != 255) { @@ -1245,7 +1241,7 @@ riprecv(void) return; /* The packet is from me; ignore */ if (rp->rip6_cmd != RIP6_RESPONSE) { trace(1, "Invalid command %d\n", rp->rip6_cmd); - return; + return; } /* -N: no use */ @@ -1323,7 +1319,7 @@ riprecv(void) /* special rule: ::/0 means default, not "in /0" */ if (iffp->iff_plen == 0 && np->rip6_plen > 0) continue; - ia = np->rip6_dest; + ia = np->rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) { ok = 1; @@ -1374,7 +1370,7 @@ riprecv(void) } else if (nq->rip6_metric == np->rip6_metric && np->rip6_metric < HOPCNT_INFINITY6) { if (rrt->rrt_index == ifcp->ifc_index && - IN6_ARE_ADDR_EQUAL(&nh, &rrt->rrt_gw)) { + IN6_ARE_ADDR_EQUAL(&nh, &rrt->rrt_gw)) { /* same metric, same route from same gw */ rrt->rrt_t = t; } else if (rrt->rrt_t < t_half_lifetime) { @@ -1389,7 +1385,7 @@ riprecv(void) rrt->rrt_t = t; } } - /* + /* * if nq->rip6_metric == HOPCNT_INFINITY6 then * do not update age value. Do nothing. */ @@ -1667,7 +1663,7 @@ ifremove(int ifindex) break; } if (ifcp == NULL) - return; + return; tracet(1, "ifremove: %s is departed.\n", ifcp->ifc_name); TAILQ_REMOVE(&ifc_head, ifcp, ifc_next); @@ -1824,7 +1820,7 @@ rtrecv(void) #if 0 if (rta[RTAX_DST] == NULL) { trace(1, "\tno destination, ignored\n"); - continue; + continue; } if (rta[RTAX_DST]->sin6_family != AF_INET6) { trace(1, "\taf mismatch, ignored\n"); @@ -2422,7 +2418,7 @@ getifmtu(int ifindex) mib[3] = AF_INET6; mib[4] = NET_RT_IFLIST; mib[5] = ifindex; - if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &msize, NULL, 0) < 0) { fatal("sysctl estimate NET_RT_IFLIST"); /*NOTREACHED*/ } @@ -2430,7 +2426,7 @@ getifmtu(int ifindex) fatal("malloc"); /*NOTREACHED*/ } - if (sysctl(mib, 6, buf, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &msize, NULL, 0) < 0) { fatal("sysctl NET_RT_IFLIST"); /*NOTREACHED*/ } @@ -2602,7 +2598,7 @@ krtread(int again) free(buf); buf = NULL; } - if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &msize, NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; } @@ -2610,7 +2606,7 @@ krtread(int again) errmsg = "malloc"; continue; } - if (sysctl(mib, 6, buf, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &msize, NULL, 0) < 0) { errmsg = "sysctl NET_RT_DUMP"; continue; } @@ -3238,7 +3234,7 @@ ifonly: #if 0 /* * When the address has already been registered in the - * kernel routing table, it should be removed + * kernel routing table, it should be removed */ delroute(&rrt->rrt_info, &gw); #else @@ -3319,7 +3315,7 @@ mask2len(const struct in6_addr *addr, in { int i = 0, j; const u_char *p = (const u_char *)addr; - + for (j = 0; j < lenlim; j++, p++) { if (*p != 0xff) break; @@ -3446,7 +3442,7 @@ ripsuptrig(void) time_t t; double r = rand(); - t = (int)(RIP_TRIG_INT6_MIN + + t = (int)(RIP_TRIG_INT6_MIN + (RIP_TRIG_INT6_MAX - RIP_TRIG_INT6_MIN) * (r / RAND_MAX)); sup_trig_update = time(NULL) + t; return t; From owner-svn-src-all@freebsd.org Fri Jan 13 08:27:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D55C0CADFE1; Fri, 13 Jan 2017 08:27:41 +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 AFBCA1EC5; Fri, 13 Jan 2017 08:27:41 +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 v0D8ReAM044966; Fri, 13 Jan 2017 08:27:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8ReiR044965; Fri, 13 Jan 2017 08:27:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130827.v0D8ReiR044965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312023 - stable/10/usr.sbin/route6d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:27:41 -0000 Author: ngie Date: Fri Jan 13 08:27:40 2017 New Revision: 312023 URL: https://svnweb.freebsd.org/changeset/base/312023 Log: MFC r311711,r311712,r311713: r311711: Clean up trailing whitespace r311712: Sort #includes r311713: Use nitems(mib) instead of hardcoding mib's length Modified: stable/10/usr.sbin/route6d/route6d.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/route6d/route6d.c ============================================================================== --- stable/10/usr.sbin/route6d/route6d.c Fri Jan 13 08:27:07 2017 (r312022) +++ stable/10/usr.sbin/route6d/route6d.c Fri Jan 13 08:27:40 2017 (r312023) @@ -4,7 +4,7 @@ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,7 +16,7 @@ * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 @@ -34,34 +34,13 @@ static const char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itojun Exp $"; #endif -#include - -#include -#include -#include -#include -#include -#include -#ifdef __STDC__ -#include -#else -#include -#endif -#include -#include -#include -#include -#ifdef HAVE_POLL_H -#include -#endif - -#include #include #include -#include #include +#include #include #include +#include #include #include #include @@ -69,10 +48,27 @@ static const char _rcsid[] = "$KAME: rou #include #include #include -#include +#include +#include +#include #include - -#include +#include +#ifdef HAVE_POLL_H +#include +#endif +#include +#include +#ifdef __STDC__ +#include +#else +#include +#endif +#include +#include +#include +#include +#include +#include #include "route6d.h" @@ -107,7 +103,7 @@ struct ifc { /* Configuration of an in }; TAILQ_HEAD(, ifc) ifc_head = TAILQ_HEAD_INITIALIZER(ifc_head); -struct ifac { /* Adddress associated to an interface */ +struct ifac { /* Adddress associated to an interface */ TAILQ_ENTRY(ifac) ifac_next; struct ifc *ifac_ifc; /* back pointer */ @@ -674,7 +670,7 @@ init(void) fatal("rip IPV6_PKTINFO"); /*NOTREACHED*/ } -#endif +#endif #ifdef IPV6_RECVPKTINFO if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, @@ -820,8 +816,8 @@ ripsend(struct ifc *ifcp, struct sockadd * Request from non-link local address is not * a regular route6d update. */ - maxrte = (IFMINMTU - sizeof(struct ip6_hdr) - - sizeof(struct udphdr) - + maxrte = (IFMINMTU - sizeof(struct ip6_hdr) - + sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); nh = NULL; @@ -869,8 +865,8 @@ ripsend(struct ifc *ifcp, struct sockadd return; } - maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) - - sizeof(struct udphdr) - + maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) - + sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); @@ -954,13 +950,13 @@ out_filter(struct riprt *rrt, struct ifc /* * -A: filter out less specific routes, if we have aggregated * route configured. - */ + */ TAILQ_FOREACH(iffp, &ifcp->ifc_iff_head, iff_next) { if (iffp->iff_type != 'A') continue; if (rrt->rrt_info.rip6_plen <= iffp->iff_plen) continue; - ia = rrt->rrt_info.rip6_dest; + ia = rrt->rrt_info.rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) return 0; @@ -996,7 +992,7 @@ out_filter(struct riprt *rrt, struct ifc continue; if (rrt->rrt_info.rip6_plen < iffp->iff_plen) continue; - ia = rrt->rrt_info.rip6_dest; + ia = rrt->rrt_info.rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) { ok = 1; @@ -1196,8 +1192,8 @@ riprecv(void) } else { riprequest(NULL, np, nn, &fsock); } - return; - } + return; + } if (!IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr)) { trace(1, "Response from non-ll addr: %s\n", @@ -1224,7 +1220,7 @@ riprecv(void) * source address to be forwarded to a different link. * So we also check whether the destination address is a link-local * address or the hop limit is 255. Note that RFC2080 does not require - * the specific hop limit for a unicast response, so we cannot assume + * the specific hop limit for a unicast response, so we cannot assume * the limitation. */ if (!IN6_IS_ADDR_LINKLOCAL(&pi->ipi6_addr) && *hlimp != 255) { @@ -1246,7 +1242,7 @@ riprecv(void) return; /* The packet is from me; ignore */ if (rp->rip6_cmd != RIP6_RESPONSE) { trace(1, "Invalid command %d\n", rp->rip6_cmd); - return; + return; } /* -N: no use */ @@ -1324,7 +1320,7 @@ riprecv(void) /* special rule: ::/0 means default, not "in /0" */ if (iffp->iff_plen == 0 && np->rip6_plen > 0) continue; - ia = np->rip6_dest; + ia = np->rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) { ok = 1; @@ -1375,7 +1371,7 @@ riprecv(void) } else if (nq->rip6_metric == np->rip6_metric && np->rip6_metric < HOPCNT_INFINITY6) { if (rrt->rrt_index == ifcp->ifc_index && - IN6_ARE_ADDR_EQUAL(&nh, &rrt->rrt_gw)) { + IN6_ARE_ADDR_EQUAL(&nh, &rrt->rrt_gw)) { /* same metric, same route from same gw */ rrt->rrt_t = t; } else if (rrt->rrt_t < t_half_lifetime) { @@ -1390,7 +1386,7 @@ riprecv(void) rrt->rrt_t = t; } } - /* + /* * if nq->rip6_metric == HOPCNT_INFINITY6 then * do not update age value. Do nothing. */ @@ -1668,7 +1664,7 @@ ifremove(int ifindex) break; } if (ifcp == NULL) - return; + return; tracet(1, "ifremove: %s is departed.\n", ifcp->ifc_name); TAILQ_REMOVE(&ifc_head, ifcp, ifc_next); @@ -1825,7 +1821,7 @@ rtrecv(void) #if 0 if (rta[RTAX_DST] == NULL) { trace(1, "\tno destination, ignored\n"); - continue; + continue; } if (rta[RTAX_DST]->sin6_family != AF_INET6) { trace(1, "\taf mismatch, ignored\n"); @@ -2423,7 +2419,7 @@ getifmtu(int ifindex) mib[3] = AF_INET6; mib[4] = NET_RT_IFLIST; mib[5] = ifindex; - if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &msize, NULL, 0) < 0) { fatal("sysctl estimate NET_RT_IFLIST"); /*NOTREACHED*/ } @@ -2431,7 +2427,7 @@ getifmtu(int ifindex) fatal("malloc"); /*NOTREACHED*/ } - if (sysctl(mib, 6, buf, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &msize, NULL, 0) < 0) { fatal("sysctl NET_RT_IFLIST"); /*NOTREACHED*/ } @@ -2606,7 +2602,7 @@ krtread(int again) free(buf); buf = NULL; } - if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &msize, NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; } @@ -2614,7 +2610,7 @@ krtread(int again) errmsg = "malloc"; continue; } - if (sysctl(mib, 6, buf, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &msize, NULL, 0) < 0) { errmsg = "sysctl NET_RT_DUMP"; continue; } @@ -3242,7 +3238,7 @@ ifonly: #if 0 /* * When the address has already been registered in the - * kernel routing table, it should be removed + * kernel routing table, it should be removed */ delroute(&rrt->rrt_info, &gw); #else @@ -3323,7 +3319,7 @@ mask2len(const struct in6_addr *addr, in { int i = 0, j; const u_char *p = (const u_char *)addr; - + for (j = 0; j < lenlim; j++, p++) { if (*p != 0xff) break; @@ -3450,7 +3446,7 @@ ripsuptrig(void) time_t t; double r = rand(); - t = (int)(RIP_TRIG_INT6_MIN + + t = (int)(RIP_TRIG_INT6_MIN + (RIP_TRIG_INT6_MAX - RIP_TRIG_INT6_MIN) * (r / RAND_MAX)); sup_trig_update = time(NULL) + t; return t; From owner-svn-src-all@freebsd.org Fri Jan 13 08:29:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C81F4CA515B; Fri, 13 Jan 2017 08:29:41 +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 7BF4310DE; Fri, 13 Jan 2017 08:29:41 +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 v0D8TeAU045110; Fri, 13 Jan 2017 08:29:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8Terp045109; Fri, 13 Jan 2017 08:29:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130829.v0D8Terp045109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312024 - stable/11/tools/tools/gensnmpdef X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:29:41 -0000 Author: ngie Date: Fri Jan 13 08:29:40 2017 New Revision: 312024 URL: https://svnweb.freebsd.org/changeset/base/312024 Log: MFC r311511: Add integration makefile for contrib/bsnmp/gensnmpdef It's a whole lot less error prone than generating the file completely by hand. Added: stable/11/tools/tools/gensnmpdef/ - copied from r311511, head/tools/tools/gensnmpdef/ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Fri Jan 13 08:29:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3D0FCA5183; Fri, 13 Jan 2017 08:29:44 +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 79DA510DF; Fri, 13 Jan 2017 08:29: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 v0D8ThNw045156; Fri, 13 Jan 2017 08:29:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8Th3J045155; Fri, 13 Jan 2017 08:29:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130829.v0D8Th3J045155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312025 - stable/10/tools/tools/gensnmpdef X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:29:44 -0000 Author: ngie Date: Fri Jan 13 08:29:43 2017 New Revision: 312025 URL: https://svnweb.freebsd.org/changeset/base/312025 Log: MFC r311511: Add integration makefile for contrib/bsnmp/gensnmpdef It's a whole lot less error prone than generating the file completely by hand. Added: stable/10/tools/tools/gensnmpdef/ - copied from r311511, head/tools/tools/gensnmpdef/ Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Fri Jan 13 08:31:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAAC7CA539F; Fri, 13 Jan 2017 08:31:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 838991657; Fri, 13 Jan 2017 08:31:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8VuOj048899; Fri, 13 Jan 2017 08:31:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8VuFa048892; Fri, 13 Jan 2017 08:31:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701130831.v0D8VuFa048892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Jan 2017 08:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312026 - in head/sys/cam: . ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:31:57 -0000 Author: mav Date: Fri Jan 13 08:31:55 2017 New Revision: 312026 URL: https://svnweb.freebsd.org/changeset/base/312026 Log: Improve CAM_CDB_POINTER support. MFC after: 2 weeks Modified: head/sys/cam/cam_ccb.h head/sys/cam/cam_periph.c head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/scsi_ctl.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Fri Jan 13 08:29:43 2017 (r312025) +++ head/sys/cam/cam_ccb.h Fri Jan 13 08:31:55 2017 (r312026) @@ -784,6 +784,13 @@ struct ccb_accept_tio { struct scsi_sense_data sense_data; }; +static __inline uint8_t * +atio_cdb_ptr(struct ccb_accept_tio *ccb) +{ + return ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? + ccb->cdb_io.cdb_ptr : ccb->cdb_io.cdb_bytes); +} + /* Release SIM Queue */ struct ccb_relsim { struct ccb_hdr ccb_h; Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Fri Jan 13 08:29:43 2017 (r312025) +++ head/sys/cam/cam_periph.c Fri Jan 13 08:31:55 2017 (r312026) @@ -1930,10 +1930,7 @@ cam_periph_devctl_notify(union ccb *ccb) if (ccb->ccb_h.func_code == XPT_SCSI_IO) { sbuf_printf(&sb, "CDB=\""); - if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0) - scsi_cdb_sbuf(ccb->csio.cdb_io.cdb_ptr, &sb); - else - scsi_cdb_sbuf(ccb->csio.cdb_io.cdb_bytes, &sb); + scsi_cdb_sbuf(scsiio_cdb_ptr(&ccb->csio), &sb); sbuf_printf(&sb, "\" "); } else if (ccb->ccb_h.func_code == XPT_ATA_IO) { sbuf_printf(&sb, "ACB=\""); Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Jan 13 08:29:43 2017 (r312025) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Jan 13 08:31:55 2017 (r312026) @@ -587,8 +587,7 @@ cfcs_action(struct cam_sim *sim, union c __func__, csio->cdb_len, sizeof(io->scsiio.cdb)); } io->scsiio.cdb_len = min(csio->cdb_len, sizeof(io->scsiio.cdb)); - bcopy(csio->cdb_io.cdb_bytes, io->scsiio.cdb, - io->scsiio.cdb_len); + bcopy(scsiio_cdb_ptr(csio), io->scsiio.cdb, io->scsiio.cdb_len); ccb->ccb_h.status |= CAM_SIM_QUEUED; err = ctl_queue(io); Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Fri Jan 13 08:29:43 2017 (r312025) +++ head/sys/cam/ctl/scsi_ctl.c Fri Jan 13 08:31:55 2017 (r312026) @@ -941,7 +941,7 @@ ctlfestart(struct cam_periph *periph, un && (csio->sglist_cnt != 0))) { printf("%s: tag %04x cdb %02x flags %#x dxfer_len " "%d sg %u\n", __func__, atio->tag_id, - atio->cdb_io.cdb_bytes[0], flags, dxfer_len, + atio_cdb_ptr(atio)[0], flags, dxfer_len, csio->sglist_cnt); printf("%s: tag %04x io status %#x\n", __func__, atio->tag_id, io->io_hdr.status); @@ -1027,8 +1027,7 @@ ctlfe_adjust_cdb(struct ccb_accept_tio * { uint64_t lba; uint32_t num_blocks, nbc; - uint8_t *cmdbyt = (atio->ccb_h.flags & CAM_CDB_POINTER)? - atio->cdb_io.cdb_ptr : atio->cdb_io.cdb_bytes; + uint8_t *cmdbyt = atio_cdb_ptr(atio); nbc = offset >> 9; /* ASSUMING 512 BYTE BLOCKS */ @@ -1206,8 +1205,7 @@ ctlfedone(struct cam_periph *periph, uni __func__, atio->cdb_len, sizeof(io->scsiio.cdb)); } io->scsiio.cdb_len = min(atio->cdb_len, sizeof(io->scsiio.cdb)); - bcopy(atio->cdb_io.cdb_bytes, io->scsiio.cdb, - io->scsiio.cdb_len); + bcopy(atio_cdb_ptr(atio), io->scsiio.cdb, io->scsiio.cdb_len); #ifdef CTLFEDEBUG printf("%s: %u:%u:%u: tag %04x CDB %02x\n", __func__, @@ -1388,7 +1386,7 @@ ctlfedone(struct cam_periph *periph, uni printf("%s: tag %04x no status or " "len cdb = %02x\n", __func__, atio->tag_id, - atio->cdb_io.cdb_bytes[0]); + atio_cdb_ptr(atio)[0]); printf("%s: tag %04x io status %#x\n", __func__, atio->tag_id, io->io_hdr.status); Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Fri Jan 13 08:29:43 2017 (r312025) +++ head/sys/cam/scsi/scsi_all.c Fri Jan 13 08:31:55 2017 (r312026) @@ -3617,15 +3617,9 @@ scsi_command_string(struct cam_device *d #endif /* _KERNEL/!_KERNEL */ - if ((csio->ccb_h.flags & CAM_CDB_POINTER) != 0) { - sbuf_printf(sb, "%s. CDB: ", - scsi_op_desc(csio->cdb_io.cdb_ptr[0], inq_data)); - scsi_cdb_sbuf(csio->cdb_io.cdb_ptr, sb); - } else { - sbuf_printf(sb, "%s. CDB: ", - scsi_op_desc(csio->cdb_io.cdb_bytes[0], inq_data)); - scsi_cdb_sbuf(csio->cdb_io.cdb_bytes, sb); - } + sbuf_printf(sb, "%s. CDB: ", + scsi_op_desc(scsiio_cdb_ptr(csio)[0], inq_data)); + scsi_cdb_sbuf(scsiio_cdb_ptr(csio), sb); #ifdef _KERNEL xpt_free_ccb((union ccb *)cgd); @@ -5030,7 +5024,6 @@ scsi_sense_sbuf(struct cam_device *devic struct ccb_getdev *cgd; #endif /* _KERNEL */ char path_str[64]; - uint8_t *cdb; #ifndef _KERNEL if (device == NULL) @@ -5128,14 +5121,9 @@ scsi_sense_sbuf(struct cam_device *devic sense = &csio->sense_data; } - if (csio->ccb_h.flags & CAM_CDB_POINTER) - cdb = csio->cdb_io.cdb_ptr; - else - cdb = csio->cdb_io.cdb_bytes; - scsi_sense_only_sbuf(sense, csio->sense_len - csio->sense_resid, sb, - path_str, inq_data, cdb, csio->cdb_len); - + path_str, inq_data, scsiio_cdb_ptr(csio), csio->cdb_len); + #ifdef _KERNEL xpt_free_ccb((union ccb*)cgd); #endif /* _KERNEL/!_KERNEL */ Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Fri Jan 13 08:29:43 2017 (r312025) +++ head/sys/cam/scsi/scsi_xpt.c Fri Jan 13 08:31:55 2017 (r312026) @@ -3139,6 +3139,6 @@ scsi_proto_debug_out(union ccb *ccb) device = ccb->ccb_h.path->device; CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_CDB,("%s. CDB: %s\n", - scsi_op_desc(ccb->csio.cdb_io.cdb_bytes[0], &device->inq_data), - scsi_cdb_string(ccb->csio.cdb_io.cdb_bytes, cdb_str, sizeof(cdb_str)))); + scsi_op_desc(scsiio_cdb_ptr(&ccb->csio)[0], &device->inq_data), + scsi_cdb_string(scsiio_cdb_ptr(&ccb->csio), cdb_str, sizeof(cdb_str)))); } From owner-svn-src-all@freebsd.org Fri Jan 13 08:35:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FF63CA5512; Fri, 13 Jan 2017 08:35:02 +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 6F0C818DC; Fri, 13 Jan 2017 08:35:02 +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 v0D8Z1CD049156; Fri, 13 Jan 2017 08:35:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8Z1SK049155; Fri, 13 Jan 2017 08:35:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130835.v0D8Z1SK049155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312027 - stable/11/contrib/netbsd-tests/lib/libc/ttyio X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:35:02 -0000 Author: ngie Date: Fri Jan 13 08:35:01 2017 New Revision: 312027 URL: https://svnweb.freebsd.org/changeset/base/312027 Log: MFC r311871: Merge ^/vendor/NetBSD/tests/dist@r311868 This is the vendor accepted version of ^/head@r311245 Modified: stable/11/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Fri Jan 13 08:31:55 2017 (r312026) +++ stable/11/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Fri Jan 13 08:35:01 2017 (r312027) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $ */ +/* $NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $ */ /* * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $"); +__RCSID("$NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $"); #include #include @@ -150,11 +150,9 @@ ATF_TC_BODY(ioctl, tc) /* wait for last child */ sa.sa_handler = SIG_DFL; REQUIRE_ERRNO(sigaction(SIGCHLD, &sa, NULL), -1); - (void) wait(NULL); + (void)wait(NULL); -#ifdef __FreeBSD__ (void)close(s); -#endif ATF_REQUIRE_EQ(rc, 0); } From owner-svn-src-all@freebsd.org Fri Jan 13 08:36:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36E7FCA55EF; Fri, 13 Jan 2017 08:36: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 009E71A6E; Fri, 13 Jan 2017 08:36: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 v0D8aFRF049264; Fri, 13 Jan 2017 08:36:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8aFvx049263; Fri, 13 Jan 2017 08:36:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130836.v0D8aFvx049263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312028 - stable/10/contrib/netbsd-tests/lib/libc/ttyio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:36:16 -0000 Author: ngie Date: Fri Jan 13 08:36:14 2017 New Revision: 312028 URL: https://svnweb.freebsd.org/changeset/base/312028 Log: MFC r311871: Merge ^/vendor/NetBSD/tests/dist@r311868 This is the vendor accepted version of ^/head@r311245 Modified: stable/10/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Fri Jan 13 08:35:01 2017 (r312027) +++ stable/10/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Fri Jan 13 08:36:14 2017 (r312028) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $ */ +/* $NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $ */ /* * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $"); +__RCSID("$NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $"); #include #include @@ -150,11 +150,9 @@ ATF_TC_BODY(ioctl, tc) /* wait for last child */ sa.sa_handler = SIG_DFL; REQUIRE_ERRNO(sigaction(SIGCHLD, &sa, NULL), -1); - (void) wait(NULL); + (void)wait(NULL); -#ifdef __FreeBSD__ (void)close(s); -#endif ATF_REQUIRE_EQ(rc, 0); } From owner-svn-src-all@freebsd.org Fri Jan 13 08:37:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AE45CA5717; Fri, 13 Jan 2017 08:37: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 2C3591E13; Fri, 13 Jan 2017 08:37: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 v0D8bdL4049691; Fri, 13 Jan 2017 08:37:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8bdka049690; Fri, 13 Jan 2017 08:37:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130837.v0D8bdka049690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312029 - stable/11/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:37:40 -0000 Author: ngie Date: Fri Jan 13 08:37:39 2017 New Revision: 312029 URL: https://svnweb.freebsd.org/changeset/base/312029 Log: MFC r311870: Merge the grammar fix for lib/libc/gen/raise_test:raise_stress Modified: stable/11/contrib/netbsd-tests/lib/libc/gen/t_raise.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/gen/t_raise.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/gen/t_raise.c Fri Jan 13 08:36:14 2017 (r312028) +++ stable/11/contrib/netbsd-tests/lib/libc/gen/t_raise.c Fri Jan 13 08:37:39 2017 (r312029) @@ -1,4 +1,4 @@ -/* $NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $ */ +/* $NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $"); +__RCSID("$NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $"); #include @@ -180,7 +180,7 @@ ATF_TC_BODY(raise_stress, tc) (void)raise(SIGUSR1); if (count != maxiter) - atf_tc_fail("not all signals were catched"); + atf_tc_fail("not all signals were caught"); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Fri Jan 13 08:38:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10ADDCA579E; Fri, 13 Jan 2017 08:38: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 D44A01F9F; Fri, 13 Jan 2017 08:38:30 +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 v0D8cUIT049775; Fri, 13 Jan 2017 08:38:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8cUgp049774; Fri, 13 Jan 2017 08:38:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130838.v0D8cUgp049774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312030 - stable/10/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:38:31 -0000 Author: ngie Date: Fri Jan 13 08:38:29 2017 New Revision: 312030 URL: https://svnweb.freebsd.org/changeset/base/312030 Log: MFC r311870: Merge the grammar fix for lib/libc/gen/raise_test:raise_stress Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c Fri Jan 13 08:37:39 2017 (r312029) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c Fri Jan 13 08:38:29 2017 (r312030) @@ -1,4 +1,4 @@ -/* $NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $ */ +/* $NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $"); +__RCSID("$NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $"); #include @@ -180,7 +180,7 @@ ATF_TC_BODY(raise_stress, tc) (void)raise(SIGUSR1); if (count != maxiter) - atf_tc_fail("not all signals were catched"); + atf_tc_fail("not all signals were caught"); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Fri Jan 13 08:39:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA238CA5829; Fri, 13 Jan 2017 08:39: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 9207F1110; Fri, 13 Jan 2017 08:39:24 +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 v0D8dN9o049892; Fri, 13 Jan 2017 08:39:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8dNPU049888; Fri, 13 Jan 2017 08:39:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130839.v0D8dNPU049888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312031 - stable/11/lib/libutil X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:39:24 -0000 Author: ngie Date: Fri Jan 13 08:39:23 2017 New Revision: 312031 URL: https://svnweb.freebsd.org/changeset/base/312031 Log: MFC r311714: lib/libutil/kinfo_*: style cleanup - Use nitems(mib) instead of hardcoding mib's length - Sort sys/ #includes Modified: stable/11/lib/libutil/kinfo_getallproc.c stable/11/lib/libutil/kinfo_getfile.c stable/11/lib/libutil/kinfo_getproc.c stable/11/lib/libutil/kinfo_getvmmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libutil/kinfo_getallproc.c ============================================================================== --- stable/11/lib/libutil/kinfo_getallproc.c Fri Jan 13 08:38:29 2017 (r312030) +++ stable/11/lib/libutil/kinfo_getallproc.c Fri Jan 13 08:39:23 2017 (r312031) @@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -75,14 +75,14 @@ kinfo_getallproc(int *cntp) mib[2] = KERN_PROC_PROC; len = 0; - if (sysctl(mib, 3, NULL, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) return (NULL); kipp = malloc(len); if (kipp == NULL) return (NULL); - if (sysctl(mib, 3, kipp, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), kipp, &len, NULL, 0) < 0) goto bad; if (len % sizeof(*kipp) != 0) goto bad; Modified: stable/11/lib/libutil/kinfo_getfile.c ============================================================================== --- stable/11/lib/libutil/kinfo_getfile.c Fri Jan 13 08:38:29 2017 (r312030) +++ stable/11/lib/libutil/kinfo_getfile.c Fri Jan 13 08:39:23 2017 (r312031) @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -26,14 +26,14 @@ kinfo_getfile(pid_t pid, int *cntp) mib[2] = KERN_PROC_FILEDESC; mib[3] = pid; - error = sysctl(mib, 4, NULL, &len, NULL, 0); + error = sysctl(mib, nitems(mib), NULL, &len, NULL, 0); if (error) return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) return (NULL); - error = sysctl(mib, 4, buf, &len, NULL, 0); + error = sysctl(mib, nitems(mib), buf, &len, NULL, 0); if (error) { free(buf); return (NULL); Modified: stable/11/lib/libutil/kinfo_getproc.c ============================================================================== --- stable/11/lib/libutil/kinfo_getproc.c Fri Jan 13 08:38:29 2017 (r312030) +++ stable/11/lib/libutil/kinfo_getproc.c Fri Jan 13 08:39:23 2017 (r312031) @@ -30,8 +30,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -49,14 +49,14 @@ kinfo_getproc(pid_t pid) mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID; mib[3] = pid; - if (sysctl(mib, 4, NULL, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) return (NULL); kipp = malloc(len); if (kipp == NULL) return (NULL); - if (sysctl(mib, 4, kipp, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), kipp, &len, NULL, 0) < 0) goto bad; if (len != sizeof(*kipp)) goto bad; Modified: stable/11/lib/libutil/kinfo_getvmmap.c ============================================================================== --- stable/11/lib/libutil/kinfo_getvmmap.c Fri Jan 13 08:38:29 2017 (r312030) +++ stable/11/lib/libutil/kinfo_getvmmap.c Fri Jan 13 08:39:23 2017 (r312031) @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -26,14 +26,14 @@ kinfo_getvmmap(pid_t pid, int *cntp) mib[2] = KERN_PROC_VMMAP; mib[3] = pid; - error = sysctl(mib, 4, NULL, &len, NULL, 0); + error = sysctl(mib, nitems(mib), NULL, &len, NULL, 0); if (error) return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) return (NULL); - error = sysctl(mib, 4, buf, &len, NULL, 0); + error = sysctl(mib, nitems(mib), buf, &len, NULL, 0); if (error) { free(buf); return (NULL); From owner-svn-src-all@freebsd.org Fri Jan 13 08:39:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D241BCA58B2; Fri, 13 Jan 2017 08:39:41 +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 ACB7E124D; Fri, 13 Jan 2017 08:39:41 +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 v0D8deu9049953; Fri, 13 Jan 2017 08:39:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8def3049949; Fri, 13 Jan 2017 08:39:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130839.v0D8def3049949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312032 - stable/10/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:39:41 -0000 Author: ngie Date: Fri Jan 13 08:39:40 2017 New Revision: 312032 URL: https://svnweb.freebsd.org/changeset/base/312032 Log: MFC r311714: lib/libutil/kinfo_*: style cleanup - Use nitems(mib) instead of hardcoding mib's length - Sort sys/ #includes Modified: stable/10/lib/libutil/kinfo_getallproc.c stable/10/lib/libutil/kinfo_getfile.c stable/10/lib/libutil/kinfo_getproc.c stable/10/lib/libutil/kinfo_getvmmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/kinfo_getallproc.c ============================================================================== --- stable/10/lib/libutil/kinfo_getallproc.c Fri Jan 13 08:39:23 2017 (r312031) +++ stable/10/lib/libutil/kinfo_getallproc.c Fri Jan 13 08:39:40 2017 (r312032) @@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -75,14 +75,14 @@ kinfo_getallproc(int *cntp) mib[2] = KERN_PROC_PROC; len = 0; - if (sysctl(mib, 3, NULL, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) return (NULL); kipp = malloc(len); if (kipp == NULL) return (NULL); - if (sysctl(mib, 3, kipp, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), kipp, &len, NULL, 0) < 0) goto bad; if (len % sizeof(*kipp) != 0) goto bad; Modified: stable/10/lib/libutil/kinfo_getfile.c ============================================================================== --- stable/10/lib/libutil/kinfo_getfile.c Fri Jan 13 08:39:23 2017 (r312031) +++ stable/10/lib/libutil/kinfo_getfile.c Fri Jan 13 08:39:40 2017 (r312032) @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -26,14 +26,14 @@ kinfo_getfile(pid_t pid, int *cntp) mib[2] = KERN_PROC_FILEDESC; mib[3] = pid; - error = sysctl(mib, 4, NULL, &len, NULL, 0); + error = sysctl(mib, nitems(mib), NULL, &len, NULL, 0); if (error) return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) return (NULL); - error = sysctl(mib, 4, buf, &len, NULL, 0); + error = sysctl(mib, nitems(mib), buf, &len, NULL, 0); if (error) { free(buf); return (NULL); Modified: stable/10/lib/libutil/kinfo_getproc.c ============================================================================== --- stable/10/lib/libutil/kinfo_getproc.c Fri Jan 13 08:39:23 2017 (r312031) +++ stable/10/lib/libutil/kinfo_getproc.c Fri Jan 13 08:39:40 2017 (r312032) @@ -30,8 +30,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -49,14 +49,14 @@ kinfo_getproc(pid_t pid) mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID; mib[3] = pid; - if (sysctl(mib, 4, NULL, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) return (NULL); kipp = malloc(len); if (kipp == NULL) return (NULL); - if (sysctl(mib, 4, kipp, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), kipp, &len, NULL, 0) < 0) goto bad; if (len != sizeof(*kipp)) goto bad; Modified: stable/10/lib/libutil/kinfo_getvmmap.c ============================================================================== --- stable/10/lib/libutil/kinfo_getvmmap.c Fri Jan 13 08:39:23 2017 (r312031) +++ stable/10/lib/libutil/kinfo_getvmmap.c Fri Jan 13 08:39:40 2017 (r312032) @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -26,14 +26,14 @@ kinfo_getvmmap(pid_t pid, int *cntp) mib[2] = KERN_PROC_VMMAP; mib[3] = pid; - error = sysctl(mib, 4, NULL, &len, NULL, 0); + error = sysctl(mib, nitems(mib), NULL, &len, NULL, 0); if (error) return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) return (NULL); - error = sysctl(mib, 4, buf, &len, NULL, 0); + error = sysctl(mib, nitems(mib), buf, &len, NULL, 0); if (error) { free(buf); return (NULL); From owner-svn-src-all@freebsd.org Fri Jan 13 08:40:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13B4ACA59DB; Fri, 13 Jan 2017 08:40:30 +0000 (UTC) (envelope-from julien.charbon@gmail.com) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) (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 BC33914AE; Fri, 13 Jan 2017 08:40:29 +0000 (UTC) (envelope-from julien.charbon@gmail.com) Received: by mail-lf0-f68.google.com with SMTP id q89so4622335lfi.1; Fri, 13 Jan 2017 00:40:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=TmS09Q20QEsG1oDwQ/Z0U9o88LW1G3KSo3gj5ZANfeU=; b=dujVq1GkW9eUFld6mvICFpOg8u06RaArJsAF46QD95bnmzXzToQ1c7b9xzVE81QBpW RYZdne9F19bxUjFvThTN4T5S8UKQl54XR4iIDdD+OLlzJ9UYKb6q1eOvJyZTZPxJ5Lra JzsIxa1OtJe7+YVl1wqqvsTUxGEKN0DQCCTgL72Z+sSuiI8lf3Oe5ooK2g6nsEBErAHJ 1M8V/zZE6/hwnfZtfwSr+81vjY26JOWOLjH7Tgw971mJkmZ/v60WqxT27XXlenNkU2kw eCC6ts78CEHRqfBC0dJJkzm220OmBJwisSiq5fZ4XJxcKgg3+CNU8jfHU1xbRN1l8JBo dO8g== X-Gm-Message-State: AIkVDXINSr3BAGzP4yJCeb3ZBZw+QiiKeCb9FHemuNdOLDKvk1b0B2P+qaBQzrq3DesxmQ== X-Received: by 10.25.13.18 with SMTP id 18mr5869116lfn.43.1484295060010; Fri, 13 Jan 2017 00:11:00 -0800 (PST) Received: from [10.5.50.241] (125.226.200.213.static.wline.lns.sme.cust.swisscom.ch. [213.200.226.125]) by smtp.gmail.com with ESMTPSA id d135sm3355982lfg.12.2017.01.13.00.10.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 00:10:59 -0800 (PST) Subject: Re: svn commit: r304218 - head/sys/netinet To: Randall Stewart , Slawa Olhovchenkov References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <20160816131805.GK22212@zxy.spb.ru> <16561701-B1C6-4BE3-B9BA-3535F564620F@netflix.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Julien Charbon Message-ID: <88223427-eb42-d741-033b-6b1d0d284719@freebsd.org> Date: Fri, 13 Jan 2017 09:10:51 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <16561701-B1C6-4BE3-B9BA-3535F564620F@netflix.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="v5q95kLA2MG3UGQnr9Wm3FREm9TTM72q0" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:40:30 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --v5q95kLA2MG3UGQnr9Wm3FREm9TTM72q0 Content-Type: multipart/mixed; boundary="o1BMqbN0huGTO6ooXGSso8MQ2pX0qqNUK"; protected-headers="v1" From: Julien Charbon To: Randall Stewart , Slawa Olhovchenkov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <88223427-eb42-d741-033b-6b1d0d284719@freebsd.org> Subject: Re: svn commit: r304218 - head/sys/netinet References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <20160816131805.GK22212@zxy.spb.ru> <16561701-B1C6-4BE3-B9BA-3535F564620F@netflix.com> In-Reply-To: <16561701-B1C6-4BE3-B9BA-3535F564620F@netflix.com> --o1BMqbN0huGTO6ooXGSso8MQ2pX0qqNUK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, On 8/16/16 3:21 PM, Randall Stewart via svn-src-all wrote: >=20 > In theory it *could* be MFC=E2=80=99d to stable-10 and 11 but I am not = sure we want to do that. I am > told by Drew that it does improve performance since in stable-10 you ar= e getting the INFO_WLOCK() > but I am not sure if folks want it MFC=E2=80=99d=E2=80=A6 > > R A bit late in the game but for information: Since r309108,in stable-10 you are getting the INFO_RLOCK instead of the INFO_WLOCK like in stable-11 and HEAD: https://svnweb.freebsd.org/base?view=3Drevision&revision=3D309108 In summary the same TCP INP_INFO lock logic is used in stable-10, 11 and HEAD which simplify MFC if needed. My 2 cents. -- Julien --o1BMqbN0huGTO6ooXGSso8MQ2pX0qqNUK-- --v5q95kLA2MG3UGQnr9Wm3FREm9TTM72q0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJYeIuTAAoJEKVlQ5Je6dhxu9AIALpWPKK82sL+XIdcO3xrmQFk 8doYfqGAtGu4veESWpcamDFvYmgFDii5VebxMWda3nQ++2U6c1GP9C68bGhj6dyI wV58qs1eDA1+uAb+p1X5kI7RgRGsbwcJvJ1KCx8h4M1huPPQ+4gwzwl9cjPhL1UC jOgIaD43/SNnc2bVc2RsFkrlKUv0JD5sHHq8sgzv1UvVMIRCqYib9RBhKhwccDIb FZfJY8nMxVPSXdYRlyetRnjdg1i+NOxLZLZeA++b3ZeeMloITcaeygkWj9Kb96K5 BhWTvqhTWqy216234+6JY9C2KK4xwFUAajdQti6KegoyKPU/fbEeFWx6Nj2+6do= =EuF1 -----END PGP SIGNATURE----- --v5q95kLA2MG3UGQnr9Wm3FREm9TTM72q0-- From owner-svn-src-all@freebsd.org Fri Jan 13 08:40:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 192AECA5A8A; Fri, 13 Jan 2017 08:40:55 +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 DC69E16F1; Fri, 13 Jan 2017 08:40:54 +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 v0D8es3L050995; Fri, 13 Jan 2017 08:40:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8esCO050976; Fri, 13 Jan 2017 08:40:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130840.v0D8esCO050976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312033 - stable/11/usr.sbin/rwhod X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:40:55 -0000 Author: ngie Date: Fri Jan 13 08:40:53 2017 New Revision: 312033 URL: https://svnweb.freebsd.org/changeset/base/312033 Log: MFC r311709: Style(9) fixes - Sort sys/ #includes - Use nitems instead of hardcoding the length of `mib` Modified: stable/11/usr.sbin/rwhod/rwhod.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/rwhod/rwhod.c ============================================================================== --- stable/11/usr.sbin/rwhod/rwhod.c Fri Jan 13 08:39:40 2017 (r312032) +++ stable/11/usr.sbin/rwhod/rwhod.c Fri Jan 13 08:40:53 2017 (r312033) @@ -43,14 +43,14 @@ static char sccsid[] = "@(#)rwhod.c 8.1 #include __FBSDID("$FreeBSD$"); -#include #include +#include +#include +#include #include #include #include -#include #include -#include #include #include @@ -548,7 +548,7 @@ getboottime(int signo __unused) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(tm); - if (sysctl(mib, 2, &tm, &size, NULL, 0) == -1) { + if (sysctl(mib, nitems(mib), &tm, &size, NULL, 0) == -1) { syslog(LOG_ERR, "cannot get boottime: %m"); exit(1); } @@ -629,11 +629,11 @@ configure(int so) mib[3] = AF_INET; mib[4] = NET_RT_IFLIST; mib[5] = 0; - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) quit("route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) quit("malloc"); - if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), buf, &needed, NULL, 0) < 0) quit("actual retrieval of interface table"); lim = buf + needed; From owner-svn-src-all@freebsd.org Fri Jan 13 08:41:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25D9DCA5AD8; Fri, 13 Jan 2017 08:41: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 E7300177A; Fri, 13 Jan 2017 08:40:59 +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 v0D8exaO051650; Fri, 13 Jan 2017 08:40:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8extn051649; Fri, 13 Jan 2017 08:40:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130840.v0D8extn051649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312034 - stable/10/usr.sbin/rwhod X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:41:00 -0000 Author: ngie Date: Fri Jan 13 08:40:58 2017 New Revision: 312034 URL: https://svnweb.freebsd.org/changeset/base/312034 Log: MFC r311709: Style(9) fixes - Sort sys/ #includes - Use nitems instead of hardcoding the length of `mib` Modified: stable/10/usr.sbin/rwhod/rwhod.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rwhod/rwhod.c ============================================================================== --- stable/10/usr.sbin/rwhod/rwhod.c Fri Jan 13 08:40:53 2017 (r312033) +++ stable/10/usr.sbin/rwhod/rwhod.c Fri Jan 13 08:40:58 2017 (r312034) @@ -43,14 +43,14 @@ static char sccsid[] = "@(#)rwhod.c 8.1 #include __FBSDID("$FreeBSD$"); -#include #include +#include +#include +#include #include #include #include -#include #include -#include #include #include @@ -549,7 +549,7 @@ getboottime(int signo __unused) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(tm); - if (sysctl(mib, 2, &tm, &size, NULL, 0) == -1) { + if (sysctl(mib, nitems(mib), &tm, &size, NULL, 0) == -1) { syslog(LOG_ERR, "cannot get boottime: %m"); exit(1); } @@ -630,11 +630,11 @@ configure(int so) mib[3] = AF_INET; mib[4] = NET_RT_IFLIST; mib[5] = 0; - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) quit("route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) quit("malloc"); - if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), buf, &needed, NULL, 0) < 0) quit("actual retrieval of interface table"); lim = buf + needed; From owner-svn-src-all@freebsd.org Fri Jan 13 08:42:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65A0ECA5D70; Fri, 13 Jan 2017 08:42:07 +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 205571CBA; Fri, 13 Jan 2017 08:42:07 +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 v0D8g6I9053864; Fri, 13 Jan 2017 08:42:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8g6Po053863; Fri, 13 Jan 2017 08:42:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130842.v0D8g6Po053863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312035 - stable/11/lib/libprocstat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:42:07 -0000 Author: ngie Date: Fri Jan 13 08:42:05 2017 New Revision: 312035 URL: https://svnweb.freebsd.org/changeset/base/312035 Log: MFC r311715: Use nitems({mib,name}) instead of hardcoding their value Modified: stable/11/lib/libprocstat/libprocstat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libprocstat/libprocstat.c ============================================================================== --- stable/11/lib/libprocstat/libprocstat.c Fri Jan 13 08:40:58 2017 (r312034) +++ stable/11/lib/libprocstat/libprocstat.c Fri Jan 13 08:42:05 2017 (r312035) @@ -282,7 +282,7 @@ procstat_getprocs(struct procstat *procs name[1] = KERN_PROC; name[2] = what; name[3] = arg; - error = sysctl(name, 4, NULL, &len, NULL, 0); + error = sysctl(name, nitems(name), NULL, &len, NULL, 0); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); goto fail; @@ -299,7 +299,7 @@ procstat_getprocs(struct procstat *procs goto fail; } olen = len; - error = sysctl(name, 4, p, &len, NULL, 0); + error = sysctl(name, nitems(name), p, &len, NULL, 0); } while (error < 0 && errno == ENOMEM && olen == len); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); @@ -1760,7 +1760,7 @@ getargv(struct procstat *procstat, struc name[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; name[3] = kp->ki_pid; len = nchr; - error = sysctl(name, 4, av->buf, &len, NULL, 0); + error = sysctl(name, nitems(name), av->buf, &len, NULL, 0); if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl(kern.proc.%s)", env ? "env" : "args"); if (error != 0 || len == 0) @@ -1983,7 +1983,7 @@ procstat_getgroups_sysctl(pid_t pid, uns warn("malloc(%zu)", len); return (NULL); } - if (sysctl(mib, 4, groups, &len, NULL, 0) == -1) { + if (sysctl(mib, nitems(mib), groups, &len, NULL, 0) == -1) { warn("sysctl: kern.proc.groups: %d", pid); free(groups); return (NULL); @@ -2059,7 +2059,7 @@ procstat_getumask_sysctl(pid_t pid, unsi mib[2] = KERN_PROC_UMASK; mib[3] = pid; len = sizeof(*maskp); - error = sysctl(mib, 4, maskp, &len, NULL, 0); + error = sysctl(mib, nitems(mib), maskp, &len, NULL, 0); if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.umask: %d", pid); return (error); @@ -2139,7 +2139,7 @@ procstat_getrlimit_sysctl(pid_t pid, int name[3] = pid; name[4] = which; len = sizeof(struct rlimit); - error = sysctl(name, 5, rlimit, &len, NULL, 0); + error = sysctl(name, nitems(name), rlimit, &len, NULL, 0); if (error < 0 && errno != ESRCH) { warn("sysctl: kern.proc.rlimit: %d", pid); return (-1); @@ -2201,7 +2201,7 @@ procstat_getpathname_sysctl(pid_t pid, c name[2] = KERN_PROC_PATHNAME; name[3] = pid; len = maxlen; - error = sysctl(name, 4, pathname, &len, NULL, 0); + error = sysctl(name, nitems(name), pathname, &len, NULL, 0); if (error != 0 && errno != ESRCH) warn("sysctl: kern.proc.pathname: %d", pid); if (len == 0) @@ -2281,7 +2281,7 @@ procstat_getosrel_sysctl(pid_t pid, int name[2] = KERN_PROC_OSREL; name[3] = pid; len = sizeof(*osrelp); - error = sysctl(name, 4, osrelp, &len, NULL, 0); + error = sysctl(name, nitems(name), osrelp, &len, NULL, 0); if (error != 0 && errno != ESRCH) warn("sysctl: kern.proc.osrel: %d", pid); return (error); @@ -2341,7 +2341,7 @@ is_elf32_sysctl(pid_t pid) name[2] = KERN_PROC_SV_NAME; name[3] = pid; len = sizeof(sv_name); - error = sysctl(name, 4, sv_name, &len, NULL, 0); + error = sysctl(name, nitems(name), sv_name, &len, NULL, 0); if (error != 0 || len == 0) return (0); for (i = 0; i < sizeof(elf32_sv_names) / sizeof(*elf32_sv_names); i++) { @@ -2372,7 +2372,7 @@ procstat_getauxv32_sysctl(pid_t pid, uns warn("malloc(%zu)", len); goto out; } - if (sysctl(name, 4, auxv32, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), auxv32, &len, NULL, 0) == -1) { if (errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); goto out; @@ -2421,7 +2421,7 @@ procstat_getauxv_sysctl(pid_t pid, unsig warn("malloc(%zu)", len); return (NULL); } - if (sysctl(name, 4, auxv, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), auxv, &len, NULL, 0) == -1) { if (errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); free(auxv); @@ -2482,7 +2482,7 @@ procstat_getkstack_sysctl(pid_t pid, int name[3] = pid; len = 0; - error = sysctl(name, 4, NULL, &len, NULL, 0); + error = sysctl(name, nitems(name), NULL, &len, NULL, 0); if (error < 0 && errno != ESRCH && errno != EPERM && errno != ENOENT) { warn("sysctl: kern.proc.kstack: %d", pid); return (NULL); @@ -2499,7 +2499,7 @@ procstat_getkstack_sysctl(pid_t pid, int warn("malloc(%zu)", len); return (NULL); } - if (sysctl(name, 4, kkstp, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), kkstp, &len, NULL, 0) == -1) { warn("sysctl: kern.proc.pid: %d", pid); free(kkstp); return (NULL); From owner-svn-src-all@freebsd.org Fri Jan 13 08:42:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5B45CA5DA6; Fri, 13 Jan 2017 08:42:12 +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 66F4B1CE8; Fri, 13 Jan 2017 08:42:12 +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 v0D8gBM8053912; Fri, 13 Jan 2017 08:42:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8gBsJ053911; Fri, 13 Jan 2017 08:42:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130842.v0D8gBsJ053911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312036 - stable/10/lib/libprocstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:42:12 -0000 Author: ngie Date: Fri Jan 13 08:42:11 2017 New Revision: 312036 URL: https://svnweb.freebsd.org/changeset/base/312036 Log: MFC r311715: Use nitems({mib,name}) instead of hardcoding their value Modified: stable/10/lib/libprocstat/libprocstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libprocstat/libprocstat.c ============================================================================== --- stable/10/lib/libprocstat/libprocstat.c Fri Jan 13 08:42:05 2017 (r312035) +++ stable/10/lib/libprocstat/libprocstat.c Fri Jan 13 08:42:11 2017 (r312036) @@ -282,7 +282,7 @@ procstat_getprocs(struct procstat *procs name[1] = KERN_PROC; name[2] = what; name[3] = arg; - error = sysctl(name, 4, NULL, &len, NULL, 0); + error = sysctl(name, nitems(name), NULL, &len, NULL, 0); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); goto fail; @@ -299,7 +299,7 @@ procstat_getprocs(struct procstat *procs goto fail; } olen = len; - error = sysctl(name, 4, p, &len, NULL, 0); + error = sysctl(name, nitems(name), p, &len, NULL, 0); } while (error < 0 && errno == ENOMEM && olen == len); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); @@ -1760,7 +1760,7 @@ getargv(struct procstat *procstat, struc name[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; name[3] = kp->ki_pid; len = nchr; - error = sysctl(name, 4, av->buf, &len, NULL, 0); + error = sysctl(name, nitems(name), av->buf, &len, NULL, 0); if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl(kern.proc.%s)", env ? "env" : "args"); if (error != 0 || len == 0) @@ -1983,7 +1983,7 @@ procstat_getgroups_sysctl(pid_t pid, uns warn("malloc(%zu)", len); return (NULL); } - if (sysctl(mib, 4, groups, &len, NULL, 0) == -1) { + if (sysctl(mib, nitems(mib), groups, &len, NULL, 0) == -1) { warn("sysctl: kern.proc.groups: %d", pid); free(groups); return (NULL); @@ -2059,7 +2059,7 @@ procstat_getumask_sysctl(pid_t pid, unsi mib[2] = KERN_PROC_UMASK; mib[3] = pid; len = sizeof(*maskp); - error = sysctl(mib, 4, maskp, &len, NULL, 0); + error = sysctl(mib, nitems(mib), maskp, &len, NULL, 0); if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.umask: %d", pid); return (error); @@ -2139,7 +2139,7 @@ procstat_getrlimit_sysctl(pid_t pid, int name[3] = pid; name[4] = which; len = sizeof(struct rlimit); - error = sysctl(name, 5, rlimit, &len, NULL, 0); + error = sysctl(name, nitems(name), rlimit, &len, NULL, 0); if (error < 0 && errno != ESRCH) { warn("sysctl: kern.proc.rlimit: %d", pid); return (-1); @@ -2201,7 +2201,7 @@ procstat_getpathname_sysctl(pid_t pid, c name[2] = KERN_PROC_PATHNAME; name[3] = pid; len = maxlen; - error = sysctl(name, 4, pathname, &len, NULL, 0); + error = sysctl(name, nitems(name), pathname, &len, NULL, 0); if (error != 0 && errno != ESRCH) warn("sysctl: kern.proc.pathname: %d", pid); if (len == 0) @@ -2281,7 +2281,7 @@ procstat_getosrel_sysctl(pid_t pid, int name[2] = KERN_PROC_OSREL; name[3] = pid; len = sizeof(*osrelp); - error = sysctl(name, 4, osrelp, &len, NULL, 0); + error = sysctl(name, nitems(name), osrelp, &len, NULL, 0); if (error != 0 && errno != ESRCH) warn("sysctl: kern.proc.osrel: %d", pid); return (error); @@ -2341,7 +2341,7 @@ is_elf32_sysctl(pid_t pid) name[2] = KERN_PROC_SV_NAME; name[3] = pid; len = sizeof(sv_name); - error = sysctl(name, 4, sv_name, &len, NULL, 0); + error = sysctl(name, nitems(name), sv_name, &len, NULL, 0); if (error != 0 || len == 0) return (0); for (i = 0; i < sizeof(elf32_sv_names) / sizeof(*elf32_sv_names); i++) { @@ -2372,7 +2372,7 @@ procstat_getauxv32_sysctl(pid_t pid, uns warn("malloc(%zu)", len); goto out; } - if (sysctl(name, 4, auxv32, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), auxv32, &len, NULL, 0) == -1) { if (errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); goto out; @@ -2421,7 +2421,7 @@ procstat_getauxv_sysctl(pid_t pid, unsig warn("malloc(%zu)", len); return (NULL); } - if (sysctl(name, 4, auxv, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), auxv, &len, NULL, 0) == -1) { if (errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); free(auxv); @@ -2482,7 +2482,7 @@ procstat_getkstack_sysctl(pid_t pid, int name[3] = pid; len = 0; - error = sysctl(name, 4, NULL, &len, NULL, 0); + error = sysctl(name, nitems(name), NULL, &len, NULL, 0); if (error < 0 && errno != ESRCH && errno != EPERM && errno != ENOENT) { warn("sysctl: kern.proc.kstack: %d", pid); return (NULL); @@ -2499,7 +2499,7 @@ procstat_getkstack_sysctl(pid_t pid, int warn("malloc(%zu)", len); return (NULL); } - if (sysctl(name, 4, kkstp, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), kkstp, &len, NULL, 0) == -1) { warn("sysctl: kern.proc.pid: %d", pid); free(kkstp); return (NULL); From owner-svn-src-all@freebsd.org Fri Jan 13 08:46:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8558CAB04B; Fri, 13 Jan 2017 08:46:47 +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 C3A1712BC; Fri, 13 Jan 2017 08:46:47 +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 v0D8kkCb054335; Fri, 13 Jan 2017 08:46:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8kkcD054333; Fri, 13 Jan 2017 08:46:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130846.v0D8kkcD054333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312037 - stable/11/contrib/netbsd-tests/lib/libpthread X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:46:48 -0000 Author: ngie Date: Fri Jan 13 08:46:46 2017 New Revision: 312037 URL: https://svnweb.freebsd.org/changeset/base/312037 Log: MFC r311265,r311274: r311265: fpu: ensure calls to pthread_create succeed and test sched_yield to make sure it returns 0 sched_yield tests for values returning 0 of type int and sched_yield is of type long, so the test is a mismatch CID: 1254953, 1254954, 1254965, 1254966 r311274: run: ensure pthread_condattr_{init,setclock} is successful CID: 1268631, 1268633 Modified: stable/11/contrib/netbsd-tests/lib/libpthread/t_condwait.c stable/11/contrib/netbsd-tests/lib/libpthread/t_fpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libpthread/t_condwait.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libpthread/t_condwait.c Fri Jan 13 08:42:11 2017 (r312036) +++ stable/11/contrib/netbsd-tests/lib/libpthread/t_condwait.c Fri Jan 13 08:46:46 2017 (r312037) @@ -42,6 +42,8 @@ __RCSID("$NetBSD: t_condwait.c,v 1.4 201 #ifdef __FreeBSD__ #include + +#include "h_common.h" #endif #define WAITTIME 2 /* Timeout wait secound */ @@ -60,8 +62,13 @@ run(void *param) clck = *(clockid_t *)param; +#ifdef __FreeBSD__ + PTHREAD_REQUIRE(pthread_condattr_init(&attr)); + PTHREAD_REQUIRE(pthread_condattr_setclock(&attr, clck)); +#else pthread_condattr_init(&attr); pthread_condattr_setclock(&attr, clck); /* MONOTONIC or MONOTONIC */ +#endif pthread_cond_init(&cond, &attr); ATF_REQUIRE_EQ((ret = pthread_mutex_lock(&m)), 0); Modified: stable/11/contrib/netbsd-tests/lib/libpthread/t_fpu.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libpthread/t_fpu.c Fri Jan 13 08:42:11 2017 (r312036) +++ stable/11/contrib/netbsd-tests/lib/libpthread/t_fpu.c Fri Jan 13 08:46:46 2017 (r312037) @@ -58,6 +58,11 @@ __RCSID("$NetBSD: t_fpu.c,v 1.2 2013/01/ #include +#ifdef __FreeBSD__ +#include +#include +#endif + #include "h_common.h" #define N_RECURSE 10 @@ -77,14 +82,24 @@ stir(void *p) for (;;) { x = sin ((y = cos (x + y + .4)) - (z = cos (x + z + .6))); +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(sched_yield() == 0, + "sched_yield failed: %s", strerror(errno)); +#else PTHREAD_REQUIRE(sched_yield()); +#endif } } static double mul3(double x, double y, double z) { +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(sched_yield() == 0, + "sched_yield failed: %s", strerror(errno)); +#else PTHREAD_REQUIRE(sched_yield()); +#endif return x * y * z; } @@ -114,7 +129,11 @@ bar(void *p) static void recurse(void) { pthread_t s2; +#ifdef __FreeBSD__ + PTHREAD_REQUIRE(pthread_create(&s2, 0, bar, 0)); +#else pthread_create(&s2, 0, bar, 0); +#endif sleep(20); /* XXX must be long enough for our slowest machine */ } @@ -134,7 +153,11 @@ ATF_TC_BODY(fpu, tc) PTHREAD_REQUIRE(pthread_mutex_init(&recursion_depth_lock, 0)); +#ifdef __FreeBSD__ + PTHREAD_REQUIRE(pthread_create(&s5, 0, stir, stirseed)); +#else pthread_create(&s5, 0, stir, stirseed); +#endif recurse(); atf_tc_fail("exiting from main"); From owner-svn-src-all@freebsd.org Fri Jan 13 08:46:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C849CAB063; Fri, 13 Jan 2017 08:46:50 +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 63F8F12BF; Fri, 13 Jan 2017 08:46:50 +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 v0D8knWr054384; Fri, 13 Jan 2017 08:46:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8knFJ054382; Fri, 13 Jan 2017 08:46:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130846.v0D8knFJ054382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312038 - stable/10/contrib/netbsd-tests/lib/libpthread X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:46:50 -0000 Author: ngie Date: Fri Jan 13 08:46:49 2017 New Revision: 312038 URL: https://svnweb.freebsd.org/changeset/base/312038 Log: MFC r311265,r311274: r311265: fpu: ensure calls to pthread_create succeed and test sched_yield to make sure it returns 0 sched_yield tests for values returning 0 of type int and sched_yield is of type long, so the test is a mismatch CID: 1254953, 1254954, 1254965, 1254966 r311274: run: ensure pthread_condattr_{init,setclock} is successful CID: 1268631, 1268633 Modified: stable/10/contrib/netbsd-tests/lib/libpthread/t_condwait.c stable/10/contrib/netbsd-tests/lib/libpthread/t_fpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libpthread/t_condwait.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libpthread/t_condwait.c Fri Jan 13 08:46:46 2017 (r312037) +++ stable/10/contrib/netbsd-tests/lib/libpthread/t_condwait.c Fri Jan 13 08:46:49 2017 (r312038) @@ -42,6 +42,8 @@ __RCSID("$NetBSD: t_condwait.c,v 1.4 201 #ifdef __FreeBSD__ #include + +#include "h_common.h" #endif #define WAITTIME 2 /* Timeout wait secound */ @@ -60,8 +62,13 @@ run(void *param) clck = *(clockid_t *)param; +#ifdef __FreeBSD__ + PTHREAD_REQUIRE(pthread_condattr_init(&attr)); + PTHREAD_REQUIRE(pthread_condattr_setclock(&attr, clck)); +#else pthread_condattr_init(&attr); pthread_condattr_setclock(&attr, clck); /* MONOTONIC or MONOTONIC */ +#endif pthread_cond_init(&cond, &attr); ATF_REQUIRE_EQ((ret = pthread_mutex_lock(&m)), 0); Modified: stable/10/contrib/netbsd-tests/lib/libpthread/t_fpu.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libpthread/t_fpu.c Fri Jan 13 08:46:46 2017 (r312037) +++ stable/10/contrib/netbsd-tests/lib/libpthread/t_fpu.c Fri Jan 13 08:46:49 2017 (r312038) @@ -58,6 +58,11 @@ __RCSID("$NetBSD: t_fpu.c,v 1.2 2013/01/ #include +#ifdef __FreeBSD__ +#include +#include +#endif + #include "h_common.h" #define N_RECURSE 10 @@ -77,14 +82,24 @@ stir(void *p) for (;;) { x = sin ((y = cos (x + y + .4)) - (z = cos (x + z + .6))); +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(sched_yield() == 0, + "sched_yield failed: %s", strerror(errno)); +#else PTHREAD_REQUIRE(sched_yield()); +#endif } } static double mul3(double x, double y, double z) { +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(sched_yield() == 0, + "sched_yield failed: %s", strerror(errno)); +#else PTHREAD_REQUIRE(sched_yield()); +#endif return x * y * z; } @@ -114,7 +129,11 @@ bar(void *p) static void recurse(void) { pthread_t s2; +#ifdef __FreeBSD__ + PTHREAD_REQUIRE(pthread_create(&s2, 0, bar, 0)); +#else pthread_create(&s2, 0, bar, 0); +#endif sleep(20); /* XXX must be long enough for our slowest machine */ } @@ -134,7 +153,11 @@ ATF_TC_BODY(fpu, tc) PTHREAD_REQUIRE(pthread_mutex_init(&recursion_depth_lock, 0)); +#ifdef __FreeBSD__ + PTHREAD_REQUIRE(pthread_create(&s5, 0, stir, stirseed)); +#else pthread_create(&s5, 0, stir, stirseed); +#endif recurse(); atf_tc_fail("exiting from main"); From owner-svn-src-all@freebsd.org Fri Jan 13 08:48:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0C58CAB16F; Fri, 13 Jan 2017 08:48:18 +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 B20CF1623; Fri, 13 Jan 2017 08:48:18 +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 v0D8mHrR054519; Fri, 13 Jan 2017 08:48:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8mHFI054518; Fri, 13 Jan 2017 08:48:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130848.v0D8mHFI054518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312039 - stable/10/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:48:19 -0000 Author: ngie Date: Fri Jan 13 08:48:17 2017 New Revision: 312039 URL: https://svnweb.freebsd.org/changeset/base/312039 Log: MFC r311268: Clarify lifetime of child(..) function Ensure child exits when complete as it's always run in a forked process. Add a missing break statement in :pselect_sigmask when calling child(..) for clarity and to avoid weird domino effects if the child process somehow does something it's not supposed to do with the logfiles, file descriptors, etc CID: 1223369, 1223370, 1300301 Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_select.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_select.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/sys/t_select.c Fri Jan 13 08:46:49 2017 (r312038) +++ stable/10/contrib/netbsd-tests/lib/libc/sys/t_select.c Fri Jan 13 08:48:17 2017 (r312039) @@ -135,6 +135,9 @@ child(const struct timespec *ts) "after timeout %s != %s", prmask(&nset, nbuf, sizeof(nbuf)), prmask(&oset, obuf, sizeof(obuf))); +#ifdef __FreeBSD__ + _exit(0); +#endif } ATF_TC(pselect_sigmask); @@ -154,6 +157,9 @@ ATF_TC_BODY(pselect_sigmask, tc) switch (pid = fork()) { case 0: child(NULL); +#ifdef __FreeBSD__ + break; +#endif case -1: err(1, "fork"); default: From owner-svn-src-all@freebsd.org Fri Jan 13 08:48:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C220CCAB188; Fri, 13 Jan 2017 08:48:21 +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 91E361624; Fri, 13 Jan 2017 08:48:21 +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 v0D8mKVR054567; Fri, 13 Jan 2017 08:48:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8mKoj054566; Fri, 13 Jan 2017 08:48:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130848.v0D8mKoj054566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312040 - stable/11/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:48:21 -0000 Author: ngie Date: Fri Jan 13 08:48:20 2017 New Revision: 312040 URL: https://svnweb.freebsd.org/changeset/base/312040 Log: MFC r311268: Clarify lifetime of child(..) function Ensure child exits when complete as it's always run in a forked process. Add a missing break statement in :pselect_sigmask when calling child(..) for clarity and to avoid weird domino effects if the child process somehow does something it's not supposed to do with the logfiles, file descriptors, etc CID: 1223369, 1223370, 1300301 Modified: stable/11/contrib/netbsd-tests/lib/libc/sys/t_select.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/sys/t_select.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/sys/t_select.c Fri Jan 13 08:48:17 2017 (r312039) +++ stable/11/contrib/netbsd-tests/lib/libc/sys/t_select.c Fri Jan 13 08:48:20 2017 (r312040) @@ -135,6 +135,9 @@ child(const struct timespec *ts) "after timeout %s != %s", prmask(&nset, nbuf, sizeof(nbuf)), prmask(&oset, obuf, sizeof(obuf))); +#ifdef __FreeBSD__ + _exit(0); +#endif } ATF_TC(pselect_sigmask); @@ -154,6 +157,9 @@ ATF_TC_BODY(pselect_sigmask, tc) switch (pid = fork()) { case 0: child(NULL); +#ifdef __FreeBSD__ + break; +#endif case -1: err(1, "fork"); default: From owner-svn-src-all@freebsd.org Fri Jan 13 08:49:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A2DBCAB281; Fri, 13 Jan 2017 08:49:12 +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 092C71942; Fri, 13 Jan 2017 08:49: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 v0D8nBEw054681; Fri, 13 Jan 2017 08:49:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8nBT8054680; Fri, 13 Jan 2017 08:49:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130849.v0D8nBT8054680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312041 - stable/11/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:49:12 -0000 Author: ngie Date: Fri Jan 13 08:49:10 2017 New Revision: 312041 URL: https://svnweb.freebsd.org/changeset/base/312041 Log: MFC r311282: snmp_mibII(3) requires net/if.h and net/if_mib.h Document that requirement Modified: stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.3 ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Fri Jan 13 08:48:20 2017 (r312040) +++ stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Fri Jan 13 08:49:10 2017 (r312041) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmp_mibII/snmp_mibII.3,v 1.10 2005/10/04 08:46:52 brandt_h Exp $ .\" -.Dd October 4, 2005 +.Dd January 4, 2017 .Dt SNMP_MIBII 3 .Os .Sh NAME @@ -63,6 +63,8 @@ .Sh LIBRARY .Pq begemotSnmpdModulePath."mibII" = "@MODPATH@snmp_mibII.so" .Sh SYNOPSIS +.In net/if.h +.In net/if_mib.h .In bsnmp/snmpmod.h .In bsnmp/snmp_mibII.h .Ft typedef void From owner-svn-src-all@freebsd.org Fri Jan 13 08:49:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03A67CAB2E1; Fri, 13 Jan 2017 08:49: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 C63D219F6; Fri, 13 Jan 2017 08:49: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 v0D8nN7C054738; Fri, 13 Jan 2017 08:49:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8nNWO054737; Fri, 13 Jan 2017 08:49:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130849.v0D8nNWO054737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312042 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:49:24 -0000 Author: ngie Date: Fri Jan 13 08:49:22 2017 New Revision: 312042 URL: https://svnweb.freebsd.org/changeset/base/312042 Log: MFC r311282: snmp_mibII(3) requires net/if.h and net/if_mib.h Document that requirement Modified: stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Fri Jan 13 08:49:10 2017 (r312041) +++ stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Fri Jan 13 08:49:22 2017 (r312042) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmp_mibII/snmp_mibII.3,v 1.10 2005/10/04 08:46:52 brandt_h Exp $ .\" -.Dd October 4, 2005 +.Dd January 4, 2017 .Dt SNMP_MIBII 3 .Os .Sh NAME @@ -63,6 +63,8 @@ .Sh LIBRARY .Pq begemotSnmpdModulePath."mibII" = "@MODPATH@snmp_mibII.so" .Sh SYNOPSIS +.In net/if.h +.In net/if_mib.h .In bsnmp/snmpmod.h .In bsnmp/snmp_mibII.h .Ft typedef void From owner-svn-src-all@freebsd.org Fri Jan 13 08:51:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B91CAB639; Fri, 13 Jan 2017 08:51:47 +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 5CF2D1E7D; Fri, 13 Jan 2017 08:51:47 +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 v0D8pkEU057397; Fri, 13 Jan 2017 08:51:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8pkbl057396; Fri, 13 Jan 2017 08:51:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130851.v0D8pkbl057396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312044 - stable/10/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:51:47 -0000 Author: ngie Date: Fri Jan 13 08:51:46 2017 New Revision: 312044 URL: https://svnweb.freebsd.org/changeset/base/312044 Log: MFC r311290,r311293,r311294: r311290: Use strlcpy instead of strcpy when copying the bridge name to ifr.ifr_name to avoid buffer overflows CID: 1006735, 1006737, 1006738 r311293: bridge_do_pfctl: allocate mib_name dynamically using asprintf This is being done to reduce wasted space, simplify complexity in the code, and to quell a Coverity warning about buffer overruns. warning about buffer overruns. CID: 1006736 r311294: style cleanup - bridge_pf_dump: use nitems instead of spelling it out longhand - bridge_do_pfctl: sort variables by alignment for type Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Fri Jan 13 08:51:43 2017 (r312043) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Fri Jan 13 08:51:46 2017 (r312044) @@ -485,7 +485,7 @@ bridge_set_if_up(const char* b_name, int struct ifreq ifr; bzero(&ifr, sizeof(ifr)); - strcpy(ifr.ifr_name, b_name); + strlcpy(ifr.ifr_name, b_name, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { syslog(LOG_ERR, "set bridge up: ioctl(SIOCGIFFLAGS) " "failed: %s", strerror(errno)); @@ -516,7 +516,7 @@ bridge_create(const char *b_name) struct ifreq ifr; bzero(&ifr, sizeof(ifr)); - strcpy(ifr.ifr_name, b_name); + strlcpy(ifr.ifr_name, b_name, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCIFCREATE, &ifr) < 0) { syslog(LOG_ERR, "create bridge: ioctl(SIOCIFCREATE) " @@ -549,7 +549,7 @@ bridge_destroy(const char *b_name) struct ifreq ifr; bzero(&ifr, sizeof(ifr)); - strcpy(ifr.ifr_name, b_name); + strlcpy(ifr.ifr_name, b_name, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCIFDESTROY, &ifr) < 0) { syslog(LOG_ERR, "destroy bridge: ioctl(SIOCIFDESTROY) " @@ -1459,9 +1459,9 @@ bridge_get_pfval(uint8_t which) int32_t bridge_do_pfctl(int32_t bridge_ctl, enum snmp_op op, int32_t *val) { - char mib_name[100]; - int32_t i, s_i; + char *mib_oid; size_t len, s_len; + int32_t i, s_i; if (bridge_ctl >= LEAF_begemotBridgeLayer2PfStatus) return (-2); @@ -1474,19 +1474,24 @@ bridge_do_pfctl(int32_t bridge_ctl, enum len = sizeof(i); - strcpy(mib_name, bridge_sysctl); + asprintf(&mib_oid, "%s%s", bridge_sysctl, + bridge_pf_sysctl[bridge_ctl].name); + if (mib_oid == NULL) + return (-1); - if (sysctlbyname(strcat(mib_name, - bridge_pf_sysctl[bridge_ctl].name), &i, &len, - (op == SNMP_OP_SET ? &s_i : NULL), s_len) == -1) { - syslog(LOG_ERR, "sysctl(%s%s) failed - %s", bridge_sysctl, - bridge_pf_sysctl[bridge_ctl].name, strerror(errno)); + if (sysctlbyname(mib_oid, &i, &len, (op == SNMP_OP_SET ? &s_i : NULL), + s_len) == -1) { + syslog(LOG_ERR, "sysctl(%s) failed - %s", mib_oid, + strerror(errno)); + free(mib_oid); return (-1); } bridge_pf_sysctl[bridge_ctl].val = i; *val = i; + free(mib_oid); + return (i); } @@ -1495,8 +1500,7 @@ bridge_pf_dump(void) { uint8_t i; - for (i = 0; i < sizeof(bridge_pf_sysctl) / sizeof(bridge_pf_sysctl[0]); - i++) { + for (i = 0; i < nitems(bridge_pf_sysctl); i++) { syslog(LOG_ERR, "%s%s = %d", bridge_sysctl, bridge_pf_sysctl[i].name, bridge_pf_sysctl[i].val); } From owner-svn-src-all@freebsd.org Fri Jan 13 08:51:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F34A7CAB5FD; Fri, 13 Jan 2017 08:51:44 +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 AAAC61E76; Fri, 13 Jan 2017 08:51: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 v0D8phCG057350; Fri, 13 Jan 2017 08:51:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8ph2a057349; Fri, 13 Jan 2017 08:51:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130851.v0D8ph2a057349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312043 - stable/11/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:51:45 -0000 Author: ngie Date: Fri Jan 13 08:51:43 2017 New Revision: 312043 URL: https://svnweb.freebsd.org/changeset/base/312043 Log: MFC r311290,r311293,r311294: r311290: Use strlcpy instead of strcpy when copying the bridge name to ifr.ifr_name to avoid buffer overflows CID: 1006735, 1006737, 1006738 r311293: bridge_do_pfctl: allocate mib_name dynamically using asprintf This is being done to reduce wasted space, simplify complexity in the code, and to quell a Coverity warning about buffer overruns. warning about buffer overruns. CID: 1006736 r311294: style cleanup - bridge_pf_dump: use nitems instead of spelling it out longhand - bridge_do_pfctl: sort variables by alignment for type Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Fri Jan 13 08:49:22 2017 (r312042) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Fri Jan 13 08:51:43 2017 (r312043) @@ -485,7 +485,7 @@ bridge_set_if_up(const char* b_name, int struct ifreq ifr; bzero(&ifr, sizeof(ifr)); - strcpy(ifr.ifr_name, b_name); + strlcpy(ifr.ifr_name, b_name, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { syslog(LOG_ERR, "set bridge up: ioctl(SIOCGIFFLAGS) " "failed: %s", strerror(errno)); @@ -516,7 +516,7 @@ bridge_create(const char *b_name) struct ifreq ifr; bzero(&ifr, sizeof(ifr)); - strcpy(ifr.ifr_name, b_name); + strlcpy(ifr.ifr_name, b_name, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCIFCREATE, &ifr) < 0) { syslog(LOG_ERR, "create bridge: ioctl(SIOCIFCREATE) " @@ -549,7 +549,7 @@ bridge_destroy(const char *b_name) struct ifreq ifr; bzero(&ifr, sizeof(ifr)); - strcpy(ifr.ifr_name, b_name); + strlcpy(ifr.ifr_name, b_name, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCIFDESTROY, &ifr) < 0) { syslog(LOG_ERR, "destroy bridge: ioctl(SIOCIFDESTROY) " @@ -1459,9 +1459,9 @@ bridge_get_pfval(uint8_t which) int32_t bridge_do_pfctl(int32_t bridge_ctl, enum snmp_op op, int32_t *val) { - char mib_name[100]; - int32_t i, s_i; + char *mib_oid; size_t len, s_len; + int32_t i, s_i; if (bridge_ctl >= LEAF_begemotBridgeLayer2PfStatus) return (-2); @@ -1474,19 +1474,24 @@ bridge_do_pfctl(int32_t bridge_ctl, enum len = sizeof(i); - strcpy(mib_name, bridge_sysctl); + asprintf(&mib_oid, "%s%s", bridge_sysctl, + bridge_pf_sysctl[bridge_ctl].name); + if (mib_oid == NULL) + return (-1); - if (sysctlbyname(strcat(mib_name, - bridge_pf_sysctl[bridge_ctl].name), &i, &len, - (op == SNMP_OP_SET ? &s_i : NULL), s_len) == -1) { - syslog(LOG_ERR, "sysctl(%s%s) failed - %s", bridge_sysctl, - bridge_pf_sysctl[bridge_ctl].name, strerror(errno)); + if (sysctlbyname(mib_oid, &i, &len, (op == SNMP_OP_SET ? &s_i : NULL), + s_len) == -1) { + syslog(LOG_ERR, "sysctl(%s) failed - %s", mib_oid, + strerror(errno)); + free(mib_oid); return (-1); } bridge_pf_sysctl[bridge_ctl].val = i; *val = i; + free(mib_oid); + return (i); } @@ -1495,8 +1500,7 @@ bridge_pf_dump(void) { uint8_t i; - for (i = 0; i < sizeof(bridge_pf_sysctl) / sizeof(bridge_pf_sysctl[0]); - i++) { + for (i = 0; i < nitems(bridge_pf_sysctl); i++) { syslog(LOG_ERR, "%s%s = %d", bridge_sysctl, bridge_pf_sysctl[i].name, bridge_pf_sysctl[i].val); } From owner-svn-src-all@freebsd.org Fri Jan 13 08:54:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3629FCAB73E; Fri, 13 Jan 2017 08:54:08 +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 E03D31214; Fri, 13 Jan 2017 08:54:07 +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 v0D8s7kp059156; Fri, 13 Jan 2017 08:54:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8s7At059155; Fri, 13 Jan 2017 08:54:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130854.v0D8s7At059155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312045 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:54:08 -0000 Author: ngie Date: Fri Jan 13 08:54:06 2017 New Revision: 312045 URL: https://svnweb.freebsd.org/changeset/base/312045 Log: MFC r311733: Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.c Fri Jan 13 08:51:46 2017 (r312044) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.c Fri Jan 13 08:54:06 2017 (r312045) @@ -319,7 +319,7 @@ fetch_generic_mib(struct mibif *ifp, con name[5] = IFDATA_GENERAL; len = sizeof(ifp->mib); - if (sysctl(name, 6, &ifp->mib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), &ifp->mib, &len, NULL, 0) == -1) { if (errno != ENOENT) syslog(LOG_WARNING, "sysctl(ifmib, %s) failed %m", ifp->name); @@ -480,7 +480,7 @@ mib_fetch_ifmib(struct mibif *ifp) name[3] = IFMIB_IFDATA; name[4] = ifp->sysindex; name[5] = IFDATA_LINKSPECIFIC; - if (sysctl(name, 6, NULL, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), NULL, &len, NULL, 0) == -1) { syslog(LOG_WARNING, "sysctl linkmib estimate (%s): %m", ifp->name); if (ifp->specmib != NULL) { @@ -506,7 +506,7 @@ mib_fetch_ifmib(struct mibif *ifp) ifp->specmib = newmib; ifp->specmiblen = len; } - if (sysctl(name, 6, ifp->specmib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), ifp->specmib, &len, NULL, 0) == -1) { syslog(LOG_WARNING, "sysctl linkmib (%s): %m", ifp->name); if (ifp->specmib != NULL) { ifp->specmib = NULL; @@ -902,7 +902,7 @@ mib_refresh_iflist(void) for (idx = 1; idx <= count; idx++) { name[4] = idx; len = sizeof(mib); - if (sysctl(name, 6, &mib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), &mib, &len, NULL, 0) == -1) { if (errno == ENOENT) continue; syslog(LOG_ERR, "ifmib(%u): %m", idx); @@ -1213,7 +1213,7 @@ mib_fetch_rtab(int af, int info, int arg *lenp = 0; /* initial estimate */ - if (sysctl(name, 6, NULL, lenp, NULL, 0) == -1) { + if (sysctl(name, nitems(name), NULL, lenp, NULL, 0) == -1) { syslog(LOG_ERR, "sysctl estimate (%d,%d,%d,%d,%d,%d): %m", name[0], name[1], name[2], name[3], name[4], name[5]); return (NULL); @@ -1230,7 +1230,7 @@ mib_fetch_rtab(int af, int info, int arg } buf = newbuf; - if (sysctl(name, 6, buf, lenp, NULL, 0) == 0) + if (sysctl(name, nitems(name), buf, lenp, NULL, 0) == 0) break; if (errno != ENOMEM) { From owner-svn-src-all@freebsd.org Fri Jan 13 08:54:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4DEFCAB760; Fri, 13 Jan 2017 08:54:10 +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 7A00E1215; Fri, 13 Jan 2017 08:54:10 +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 v0D8s98V059203; Fri, 13 Jan 2017 08:54:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8s9lt059202; Fri, 13 Jan 2017 08:54:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130854.v0D8s9lt059202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312046 - stable/11/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:54:10 -0000 Author: ngie Date: Fri Jan 13 08:54:09 2017 New Revision: 312046 URL: https://svnweb.freebsd.org/changeset/base/312046 Log: MFC r311733: Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3) Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII.c Fri Jan 13 08:54:06 2017 (r312045) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII.c Fri Jan 13 08:54:09 2017 (r312046) @@ -319,7 +319,7 @@ fetch_generic_mib(struct mibif *ifp, con name[5] = IFDATA_GENERAL; len = sizeof(ifp->mib); - if (sysctl(name, 6, &ifp->mib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), &ifp->mib, &len, NULL, 0) == -1) { if (errno != ENOENT) syslog(LOG_WARNING, "sysctl(ifmib, %s) failed %m", ifp->name); @@ -480,7 +480,7 @@ mib_fetch_ifmib(struct mibif *ifp) name[3] = IFMIB_IFDATA; name[4] = ifp->sysindex; name[5] = IFDATA_LINKSPECIFIC; - if (sysctl(name, 6, NULL, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), NULL, &len, NULL, 0) == -1) { syslog(LOG_WARNING, "sysctl linkmib estimate (%s): %m", ifp->name); if (ifp->specmib != NULL) { @@ -506,7 +506,7 @@ mib_fetch_ifmib(struct mibif *ifp) ifp->specmib = newmib; ifp->specmiblen = len; } - if (sysctl(name, 6, ifp->specmib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), ifp->specmib, &len, NULL, 0) == -1) { syslog(LOG_WARNING, "sysctl linkmib (%s): %m", ifp->name); if (ifp->specmib != NULL) { ifp->specmib = NULL; @@ -902,7 +902,7 @@ mib_refresh_iflist(void) for (idx = 1; idx <= count; idx++) { name[4] = idx; len = sizeof(mib); - if (sysctl(name, 6, &mib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), &mib, &len, NULL, 0) == -1) { if (errno == ENOENT) continue; syslog(LOG_ERR, "ifmib(%u): %m", idx); @@ -1213,7 +1213,7 @@ mib_fetch_rtab(int af, int info, int arg *lenp = 0; /* initial estimate */ - if (sysctl(name, 6, NULL, lenp, NULL, 0) == -1) { + if (sysctl(name, nitems(name), NULL, lenp, NULL, 0) == -1) { syslog(LOG_ERR, "sysctl estimate (%d,%d,%d,%d,%d,%d): %m", name[0], name[1], name[2], name[3], name[4], name[5]); return (NULL); @@ -1230,7 +1230,7 @@ mib_fetch_rtab(int af, int info, int arg } buf = newbuf; - if (sysctl(name, 6, buf, lenp, NULL, 0) == 0) + if (sysctl(name, nitems(name), buf, lenp, NULL, 0) == 0) break; if (errno != ENOMEM) { From owner-svn-src-all@freebsd.org Fri Jan 13 08:55:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07FDACAB848; Fri, 13 Jan 2017 08:55:39 +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 CDCCD156E; Fri, 13 Jan 2017 08:55: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 v0D8tcP0059363; Fri, 13 Jan 2017 08:55:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8tcOb059362; Fri, 13 Jan 2017 08:55:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130855.v0D8tcOb059362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312047 - stable/10/contrib/bsnmp/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:55:39 -0000 Author: ngie Date: Fri Jan 13 08:55:37 2017 New Revision: 312047 URL: https://svnweb.freebsd.org/changeset/base/312047 Log: MFC r310729: Prevent improper memory accesses after calling snmp_pdu_free and snmp_value_free snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that could happen if a pdu was reused after calling the function, and as both stack and heap allocation types are used in contrib/bsnmp and usr.sbin/bsnmpd. snmp_value_free: NULL out value->v.octetstring.octets after calling free on it to prevent a double-free from occurring. Modified: stable/10/contrib/bsnmp/lib/snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmp.c Fri Jan 13 08:54:09 2017 (r312046) +++ stable/10/contrib/bsnmp/lib/snmp.c Fri Jan 13 08:55:37 2017 (r312047) @@ -1154,8 +1154,11 @@ snmp_pdu_dump(const struct snmp_pdu *pdu void snmp_value_free(struct snmp_value *value) { - if (value->syntax == SNMP_SYNTAX_OCTETSTRING) + + if (value->syntax == SNMP_SYNTAX_OCTETSTRING) { free(value->v.octetstring.octets); + value->v.octetstring.octets = NULL; + } value->syntax = SNMP_SYNTAX_NULL; } @@ -1216,6 +1219,7 @@ snmp_pdu_free(struct snmp_pdu *pdu) for (i = 0; i < pdu->nbindings; i++) snmp_value_free(&pdu->bindings[i]); + pdu->nbindings = 0; } /* From owner-svn-src-all@freebsd.org Fri Jan 13 08:55:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D3F6CAB87A; Fri, 13 Jan 2017 08:55:42 +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 5EE64157B; Fri, 13 Jan 2017 08:55:42 +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 v0D8tfuf059414; Fri, 13 Jan 2017 08:55:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8tfYI059413; Fri, 13 Jan 2017 08:55:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130855.v0D8tfYI059413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312048 - stable/11/contrib/bsnmp/lib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:55:42 -0000 Author: ngie Date: Fri Jan 13 08:55:41 2017 New Revision: 312048 URL: https://svnweb.freebsd.org/changeset/base/312048 Log: MFC r310729: Prevent improper memory accesses after calling snmp_pdu_free and snmp_value_free snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that could happen if a pdu was reused after calling the function, and as both stack and heap allocation types are used in contrib/bsnmp and usr.sbin/bsnmpd. snmp_value_free: NULL out value->v.octetstring.octets after calling free on it to prevent a double-free from occurring. Modified: stable/11/contrib/bsnmp/lib/snmp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmp.c Fri Jan 13 08:55:37 2017 (r312047) +++ stable/11/contrib/bsnmp/lib/snmp.c Fri Jan 13 08:55:41 2017 (r312048) @@ -1154,8 +1154,11 @@ snmp_pdu_dump(const struct snmp_pdu *pdu void snmp_value_free(struct snmp_value *value) { - if (value->syntax == SNMP_SYNTAX_OCTETSTRING) + + if (value->syntax == SNMP_SYNTAX_OCTETSTRING) { free(value->v.octetstring.octets); + value->v.octetstring.octets = NULL; + } value->syntax = SNMP_SYNTAX_NULL; } @@ -1216,6 +1219,7 @@ snmp_pdu_free(struct snmp_pdu *pdu) for (i = 0; i < pdu->nbindings; i++) snmp_value_free(&pdu->bindings[i]); + pdu->nbindings = 0; } /* From owner-svn-src-all@freebsd.org Fri Jan 13 08:59:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B14CCAB94E; Fri, 13 Jan 2017 08:59:09 +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 2FC1218C2; Fri, 13 Jan 2017 08:59:09 +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 v0D8x8qY059705; Fri, 13 Jan 2017 08:59:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8x8NC059704; Fri, 13 Jan 2017 08:59:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130859.v0D8x8NC059704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312049 - stable/11/usr.sbin/bsnmpd/tools/bsnmptools X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:59:09 -0000 Author: ngie Date: Fri Jan 13 08:59:08 2017 New Revision: 312049 URL: https://svnweb.freebsd.org/changeset/base/312049 Log: MFC r310892,r310894,r310989: r310892: Don't call snmp_pdu_free(..) until finished with the pdu and when ready to allocate a new one via snmp_pdu_create(..) This fixes bsnmpwalk, so it no longer crashes after r310729 r310894: snmp_pdu_free the right object at the right time in snmptool_walk r310892 was on the right track, but unfortunately it was resolving the problem incorrectly and accidentally leaking memory in the process. - Call snmp_pdu_free on req before calling snmp_pdu_create on it at the bottom of the outer while loop - Call snmp_pdu_free on resp after calling snmpwalk_nextpdu_create in the inner loop r310989: Call snmp_pdu_free on req/resp with a consistent, correct pattern - snmp_pdu_free should be called before snmp_pdu_create is called again - snmp_pdu_free should be called on the resp to snmp_dialog when successful Tested with the following bsnmp commands: % export SNMPUSER=bsnmp SNMPPASSWD=bsnmptest % SNMP_ARGS="-A proto=sha -C context='' -K -P proto=des -v 3 -r 0" % bsnmpset $SNMP_ARGS sysLocation="MyAgent" % bsnmpget $SNMP_ARGS sysLocation % bsnmpwalk $SNMP_ARGS Modified: stable/11/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Fri Jan 13 08:55:41 2017 (r312048) +++ stable/11/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Fri Jan 13 08:59:08 2017 (r312049) @@ -400,13 +400,16 @@ snmptool_get(struct snmp_toolinfo *snmpt if (snmp_parse_resp(&resp, &req) >= 0) { snmp_output_resp(snmptoolctx, &resp, NULL); + snmp_pdu_free(&resp); break; } snmp_output_err_resp(snmptoolctx, &resp); if (GET_PDUTYPE(snmptoolctx) == SNMP_PDU_GETBULK || - !ISSET_RETRY(snmptoolctx)) + !ISSET_RETRY(snmptoolctx)) { + snmp_pdu_free(&resp); break; + } /* * Loop through the object list and set object->error to the @@ -414,15 +417,17 @@ snmptool_get(struct snmp_toolinfo *snmpt */ if (snmp_object_seterror(snmptoolctx, &(resp.bindings[resp.error_index - 1]), - resp.error_status) <= 0) + resp.error_status) <= 0) { + snmp_pdu_free(&resp); break; + } fprintf(stderr, "Retrying...\n"); snmp_pdu_free(&resp); snmp_pdu_create(&req, GET_PDUTYPE(snmptoolctx)); } - snmp_pdu_free(&resp); + snmp_pdu_free(&req); return (0); } @@ -498,27 +503,29 @@ snmptool_walk(struct snmp_toolinfo *snmp } outputs += rc; - snmp_pdu_free(&resp); - if ((u_int)rc < resp.nbindings) + if ((u_int)rc < resp.nbindings) { + snmp_pdu_free(&resp); break; + } snmpwalk_nextpdu_create(op, &(resp.bindings[resp.nbindings - 1].var), &req); if (op == SNMP_PDU_GETBULK) snmpget_fix_getbulk(&req, GET_MAXREP(snmptoolctx), GET_NONREP(snmptoolctx)); + snmp_pdu_free(&resp); } /* Just in case our root was a leaf. */ if (outputs == 0) { snmpwalk_nextpdu_create(SNMP_PDU_GET, &root, &req); if (snmp_dialog(&req, &resp) == SNMP_CODE_OK) { - if (snmp_parse_resp(&resp,&req) < 0) + if (snmp_parse_resp(&resp, &req) < 0) snmp_output_err_resp(snmptoolctx, &resp); else - snmp_output_resp(snmptoolctx, &(resp), NULL); - + snmp_output_resp(snmptoolctx, &resp, + NULL); snmp_pdu_free(&resp); } else warn("Snmp dialog"); @@ -529,9 +536,12 @@ snmptool_walk(struct snmp_toolinfo *snmp break; } + snmp_pdu_free(&req); snmp_pdu_create(&req, op); } + snmp_pdu_free(&req); + if (rc == 0) return (0); else @@ -1089,25 +1099,29 @@ snmptool_set(struct snmp_toolinfo *snmpt if (snmp_pdu_check(&req, &resp) > 0) { if (GET_OUTPUT(snmptoolctx) != OUTPUT_QUIET) snmp_output_resp(snmptoolctx, &resp, NULL); + snmp_pdu_free(&resp); break; } snmp_output_err_resp(snmptoolctx, &resp); - if (!ISSET_RETRY(snmptoolctx)) + if (!ISSET_RETRY(snmptoolctx)) { + snmp_pdu_free(&resp); break; + } if (snmp_object_seterror(snmptoolctx, &(resp.bindings[resp.error_index - 1]), - resp.error_status) <= 0) + resp.error_status) <= 0) { + snmp_pdu_free(&resp); break; + } fprintf(stderr, "Retrying...\n"); snmp_pdu_free(&req); - snmp_pdu_free(&resp); snmp_pdu_create(&req, SNMP_PDU_SET); } - snmp_pdu_free(&resp); + snmp_pdu_free(&req); return (0); } From owner-svn-src-all@freebsd.org Fri Jan 13 08:59:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 736FDCAB9C5; Fri, 13 Jan 2017 08:59:23 +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 383E519A2; Fri, 13 Jan 2017 08:59: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 v0D8xMZb059758; Fri, 13 Jan 2017 08:59:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8xMGf059757; Fri, 13 Jan 2017 08:59:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130859.v0D8xMGf059757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312050 - stable/10/usr.sbin/bsnmpd/tools/bsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:59:23 -0000 Author: ngie Date: Fri Jan 13 08:59:22 2017 New Revision: 312050 URL: https://svnweb.freebsd.org/changeset/base/312050 Log: MFC r310892,r310894,r310989: r310892: Don't call snmp_pdu_free(..) until finished with the pdu and when ready to allocate a new one via snmp_pdu_create(..) This fixes bsnmpwalk, so it no longer crashes after r310729 r310894: snmp_pdu_free the right object at the right time in snmptool_walk r310892 was on the right track, but unfortunately it was resolving the problem incorrectly and accidentally leaking memory in the process. - Call snmp_pdu_free on req before calling snmp_pdu_create on it at the bottom of the outer while loop - Call snmp_pdu_free on resp after calling snmpwalk_nextpdu_create in the inner loop r310989: Call snmp_pdu_free on req/resp with a consistent, correct pattern - snmp_pdu_free should be called before snmp_pdu_create is called again - snmp_pdu_free should be called on the resp to snmp_dialog when successful Tested with the following bsnmp commands: % export SNMPUSER=bsnmp SNMPPASSWD=bsnmptest % SNMP_ARGS="-A proto=sha -C context='' -K -P proto=des -v 3 -r 0" % bsnmpset $SNMP_ARGS sysLocation="MyAgent" % bsnmpget $SNMP_ARGS sysLocation % bsnmpwalk $SNMP_ARGS Modified: stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Fri Jan 13 08:59:08 2017 (r312049) +++ stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Fri Jan 13 08:59:22 2017 (r312050) @@ -400,13 +400,16 @@ snmptool_get(struct snmp_toolinfo *snmpt if (snmp_parse_resp(&resp, &req) >= 0) { snmp_output_resp(snmptoolctx, &resp, NULL); + snmp_pdu_free(&resp); break; } snmp_output_err_resp(snmptoolctx, &resp); if (GET_PDUTYPE(snmptoolctx) == SNMP_PDU_GETBULK || - !ISSET_RETRY(snmptoolctx)) + !ISSET_RETRY(snmptoolctx)) { + snmp_pdu_free(&resp); break; + } /* * Loop through the object list and set object->error to the @@ -414,15 +417,17 @@ snmptool_get(struct snmp_toolinfo *snmpt */ if (snmp_object_seterror(snmptoolctx, &(resp.bindings[resp.error_index - 1]), - resp.error_status) <= 0) + resp.error_status) <= 0) { + snmp_pdu_free(&resp); break; + } fprintf(stderr, "Retrying...\n"); snmp_pdu_free(&resp); snmp_pdu_create(&req, GET_PDUTYPE(snmptoolctx)); } - snmp_pdu_free(&resp); + snmp_pdu_free(&req); return (0); } @@ -498,27 +503,29 @@ snmptool_walk(struct snmp_toolinfo *snmp } outputs += rc; - snmp_pdu_free(&resp); - if ((u_int)rc < resp.nbindings) + if ((u_int)rc < resp.nbindings) { + snmp_pdu_free(&resp); break; + } snmpwalk_nextpdu_create(op, &(resp.bindings[resp.nbindings - 1].var), &req); if (op == SNMP_PDU_GETBULK) snmpget_fix_getbulk(&req, GET_MAXREP(snmptoolctx), GET_NONREP(snmptoolctx)); + snmp_pdu_free(&resp); } /* Just in case our root was a leaf. */ if (outputs == 0) { snmpwalk_nextpdu_create(SNMP_PDU_GET, &root, &req); if (snmp_dialog(&req, &resp) == SNMP_CODE_OK) { - if (snmp_parse_resp(&resp,&req) < 0) + if (snmp_parse_resp(&resp, &req) < 0) snmp_output_err_resp(snmptoolctx, &resp); else - snmp_output_resp(snmptoolctx, &(resp), NULL); - + snmp_output_resp(snmptoolctx, &resp, + NULL); snmp_pdu_free(&resp); } else warn("Snmp dialog"); @@ -529,9 +536,12 @@ snmptool_walk(struct snmp_toolinfo *snmp break; } + snmp_pdu_free(&req); snmp_pdu_create(&req, op); } + snmp_pdu_free(&req); + if (rc == 0) return (0); else @@ -1089,25 +1099,29 @@ snmptool_set(struct snmp_toolinfo *snmpt if (snmp_pdu_check(&req, &resp) > 0) { if (GET_OUTPUT(snmptoolctx) != OUTPUT_QUIET) snmp_output_resp(snmptoolctx, &resp, NULL); + snmp_pdu_free(&resp); break; } snmp_output_err_resp(snmptoolctx, &resp); - if (!ISSET_RETRY(snmptoolctx)) + if (!ISSET_RETRY(snmptoolctx)) { + snmp_pdu_free(&resp); break; + } if (snmp_object_seterror(snmptoolctx, &(resp.bindings[resp.error_index - 1]), - resp.error_status) <= 0) + resp.error_status) <= 0) { + snmp_pdu_free(&resp); break; + } fprintf(stderr, "Retrying...\n"); snmp_pdu_free(&req); - snmp_pdu_free(&resp); snmp_pdu_create(&req, SNMP_PDU_SET); } - snmp_pdu_free(&resp); + snmp_pdu_free(&req); return (0); } From owner-svn-src-all@freebsd.org Fri Jan 13 09:01:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 419A3CABEFA; Fri, 13 Jan 2017 09:01:08 +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 0D9C91DAB; Fri, 13 Jan 2017 09:01:07 +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 v0D9175g062033; Fri, 13 Jan 2017 09:01:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D917TR062032; Fri, 13 Jan 2017 09:01:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130901.v0D917TR062032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312051 - stable/11/contrib/bsnmp/lib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:01:08 -0000 Author: ngie Date: Fri Jan 13 09:01:06 2017 New Revision: 312051 URL: https://svnweb.freebsd.org/changeset/base/312051 Log: MFC r311390: snmp_table_fetch_async: don't leak `work` if snmp_pdu_send(..) fails CID: 1017276 Modified: stable/11/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpclient.c Fri Jan 13 08:59:22 2017 (r312050) +++ stable/11/contrib/bsnmp/lib/snmpclient.c Fri Jan 13 09:01:06 2017 (r312051) @@ -728,8 +728,11 @@ snmp_table_fetch_async(const struct snmp work->last_change = 0; table_init_pdu(descr, &work->pdu); - if (snmp_pdu_send(&work->pdu, table_cb, work) == -1) + if (snmp_pdu_send(&work->pdu, table_cb, work) == -1) { + free(work); + work = NULL; return (-1); + } return (0); } From owner-svn-src-all@freebsd.org Fri Jan 13 09:01:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73E26CABF0E; Fri, 13 Jan 2017 09:01:10 +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 411271DB5; Fri, 13 Jan 2017 09:01:10 +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 v0D919dA062079; Fri, 13 Jan 2017 09:01:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D9196V062078; Fri, 13 Jan 2017 09:01:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130901.v0D9196V062078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312052 - stable/10/contrib/bsnmp/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:01:10 -0000 Author: ngie Date: Fri Jan 13 09:01:09 2017 New Revision: 312052 URL: https://svnweb.freebsd.org/changeset/base/312052 Log: MFC r311390: snmp_table_fetch_async: don't leak `work` if snmp_pdu_send(..) fails CID: 1017276 Modified: stable/10/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpclient.c Fri Jan 13 09:01:06 2017 (r312051) +++ stable/10/contrib/bsnmp/lib/snmpclient.c Fri Jan 13 09:01:09 2017 (r312052) @@ -728,8 +728,11 @@ snmp_table_fetch_async(const struct snmp work->last_change = 0; table_init_pdu(descr, &work->pdu); - if (snmp_pdu_send(&work->pdu, table_cb, work) == -1) + if (snmp_pdu_send(&work->pdu, table_cb, work) == -1) { + free(work); + work = NULL; return (-1); + } return (0); } From owner-svn-src-all@freebsd.org Fri Jan 13 09:04:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48F47CAA1CD; Fri, 13 Jan 2017 09:04:28 +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 120951451; Fri, 13 Jan 2017 09:04:27 +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 v0D94RQk063875; Fri, 13 Jan 2017 09:04:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D94Rwu063874; Fri, 13 Jan 2017 09:04:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130904.v0D94Rwu063874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312053 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:04:28 -0000 Author: ngie Date: Fri Jan 13 09:04:26 2017 New Revision: 312053 URL: https://svnweb.freebsd.org/changeset/base/312053 Log: MFC r311378: lm_load: fix string copying issues - Ensure `section` doesn't overrun section by using strlcpy instead of strcpy [*]. - Use strdup instead of malloc + strcpy (this wasn't flagged by Coverity, but is an opportunistic change). CID: 1006826 [*] Modified: stable/11/contrib/bsnmp/snmpd/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:01:09 2017 (r312052) +++ stable/11/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:04:26 2017 (r312053) @@ -2508,13 +2508,12 @@ lm_load(const char *path, const char *se } m->handle = NULL; m->flags = 0; - strcpy(m->section, section); + strlcpy(m->section, section, sizeof(m->section)); - if ((m->path = malloc(strlen(path) + 1)) == NULL) { + if ((m->path = strdup(path)) == NULL) { syslog(LOG_ERR, "lm_load: %m"); goto err; } - strcpy(m->path, path); /* * Make index From owner-svn-src-all@freebsd.org Fri Jan 13 09:04:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4350CCAA1FA; Fri, 13 Jan 2017 09:04:30 +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 117841453; Fri, 13 Jan 2017 09:04:29 +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 v0D94Tvd063920; Fri, 13 Jan 2017 09:04:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D94TpI063919; Fri, 13 Jan 2017 09:04:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130904.v0D94TpI063919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312054 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:04:30 -0000 Author: ngie Date: Fri Jan 13 09:04:29 2017 New Revision: 312054 URL: https://svnweb.freebsd.org/changeset/base/312054 Log: MFC r311378: lm_load: fix string copying issues - Ensure `section` doesn't overrun section by using strlcpy instead of strcpy [*]. - Use strdup instead of malloc + strcpy (this wasn't flagged by Coverity, but is an opportunistic change). CID: 1006826 [*] Modified: stable/10/contrib/bsnmp/snmpd/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:04:26 2017 (r312053) +++ stable/10/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:04:29 2017 (r312054) @@ -2508,13 +2508,12 @@ lm_load(const char *path, const char *se } m->handle = NULL; m->flags = 0; - strcpy(m->section, section); + strlcpy(m->section, section, sizeof(m->section)); - if ((m->path = malloc(strlen(path) + 1)) == NULL) { + if ((m->path = strdup(path)) == NULL) { syslog(LOG_ERR, "lm_load: %m"); goto err; } - strcpy(m->path, path); /* * Make index From owner-svn-src-all@freebsd.org Fri Jan 13 09:07:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 252FCCAA2F2; Fri, 13 Jan 2017 09:07:27 +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 EB68D179F; Fri, 13 Jan 2017 09:07:26 +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 v0D97QrR064111; Fri, 13 Jan 2017 09:07:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D97Ps7064104; Fri, 13 Jan 2017 09:07:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130907.v0D97Ps7064104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312055 - in stable/10/usr.sbin/bsnmpd/modules: snmp_atm snmp_hast snmp_hostres snmp_mibII snmp_target snmp_usm snmp_vacm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:07:27 -0000 Author: ngie Date: Fri Jan 13 09:07:25 2017 New Revision: 312055 URL: https://svnweb.freebsd.org/changeset/base/312055 Log: MFC r311739: Use SRCTOP instead of spelling out the full path with .CURDIR This helps condense the output for CFLAGS and .PATH Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_atm/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_hast/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_target/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_usm/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_atm/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_atm/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_atm/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ # # Author: Harti Brandt -CONTRIB= ${.CURDIR}/../../../../contrib/ngatm +CONTRIB= ${SRCTOP}/contrib/ngatm .PATH: ${CONTRIB}/snmp_atm MOD= atm Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../../../sbin/hastd +.PATH: ${SRCTOP}/sbin/hastd MOD= hast SRCS= ebuf.c @@ -18,7 +18,7 @@ MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= NO_WMISSING_VARIABLE_DECLARATIONS= -CFLAGS+=-I${.CURDIR}/../../../../sbin/hastd +CFLAGS+=-I${SRCTOP}/sbin/hastd CFLAGS+=-DHAVE_CAPSICUM CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -28,7 +28,7 @@ # $FreeBSD$ # -LPRSRC= ${.CURDIR}/../../../lpr/common_source +LPRSRC= ${SRCTOP}/usr.sbin/lpr/common_source .PATH: ${LPRSRC} MOD= hostres Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ # # Author: Harti Brandt -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_mibII MOD= mibII Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_target/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_target/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_target/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_target MOD= target Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_usm/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_usm/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_usm/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_usm MOD= usm Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_vacm MOD= vacm From owner-svn-src-all@freebsd.org Fri Jan 13 09:07:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBEA3CAA31C; Fri, 13 Jan 2017 09:07:30 +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 B587417B0; Fri, 13 Jan 2017 09:07:30 +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 v0D97T8l064167; Fri, 13 Jan 2017 09:07:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D97T3i064160; Fri, 13 Jan 2017 09:07:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130907.v0D97T3i064160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312056 - in stable/11/usr.sbin/bsnmpd/modules: snmp_atm snmp_hast snmp_hostres snmp_mibII snmp_target snmp_usm snmp_vacm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:07:31 -0000 Author: ngie Date: Fri Jan 13 09:07:29 2017 New Revision: 312056 URL: https://svnweb.freebsd.org/changeset/base/312056 Log: MFC r311739: Use SRCTOP instead of spelling out the full path with .CURDIR This helps condense the output for CFLAGS and .PATH Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_atm/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_hast/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_target/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_usm/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_atm/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_atm/Makefile Fri Jan 13 09:07:25 2017 (r312055) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_atm/Makefile Fri Jan 13 09:07:29 2017 (r312056) @@ -2,7 +2,7 @@ # # Author: Harti Brandt -CONTRIB= ${.CURDIR}/../../../../contrib/ngatm +CONTRIB= ${SRCTOP}/contrib/ngatm .PATH: ${CONTRIB}/snmp_atm MOD= atm Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Fri Jan 13 09:07:25 2017 (r312055) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Fri Jan 13 09:07:29 2017 (r312056) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../../../sbin/hastd +.PATH: ${SRCTOP}/sbin/hastd MOD= hast SRCS= ebuf.c @@ -18,7 +18,7 @@ MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= NO_WMISSING_VARIABLE_DECLARATIONS= -CFLAGS+=-I${.CURDIR}/../../../../sbin/hastd +CFLAGS+=-I${SRCTOP}/sbin/hastd CFLAGS+=-DHAVE_CAPSICUM CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Fri Jan 13 09:07:25 2017 (r312055) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Fri Jan 13 09:07:29 2017 (r312056) @@ -28,7 +28,7 @@ # $FreeBSD$ # -LPRSRC= ${.CURDIR}/../../../lpr/common_source +LPRSRC= ${SRCTOP}/usr.sbin/lpr/common_source .PATH: ${LPRSRC} MOD= hostres Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Fri Jan 13 09:07:25 2017 (r312055) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Fri Jan 13 09:07:29 2017 (r312056) @@ -2,7 +2,7 @@ # # Author: Harti Brandt -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_mibII MOD= mibII Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_target/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_target/Makefile Fri Jan 13 09:07:25 2017 (r312055) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_target/Makefile Fri Jan 13 09:07:29 2017 (r312056) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_target MOD= target Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_usm/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_usm/Makefile Fri Jan 13 09:07:25 2017 (r312055) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_usm/Makefile Fri Jan 13 09:07:29 2017 (r312056) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_usm MOD= usm Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Fri Jan 13 09:07:25 2017 (r312055) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Fri Jan 13 09:07:29 2017 (r312056) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_vacm MOD= vacm From owner-svn-src-all@freebsd.org Fri Jan 13 09:11:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F466CAA58B; Fri, 13 Jan 2017 09:11:12 +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 5DBFE1B3D; Fri, 13 Jan 2017 09:11:12 +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 v0D9BBtm065855; Fri, 13 Jan 2017 09:11:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D9BBIB065851; Fri, 13 Jan 2017 09:11:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130911.v0D9BBIB065851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312057 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:11:12 -0000 Author: ngie Date: Fri Jan 13 09:11:11 2017 New Revision: 312057 URL: https://svnweb.freebsd.org/changeset/base/312057 Log: MFC r310586,r310587,r310588: r310586: Refactor transport sources a bit to facilitate changes coming down pipeline Add recv callback to transport layer to better facilitate code reuse and readability and for symmetry with send callback. Move recv_dgram and recv_stream to udp_recv and lsock_recv, respectively, and make the beforementioned functions recv callbacks for the udp and lsock transports, respectively. Consolidate the check_priv* functions in their relevant trans*.c source to limit scope/use. Note: this code is roughly based content from the submitter, although this was modified to be more of a direct move from snmpd/main.c to the trans_*.c sources, and to reduce unnecessary static function declarations. r310587: Fix definition for recv_dgram(..); it should be "ssize_t", not "int" I'm not sure why this wasn't flagged as an issue by the compiler, yet r310588: Fix return type for `ret` (recv callback) and sort variables by alignment Again, for reasons I don't yet understand, this is not being flagged by the compiler. Unlike the issue addressed in r310587, this problem existed prior to r310586 Modified: stable/11/contrib/bsnmp/snmpd/main.c stable/11/contrib/bsnmp/snmpd/snmpd.h stable/11/contrib/bsnmp/snmpd/trans_lsock.c stable/11/contrib/bsnmp/snmpd/trans_udp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:07:29 2017 (r312056) +++ stable/11/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:11:11 2017 (r312057) @@ -1024,154 +1024,6 @@ snmp_input_consume(struct port_input *pi pi->length -= pi->consumed; } -static void -check_priv_dgram(struct port_input *pi, struct sockcred *cred) -{ - - /* process explicitly sends credentials */ - if (cred) - pi->priv = (cred->sc_euid == 0); - else - pi->priv = 0; -} - -static void -check_priv_stream(struct port_input *pi) -{ - struct xucred ucred; - socklen_t ucredlen; - - /* obtain the accept time credentials */ - ucredlen = sizeof(ucred); - - if (getsockopt(pi->fd, 0, LOCAL_PEERCRED, &ucred, &ucredlen) == 0 && - ucredlen >= sizeof(ucred) && ucred.cr_version == XUCRED_VERSION) - pi->priv = (ucred.cr_uid == 0); - else - pi->priv = 0; -} - -/* - * Input from a stream socket. - */ -static int -recv_stream(struct port_input *pi) -{ - struct msghdr msg; - struct iovec iov[1]; - ssize_t len; - - if (pi->buf == NULL) { - /* no buffer yet - allocate one */ - if ((pi->buf = buf_alloc(0)) == NULL) { - /* ups - could not get buffer. Return an error - * the caller must close the transport. */ - return (-1); - } - pi->buflen = buf_size(0); - pi->consumed = 0; - pi->length = 0; - } - - /* try to get a message */ - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_control = NULL; - msg.msg_controllen = 0; - msg.msg_flags = 0; - - iov[0].iov_base = pi->buf + pi->length; - iov[0].iov_len = pi->buflen - pi->length; - - len = recvmsg(pi->fd, &msg, 0); - - if (len == -1 || len == 0) - /* receive error */ - return (-1); - - pi->length += len; - - if (pi->cred) - check_priv_stream(pi); - - return (0); -} - -/* - * Input from a datagram socket. - * Each receive should return one datagram. - */ -static int -recv_dgram(struct port_input *pi, struct in_addr *laddr) -{ - u_char embuf[1000]; - char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + - CMSG_SPACE(sizeof(struct in_addr))]; - struct msghdr msg; - struct iovec iov[1]; - ssize_t len; - struct cmsghdr *cmsg; - struct sockcred *cred = NULL; - - if (pi->buf == NULL) { - /* no buffer yet - allocate one */ - if ((pi->buf = buf_alloc(0)) == NULL) { - /* ups - could not get buffer. Read away input - * and drop it */ - (void)recvfrom(pi->fd, embuf, sizeof(embuf), - 0, NULL, NULL); - /* return error */ - return (-1); - } - pi->buflen = buf_size(0); - } - - /* try to get a message */ - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - memset(cbuf, 0, sizeof(cbuf)); - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - msg.msg_flags = 0; - - iov[0].iov_base = pi->buf; - iov[0].iov_len = pi->buflen; - - len = recvmsg(pi->fd, &msg, 0); - - if (len == -1 || len == 0) - /* receive error */ - return (-1); - - if (msg.msg_flags & MSG_TRUNC) { - /* truncated - drop */ - snmpd_stats.silentDrops++; - snmpd_stats.inTooLong++; - return (-1); - } - - pi->length = (size_t)len; - - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (cmsg->cmsg_level == IPPROTO_IP && - cmsg->cmsg_type == IP_RECVDSTADDR) - memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); - if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_CREDS) - cred = (struct sockcred *)CMSG_DATA(cmsg); - } - - if (pi->cred) - check_priv_dgram(pi, cred); - - return (0); -} - /* * Input from a socket */ @@ -1183,43 +1035,15 @@ snmpd_input(struct port_input *pi, struc struct snmp_pdu pdu; enum snmpd_input_err ierr, ferr; enum snmpd_proxy_err perr; + ssize_t ret, slen; int32_t vi; - int ret; - ssize_t slen; #ifdef USE_TCPWRAPPERS char client[16]; #endif struct msghdr msg; struct iovec iov[1]; - char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - struct cmsghdr *cmsgp; - - /* get input depending on the transport */ - if (pi->stream) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - - ret = recv_stream(pi); - } else { - struct in_addr *laddr; - - memset(cbuf, 0, CMSG_SPACE(sizeof(struct in_addr))); - msg.msg_control = cbuf; - msg.msg_controllen = CMSG_SPACE(sizeof(struct in_addr)); - cmsgp = CMSG_FIRSTHDR(&msg); - cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - cmsgp->cmsg_level = IPPROTO_IP; - cmsgp->cmsg_type = IP_SENDSRCADDR; - laddr = (struct in_addr *)CMSG_DATA(cmsgp); - - ret = recv_dgram(pi, laddr); - - if (laddr->s_addr == 0) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } - } + ret = tport->transport->vtab->recv(pi); if (ret == -1) return (-1); Modified: stable/11/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- stable/11/contrib/bsnmp/snmpd/snmpd.h Fri Jan 13 09:07:29 2017 (r312056) +++ stable/11/contrib/bsnmp/snmpd/snmpd.h Fri Jan 13 09:11:11 2017 (r312057) @@ -193,6 +193,7 @@ struct transport_def { ssize_t (*send)(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); + ssize_t (*recv)(struct port_input *); }; struct transport { struct asn_oid index; /* transport table index */ Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_lsock.c Fri Jan 13 09:07:29 2017 (r312056) +++ stable/11/contrib/bsnmp/snmpd/trans_lsock.c Fri Jan 13 09:11:11 2017 (r312057) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -58,6 +59,7 @@ static void lsock_close_port(struct tpor static int lsock_init_port(struct tport *); static ssize_t lsock_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); +static ssize_t lsock_recv(struct port_input *); /* exported */ const struct transport_def lsock_trans = { @@ -67,7 +69,8 @@ const struct transport_def lsock_trans = lsock_stop, lsock_close_port, lsock_init_port, - lsock_send + lsock_send, + lsock_recv }; static struct transport *my_trans; @@ -418,6 +421,73 @@ lsock_send(struct tport *tp, const u_cha return (sendto(peer->input.fd, buf, len, 0, addr, addrlen)); } +static void +check_priv_stream(struct port_input *pi) +{ + struct xucred ucred; + socklen_t ucredlen; + + /* obtain the accept time credentials */ + ucredlen = sizeof(ucred); + + if (getsockopt(pi->fd, 0, LOCAL_PEERCRED, &ucred, &ucredlen) == 0 && + ucredlen >= sizeof(ucred) && ucred.cr_version == XUCRED_VERSION) + pi->priv = (ucred.cr_uid == 0); + else + pi->priv = 0; +} + +/* + * Receive something + */ +static ssize_t +lsock_recv(struct port_input *pi) +{ + struct msghdr msg; + struct iovec iov[1]; + ssize_t len; + + msg.msg_control = NULL; + msg.msg_controllen = 0; + + if (pi->buf == NULL) { + /* no buffer yet - allocate one */ + if ((pi->buf = buf_alloc(0)) == NULL) { + /* ups - could not get buffer. Return an error + * the caller must close the transport. */ + return (-1); + } + pi->buflen = buf_size(0); + pi->consumed = 0; + pi->length = 0; + } + + /* try to get a message */ + msg.msg_name = pi->peer; + msg.msg_namelen = pi->peerlen; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_control = NULL; + msg.msg_controllen = 0; + msg.msg_flags = 0; + + iov[0].iov_base = pi->buf + pi->length; + iov[0].iov_len = pi->buflen - pi->length; + + len = recvmsg(pi->fd, &msg, 0); + + if (len == -1 || len == 0) + /* receive error */ + return (-1); + + pi->length += len; + + if (pi->cred) + check_priv_stream(pi); + + return (0); +} + /* * Dependency to create a lsock port */ Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 13 09:07:29 2017 (r312056) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 13 09:11:11 2017 (r312057) @@ -32,6 +32,7 @@ */ #include #include +#include #include #include @@ -54,6 +55,7 @@ static void udp_close_port(struct tport static int udp_init_port(struct tport *); static ssize_t udp_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); +static ssize_t udp_recv(struct port_input *); /* exported */ const struct transport_def udp_trans = { @@ -63,7 +65,8 @@ const struct transport_def udp_trans = { udp_stop, udp_close_port, udp_init_port, - udp_send + udp_send, + udp_recv }; static struct transport *my_trans; @@ -218,6 +221,123 @@ udp_send(struct tport *tp, const u_char return (sendto(p->input.fd, buf, len, 0, addr, addrlen)); } +static void +check_priv_dgram(struct port_input *pi, struct sockcred *cred) +{ + + /* process explicitly sends credentials */ + if (cred) + pi->priv = (cred->sc_euid == 0); + else + pi->priv = 0; +} + +/* + * Input from a datagram socket. + * Each receive should return one datagram. + */ +static ssize_t +recv_dgram(struct port_input *pi, struct in_addr *laddr) +{ + u_char embuf[1000]; + char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + + CMSG_SPACE(sizeof(struct in_addr))]; + struct msghdr msg; + struct iovec iov[1]; + ssize_t len; + struct cmsghdr *cmsg; + struct sockcred *cred = NULL; + + if (pi->buf == NULL) { + /* no buffer yet - allocate one */ + if ((pi->buf = buf_alloc(0)) == NULL) { + /* ups - could not get buffer. Read away input + * and drop it */ + (void)recvfrom(pi->fd, embuf, sizeof(embuf), + 0, NULL, NULL); + /* return error */ + return (-1); + } + pi->buflen = buf_size(0); + } + + /* try to get a message */ + msg.msg_name = pi->peer; + msg.msg_namelen = pi->peerlen; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + memset(cbuf, 0, sizeof(cbuf)); + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + msg.msg_flags = 0; + + iov[0].iov_base = pi->buf; + iov[0].iov_len = pi->buflen; + + len = recvmsg(pi->fd, &msg, 0); + + if (len == -1 || len == 0) + /* receive error */ + return (-1); + + if (msg.msg_flags & MSG_TRUNC) { + /* truncated - drop */ + snmpd_stats.silentDrops++; + snmpd_stats.inTooLong++; + return (-1); + } + + pi->length = (size_t)len; + + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == IPPROTO_IP && + cmsg->cmsg_type == IP_RECVDSTADDR) + memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); + if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_CREDS) + cred = (struct sockcred *)CMSG_DATA(cmsg); + } + + if (pi->cred) + check_priv_dgram(pi, cred); + + return (0); +} + +/* + * Receive something + */ +static ssize_t +udp_recv(struct port_input *pi) +{ + struct in_addr *laddr; + struct msghdr msg; + char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; + struct cmsghdr *cmsgp; + ssize_t ret; + + memset(cbuf, 0, sizeof(cbuf)); + + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsgp = CMSG_FIRSTHDR(&msg); + cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + cmsgp->cmsg_level = IPPROTO_IP; + cmsgp->cmsg_type = IP_SENDSRCADDR; + laddr = (struct in_addr *)CMSG_DATA(cmsgp); + + ret = recv_dgram(pi, laddr); + + if (laddr->s_addr == INADDR_ANY) { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } + + return (ret); +} + /* * Port table */ From owner-svn-src-all@freebsd.org Fri Jan 13 09:19:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF30CAA82C; Fri, 13 Jan 2017 09:19:05 +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 A1FFA10E2; Fri, 13 Jan 2017 09:19:05 +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 v0D9J4O1068602; Fri, 13 Jan 2017 09:19:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D9J46j068598; Fri, 13 Jan 2017 09:19:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130919.v0D9J46j068598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312058 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:19:06 -0000 Author: ngie Date: Fri Jan 13 09:19:04 2017 New Revision: 312058 URL: https://svnweb.freebsd.org/changeset/base/312058 Log: MFC r310586,r310587,r310588,r311381: r310586: Refactor transport sources a bit to facilitate changes coming down pipeline Add recv callback to transport layer to better facilitate code reuse and readability and for symmetry with send callback. Move recv_dgram and recv_stream to udp_recv and lsock_recv, respectively, and make the beforementioned functions recv callbacks for the udp and lsock transports, respectively. Consolidate the check_priv* functions in their relevant trans*.c source to limit scope/use. Note: this code is roughly based content from the submitter, although this was modified to be more of a direct move from snmpd/main.c to the trans_*.c sources, and to reduce unnecessary static function declarations. r310587: Fix definition for recv_dgram(..); it should be "ssize_t", not "int" I'm not sure why this wasn't flagged as an issue by the compiler, yet r310588: Fix return type for `ret` (recv callback) and sort variables by alignment Again, for reasons I don't yet understand, this is not being flagged by the compiler. Unlike the issue addressed in r310587, this problem existed prior to r310586 r311381: lsock_init_port: address issues with initializing sockaddr_un object - Use strlcpy to ensure p->name doesn't overflow sa.sun_path [*]. - Use SUN_LEN(..) instead of spelling out calculation longhand (inspired by comment by jmallett). Tested with: dgram and stream support with both bsnmpwalk and snmpwalk CID: 1006825 Modified: stable/10/contrib/bsnmp/snmpd/main.c stable/10/contrib/bsnmp/snmpd/snmpd.h stable/10/contrib/bsnmp/snmpd/trans_lsock.c stable/10/contrib/bsnmp/snmpd/trans_udp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:11:11 2017 (r312057) +++ stable/10/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:19:04 2017 (r312058) @@ -1024,154 +1024,6 @@ snmp_input_consume(struct port_input *pi pi->length -= pi->consumed; } -static void -check_priv_dgram(struct port_input *pi, struct sockcred *cred) -{ - - /* process explicitly sends credentials */ - if (cred) - pi->priv = (cred->sc_euid == 0); - else - pi->priv = 0; -} - -static void -check_priv_stream(struct port_input *pi) -{ - struct xucred ucred; - socklen_t ucredlen; - - /* obtain the accept time credentials */ - ucredlen = sizeof(ucred); - - if (getsockopt(pi->fd, 0, LOCAL_PEERCRED, &ucred, &ucredlen) == 0 && - ucredlen >= sizeof(ucred) && ucred.cr_version == XUCRED_VERSION) - pi->priv = (ucred.cr_uid == 0); - else - pi->priv = 0; -} - -/* - * Input from a stream socket. - */ -static int -recv_stream(struct port_input *pi) -{ - struct msghdr msg; - struct iovec iov[1]; - ssize_t len; - - if (pi->buf == NULL) { - /* no buffer yet - allocate one */ - if ((pi->buf = buf_alloc(0)) == NULL) { - /* ups - could not get buffer. Return an error - * the caller must close the transport. */ - return (-1); - } - pi->buflen = buf_size(0); - pi->consumed = 0; - pi->length = 0; - } - - /* try to get a message */ - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_control = NULL; - msg.msg_controllen = 0; - msg.msg_flags = 0; - - iov[0].iov_base = pi->buf + pi->length; - iov[0].iov_len = pi->buflen - pi->length; - - len = recvmsg(pi->fd, &msg, 0); - - if (len == -1 || len == 0) - /* receive error */ - return (-1); - - pi->length += len; - - if (pi->cred) - check_priv_stream(pi); - - return (0); -} - -/* - * Input from a datagram socket. - * Each receive should return one datagram. - */ -static int -recv_dgram(struct port_input *pi, struct in_addr *laddr) -{ - u_char embuf[1000]; - char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + - CMSG_SPACE(sizeof(struct in_addr))]; - struct msghdr msg; - struct iovec iov[1]; - ssize_t len; - struct cmsghdr *cmsg; - struct sockcred *cred = NULL; - - if (pi->buf == NULL) { - /* no buffer yet - allocate one */ - if ((pi->buf = buf_alloc(0)) == NULL) { - /* ups - could not get buffer. Read away input - * and drop it */ - (void)recvfrom(pi->fd, embuf, sizeof(embuf), - 0, NULL, NULL); - /* return error */ - return (-1); - } - pi->buflen = buf_size(0); - } - - /* try to get a message */ - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - memset(cbuf, 0, sizeof(cbuf)); - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - msg.msg_flags = 0; - - iov[0].iov_base = pi->buf; - iov[0].iov_len = pi->buflen; - - len = recvmsg(pi->fd, &msg, 0); - - if (len == -1 || len == 0) - /* receive error */ - return (-1); - - if (msg.msg_flags & MSG_TRUNC) { - /* truncated - drop */ - snmpd_stats.silentDrops++; - snmpd_stats.inTooLong++; - return (-1); - } - - pi->length = (size_t)len; - - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (cmsg->cmsg_level == IPPROTO_IP && - cmsg->cmsg_type == IP_RECVDSTADDR) - memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); - if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_CREDS) - cred = (struct sockcred *)CMSG_DATA(cmsg); - } - - if (pi->cred) - check_priv_dgram(pi, cred); - - return (0); -} - /* * Input from a socket */ @@ -1183,43 +1035,15 @@ snmpd_input(struct port_input *pi, struc struct snmp_pdu pdu; enum snmpd_input_err ierr, ferr; enum snmpd_proxy_err perr; + ssize_t ret, slen; int32_t vi; - int ret; - ssize_t slen; #ifdef USE_TCPWRAPPERS char client[16]; #endif struct msghdr msg; struct iovec iov[1]; - char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - struct cmsghdr *cmsgp; - - /* get input depending on the transport */ - if (pi->stream) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - - ret = recv_stream(pi); - } else { - struct in_addr *laddr; - - memset(cbuf, 0, CMSG_SPACE(sizeof(struct in_addr))); - msg.msg_control = cbuf; - msg.msg_controllen = CMSG_SPACE(sizeof(struct in_addr)); - cmsgp = CMSG_FIRSTHDR(&msg); - cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - cmsgp->cmsg_level = IPPROTO_IP; - cmsgp->cmsg_type = IP_SENDSRCADDR; - laddr = (struct in_addr *)CMSG_DATA(cmsgp); - - ret = recv_dgram(pi, laddr); - - if (laddr->s_addr == 0) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } - } + ret = tport->transport->vtab->recv(pi); if (ret == -1) return (-1); Modified: stable/10/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- stable/10/contrib/bsnmp/snmpd/snmpd.h Fri Jan 13 09:11:11 2017 (r312057) +++ stable/10/contrib/bsnmp/snmpd/snmpd.h Fri Jan 13 09:19:04 2017 (r312058) @@ -193,6 +193,7 @@ struct transport_def { ssize_t (*send)(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); + ssize_t (*recv)(struct port_input *); }; struct transport { struct asn_oid index; /* transport table index */ Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_lsock.c Fri Jan 13 09:11:11 2017 (r312057) +++ stable/10/contrib/bsnmp/snmpd/trans_lsock.c Fri Jan 13 09:19:04 2017 (r312058) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -58,6 +59,7 @@ static void lsock_close_port(struct tpor static int lsock_init_port(struct tport *); static ssize_t lsock_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); +static ssize_t lsock_recv(struct port_input *); /* exported */ const struct transport_def lsock_trans = { @@ -67,7 +69,8 @@ const struct transport_def lsock_trans = lsock_stop, lsock_close_port, lsock_init_port, - lsock_send + lsock_send, + lsock_recv }; static struct transport *my_trans; @@ -302,10 +305,9 @@ lsock_init_port(struct tport *tp) return (SNMP_ERR_RES_UNAVAIL); } - strcpy(sa.sun_path, p->name); + strlcpy(sa.sun_path, p->name, sizeof(sa.sun_path)); sa.sun_family = AF_LOCAL; - sa.sun_len = strlen(p->name) + - offsetof(struct sockaddr_un, sun_path); + sa.sun_len = SUN_LEN(&sa); (void)remove(p->name); @@ -357,10 +359,9 @@ lsock_init_port(struct tport *tp) return (SNMP_ERR_GENERR); } - strcpy(sa.sun_path, p->name); + strlcpy(sa.sun_path, p->name, sizeof(sa.sun_path)); sa.sun_family = AF_LOCAL; - sa.sun_len = strlen(p->name) + - offsetof(struct sockaddr_un, sun_path); + sa.sun_len = SUN_LEN(&sa); (void)remove(p->name); @@ -418,6 +419,73 @@ lsock_send(struct tport *tp, const u_cha return (sendto(peer->input.fd, buf, len, 0, addr, addrlen)); } +static void +check_priv_stream(struct port_input *pi) +{ + struct xucred ucred; + socklen_t ucredlen; + + /* obtain the accept time credentials */ + ucredlen = sizeof(ucred); + + if (getsockopt(pi->fd, 0, LOCAL_PEERCRED, &ucred, &ucredlen) == 0 && + ucredlen >= sizeof(ucred) && ucred.cr_version == XUCRED_VERSION) + pi->priv = (ucred.cr_uid == 0); + else + pi->priv = 0; +} + +/* + * Receive something + */ +static ssize_t +lsock_recv(struct port_input *pi) +{ + struct msghdr msg; + struct iovec iov[1]; + ssize_t len; + + msg.msg_control = NULL; + msg.msg_controllen = 0; + + if (pi->buf == NULL) { + /* no buffer yet - allocate one */ + if ((pi->buf = buf_alloc(0)) == NULL) { + /* ups - could not get buffer. Return an error + * the caller must close the transport. */ + return (-1); + } + pi->buflen = buf_size(0); + pi->consumed = 0; + pi->length = 0; + } + + /* try to get a message */ + msg.msg_name = pi->peer; + msg.msg_namelen = pi->peerlen; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_control = NULL; + msg.msg_controllen = 0; + msg.msg_flags = 0; + + iov[0].iov_base = pi->buf + pi->length; + iov[0].iov_len = pi->buflen - pi->length; + + len = recvmsg(pi->fd, &msg, 0); + + if (len == -1 || len == 0) + /* receive error */ + return (-1); + + pi->length += len; + + if (pi->cred) + check_priv_stream(pi); + + return (0); +} + /* * Dependency to create a lsock port */ Modified: stable/10/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 13 09:11:11 2017 (r312057) +++ stable/10/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 13 09:19:04 2017 (r312058) @@ -32,6 +32,7 @@ */ #include #include +#include #include #include @@ -54,6 +55,7 @@ static void udp_close_port(struct tport static int udp_init_port(struct tport *); static ssize_t udp_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); +static ssize_t udp_recv(struct port_input *); /* exported */ const struct transport_def udp_trans = { @@ -63,7 +65,8 @@ const struct transport_def udp_trans = { udp_stop, udp_close_port, udp_init_port, - udp_send + udp_send, + udp_recv }; static struct transport *my_trans; @@ -218,6 +221,123 @@ udp_send(struct tport *tp, const u_char return (sendto(p->input.fd, buf, len, 0, addr, addrlen)); } +static void +check_priv_dgram(struct port_input *pi, struct sockcred *cred) +{ + + /* process explicitly sends credentials */ + if (cred) + pi->priv = (cred->sc_euid == 0); + else + pi->priv = 0; +} + +/* + * Input from a datagram socket. + * Each receive should return one datagram. + */ +static ssize_t +recv_dgram(struct port_input *pi, struct in_addr *laddr) +{ + u_char embuf[1000]; + char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + + CMSG_SPACE(sizeof(struct in_addr))]; + struct msghdr msg; + struct iovec iov[1]; + ssize_t len; + struct cmsghdr *cmsg; + struct sockcred *cred = NULL; + + if (pi->buf == NULL) { + /* no buffer yet - allocate one */ + if ((pi->buf = buf_alloc(0)) == NULL) { + /* ups - could not get buffer. Read away input + * and drop it */ + (void)recvfrom(pi->fd, embuf, sizeof(embuf), + 0, NULL, NULL); + /* return error */ + return (-1); + } + pi->buflen = buf_size(0); + } + + /* try to get a message */ + msg.msg_name = pi->peer; + msg.msg_namelen = pi->peerlen; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + memset(cbuf, 0, sizeof(cbuf)); + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + msg.msg_flags = 0; + + iov[0].iov_base = pi->buf; + iov[0].iov_len = pi->buflen; + + len = recvmsg(pi->fd, &msg, 0); + + if (len == -1 || len == 0) + /* receive error */ + return (-1); + + if (msg.msg_flags & MSG_TRUNC) { + /* truncated - drop */ + snmpd_stats.silentDrops++; + snmpd_stats.inTooLong++; + return (-1); + } + + pi->length = (size_t)len; + + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == IPPROTO_IP && + cmsg->cmsg_type == IP_RECVDSTADDR) + memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); + if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_CREDS) + cred = (struct sockcred *)CMSG_DATA(cmsg); + } + + if (pi->cred) + check_priv_dgram(pi, cred); + + return (0); +} + +/* + * Receive something + */ +static ssize_t +udp_recv(struct port_input *pi) +{ + struct in_addr *laddr; + struct msghdr msg; + char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; + struct cmsghdr *cmsgp; + ssize_t ret; + + memset(cbuf, 0, sizeof(cbuf)); + + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsgp = CMSG_FIRSTHDR(&msg); + cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + cmsgp->cmsg_level = IPPROTO_IP; + cmsgp->cmsg_type = IP_SENDSRCADDR; + laddr = (struct in_addr *)CMSG_DATA(cmsgp); + + ret = recv_dgram(pi, laddr); + + if (laddr->s_addr == INADDR_ANY) { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } + + return (ret); +} + /* * Port table */ From owner-svn-src-all@freebsd.org Fri Jan 13 09:19:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A101CAA875; Fri, 13 Jan 2017 09:19:10 +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 37D5D1150; Fri, 13 Jan 2017 09:19:10 +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 v0D9J90n068651; Fri, 13 Jan 2017 09:19:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D9J96p068650; Fri, 13 Jan 2017 09:19:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130919.v0D9J96p068650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312059 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:19:10 -0000 Author: ngie Date: Fri Jan 13 09:19:09 2017 New Revision: 312059 URL: https://svnweb.freebsd.org/changeset/base/312059 Log: MFC r311381: lsock_init_port: address issues with initializing sockaddr_un object - Use strlcpy to ensure p->name doesn't overflow sa.sun_path [*]. - Use SUN_LEN(..) instead of spelling out calculation longhand (inspired by comment by jmallett). Tested with: dgram and stream support with both bsnmpwalk and snmpwalk CID: 1006825 Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_lsock.c Fri Jan 13 09:19:04 2017 (r312058) +++ stable/11/contrib/bsnmp/snmpd/trans_lsock.c Fri Jan 13 09:19:09 2017 (r312059) @@ -305,10 +305,9 @@ lsock_init_port(struct tport *tp) return (SNMP_ERR_RES_UNAVAIL); } - strcpy(sa.sun_path, p->name); + strlcpy(sa.sun_path, p->name, sizeof(sa.sun_path)); sa.sun_family = AF_LOCAL; - sa.sun_len = strlen(p->name) + - offsetof(struct sockaddr_un, sun_path); + sa.sun_len = SUN_LEN(&sa); (void)remove(p->name); @@ -360,10 +359,9 @@ lsock_init_port(struct tport *tp) return (SNMP_ERR_GENERR); } - strcpy(sa.sun_path, p->name); + strlcpy(sa.sun_path, p->name, sizeof(sa.sun_path)); sa.sun_family = AF_LOCAL; - sa.sun_len = strlen(p->name) + - offsetof(struct sockaddr_un, sun_path); + sa.sun_len = SUN_LEN(&sa); (void)remove(p->name); From owner-svn-src-all@freebsd.org Fri Jan 13 10:28:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C0FECADB70; Fri, 13 Jan 2017 10:28:27 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2129B149E; Fri, 13 Jan 2017 10:28:27 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DASQim098762; Fri, 13 Jan 2017 10:28:26 GMT (envelope-from amdmi3@FreeBSD.org) Received: (from amdmi3@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DASQdG098761; Fri, 13 Jan 2017 10:28:26 GMT (envelope-from amdmi3@FreeBSD.org) Message-Id: <201701131028.v0DASQdG098761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: amdmi3 set sender to amdmi3@FreeBSD.org using -f From: Dmitry Marakasov Date: Fri, 13 Jan 2017 10:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312062 - stable/11/contrib/bzip2 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 10:28:27 -0000 Author: amdmi3 (ports committer) Date: Fri Jan 13 10:28:26 2017 New Revision: 312062 URL: https://svnweb.freebsd.org/changeset/base/312062 Log: MFC r310718: bzip2 does not exit after showing license as requested with --version or --license as most apps would do, instead it waits for data to compress on stdin. Because of that, if `bzip2 --version' is called, bogus `bzip2: I won't write compressed data to a terminal' error message will be displayed, and checking for bzip2 version in scripts as in bzip2 --version 2>&1 | grep -o "Version [^,]*" will hand as bzip2 would wait for data to compress on stdin. Fix this by exiting right after showing version/license text. I've tried to push this upstream for more than a year, but author is unresponsive, so upstream may be considered dead. Ubuntu applies similar fix, for the note. PR: 199443 Approved by: dim, bapt Differential Revision: D8924 Modified: stable/11/contrib/bzip2/bzip2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bzip2/bzip2.c ============================================================================== --- stable/11/contrib/bzip2/bzip2.c Fri Jan 13 10:28:24 2017 (r312061) +++ stable/11/contrib/bzip2/bzip2.c Fri Jan 13 10:28:26 2017 (r312062) @@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *a case '8': blockSize100k = 8; break; case '9': blockSize100k = 9; break; case 'V': - case 'L': license(); break; + case 'L': license(); + exit ( 0 ); + break; case 'v': verbosity++; break; case 'h': usage ( progName ); exit ( 0 ); @@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *a if (ISFLAG("--keep")) keepInputFiles = True; else if (ISFLAG("--small")) smallMode = True; else if (ISFLAG("--quiet")) noisy = False; else - if (ISFLAG("--version")) license(); else - if (ISFLAG("--license")) license(); else + if (ISFLAG("--version")) { license(); exit ( 0 ); } else + if (ISFLAG("--license")) { license(); exit ( 0 ); } else if (ISFLAG("--exponential")) workFactor = 1; else if (ISFLAG("--repetitive-best")) redundant(aa->name); else if (ISFLAG("--repetitive-fast")) redundant(aa->name); else From owner-svn-src-all@freebsd.org Fri Jan 13 10:28:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA662CADB69; Fri, 13 Jan 2017 10:28:25 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 916CD149C; Fri, 13 Jan 2017 10:28:25 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DASOYK098704; Fri, 13 Jan 2017 10:28:24 GMT (envelope-from amdmi3@FreeBSD.org) Received: (from amdmi3@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DASOp8098703; Fri, 13 Jan 2017 10:28:24 GMT (envelope-from amdmi3@FreeBSD.org) Message-Id: <201701131028.v0DASOp8098703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: amdmi3 set sender to amdmi3@FreeBSD.org using -f From: Dmitry Marakasov Date: Fri, 13 Jan 2017 10:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312061 - stable/10/contrib/bzip2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 10:28:26 -0000 Author: amdmi3 (ports committer) Date: Fri Jan 13 10:28:24 2017 New Revision: 312061 URL: https://svnweb.freebsd.org/changeset/base/312061 Log: MFC r310718: bzip2 does not exit after showing license as requested with --version or --license as most apps would do, instead it waits for data to compress on stdin. Because of that, if `bzip2 --version' is called, bogus `bzip2: I won't write compressed data to a terminal' error message will be displayed, and checking for bzip2 version in scripts as in bzip2 --version 2>&1 | grep -o "Version [^,]*" will hand as bzip2 would wait for data to compress on stdin. Fix this by exiting right after showing version/license text. I've tried to push this upstream for more than a year, but author is unresponsive, so upstream may be considered dead. Ubuntu applies similar fix, for the note. PR: 199443 Approved by: dim, bapt Differential Revision: D8924 Modified: stable/10/contrib/bzip2/bzip2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bzip2/bzip2.c ============================================================================== --- stable/10/contrib/bzip2/bzip2.c Fri Jan 13 09:32:11 2017 (r312060) +++ stable/10/contrib/bzip2/bzip2.c Fri Jan 13 10:28:24 2017 (r312061) @@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *a case '8': blockSize100k = 8; break; case '9': blockSize100k = 9; break; case 'V': - case 'L': license(); break; + case 'L': license(); + exit ( 0 ); + break; case 'v': verbosity++; break; case 'h': usage ( progName ); exit ( 0 ); @@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *a if (ISFLAG("--keep")) keepInputFiles = True; else if (ISFLAG("--small")) smallMode = True; else if (ISFLAG("--quiet")) noisy = False; else - if (ISFLAG("--version")) license(); else - if (ISFLAG("--license")) license(); else + if (ISFLAG("--version")) { license(); exit ( 0 ); } else + if (ISFLAG("--license")) { license(); exit ( 0 ); } else if (ISFLAG("--exponential")) workFactor = 1; else if (ISFLAG("--repetitive-best")) redundant(aa->name); else if (ISFLAG("--repetitive-fast")) redundant(aa->name); else From owner-svn-src-all@freebsd.org Fri Jan 13 10:55:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04540CAC995; Fri, 13 Jan 2017 10:55:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7ECF18BE; Fri, 13 Jan 2017 10:55:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DAtQh2011130; Fri, 13 Jan 2017 10:55:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DAtQ6X011129; Fri, 13 Jan 2017 10:55:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201701131055.v0DAtQ6X011129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 13 Jan 2017 10:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312063 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 10:55:28 -0000 Author: tuexen Date: Fri Jan 13 10:55:26 2017 New Revision: 312063 URL: https://svnweb.freebsd.org/changeset/base/312063 Log: Ensure that the buffer length and the length provided in the IPv4 header match when using a raw socket to send IPv4 packets and providing the header. If they don't match, let send return -1 and set errno to EINVAL. Before this patch is was only enforced that the length in the header is not larger then the buffer length. PR: 212283 Reviewed by: ae, gnn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9161 Modified: head/sys/netinet/raw_ip.c Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Fri Jan 13 10:28:26 2017 (r312062) +++ head/sys/netinet/raw_ip.c Fri Jan 13 10:55:26 2017 (r312063) @@ -508,7 +508,7 @@ rip_output(struct mbuf *m, struct socket * and don't allow packet length sizes that will crash. */ if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options) - || (ntohs(ip->ip_len) > m->m_pkthdr.len) + || (ntohs(ip->ip_len) != m->m_pkthdr.len) || (ntohs(ip->ip_len) < (ip->ip_hl << 2))) { INP_RUNLOCK(inp); m_freem(m); From owner-svn-src-all@freebsd.org Fri Jan 13 12:31:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA6D7CAE42C; Fri, 13 Jan 2017 12:31:57 +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 6EB1E1AF3; Fri, 13 Jan 2017 12:31:57 +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 v0DCVulN049259; Fri, 13 Jan 2017 12:31:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DCVuYG049258; Fri, 13 Jan 2017 12:31:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131231.v0DCVuYG049258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 12:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312064 - stable/11/sys/fs/tmpfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 12:31:57 -0000 Author: kib Date: Fri Jan 13 12:31:56 2017 New Revision: 312064 URL: https://svnweb.freebsd.org/changeset/base/312064 Log: MFC r311523: Remove dead code. Modified: stable/11/sys/fs/tmpfs/tmpfs_fifoops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 10:55:26 2017 (r312063) +++ stable/11/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:31:56 2017 (r312064) @@ -49,27 +49,6 @@ #include static int -tmpfs_fifo_kqfilter(struct vop_kqfilter_args *ap) -{ - struct vnode *vp; - struct tmpfs_node *node; - - vp = ap->a_vp; - node = VP_TO_TMPFS_NODE(vp); - - switch (ap->a_kn->kn_filter){ - case EVFILT_READ: - node->tn_status |= TMPFS_NODE_ACCESSED; - break; - case EVFILT_WRITE: - node->tn_status |= TMPFS_NODE_MODIFIED; - break; - } - - return fifo_specops.vop_kqfilter(ap); -} - -static int tmpfs_fifo_close(struct vop_close_args *v) { struct tmpfs_node *node; @@ -90,6 +69,5 @@ struct vop_vector tmpfs_fifoop_entries = .vop_access = tmpfs_access, .vop_getattr = tmpfs_getattr, .vop_setattr = tmpfs_setattr, - .vop_kqfilter = tmpfs_fifo_kqfilter, }; From owner-svn-src-all@freebsd.org Fri Jan 13 12:36:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30377CAE53A; Fri, 13 Jan 2017 12:36:55 +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 E8BF81E14; Fri, 13 Jan 2017 12:36:54 +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 v0DCashK051754; Fri, 13 Jan 2017 12:36:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DCas4x051753; Fri, 13 Jan 2017 12:36:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131236.v0DCas4x051753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 12:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312065 - stable/11/sys/fs/tmpfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 12:36:55 -0000 Author: kib Date: Fri Jan 13 12:36:53 2017 New Revision: 312065 URL: https://svnweb.freebsd.org/changeset/base/312065 Log: MFC r311524: Use vnode lock assertion expression, assert exclusive ownership. Modified: stable/11/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:31:56 2017 (r312064) +++ stable/11/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:36:53 2017 (r312065) @@ -1458,7 +1458,7 @@ tmpfs_chflags(struct vnode *vp, u_long f int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chflags"); node = VP_TO_TMPFS_NODE(vp); @@ -1498,9 +1498,9 @@ tmpfs_chflags(struct vnode *vp, u_long f node->tn_flags = flags; node->tn_status |= TMPFS_NODE_CHANGED; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chflags2"); - return 0; + return (0); } /* @@ -1514,7 +1514,7 @@ tmpfs_chmod(struct vnode *vp, mode_t mod int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chmod"); node = VP_TO_TMPFS_NODE(vp); @@ -1554,9 +1554,9 @@ tmpfs_chmod(struct vnode *vp, mode_t mod node->tn_status |= TMPFS_NODE_CHANGED; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chmod2"); - return 0; + return (0); } /* @@ -1575,7 +1575,7 @@ tmpfs_chown(struct vnode *vp, uid_t uid, uid_t ouid; gid_t ogid; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chown"); node = VP_TO_TMPFS_NODE(vp); @@ -1625,9 +1625,9 @@ tmpfs_chown(struct vnode *vp, uid_t uid, node->tn_mode &= ~(S_ISUID | S_ISGID); } - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chown2"); - return 0; + return (0); } /* @@ -1642,7 +1642,7 @@ tmpfs_chsize(struct vnode *vp, u_quad_t int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chsize"); node = VP_TO_TMPFS_NODE(vp); @@ -1680,9 +1680,9 @@ tmpfs_chsize(struct vnode *vp, u_quad_t /* tmpfs_truncate will raise the NOTE_EXTEND and NOTE_ATTRIB kevents * for us, as will update tn_status; no need to do that here. */ - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chsize2"); - return error; + return (error); } /* @@ -1697,7 +1697,7 @@ tmpfs_chtimes(struct vnode *vp, struct v int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chtimes"); node = VP_TO_TMPFS_NODE(vp); @@ -1726,9 +1726,9 @@ tmpfs_chtimes(struct vnode *vp, struct v if (vap->va_birthtime.tv_sec != VNOVAL) node->tn_birthtime = vap->va_birthtime; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chtimes2"); - return 0; + return (0); } /* Sync timestamps */ From owner-svn-src-all@freebsd.org Fri Jan 13 12:38:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8968CAE624; Fri, 13 Jan 2017 12:38: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 B3BFC1024; Fri, 13 Jan 2017 12:38: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 v0DCcPDd051871; Fri, 13 Jan 2017 12:38:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DCcPCa051867; Fri, 13 Jan 2017 12:38:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131238.v0DCcPCa051867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 12:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312066 - stable/11/sys/fs/tmpfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 12:38:27 -0000 Author: kib Date: Fri Jan 13 12:38:25 2017 New Revision: 312066 URL: https://svnweb.freebsd.org/changeset/base/312066 Log: MFC r311525: Lock tmpfs node tn_status updates done under the shared vnode lock. Modified: stable/11/sys/fs/tmpfs/tmpfs.h stable/11/sys/fs/tmpfs/tmpfs_fifoops.c stable/11/sys/fs/tmpfs/tmpfs_subr.c stable/11/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs.h Fri Jan 13 12:36:53 2017 (r312065) +++ stable/11/sys/fs/tmpfs/tmpfs.h Fri Jan 13 12:38:25 2017 (r312066) @@ -199,7 +199,9 @@ struct tmpfs_node { * allocated for it or it has been reclaimed). */ struct vnode * tn_vnode; - /* interlock to protect tn_vpstate */ + /* Interlock to protect tn_vpstate, and tn_status under shared + * vnode lock. + */ struct mtx tn_interlock; /* Identify if current node has vnode assiocate with @@ -420,6 +422,7 @@ int tmpfs_chtimes(struct vnode *, struct void tmpfs_itimes(struct vnode *, const struct timespec *, const struct timespec *); +void tmpfs_set_status(struct tmpfs_node *node, int status); void tmpfs_update(struct vnode *); int tmpfs_truncate(struct vnode *, off_t); Modified: stable/11/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:36:53 2017 (r312065) +++ stable/11/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:38:25 2017 (r312066) @@ -52,11 +52,11 @@ static int tmpfs_fifo_close(struct vop_close_args *v) { struct tmpfs_node *node; - node = VP_TO_TMPFS_NODE(v->a_vp); - node->tn_status |= TMPFS_NODE_ACCESSED; + node = VP_TO_TMPFS_NODE(v->a_vp); + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); tmpfs_update(v->a_vp); - return fifo_specops.vop_close(v); + return (fifo_specops.vop_close(v)); } /* Modified: stable/11/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:36:53 2017 (r312065) +++ stable/11/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:38:25 2017 (r312066) @@ -1093,9 +1093,9 @@ tmpfs_dir_getdotdent(struct tmpfs_node * else error = uiomove(&dent, dent.d_reclen, uio); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); - return error; + return (error); } /* @@ -1138,9 +1138,9 @@ tmpfs_dir_getdotdotdent(struct tmpfs_nod else error = uiomove(&dent, dent.d_reclen, uio); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); - return error; + return (error); } /* @@ -1283,7 +1283,7 @@ tmpfs_dir_getdents(struct tmpfs_node *no node->tn_dir.tn_readdir_lastn = off; node->tn_dir.tn_readdir_lastp = de; - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); return error; } @@ -1731,15 +1731,25 @@ tmpfs_chtimes(struct vnode *vp, struct v return (0); } -/* Sync timestamps */ void -tmpfs_itimes(struct vnode *vp, const struct timespec *acc, +tmpfs_set_status(struct tmpfs_node *node, int status) +{ + + if ((node->tn_status & status) == status) + return; + TMPFS_NODE_LOCK(node); + node->tn_status |= status; + TMPFS_NODE_UNLOCK(node); +} + +/* Sync timestamps */ +static void +tmpfs_itimes_locked(struct tmpfs_node *node, const struct timespec *acc, const struct timespec *mod) { - struct tmpfs_node *node; struct timespec now; - node = VP_TO_TMPFS_NODE(vp); + TMPFS_ASSERT_LOCKED(node); if ((node->tn_status & (TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED)) == 0) @@ -1756,11 +1766,25 @@ tmpfs_itimes(struct vnode *vp, const str mod = &now; node->tn_mtime = *mod; } - if (node->tn_status & TMPFS_NODE_CHANGED) { + if (node->tn_status & TMPFS_NODE_CHANGED) node->tn_ctime = now; - } - node->tn_status &= - ~(TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED); + node->tn_status &= ~(TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | + TMPFS_NODE_CHANGED); +} + +void +tmpfs_itimes(struct vnode *vp, const struct timespec *acc, + const struct timespec *mod) +{ + struct tmpfs_node *node; + + ASSERT_VOP_LOCKED(vp, "tmpfs_itimes"); + node = VP_TO_TMPFS_NODE(vp); + + TMPFS_NODE_LOCK(node); + tmpfs_itimes_locked(node, acc, mod); + TMPFS_NODE_UNLOCK(node); + /* XXX: FIX? The entropy here is desirable, but the harvesting may be expensive */ random_harvest_queue(node, sizeof(*node), 1, RANDOM_FS_ATIME); } @@ -1794,14 +1818,13 @@ tmpfs_truncate(struct vnode *vp, off_t l return (EFBIG); error = tmpfs_reg_resize(vp, length, FALSE); - if (error == 0) { + if (error == 0) node->tn_status |= TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; - } out: tmpfs_update(vp); - return error; + return (error); } static __inline int Modified: stable/11/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_vnops.c Fri Jan 13 12:36:53 2017 (r312065) +++ stable/11/sys/fs/tmpfs/tmpfs_vnops.c Fri Jan 13 12:38:25 2017 (r312066) @@ -445,7 +445,7 @@ tmpfs_read(struct vop_read_args *v) if (uio->uio_offset < 0) return (EINVAL); node = VP_TO_TMPFS_NODE(vp); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); return (uiomove_object(node->tn_reg.tn_aobj, node->tn_size, uio)); } @@ -1082,8 +1082,8 @@ tmpfs_rmdir(struct vop_rmdir_args *v) v->a_cnp->cn_namelen)); /* Check flags to see if we are allowed to remove the directory. */ - if (dnode->tn_flags & APPEND - || node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) { + if ((dnode->tn_flags & APPEND) != 0 || + (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) != 0) { error = EPERM; goto out; } @@ -1099,7 +1099,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_ASSERT_ELOCKED(node); node->tn_links--; node->tn_dir.tn_parent = NULL; - node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \ + node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; TMPFS_NODE_UNLOCK(node); @@ -1107,8 +1107,8 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_NODE_LOCK(dnode); TMPFS_ASSERT_ELOCKED(dnode); dnode->tn_links--; - dnode->tn_status |= TMPFS_NODE_ACCESSED | \ - TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; + dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | + TMPFS_NODE_MODIFIED; TMPFS_NODE_UNLOCK(dnode); cache_purge(dvp); @@ -1220,9 +1220,9 @@ tmpfs_readlink(struct vop_readlink_args error = uiomove(node->tn_link, MIN(node->tn_size, uio->uio_resid), uio); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); - return error; + return (error); } static int From owner-svn-src-all@freebsd.org Fri Jan 13 12:44:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32D3FCAE940; Fri, 13 Jan 2017 12:44:54 +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 01A521690; Fri, 13 Jan 2017 12:44:53 +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 v0DCir3W055693; Fri, 13 Jan 2017 12:44:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DCirF8055692; Fri, 13 Jan 2017 12:44:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131244.v0DCirF8055692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 12:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312067 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 12:44:54 -0000 Author: kib Date: Fri Jan 13 12:44:52 2017 New Revision: 312067 URL: https://svnweb.freebsd.org/changeset/base/312067 Log: MFC r311523: Remove dead code. Modified: stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:38:25 2017 (r312066) +++ stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:44:52 2017 (r312067) @@ -49,27 +49,6 @@ #include static int -tmpfs_fifo_kqfilter(struct vop_kqfilter_args *ap) -{ - struct vnode *vp; - struct tmpfs_node *node; - - vp = ap->a_vp; - node = VP_TO_TMPFS_NODE(vp); - - switch (ap->a_kn->kn_filter){ - case EVFILT_READ: - node->tn_status |= TMPFS_NODE_ACCESSED; - break; - case EVFILT_WRITE: - node->tn_status |= TMPFS_NODE_MODIFIED; - break; - } - - return fifo_specops.vop_kqfilter(ap); -} - -static int tmpfs_fifo_close(struct vop_close_args *v) { struct tmpfs_node *node; @@ -90,6 +69,5 @@ struct vop_vector tmpfs_fifoop_entries = .vop_access = tmpfs_access, .vop_getattr = tmpfs_getattr, .vop_setattr = tmpfs_setattr, - .vop_kqfilter = tmpfs_fifo_kqfilter, }; From owner-svn-src-all@freebsd.org Fri Jan 13 12:45:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78A21CAEADE; Fri, 13 Jan 2017 12:45:55 +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 370FF19DC; Fri, 13 Jan 2017 12:45:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DCjseh055798; Fri, 13 Jan 2017 12:45:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DCjsEC055797; Fri, 13 Jan 2017 12:45:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131245.v0DCjsEC055797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 12:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312068 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 12:45:55 -0000 Author: kib Date: Fri Jan 13 12:45:54 2017 New Revision: 312068 URL: https://svnweb.freebsd.org/changeset/base/312068 Log: MFC r311524: Use vnode lock assertion expression, assert exclusive ownership. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:44:52 2017 (r312067) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:45:54 2017 (r312068) @@ -1458,7 +1458,7 @@ tmpfs_chflags(struct vnode *vp, u_long f int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chflags"); node = VP_TO_TMPFS_NODE(vp); @@ -1498,9 +1498,9 @@ tmpfs_chflags(struct vnode *vp, u_long f node->tn_flags = flags; node->tn_status |= TMPFS_NODE_CHANGED; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chflags2"); - return 0; + return (0); } /* @@ -1514,7 +1514,7 @@ tmpfs_chmod(struct vnode *vp, mode_t mod int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chmod"); node = VP_TO_TMPFS_NODE(vp); @@ -1554,9 +1554,9 @@ tmpfs_chmod(struct vnode *vp, mode_t mod node->tn_status |= TMPFS_NODE_CHANGED; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chmod2"); - return 0; + return (0); } /* @@ -1575,7 +1575,7 @@ tmpfs_chown(struct vnode *vp, uid_t uid, uid_t ouid; gid_t ogid; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chown"); node = VP_TO_TMPFS_NODE(vp); @@ -1625,9 +1625,9 @@ tmpfs_chown(struct vnode *vp, uid_t uid, node->tn_mode &= ~(S_ISUID | S_ISGID); } - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chown2"); - return 0; + return (0); } /* @@ -1642,7 +1642,7 @@ tmpfs_chsize(struct vnode *vp, u_quad_t int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chsize"); node = VP_TO_TMPFS_NODE(vp); @@ -1680,9 +1680,9 @@ tmpfs_chsize(struct vnode *vp, u_quad_t /* tmpfs_truncate will raise the NOTE_EXTEND and NOTE_ATTRIB kevents * for us, as will update tn_status; no need to do that here. */ - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chsize2"); - return error; + return (error); } /* @@ -1697,7 +1697,7 @@ tmpfs_chtimes(struct vnode *vp, struct v int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chtimes"); node = VP_TO_TMPFS_NODE(vp); @@ -1728,9 +1728,9 @@ tmpfs_chtimes(struct vnode *vp, struct v if (vap->va_birthtime.tv_nsec != VNOVAL && vap->va_birthtime.tv_nsec != VNOVAL) node->tn_birthtime = vap->va_birthtime; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chtimes2"); - return 0; + return (0); } /* Sync timestamps */ From owner-svn-src-all@freebsd.org Fri Jan 13 12:47:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7E58CAEC15; Fri, 13 Jan 2017 12:47:45 +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 84CBB1C84; Fri, 13 Jan 2017 12:47:45 +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 v0DCliKW056020; Fri, 13 Jan 2017 12:47:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DCliDE056016; Fri, 13 Jan 2017 12:47:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131247.v0DCliDE056016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 12:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312069 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 12:47:45 -0000 Author: kib Date: Fri Jan 13 12:47:44 2017 New Revision: 312069 URL: https://svnweb.freebsd.org/changeset/base/312069 Log: MFC r311525: Lock tmpfs node tn_status updates done under the shared vnode lock. Modified: stable/10/sys/fs/tmpfs/tmpfs.h stable/10/sys/fs/tmpfs/tmpfs_fifoops.c stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs.h Fri Jan 13 12:45:54 2017 (r312068) +++ stable/10/sys/fs/tmpfs/tmpfs.h Fri Jan 13 12:47:44 2017 (r312069) @@ -199,7 +199,9 @@ struct tmpfs_node { * allocated for it or it has been reclaimed). */ struct vnode * tn_vnode; - /* interlock to protect tn_vpstate */ + /* Interlock to protect tn_vpstate, and tn_status under shared + * vnode lock. + */ struct mtx tn_interlock; /* Identify if current node has vnode assiocate with @@ -420,6 +422,7 @@ int tmpfs_chtimes(struct vnode *, struct void tmpfs_itimes(struct vnode *, const struct timespec *, const struct timespec *); +void tmpfs_set_status(struct tmpfs_node *node, int status); void tmpfs_update(struct vnode *); int tmpfs_truncate(struct vnode *, off_t); Modified: stable/10/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:45:54 2017 (r312068) +++ stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:47:44 2017 (r312069) @@ -52,11 +52,11 @@ static int tmpfs_fifo_close(struct vop_close_args *v) { struct tmpfs_node *node; - node = VP_TO_TMPFS_NODE(v->a_vp); - node->tn_status |= TMPFS_NODE_ACCESSED; + node = VP_TO_TMPFS_NODE(v->a_vp); + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); tmpfs_update(v->a_vp); - return fifo_specops.vop_close(v); + return (fifo_specops.vop_close(v)); } /* Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:45:54 2017 (r312068) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:47:44 2017 (r312069) @@ -1092,9 +1092,9 @@ tmpfs_dir_getdotdent(struct tmpfs_node * else error = uiomove(&dent, dent.d_reclen, uio); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); - return error; + return (error); } /* @@ -1137,9 +1137,9 @@ tmpfs_dir_getdotdotdent(struct tmpfs_nod else error = uiomove(&dent, dent.d_reclen, uio); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); - return error; + return (error); } /* @@ -1282,7 +1282,7 @@ tmpfs_dir_getdents(struct tmpfs_node *no node->tn_dir.tn_readdir_lastn = off; node->tn_dir.tn_readdir_lastp = de; - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); return error; } @@ -1733,15 +1733,25 @@ tmpfs_chtimes(struct vnode *vp, struct v return (0); } -/* Sync timestamps */ void -tmpfs_itimes(struct vnode *vp, const struct timespec *acc, +tmpfs_set_status(struct tmpfs_node *node, int status) +{ + + if ((node->tn_status & status) == status) + return; + TMPFS_NODE_LOCK(node); + node->tn_status |= status; + TMPFS_NODE_UNLOCK(node); +} + +/* Sync timestamps */ +static void +tmpfs_itimes_locked(struct tmpfs_node *node, const struct timespec *acc, const struct timespec *mod) { - struct tmpfs_node *node; struct timespec now; - node = VP_TO_TMPFS_NODE(vp); + TMPFS_ASSERT_LOCKED(node); if ((node->tn_status & (TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED)) == 0) @@ -1758,11 +1768,25 @@ tmpfs_itimes(struct vnode *vp, const str mod = &now; node->tn_mtime = *mod; } - if (node->tn_status & TMPFS_NODE_CHANGED) { + if (node->tn_status & TMPFS_NODE_CHANGED) node->tn_ctime = now; - } - node->tn_status &= - ~(TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED); + node->tn_status &= ~(TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | + TMPFS_NODE_CHANGED); +} + +void +tmpfs_itimes(struct vnode *vp, const struct timespec *acc, + const struct timespec *mod) +{ + struct tmpfs_node *node; + + ASSERT_VOP_LOCKED(vp, "tmpfs_itimes"); + node = VP_TO_TMPFS_NODE(vp); + + TMPFS_NODE_LOCK(node); + tmpfs_itimes_locked(node, acc, mod); + TMPFS_NODE_UNLOCK(node); + } void @@ -1794,14 +1818,13 @@ tmpfs_truncate(struct vnode *vp, off_t l return (EFBIG); error = tmpfs_reg_resize(vp, length, FALSE); - if (error == 0) { + if (error == 0) node->tn_status |= TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; - } out: tmpfs_update(vp); - return error; + return (error); } static __inline int Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Fri Jan 13 12:45:54 2017 (r312068) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Fri Jan 13 12:47:44 2017 (r312069) @@ -441,7 +441,7 @@ tmpfs_read(struct vop_read_args *v) if (uio->uio_offset < 0) return (EINVAL); node = VP_TO_TMPFS_NODE(vp); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); return (uiomove_object(node->tn_reg.tn_aobj, node->tn_size, uio)); } @@ -1078,8 +1078,8 @@ tmpfs_rmdir(struct vop_rmdir_args *v) v->a_cnp->cn_namelen)); /* Check flags to see if we are allowed to remove the directory. */ - if (dnode->tn_flags & APPEND - || node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) { + if ((dnode->tn_flags & APPEND) != 0 || + (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) != 0) { error = EPERM; goto out; } @@ -1095,7 +1095,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_ASSERT_ELOCKED(node); node->tn_links--; node->tn_dir.tn_parent = NULL; - node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \ + node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; TMPFS_NODE_UNLOCK(node); @@ -1103,8 +1103,8 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_NODE_LOCK(dnode); TMPFS_ASSERT_ELOCKED(dnode); dnode->tn_links--; - dnode->tn_status |= TMPFS_NODE_ACCESSED | \ - TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; + dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | + TMPFS_NODE_MODIFIED; TMPFS_NODE_UNLOCK(dnode); cache_purge(dvp); @@ -1216,9 +1216,9 @@ tmpfs_readlink(struct vop_readlink_args error = uiomove(node->tn_link, MIN(node->tn_size, uio->uio_resid), uio); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); - return error; + return (error); } static int From owner-svn-src-all@freebsd.org Fri Jan 13 12:47:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28A46CAEC1B; Fri, 13 Jan 2017 12:47:48 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [IPv6:2001:610:1108:5010::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E7A451C88; Fri, 13 Jan 2017 12:47:47 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mailout.stack.nl (Postfix) with ESMTP id D471F35; Fri, 13 Jan 2017 13:47:36 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id C389128494; Fri, 13 Jan 2017 13:47:36 +0100 (CET) Date: Fri, 13 Jan 2017 13:47:36 +0100 From: Jilles Tjoelker To: "Ngie Cooper (yaneurabeya)" Cc: Craig Rodrigues , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r286649 - in head: contrib/netbsd-tests/lib/libc/locale lib/libc/tests/locale Message-ID: <20170113124736.GA91713@stack.nl> References: <201508112159.t7BLxa6U057950@repo.freebsd.org> <681075F8-78D1-43FF-A75D-71D5CDBA3AB4@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <681075F8-78D1-43FF-A75D-71D5CDBA3AB4@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 12:47:48 -0000 On Wed, Jan 11, 2017 at 02:14:13AM -0800, Ngie Cooper (yaneurabeya) wrote: > > On Aug 11, 2015, at 6:45 PM, Craig Rodrigues wrote: > > > > On Tue, Aug 11, 2015 at 2:59 PM, Jilles Tjoelker > wrote: > > Author: jilles > > Date: Tue Aug 11 21:59:36 2015 > > New Revision: 286649 > > URL: https://svnweb.freebsd.org/changeset/base/286649 > > Log: > > Fix and re-enable UTF-8 tests. > > Modified: > > head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c > > head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c > > head/lib/libc/tests/locale/Makefile > > Thanks for fixing this. What is the procedure that FreeBSD > > developers need to follow to push this kind of change upstream to > > NetBSD? > I’m submitting PRs with NetBSD as needed. To be frank, I’m not > sure that this change is needed upstream (I’m probably going to #ifdef > the code — some things I found when trying to push things back). I think the change is required upstream as well, since UTF-8 no longer includes code points greater than 0x10ffff per RFC 3629 (this change made the code point ranges of UTF-8 and UTF-16 the same). The sequences that used to correspond to code points greater than 0x10ffff shall be treated as invalid. See also SVN r286490, r286491, r287125. I suppose I should have included this reasoning in the original commit message. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Fri Jan 13 13:37:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB68ECAEA33; Fri, 13 Jan 2017 13:37:11 +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 87A9316C3; Fri, 13 Jan 2017 13:37:11 +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 v0DDbAHp076328; Fri, 13 Jan 2017 13:37:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DDb9tF076313; Fri, 13 Jan 2017 13:37:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131337.v0DDb9tF076313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 13:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312072 - in stable/11: bin/pax contrib/mtree sbin/fsck_ffs sys/fs/nfsclient sys/fs/tmpfs sys/ufs/ffs sys/ufs/ufs tests/sys/kern/pipe usr.bin/find usr.bin/gzip usr.sbin/fmtree X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 13:37:11 -0000 Author: kib Date: Fri Jan 13 13:37:09 2017 New Revision: 312072 URL: https://svnweb.freebsd.org/changeset/base/312072 Log: MFC r311522: Use type-independent formats for printing nlink_t and ino_t. Modified: stable/11/bin/pax/gen_subs.c stable/11/contrib/mtree/create.c stable/11/contrib/mtree/spec.c stable/11/contrib/mtree/specspec.c stable/11/sbin/fsck_ffs/suj.c stable/11/sys/fs/nfsclient/nfs_clvnops.c stable/11/sys/fs/tmpfs/tmpfs_vnops.c stable/11/sys/ufs/ffs/ffs_softdep.c stable/11/sys/ufs/ufs/ufs_vnops.c stable/11/tests/sys/kern/pipe/pipe_ino_test.c stable/11/usr.bin/find/ls.c stable/11/usr.bin/gzip/gzip.c stable/11/usr.sbin/fmtree/compare.c stable/11/usr.sbin/fmtree/create.c stable/11/usr.sbin/fmtree/specspec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/pax/gen_subs.c ============================================================================== --- stable/11/bin/pax/gen_subs.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/bin/pax/gen_subs.c Fri Jan 13 13:37:09 2017 (r312072) @@ -109,7 +109,8 @@ ls_list(ARCHD *arcn, time_t now, FILE *f */ if (strftime(f_date,DATELEN,timefrmt,localtime(&(sbp->st_mtime))) == 0) f_date[0] = '\0'; - (void)fprintf(fp, "%s%2u %-12s %-12s ", f_mode, sbp->st_nlink, + (void)fprintf(fp, "%s%2ju %-12s %-12s ", f_mode, + (uintmax_t)sbp->st_nlink, name_uid(sbp->st_uid, 1), name_gid(sbp->st_gid, 1)); /* Modified: stable/11/contrib/mtree/create.c ============================================================================== --- stable/11/contrib/mtree/create.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/contrib/mtree/create.c Fri Jan 13 13:37:09 2017 (r312072) @@ -224,7 +224,8 @@ statf(FILE *fp, int indent, FTSENT *p) output(fp, indent, &offset, "device=%#jx", (uintmax_t)p->fts_statp->st_rdev); if (keys & F_NLINK && p->fts_statp->st_nlink != 1) - output(fp, indent, &offset, "nlink=%u", p->fts_statp->st_nlink); + output(fp, indent, &offset, "nlink=%ju", + (uintmax_t)p->fts_statp->st_nlink); if (keys & F_SIZE && (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) output(fp, indent, &offset, "size=%ju", Modified: stable/11/contrib/mtree/spec.c ============================================================================== --- stable/11/contrib/mtree/spec.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/contrib/mtree/spec.c Fri Jan 13 13:37:09 2017 (r312072) @@ -363,7 +363,8 @@ dump_nodes(FILE *fp, const char *dir, NO appendfield(fp, pathlast, "device=%#jx", (uintmax_t)cur->st_rdev); if (MATCHFLAG(F_NLINK)) - appendfield(fp, pathlast, "nlink=%d", cur->st_nlink); + appendfield(fp, pathlast, "nlink=%ju", + (uintmax_t)cur->st_nlink); if (MATCHFLAG(F_SLINK)) appendfield(fp, pathlast, "link=%s", vispath(cur->slink)); Modified: stable/11/contrib/mtree/specspec.c ============================================================================== --- stable/11/contrib/mtree/specspec.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/contrib/mtree/specspec.c Fri Jan 13 13:37:09 2017 (r312072) @@ -73,7 +73,7 @@ shownode(NODE *n, int f, char const *pat if (f & F_MODE) printf(" mode=%o", n->st_mode); if (f & F_NLINK) - printf(" nlink=%d", n->st_nlink); + printf(" nlink=%ju", (uintmax_t)n->st_nlink); if (f & F_SIZE) printf(" size=%jd", (intmax_t)n->st_size); if (f & F_UID) Modified: stable/11/sbin/fsck_ffs/suj.c ============================================================================== --- stable/11/sbin/fsck_ffs/suj.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/sbin/fsck_ffs/suj.c Fri Jan 13 13:37:09 2017 (r312072) @@ -1396,11 +1396,12 @@ ino_adjust(struct suj_ino *sino) ip = ino_read(ino); mode = DIP(ip, di_mode) & IFMT; if (nlink > LINK_MAX) - err_suj("ino %ju nlink manipulation error, new %d, old %d\n", - (uintmax_t)ino, nlink, DIP(ip, di_nlink)); + err_suj("ino %ju nlink manipulation error, new %ju, old %d\n", + (uintmax_t)ino, (uintmax_t)nlink, DIP(ip, di_nlink)); if (debug) - printf("Adjusting ino %ju, nlink %d, old link %d lastmode %o\n", - (uintmax_t)ino, nlink, DIP(ip, di_nlink), sino->si_mode); + printf("Adjusting ino %ju, nlink %ju, old link %d lastmode %o\n", + (uintmax_t)ino, (uintmax_t)nlink, DIP(ip, di_nlink), + sino->si_mode); if (mode == 0) { if (debug) printf("ino %ju, zero inode freeing bitmap\n", @@ -1419,8 +1420,9 @@ ino_adjust(struct suj_ino *sino) /* If the inode doesn't have enough links to live, free it. */ if (nlink < reqlink) { if (debug) - printf("ino %ju not enough links to live %d < %d\n", - (uintmax_t)ino, nlink, reqlink); + printf("ino %ju not enough links to live %ju < %ju\n", + (uintmax_t)ino, (uintmax_t)nlink, + (uintmax_t)reqlink); ino_reclaim(ip, ino, mode); return; } @@ -1657,10 +1659,12 @@ ino_check(struct suj_ino *sino) err_suj("Inode mode/directory type mismatch %o != %o\n", mode, rrec->jr_mode); if (debug) - printf("jrefrec: op %d ino %ju, nlink %d, parent %d, " + printf("jrefrec: op %d ino %ju, nlink %ju, parent %ju, " "diroff %jd, mode %o, isat %d, isdot %d\n", rrec->jr_op, (uintmax_t)rrec->jr_ino, - rrec->jr_nlink, rrec->jr_parent, rrec->jr_diroff, + (uintmax_t)rrec->jr_nlink, + (uintmax_t)rrec->jr_parent, + (uintmax_t)rrec->jr_diroff, rrec->jr_mode, isat, isdot); mode = rrec->jr_mode & IFMT; if (rrec->jr_op == JOP_REMREF) @@ -1677,8 +1681,10 @@ ino_check(struct suj_ino *sino) * by one. */ if (debug) - printf("ino %ju nlink %d newlinks %d removes %d dotlinks %d\n", - (uintmax_t)ino, nlink, newlinks, removes, dotlinks); + printf( + "ino %ju nlink %ju newlinks %ju removes %ju dotlinks %ju\n", + (uintmax_t)ino, (uintmax_t)nlink, (uintmax_t)newlinks, + (uintmax_t)removes, (uintmax_t)dotlinks); nlink += newlinks; nlink -= removes; sino->si_linkadj = 1; @@ -1962,15 +1968,17 @@ ino_append(union jrec *rec) mvrec = &rec->rec_jmvrec; refrec = &rec->rec_jrefrec; if (debug && mvrec->jm_op == JOP_MVREF) - printf("ino move: ino %d, parent %d, diroff %jd, oldoff %jd\n", - mvrec->jm_ino, mvrec->jm_parent, mvrec->jm_newoff, - mvrec->jm_oldoff); + printf("ino move: ino %ju, parent %ju, " + "diroff %jd, oldoff %jd\n", + (uintmax_t)mvrec->jm_ino, (uintmax_t)mvrec->jm_parent, + (uintmax_t)mvrec->jm_newoff, (uintmax_t)mvrec->jm_oldoff); else if (debug && (refrec->jr_op == JOP_ADDREF || refrec->jr_op == JOP_REMREF)) - printf("ino ref: op %d, ino %d, nlink %d, " - "parent %d, diroff %jd\n", - refrec->jr_op, refrec->jr_ino, refrec->jr_nlink, - refrec->jr_parent, refrec->jr_diroff); + printf("ino ref: op %d, ino %ju, nlink %ju, " + "parent %ju, diroff %jd\n", + refrec->jr_op, (uintmax_t)refrec->jr_ino, + (uintmax_t)refrec->jr_nlink, + (uintmax_t)refrec->jr_parent, (uintmax_t)refrec->jr_diroff); sino = ino_lookup(((struct jrefrec *)rec)->jr_ino, 1); sino->si_hasrecs = 1; srec = errmalloc(sizeof(*srec)); @@ -2182,9 +2190,10 @@ blk_build(struct jblkrec *blkrec) if (debug) printf("blk_build: op %d blkno %jd frags %d oldfrags %d " - "ino %d lbn %jd\n", - blkrec->jb_op, blkrec->jb_blkno, blkrec->jb_frags, - blkrec->jb_oldfrags, blkrec->jb_ino, blkrec->jb_lbn); + "ino %ju lbn %jd\n", + blkrec->jb_op, (uintmax_t)blkrec->jb_blkno, + blkrec->jb_frags, blkrec->jb_oldfrags, + (uintmax_t)blkrec->jb_ino, (uintmax_t)blkrec->jb_lbn); blk = blknum(fs, blkrec->jb_blkno); frag = fragnum(fs, blkrec->jb_blkno); @@ -2232,8 +2241,9 @@ ino_build_trunc(struct jtrncrec *rec) struct suj_ino *sino; if (debug) - printf("ino_build_trunc: op %d ino %d, size %jd\n", - rec->jt_op, rec->jt_ino, rec->jt_size); + printf("ino_build_trunc: op %d ino %ju, size %jd\n", + rec->jt_op, (uintmax_t)rec->jt_ino, + (uintmax_t)rec->jt_size); sino = ino_lookup(rec->jt_ino, 1); if (rec->jt_op == JOP_SYNC) { sino->si_trunc = NULL; Modified: stable/11/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clvnops.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/sys/fs/nfsclient/nfs_clvnops.c Fri Jan 13 13:37:09 2017 (r312072) @@ -3135,8 +3135,8 @@ nfs_print(struct vop_print_args *ap) struct vnode *vp = ap->a_vp; struct nfsnode *np = VTONFS(vp); - printf("\tfileid %ld fsid 0x%x", np->n_vattr.na_fileid, - np->n_vattr.na_fsid); + printf("\tfileid %jd fsid 0x%jx", (uintmax_t)np->n_vattr.na_fileid, + (uintmax_t)np->n_vattr.na_fsid); if (vp->v_type == VFIFO) fifo_printinfo(vp); printf("\n"); Modified: stable/11/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_vnops.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/sys/fs/tmpfs/tmpfs_vnops.c Fri Jan 13 13:37:09 2017 (r312072) @@ -1286,8 +1286,8 @@ tmpfs_print(struct vop_print_args *v) node = VP_TO_TMPFS_NODE(vp); - printf("tag VT_TMPFS, tmpfs_node %p, flags 0x%lx, links %d\n", - node, node->tn_flags, node->tn_links); + printf("tag VT_TMPFS, tmpfs_node %p, flags 0x%lx, links %jd\n", + node, node->tn_flags, (uintmax_t)node->tn_links); printf("\tmode 0%o, owner %d, group %d, size %jd, status 0x%x\n", node->tn_mode, node->tn_uid, node->tn_gid, (intmax_t)node->tn_size, node->tn_status); Modified: stable/11/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_softdep.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/sys/ufs/ffs/ffs_softdep.c Fri Jan 13 13:37:09 2017 (r312072) @@ -11525,7 +11525,8 @@ handle_written_inodeblock(inodedep, bp, panic("handle_written_inodeblock: bad size"); if (inodedep->id_savednlink > LINK_MAX) panic("handle_written_inodeblock: Invalid link count " - "%d for inodedep %p", inodedep->id_savednlink, inodedep); + "%jd for inodedep %p", (uintmax_t)inodedep->id_savednlink, + inodedep); if (fstype == UFS1) { if (dp1->di_nlink != inodedep->id_savednlink) { dp1->di_nlink = inodedep->id_savednlink; @@ -14271,13 +14272,14 @@ softdep_error(func, error) static void inodedep_print(struct inodedep *inodedep, int verbose) { - db_printf("%p fs %p st %x ino %jd inoblk %jd delta %d nlink %d" + db_printf("%p fs %p st %x ino %jd inoblk %jd delta %jd nlink %jd" " saveino %p\n", inodedep, inodedep->id_fs, inodedep->id_state, (intmax_t)inodedep->id_ino, (intmax_t)fsbtodb(inodedep->id_fs, ino_to_fsba(inodedep->id_fs, inodedep->id_ino)), - inodedep->id_nlinkdelta, inodedep->id_savednlink, + (intmax_t)inodedep->id_nlinkdelta, + (intmax_t)inodedep->id_savednlink, inodedep->id_savedino1); if (verbose == 0) Modified: stable/11/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_vnops.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/sys/ufs/ufs/ufs_vnops.c Fri Jan 13 13:37:09 2017 (r312072) @@ -948,8 +948,8 @@ print_bad_link_count(const char *funcnam struct inode *dip; dip = VTOI(dvp); - uprintf("%s: Bad link count %d on parent inode %d in file system %s\n", - funcname, dip->i_effnlink, dip->i_number, + uprintf("%s: Bad link count %d on parent inode %jd in file system %s\n", + funcname, dip->i_effnlink, (intmax_t)dip->i_number, dvp->v_mount->mnt_stat.f_mntonname); } Modified: stable/11/tests/sys/kern/pipe/pipe_ino_test.c ============================================================================== --- stable/11/tests/sys/kern/pipe/pipe_ino_test.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/tests/sys/kern/pipe/pipe_ino_test.c Fri Jan 13 13:37:09 2017 (r312072) @@ -53,9 +53,11 @@ main(void) if (fstat(pipefd[1], &st2) == -1) err(1, "FAIL: fstat st2"); if (st1.st_dev != st2.st_dev || st1.st_dev == 0 || st2.st_dev == 0) - errx(1, "FAIL: wrong dev number %d %d", st1.st_dev, st2.st_dev); + errx(1, "FAIL: wrong dev number %ju %ju", + (uintmax_t)st1.st_dev, (uintmax_t)st2.st_dev); if (st1.st_ino == st2.st_ino) - errx(1, "FAIL: inode numbers are equal: %d", st1.st_ino); + errx(1, "FAIL: inode numbers are equal: %ju", + (uintmax_t)st1.st_ino); close(pipefd[0]); close(pipefd[1]); Modified: stable/11/usr.bin/find/ls.c ============================================================================== --- stable/11/usr.bin/find/ls.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/usr.bin/find/ls.c Fri Jan 13 13:37:09 2017 (r312072) @@ -65,7 +65,8 @@ printlong(char *name, char *accpath, str (void)printf("%6ju %8"PRId64" ", (uintmax_t)sb->st_ino, sb->st_blocks); (void)strmode(sb->st_mode, modep); - (void)printf("%s %3u %-*s %-*s ", modep, sb->st_nlink, MAXLOGNAME - 1, + (void)printf("%s %3ju %-*s %-*s ", modep, (uintmax_t)sb->st_nlink, + MAXLOGNAME - 1, user_from_uid(sb->st_uid, 0), MAXLOGNAME - 1, group_from_gid(sb->st_gid, 0)); Modified: stable/11/usr.bin/gzip/gzip.c ============================================================================== --- stable/11/usr.bin/gzip/gzip.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/usr.bin/gzip/gzip.c Fri Jan 13 13:37:09 2017 (r312072) @@ -1252,8 +1252,8 @@ file_compress(char *file, char *outfile, if (cflag == 0) { #ifndef SMALL if (isb.st_nlink > 1 && fflag == 0) { - maybe_warnx("%s has %d other link%s -- skipping", - file, isb.st_nlink - 1, + maybe_warnx("%s has %ju other link%s -- skipping", + file, (uintmax_t)isb.st_nlink - 1, (isb.st_nlink - 1) == 1 ? "" : "s"); close(in); return (-1); @@ -1448,8 +1448,8 @@ file_uncompress(char *file, char *outfil goto lose; #ifndef SMALL if (isb.st_nlink > 1 && lflag == 0 && fflag == 0) { - maybe_warnx("%s has %d other links -- skipping", - file, isb.st_nlink - 1); + maybe_warnx("%s has %ju other links -- skipping", + file, (uintmax_t)isb.st_nlink - 1); goto lose; } if (nflag == 0 && timestamp) Modified: stable/11/usr.sbin/fmtree/compare.c ============================================================================== --- stable/11/usr.sbin/fmtree/compare.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/usr.sbin/fmtree/compare.c Fri Jan 13 13:37:09 2017 (r312072) @@ -165,8 +165,9 @@ typeerr: LABEL; if (s->flags & F_NLINK && s->type != F_DIR && s->st_nlink != p->fts_statp->st_nlink) { LABEL; - (void)printf("%slink_count expected %u found %u\n", - tab, s->st_nlink, p->fts_statp->st_nlink); + (void)printf("%slink_count expected %ju found %ju\n", + tab, (uintmax_t)s->st_nlink, + (uintmax_t)p->fts_statp->st_nlink); tab = "\t"; } if (s->flags & F_SIZE && s->st_size != p->fts_statp->st_size && Modified: stable/11/usr.sbin/fmtree/create.c ============================================================================== --- stable/11/usr.sbin/fmtree/create.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/usr.sbin/fmtree/create.c Fri Jan 13 13:37:09 2017 (r312072) @@ -207,7 +207,8 @@ statf(int indent, FTSENT *p) if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != mode) output(indent, &offset, "mode=%#o", p->fts_statp->st_mode & MBITS); if (keys & F_NLINK && p->fts_statp->st_nlink != 1) - output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink); + output(indent, &offset, "nlink=%ju", + (uintmax_t)p->fts_statp->st_nlink); if (keys & F_SIZE && S_ISREG(p->fts_statp->st_mode)) output(indent, &offset, "size=%jd", (intmax_t)p->fts_statp->st_size); Modified: stable/11/usr.sbin/fmtree/specspec.c ============================================================================== --- stable/11/usr.sbin/fmtree/specspec.c Fri Jan 13 13:03:47 2017 (r312071) +++ stable/11/usr.sbin/fmtree/specspec.c Fri Jan 13 13:37:09 2017 (r312072) @@ -64,7 +64,7 @@ shownode(NODE *n, int f, char const *pat if (f & F_MODE) printf(" mode=%o", n->st_mode); if (f & F_NLINK) - printf(" nlink=%d", n->st_nlink); + printf(" nlink=%ju", (uintmax_t)n->st_nlink); if (f & F_SIZE) printf(" size=%jd", (intmax_t)n->st_size); if (f & F_UID) From owner-svn-src-all@freebsd.org Fri Jan 13 13:45:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9396ECAED81; Fri, 13 Jan 2017 13:45:35 +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 6E8F61DB8; Fri, 13 Jan 2017 13:45:35 +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 v0DDjYeC080610; Fri, 13 Jan 2017 13:45:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DDjY5X080606; Fri, 13 Jan 2017 13:45:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131345.v0DDjY5X080606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 13:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312073 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 13:45:35 -0000 Author: kib Date: Fri Jan 13 13:45:34 2017 New Revision: 312073 URL: https://svnweb.freebsd.org/changeset/base/312073 Log: MFC r309710: Add a new populate() pager method and extend device pager ops vector with cdev_pg_populate() to provide device drivers access to it. MFC r310849: Fix two similar bugs in the populate vm_fault() code. Modified: stable/11/sys/vm/device_pager.c stable/11/sys/vm/vm_fault.c stable/11/sys/vm/vm_object.h stable/11/sys/vm/vm_pager.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/device_pager.c ============================================================================== --- stable/11/sys/vm/device_pager.c Fri Jan 13 13:37:09 2017 (r312072) +++ stable/11/sys/vm/device_pager.c Fri Jan 13 13:45:34 2017 (r312073) @@ -63,6 +63,8 @@ static int dev_pager_getpages(vm_object_ static void dev_pager_putpages(vm_object_t, vm_page_t *, int, int, int *); static boolean_t dev_pager_haspage(vm_object_t, vm_pindex_t, int *, int *); static void dev_pager_free_page(vm_object_t object, vm_page_t m); +static int dev_pager_populate(vm_object_t object, vm_pindex_t pidx, + int fault_type, vm_prot_t, vm_pindex_t *first, vm_pindex_t *last); /* list of device pager objects */ static struct pagerlst dev_pager_object_list; @@ -84,6 +86,7 @@ struct pagerops mgtdevicepagerops = { .pgo_getpages = dev_pager_getpages, .pgo_putpages = dev_pager_putpages, .pgo_haspage = dev_pager_haspage, + .pgo_populate = dev_pager_populate, }; static int old_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, @@ -127,6 +130,8 @@ cdev_pager_allocate(void *handle, enum o if (tp != OBJT_DEVICE && tp != OBJT_MGTDEVICE) return (NULL); + KASSERT(tp == OBJT_MGTDEVICE || ops->cdev_pg_populate == NULL, + ("populate on unmanaged device pager")); /* * Offset should be page aligned. @@ -179,6 +184,8 @@ cdev_pager_allocate(void *handle, enum o object->handle = handle; TAILQ_INSERT_TAIL(&dev_pager_object_list, object, pager_object_list); + if (ops->cdev_pg_populate != NULL) + vm_object_set_flag(object, OBJ_POPULATE); } } else { if (pindex > object->size) @@ -268,6 +275,8 @@ dev_pager_getpages(vm_object_t object, v /* Since our haspage reports zero after/before, the count is 1. */ KASSERT(count == 1, ("%s: count %d", __func__, count)); VM_OBJECT_ASSERT_WLOCKED(object); + if (object->un_pager.devp.ops->cdev_pg_fault == NULL) + return (VM_PAGER_FAIL); error = object->un_pager.devp.ops->cdev_pg_fault(object, IDX_TO_OFF(ma[0]->pindex), PROT_READ, &ma[0]); @@ -293,6 +302,18 @@ dev_pager_getpages(vm_object_t object, v } static int +dev_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type, + vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) +{ + + VM_OBJECT_ASSERT_WLOCKED(object); + if (object->un_pager.devp.ops->cdev_pg_populate == NULL) + return (VM_PAGER_FAIL); + return (object->un_pager.devp.ops->cdev_pg_populate(object, pidx, + fault_type, max_prot, first, last)); +} + +static int old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, int prot, vm_page_t *mres) { Modified: stable/11/sys/vm/vm_fault.c ============================================================================== --- stable/11/sys/vm/vm_fault.c Fri Jan 13 13:37:09 2017 (r312072) +++ stable/11/sys/vm/vm_fault.c Fri Jan 13 13:45:34 2017 (r312073) @@ -289,6 +289,157 @@ vm_fault_soft_fast(struct faultstate *fs return (KERN_SUCCESS); } +static void +vm_fault_restore_map_lock(struct faultstate *fs) +{ + + VM_OBJECT_ASSERT_WLOCKED(fs->first_object); + MPASS(fs->first_object->paging_in_progress > 0); + + if (!vm_map_trylock_read(fs->map)) { + VM_OBJECT_WUNLOCK(fs->first_object); + vm_map_lock_read(fs->map); + VM_OBJECT_WLOCK(fs->first_object); + } + fs->lookup_still_valid = true; +} + +static void +vm_fault_populate_check_page(vm_page_t m) +{ + + /* + * Check each page to ensure that the pager is obeying the + * interface: the page must be installed in the object, fully + * valid, and exclusively busied. + */ + MPASS(m != NULL); + MPASS(m->valid == VM_PAGE_BITS_ALL); + MPASS(vm_page_xbusied(m)); +} + +static void +vm_fault_populate_cleanup(vm_object_t object, vm_pindex_t first, + vm_pindex_t last) +{ + vm_page_t m; + vm_pindex_t pidx; + + VM_OBJECT_ASSERT_WLOCKED(object); + MPASS(first <= last); + for (pidx = first, m = vm_page_lookup(object, pidx); + pidx <= last; pidx++, m = vm_page_next(m)) { + vm_fault_populate_check_page(m); + vm_page_lock(m); + vm_page_deactivate(m); + vm_page_unlock(m); + vm_page_xunbusy(m); + } +} + +static int +vm_fault_populate(struct faultstate *fs, vm_offset_t vaddr, vm_prot_t prot, + int fault_type, int fault_flags, boolean_t wired, vm_page_t *m_hold) +{ + vm_page_t m; + vm_pindex_t map_first, map_last, pager_first, pager_last, pidx; + int rv; + + MPASS(fs->object == fs->first_object); + VM_OBJECT_ASSERT_WLOCKED(fs->first_object); + MPASS(fs->first_object->paging_in_progress > 0); + MPASS(fs->first_object->backing_object == NULL); + MPASS(fs->lookup_still_valid); + + pager_first = OFF_TO_IDX(fs->entry->offset); + pager_last = OFF_TO_IDX(fs->entry->offset + fs->entry->end - + fs->entry->start) - 1; + unlock_map(fs); + unlock_vp(fs); + + /* + * Call the pager (driver) populate() method. + * + * There is no guarantee that the method will be called again + * if the current fault is for read, and a future fault is + * for write. Report the entry's maximum allowed protection + * to the driver. + */ + rv = vm_pager_populate(fs->first_object, fs->first_pindex, + fault_type, fs->entry->max_protection, &pager_first, &pager_last); + + VM_OBJECT_ASSERT_WLOCKED(fs->first_object); + if (rv == VM_PAGER_BAD) { + /* + * VM_PAGER_BAD is the backdoor for a pager to request + * normal fault handling. + */ + vm_fault_restore_map_lock(fs); + if (fs->map->timestamp != fs->map_generation) + return (KERN_RESOURCE_SHORTAGE); /* RetryFault */ + return (KERN_NOT_RECEIVER); + } + if (rv != VM_PAGER_OK) + return (KERN_FAILURE); /* AKA SIGSEGV */ + + /* Ensure that the driver is obeying the interface. */ + MPASS(pager_first <= pager_last); + MPASS(fs->first_pindex <= pager_last); + MPASS(fs->first_pindex >= pager_first); + MPASS(pager_last < fs->first_object->size); + + vm_fault_restore_map_lock(fs); + if (fs->map->timestamp != fs->map_generation) { + vm_fault_populate_cleanup(fs->first_object, pager_first, + pager_last); + return (KERN_RESOURCE_SHORTAGE); /* RetryFault */ + } + + /* + * The map is unchanged after our last unlock. Process the fault. + * + * The range [pager_first, pager_last] that is given to the + * pager is only a hint. The pager may populate any range + * within the object that includes the requested page index. + * In case the pager expanded the range, clip it to fit into + * the map entry. + */ + map_first = MAX(OFF_TO_IDX(fs->entry->offset), pager_first); + if (map_first > pager_first) + vm_fault_populate_cleanup(fs->first_object, pager_first, + map_first - 1); + map_last = MIN(OFF_TO_IDX(fs->entry->end - fs->entry->start + + fs->entry->offset), pager_last); + if (map_last < pager_last) + vm_fault_populate_cleanup(fs->first_object, map_last + 1, + pager_last); + + for (pidx = map_first, m = vm_page_lookup(fs->first_object, pidx); + pidx <= map_last; pidx++, m = vm_page_next(m)) { + vm_fault_populate_check_page(m); + vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags, + true); + VM_OBJECT_WUNLOCK(fs->first_object); + pmap_enter(fs->map->pmap, fs->entry->start + IDX_TO_OFF(pidx) - + fs->entry->offset, m, prot, fault_type | (wired ? + PMAP_ENTER_WIRED : 0), 0); + VM_OBJECT_WLOCK(fs->first_object); + if (pidx == fs->first_pindex) + vm_fault_fill_hold(m_hold, m); + vm_page_lock(m); + if ((fault_flags & VM_FAULT_WIRE) != 0) { + KASSERT(wired, ("VM_FAULT_WIRE && !wired")); + vm_page_wire(m); + } else { + vm_page_activate(m); + } + vm_page_unlock(m); + vm_page_xunbusy(m); + } + curthread->td_ru.ru_majflt++; + return (KERN_SUCCESS); +} + /* * vm_fault: * @@ -554,6 +705,30 @@ RetryFault:; return (KERN_PROTECTION_FAILURE); } + if (fs.object == fs.first_object && + (fs.first_object->flags & OBJ_POPULATE) != 0 && + fs.first_object->shadow_count == 0) { + rv = vm_fault_populate(&fs, vaddr, prot, + fault_type, fault_flags, wired, m_hold); + switch (rv) { + case KERN_SUCCESS: + case KERN_FAILURE: + unlock_and_deallocate(&fs); + return (rv); + case KERN_RESOURCE_SHORTAGE: + unlock_and_deallocate(&fs); + goto RetryFault; + case KERN_NOT_RECEIVER: + /* + * Pager's populate() method + * returned VM_PAGER_BAD. + */ + break; + default: + panic("inconsistent return codes"); + } + } + /* * Allocate a new page for this object/offset pair. * Modified: stable/11/sys/vm/vm_object.h ============================================================================== --- stable/11/sys/vm/vm_object.h Fri Jan 13 13:37:09 2017 (r312072) +++ stable/11/sys/vm/vm_object.h Fri Jan 13 13:45:34 2017 (r312073) @@ -182,6 +182,7 @@ struct vm_object { */ #define OBJ_FICTITIOUS 0x0001 /* (c) contains fictitious pages */ #define OBJ_UNMANAGED 0x0002 /* (c) contains unmanaged pages */ +#define OBJ_POPULATE 0x0004 /* pager implements populate() */ #define OBJ_DEAD 0x0008 /* dead objects (during rundown) */ #define OBJ_NOSPLIT 0x0010 /* dont split this object */ #define OBJ_UMTXDEAD 0x0020 /* umtx pshared was terminated */ Modified: stable/11/sys/vm/vm_pager.h ============================================================================== --- stable/11/sys/vm/vm_pager.h Fri Jan 13 13:37:09 2017 (r312072) +++ stable/11/sys/vm/vm_pager.h Fri Jan 13 13:45:34 2017 (r312073) @@ -56,6 +56,8 @@ typedef int pgo_getpages_async_t(vm_obje pgo_getpages_iodone_t, void *); typedef void pgo_putpages_t(vm_object_t, vm_page_t *, int, int, int *); typedef boolean_t pgo_haspage_t(vm_object_t, vm_pindex_t, int *, int *); +typedef int pgo_populate_t(vm_object_t, vm_pindex_t, int, vm_prot_t, + vm_pindex_t *, vm_pindex_t *); typedef void pgo_pageunswapped_t(vm_page_t); struct pagerops { @@ -66,6 +68,7 @@ struct pagerops { pgo_getpages_async_t *pgo_getpages_async; /* Get page asyncly. */ pgo_putpages_t *pgo_putpages; /* Put (write) page. */ pgo_haspage_t *pgo_haspage; /* Query page. */ + pgo_populate_t *pgo_populate; /* Bulk spec pagein. */ pgo_pageunswapped_t *pgo_pageunswapped; }; @@ -151,6 +154,19 @@ vm_pager_has_page( return (ret); } +static __inline int +vm_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type, + vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) +{ + + MPASS((object->flags & OBJ_POPULATE) != 0); + MPASS(pidx < object->size); + MPASS(object->paging_in_progress > 0); + return ((*pagertab[object->type]->pgo_populate)(object, pidx, + fault_type, max_prot, first, last)); +} + + /* * vm_pager_page_unswapped * @@ -176,6 +192,9 @@ vm_pager_page_unswapped(vm_page_t m) struct cdev_pager_ops { int (*cdev_pg_fault)(vm_object_t vm_obj, vm_ooffset_t offset, int prot, vm_page_t *mres); + int (*cdev_pg_populate)(vm_object_t vm_obj, vm_pindex_t pidx, + int fault_type, vm_prot_t max_prot, vm_pindex_t *first, + vm_pindex_t *last); int (*cdev_pg_ctor)(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred, u_short *color); void (*cdev_pg_dtor)(void *handle); From owner-svn-src-all@freebsd.org Fri Jan 13 13:47:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D210ACAEE47; Fri, 13 Jan 2017 13:47:27 +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 AD29A1F44; Fri, 13 Jan 2017 13:47:27 +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 v0DDlQGJ080722; Fri, 13 Jan 2017 13:47:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DDlQ3C080721; Fri, 13 Jan 2017 13:47:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131347.v0DDlQ3C080721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 13:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312074 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 13:47:27 -0000 Author: kib Date: Fri Jan 13 13:47:26 2017 New Revision: 312074 URL: https://svnweb.freebsd.org/changeset/base/312074 Log: MFC r309711: Implement the populate() pager method for phys pager. Modified: stable/11/sys/vm/phys_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/phys_pager.c ============================================================================== --- stable/11/sys/vm/phys_pager.c Fri Jan 13 13:45:34 2017 (r312073) +++ stable/11/sys/vm/phys_pager.c Fri Jan 13 13:47:26 2017 (r312074) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* list of phys pager objects */ @@ -98,6 +99,7 @@ phys_pager_alloc(void *handle, vm_ooffse object = object1; object1 = NULL; object->handle = handle; + vm_object_set_flag(object, OBJ_POPULATE); TAILQ_INSERT_TAIL(&phys_pager_object_list, object, pager_object_list); } @@ -109,6 +111,7 @@ phys_pager_alloc(void *handle, vm_ooffse vm_object_deallocate(object1); } else { object = vm_object_allocate(OBJT_PHYS, pindex); + vm_object_set_flag(object, OBJ_POPULATE); } return (object); @@ -157,32 +160,101 @@ phys_pager_getpages(vm_object_t object, return (VM_PAGER_OK); } -static void -phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync, - int *rtvals) -{ - - panic("phys_pager_putpage called"); -} - /* * Implement a pretty aggressive clustered getpages strategy. Hint that * everything in an entire 4MB window should be prefaulted at once. * - * XXX 4MB (1024 slots per page table page) is convenient for x86, + * 4MB (1024 slots per page table page) is convenient for x86, * but may not be for other arches. */ #ifndef PHYSCLUSTER #define PHYSCLUSTER 1024 #endif +static int phys_pager_cluster = PHYSCLUSTER; +SYSCTL_INT(_vm, OID_AUTO, phys_pager_cluster, CTLFLAG_RWTUN, + &phys_pager_cluster, 0, + "prefault window size for phys pager"); + +/* + * Max hint to vm_page_alloc() about the further allocation needs + * inside the phys_pager_populate() loop. The number of bits used to + * implement VM_ALLOC_COUNT() determines the hard limit on this value. + * That limit is currently 65535. + */ +#define PHYSALLOC 16 + +static int +phys_pager_populate(vm_object_t object, vm_pindex_t pidx, + int fault_type __unused, vm_prot_t max_prot __unused, vm_pindex_t *first, + vm_pindex_t *last) +{ + vm_page_t m; + vm_pindex_t base, end, i; + int ahead; + + base = rounddown(pidx, phys_pager_cluster); + end = base + phys_pager_cluster - 1; + if (end >= object->size) + end = object->size - 1; + if (*first > base) + base = *first; + if (end > *last) + end = *last; + *first = base; + *last = end; + + for (i = base; i <= end; i++) { +retry: + m = vm_page_lookup(object, i); + if (m == NULL) { + ahead = MIN(end - i, PHYSALLOC); + m = vm_page_alloc(object, i, VM_ALLOC_NORMAL | + VM_ALLOC_ZERO | VM_ALLOC_COUNT(ahead)); + if (m == NULL) { + VM_OBJECT_WUNLOCK(object); + VM_WAIT; + VM_OBJECT_WLOCK(object); + goto retry; + } + if ((m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + m->valid = VM_PAGE_BITS_ALL; + } else if (vm_page_xbusied(m)) { + vm_page_lock(m); + VM_OBJECT_WUNLOCK(object); + vm_page_busy_sleep(m, "physb", true); + VM_OBJECT_WLOCK(object); + goto retry; + } else { + vm_page_xbusy(m); + if (m->valid != VM_PAGE_BITS_ALL) + vm_page_zero_invalid(m, TRUE); + } + + KASSERT(m->valid == VM_PAGE_BITS_ALL, + ("phys_pager_populate: partially valid page %p", m)); + KASSERT(m->dirty == 0, + ("phys_pager_populate: dirty page %p", m)); + } + return (VM_PAGER_OK); +} + +static void +phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync, + int *rtvals) +{ + + panic("phys_pager_putpage called"); +} + static boolean_t phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *after) { vm_pindex_t base, end; - base = rounddown2(pindex, PHYSCLUSTER); - end = base + (PHYSCLUSTER - 1); + base = rounddown(pindex, phys_pager_cluster); + end = base + phys_pager_cluster - 1; if (before != NULL) *before = pindex - base; if (after != NULL) @@ -197,4 +269,5 @@ struct pagerops physpagerops = { .pgo_getpages = phys_pager_getpages, .pgo_putpages = phys_pager_putpages, .pgo_haspage = phys_pager_haspage, + .pgo_populate = phys_pager_populate, }; From owner-svn-src-all@freebsd.org Fri Jan 13 13:50:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6ED1CAEF1A; Fri, 13 Jan 2017 13:50:45 +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 694DC1139; Fri, 13 Jan 2017 13:50:45 +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 v0DDoiJu081563; Fri, 13 Jan 2017 13:50:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DDoiHb081562; Fri, 13 Jan 2017 13:50:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131350.v0DDoiHb081562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 13:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312075 - stable/11/sys/dev/drm2/i915 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 13:50:45 -0000 Author: kib Date: Fri Jan 13 13:50:44 2017 New Revision: 312075 URL: https://svnweb.freebsd.org/changeset/base/312075 Log: MFC r309712: Use the populate() driver paging method for i915 driver. MFC r310027: Fix bug in r309712, do not leak gem object pin count in case of error or retry. Modified: stable/11/sys/dev/drm2/i915/i915_gem.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- stable/11/sys/dev/drm2/i915/i915_gem.c Fri Jan 13 13:47:26 2017 (r312074) +++ stable/11/sys/dev/drm2/i915/i915_gem.c Fri Jan 13 13:50:44 2017 (r312075) @@ -1474,8 +1474,8 @@ i915_gem_pager_ctor(void *handle, vm_oof int i915_intr_pf; static int -i915_gem_pager_fault(vm_object_t vm_obj, vm_ooffset_t offset, int prot, - vm_page_t *mres) +i915_gem_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type, + vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) { struct drm_gem_object *gem_obj = vm_obj->handle; struct drm_i915_gem_object *obj = to_intel_bo(gem_obj); @@ -1483,31 +1483,9 @@ i915_gem_pager_fault(vm_object_t vm_obj, drm_i915_private_t *dev_priv = dev->dev_private; vm_page_t page; int ret = 0; -#ifdef FREEBSD_WIP - bool write = (prot & VM_PROT_WRITE) != 0; -#else - bool write = true; -#endif /* FREEBSD_WIP */ + bool write = (max_prot & VM_PROT_WRITE) != 0; bool pinned; - vm_object_pip_add(vm_obj, 1); - - /* - * Remove the placeholder page inserted by vm_fault() from the - * object before dropping the object lock. If - * i915_gem_release_mmap() is active in parallel on this gem - * object, then it owns the drm device sx and might find the - * placeholder already. Then, since the page is busy, - * i915_gem_release_mmap() sleeps waiting for the busy state - * of the page cleared. We will be unable to acquire drm - * device lock until i915_gem_release_mmap() is able to make a - * progress. - */ - if (*mres != NULL) { - vm_page_lock(*mres); - vm_page_remove(*mres); - vm_page_unlock(*mres); - } VM_OBJECT_WUNLOCK(vm_obj); retry: ret = 0; @@ -1527,7 +1505,7 @@ retry: * mapping for the page. Recheck. */ VM_OBJECT_WLOCK(vm_obj); - page = vm_page_lookup(vm_obj, OFF_TO_IDX(offset)); + page = vm_page_lookup(vm_obj, pidx); if (page != NULL) { if (vm_page_busied(page)) { DRM_UNLOCK(dev); @@ -1556,20 +1534,19 @@ retry: obj->fault_mappable = true; - VM_OBJECT_WLOCK(vm_obj); - page = PHYS_TO_VM_PAGE(dev_priv->mm.gtt_base_addr + obj->gtt_offset + offset); - KASSERT((page->flags & PG_FICTITIOUS) != 0, - ("physical address %#jx not fictitious", - (uintmax_t)(dev_priv->mm.gtt_base_addr + obj->gtt_offset + offset))); + page = PHYS_TO_VM_PAGE(dev_priv->mm.gtt_base_addr + obj->gtt_offset + + IDX_TO_OFF(pidx)); if (page == NULL) { - VM_OBJECT_WUNLOCK(vm_obj); ret = -EFAULT; goto unpin; } KASSERT((page->flags & PG_FICTITIOUS) != 0, - ("not fictitious %p", page)); + ("physical address %#jx not fictitious, page %p", + (uintmax_t)(dev_priv->mm.gtt_base_addr + obj->gtt_offset + + IDX_TO_OFF(pidx)), page)); KASSERT(page->wire_count == 1, ("wire_count not 1 %p", page)); + VM_OBJECT_WLOCK(vm_obj); if (vm_page_busied(page)) { i915_gem_object_unpin(obj); DRM_UNLOCK(dev); @@ -1578,7 +1555,7 @@ retry: vm_page_busy_sleep(page, "915pbs", false); goto retry; } - if (vm_page_insert(page, vm_obj, OFF_TO_IDX(offset))) { + if (vm_page_insert(page, vm_obj, pidx)) { i915_gem_object_unpin(obj); DRM_UNLOCK(dev); VM_OBJECT_WUNLOCK(vm_obj); @@ -1589,24 +1566,17 @@ retry: have_page: vm_page_xbusy(page); - CTR4(KTR_DRM, "fault %p %jx %x phys %x", gem_obj, offset, prot, + CTR4(KTR_DRM, "fault %p %jx %x phys %x", gem_obj, pidx, fault_type, page->phys_addr); if (pinned) { /* * We may have not pinned the object if the page was - * found by the call to vm_page_lookup() + * found by the call to vm_page_lookup(). */ i915_gem_object_unpin(obj); } DRM_UNLOCK(dev); - if (*mres != NULL) { - KASSERT(*mres != page, ("losing %p %p", *mres, page)); - vm_page_lock(*mres); - vm_page_free(*mres); - vm_page_unlock(*mres); - } - *mres = page; - vm_object_pip_wakeup(vm_obj); + *first = *last = pidx; return (VM_PAGER_OK); unpin: @@ -1615,7 +1585,7 @@ unlock: DRM_UNLOCK(dev); out: KASSERT(ret != 0, ("i915_gem_pager_fault: wrong return")); - CTR4(KTR_DRM, "fault_fail %p %jx %x err %d", gem_obj, offset, prot, + CTR4(KTR_DRM, "fault_fail %p %jx %x err %d", gem_obj, pidx, fault_type, -ret); if (ret == -ERESTARTSYS) { /* @@ -1629,7 +1599,6 @@ out: goto retry; } VM_OBJECT_WLOCK(vm_obj); - vm_object_pip_wakeup(vm_obj); return (VM_PAGER_ERROR); } @@ -1645,9 +1614,9 @@ i915_gem_pager_dtor(void *handle) } struct cdev_pager_ops i915_gem_pager_ops = { - .cdev_pg_fault = i915_gem_pager_fault, - .cdev_pg_ctor = i915_gem_pager_ctor, - .cdev_pg_dtor = i915_gem_pager_dtor + .cdev_pg_populate = i915_gem_pager_populate, + .cdev_pg_ctor = i915_gem_pager_ctor, + .cdev_pg_dtor = i915_gem_pager_dtor, }; /** From owner-svn-src-all@freebsd.org Fri Jan 13 15:17:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD08ECAE8BC; Fri, 13 Jan 2017 15:17:26 +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 7E1131ECC; Fri, 13 Jan 2017 15:17:26 +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 v0DFHPt2019465; Fri, 13 Jan 2017 15:17:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DFHPFU019464; Fri, 13 Jan 2017 15:17:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701131517.v0DFHPFU019464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Jan 2017 15:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312076 - head/lib/libgcc_s X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 15:17:26 -0000 Author: emaste Date: Fri Jan 13 15:17:25 2017 New Revision: 312076 URL: https://svnweb.freebsd.org/changeset/base/312076 Log: libgcc_s: add libc DT_NEEDED to fix underlinking PR: 216012 Reported by: jbeich MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libgcc_s/Makefile Modified: head/lib/libgcc_s/Makefile ============================================================================== --- head/lib/libgcc_s/Makefile Fri Jan 13 13:50:44 2017 (r312075) +++ head/lib/libgcc_s/Makefile Fri Jan 13 15:17:25 2017 (r312076) @@ -8,6 +8,7 @@ MK_SSP= no WARNS?= 2 LDFLAGS+= -nodefaultlibs +LIBADD+= c VERSION_MAP= ${.CURDIR}/Version.map .include "../libcompiler_rt/Makefile.inc" From owner-svn-src-all@freebsd.org Fri Jan 13 16:37:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01453CAE4C9; Fri, 13 Jan 2017 16:37:40 +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 B5E911D97; Fri, 13 Jan 2017 16:37:39 +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 v0DGbcsM051794; Fri, 13 Jan 2017 16:37:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DGbcrX051790; Fri, 13 Jan 2017 16:37:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701131637.v0DGbcrX051790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 13 Jan 2017 16:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312077 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 16:37:40 -0000 Author: ian Date: Fri Jan 13 16:37:38 2017 New Revision: 312077 URL: https://svnweb.freebsd.org/changeset/base/312077 Log: Check tty_gone() after allocating IO buffers. The tty lock has to be dropped then reacquired due to using M_WAITOK, which opens a window in which the tty device can disappear. Check for this and return ENXIO back up the call chain so that callers can cope. This closes a race where TF_GONE would get set while buffers were being allocated as part of ttydev_open(), causing a subsequent call to ttydevsw_modem() later in ttydev_open() to assert. Reported by: pho Reviewed by: kib Modified: head/sys/kern/tty.c head/sys/kern/tty_inq.c head/sys/kern/tty_outq.c head/sys/sys/ttyqueue.h Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri Jan 13 15:17:25 2017 (r312076) +++ head/sys/kern/tty.c Fri Jan 13 16:37:38 2017 (r312077) @@ -105,25 +105,38 @@ SYSCTL_INT(_kern, OID_AUTO, tty_drainwai #define TTYBUF_MAX 65536 -static void +/* + * Allocate buffer space if necessary, and set low watermarks, based on speed. + * Note that the ttyxxxq_setsize() functions may drop and then reacquire the tty + * lock during memory allocation. They will return ENXIO if the tty disappears + * while unlocked. + */ +static int tty_watermarks(struct tty *tp) { size_t bs = 0; + int error; /* Provide an input buffer for 0.2 seconds of data. */ if (tp->t_termios.c_cflag & CREAD) bs = MIN(tp->t_termios.c_ispeed / 5, TTYBUF_MAX); - ttyinq_setsize(&tp->t_inq, tp, bs); + error = ttyinq_setsize(&tp->t_inq, tp, bs); + if (error != 0) + return (error); /* Set low watermark at 10% (when 90% is available). */ tp->t_inlow = (ttyinq_getallocatedsize(&tp->t_inq) * 9) / 10; /* Provide an output buffer for 0.2 seconds of data. */ bs = MIN(tp->t_termios.c_ospeed / 5, TTYBUF_MAX); - ttyoutq_setsize(&tp->t_outq, tp, bs); + error = ttyoutq_setsize(&tp->t_outq, tp, bs); + if (error != 0) + return (error); /* Set low watermark at 10% (when 90% is available). */ tp->t_outlow = (ttyoutq_getallocatedsize(&tp->t_outq) * 9) / 10; + + return (0); } static int @@ -318,7 +331,9 @@ ttydev_open(struct cdev *dev, int oflags goto done; ttydisc_open(tp); - tty_watermarks(tp); /* XXXGL: drops lock */ + error = tty_watermarks(tp); + if (error != 0) + goto done; } /* Wait for Carrier Detect. */ @@ -1627,7 +1642,9 @@ tty_generic_ioctl(struct tty *tp, u_long tp->t_termios.c_ospeed = t->c_ospeed; /* Baud rate has changed - update watermarks. */ - tty_watermarks(tp); + error = tty_watermarks(tp); + if (error) + return (error); } /* Copy new non-device driver parameters. */ Modified: head/sys/kern/tty_inq.c ============================================================================== --- head/sys/kern/tty_inq.c Fri Jan 13 15:17:25 2017 (r312076) +++ head/sys/kern/tty_inq.c Fri Jan 13 16:37:38 2017 (r312077) @@ -112,7 +112,7 @@ static uma_zone_t ttyinq_zone; TTYINQ_INSERT_TAIL(ti, tib); \ } while (0) -void +int ttyinq_setsize(struct ttyinq *ti, struct tty *tp, size_t size) { struct ttyinq_block *tib; @@ -134,8 +134,14 @@ ttyinq_setsize(struct ttyinq *ti, struct tib = uma_zalloc(ttyinq_zone, M_WAITOK); tty_lock(tp); + if (tty_gone(tp)) { + uma_zfree(ttyinq_zone, tib); + return (ENXIO); + } + TTYINQ_INSERT_TAIL(ti, tib); } + return (0); } void Modified: head/sys/kern/tty_outq.c ============================================================================== --- head/sys/kern/tty_outq.c Fri Jan 13 15:17:25 2017 (r312076) +++ head/sys/kern/tty_outq.c Fri Jan 13 16:37:38 2017 (r312077) @@ -89,7 +89,7 @@ ttyoutq_flush(struct ttyoutq *to) to->to_end = 0; } -void +int ttyoutq_setsize(struct ttyoutq *to, struct tty *tp, size_t size) { struct ttyoutq_block *tob; @@ -111,8 +111,14 @@ ttyoutq_setsize(struct ttyoutq *to, stru tob = uma_zalloc(ttyoutq_zone, M_WAITOK); tty_lock(tp); + if (tty_gone(tp)) { + uma_zfree(ttyoutq_zone, tob); + return (ENXIO); + } + TTYOUTQ_INSERT_TAIL(to, tob); } + return (0); } void Modified: head/sys/sys/ttyqueue.h ============================================================================== --- head/sys/sys/ttyqueue.h Fri Jan 13 15:17:25 2017 (r312076) +++ head/sys/sys/ttyqueue.h Fri Jan 13 16:37:38 2017 (r312077) @@ -69,7 +69,7 @@ struct ttyoutq { #ifdef _KERNEL /* Input queue handling routines. */ -void ttyinq_setsize(struct ttyinq *ti, struct tty *tp, size_t len); +int ttyinq_setsize(struct ttyinq *ti, struct tty *tp, size_t len); void ttyinq_free(struct ttyinq *ti); int ttyinq_read_uio(struct ttyinq *ti, struct tty *tp, struct uio *uio, size_t readlen, size_t flushlen); @@ -136,7 +136,7 @@ void ttyinq_line_iterate_from_reprintpos /* Output queue handling routines. */ void ttyoutq_flush(struct ttyoutq *to); -void ttyoutq_setsize(struct ttyoutq *to, struct tty *tp, size_t len); +int ttyoutq_setsize(struct ttyoutq *to, struct tty *tp, size_t len); void ttyoutq_free(struct ttyoutq *to); size_t ttyoutq_read(struct ttyoutq *to, void *buf, size_t len); int ttyoutq_read_uio(struct ttyoutq *to, struct tty *tp, struct uio *uio); From owner-svn-src-all@freebsd.org Fri Jan 13 16:46:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF390CAE854; Fri, 13 Jan 2017 16:46:02 +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 B14D114E6; Fri, 13 Jan 2017 16:46:02 +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 v0DGk1FU055808; Fri, 13 Jan 2017 16:46:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DGk1uD055807; Fri, 13 Jan 2017 16:46:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701131646.v0DGk1uD055807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 13 Jan 2017 16:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312078 - head/usr.sbin/fstyp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 16:46:03 -0000 Author: cem Date: Fri Jan 13 16:46:01 2017 New Revision: 312078 URL: https://svnweb.freebsd.org/changeset/base/312078 Log: fstyp.8: Move initial exFAT blurb to the -u section Didn't notice the second list in r312003. Reported by: trasz@ Modified: head/usr.sbin/fstyp/fstyp.8 Modified: head/usr.sbin/fstyp/fstyp.8 ============================================================================== --- head/usr.sbin/fstyp/fstyp.8 Fri Jan 13 16:37:38 2017 (r312077) +++ head/usr.sbin/fstyp/fstyp.8 Fri Jan 13 16:46:01 2017 (r312078) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2017 +.Dd January 13, 2017 .Dt FSTYP 8 .Os .Sh NAME @@ -43,7 +43,7 @@ The .Nm utility is used to determine the filesystem type on a given device. -It can recognize ISO-9660, exFAT, Ext2, FAT, NTFS, and UFS filesystems. +It can recognize ISO-9660, Ext2, FAT, NTFS, and UFS filesystems. When the .Fl u flag is specified, @@ -51,9 +51,10 @@ flag is specified, also recognizes certain additional metadata formats that cannot be handled using .Xr mount 8 , -such as ZFS pools and +such as exFAT filesystems, .Xr geli 8 -providers. +providers, and +ZFS pools. .Pp The filesystem name is printed to the standard output as, respectively: From owner-svn-src-all@freebsd.org Fri Jan 13 16:54:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08002CAEB82; Fri, 13 Jan 2017 16:54:46 +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 C8C011CAB; Fri, 13 Jan 2017 16:54:45 +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 v0DGsilM059831; Fri, 13 Jan 2017 16:54:44 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DGsiYX059830; Fri, 13 Jan 2017 16:54:44 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201701131654.v0DGsiYX059830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 13 Jan 2017 16:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312079 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 16:54:46 -0000 Author: glebius Date: Fri Jan 13 16:54:44 2017 New Revision: 312079 URL: https://svnweb.freebsd.org/changeset/base/312079 Log: Use getsock_cap() instead of deprecated fgetsock(). Reviewed by: tuexen Modified: head/sys/netinet/sctp_syscalls.c Modified: head/sys/netinet/sctp_syscalls.c ============================================================================== --- head/sys/netinet/sctp_syscalls.c Fri Jan 13 16:46:01 2017 (r312078) +++ head/sys/netinet/sctp_syscalls.c Fri Jan 13 16:54:44 2017 (r312079) @@ -121,17 +121,18 @@ sys_sctp_peeloff(td, uap) } */ *uap; { #if (defined(INET) || defined(INET6)) && defined(SCTP) - struct file *nfp = NULL; + struct file *headfp, *nfp = NULL; struct socket *head, *so; cap_rights_t rights; u_int fflag; int error, fd; AUDIT_ARG_FD(uap->sd); - error = fgetsock(td, uap->sd, cap_rights_init(&rights, CAP_PEELOFF), - &head, &fflag); + error = getsock_cap(td, uap->sd, cap_rights_init(&rights, CAP_PEELOFF), + &headfp, &fflag, NULL); if (error != 0) goto done2; + head = headfp->f_data; if (head->so_proto->pr_protocol != IPPROTO_SCTP) { error = EOPNOTSUPP; goto done; @@ -196,7 +197,7 @@ noconnection: done: if (nfp != NULL) fdrop(nfp, td); - fputsock(head); + fdrop(headfp, td); done2: return (error); #else /* SCTP */ From owner-svn-src-all@freebsd.org Fri Jan 13 17:03:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 571CACAE004; Fri, 13 Jan 2017 17:03: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 25C7813BC; Fri, 13 Jan 2017 17:03: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 v0DH3Nq6064547; Fri, 13 Jan 2017 17:03:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DH3N7j064546; Fri, 13 Jan 2017 17:03:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701131703.v0DH3N7j064546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 13 Jan 2017 17:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312080 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 17:03:24 -0000 Author: ian Date: Fri Jan 13 17:03:23 2017 New Revision: 312080 URL: https://svnweb.freebsd.org/changeset/base/312080 Log: Correct the comments about how much buffer is allocated. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri Jan 13 16:54:44 2017 (r312079) +++ head/sys/kern/tty.c Fri Jan 13 17:03:23 2017 (r312080) @@ -117,7 +117,7 @@ tty_watermarks(struct tty *tp) size_t bs = 0; int error; - /* Provide an input buffer for 0.2 seconds of data. */ + /* Provide an input buffer for 2 seconds of data. */ if (tp->t_termios.c_cflag & CREAD) bs = MIN(tp->t_termios.c_ispeed / 5, TTYBUF_MAX); error = ttyinq_setsize(&tp->t_inq, tp, bs); @@ -127,7 +127,7 @@ tty_watermarks(struct tty *tp) /* Set low watermark at 10% (when 90% is available). */ tp->t_inlow = (ttyinq_getallocatedsize(&tp->t_inq) * 9) / 10; - /* Provide an output buffer for 0.2 seconds of data. */ + /* Provide an output buffer for 2 seconds of data. */ bs = MIN(tp->t_termios.c_ospeed / 5, TTYBUF_MAX); error = ttyoutq_setsize(&tp->t_outq, tp, bs); if (error != 0) From owner-svn-src-all@freebsd.org Fri Jan 13 18:36:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A3F3CAEE5E; Fri, 13 Jan 2017 18:36:48 +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 D06AB102B; Fri, 13 Jan 2017 18:36:47 +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 v0DIak9L001974; Fri, 13 Jan 2017 18:36:46 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DIaklV001972; Fri, 13 Jan 2017 18:36:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201701131836.v0DIaklV001972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 13 Jan 2017 18:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312081 - head/sys/dev/iscsi_initiator X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 18:36:48 -0000 Author: glebius Date: Fri Jan 13 18:36:46 2017 New Revision: 312081 URL: https://svnweb.freebsd.org/changeset/base/312081 Log: Use getsock_cap() instead of deprecated fgetsock(). Reviewed by: Daniel Braniss Modified: head/sys/dev/iscsi_initiator/isc_soc.c head/sys/dev/iscsi_initiator/iscsi.c Modified: head/sys/dev/iscsi_initiator/isc_soc.c ============================================================================== --- head/sys/dev/iscsi_initiator/isc_soc.c Fri Jan 13 17:03:23 2017 (r312080) +++ head/sys/dev/iscsi_initiator/isc_soc.c Fri Jan 13 18:36:46 2017 (r312081) @@ -680,7 +680,6 @@ isc_stop_receiver(isc_session_t *sp) if(sp->fp != NULL) fdrop(sp->fp, sp->td); - fputsock(sp->soc); sp->soc = NULL; sp->fp = NULL; Modified: head/sys/dev/iscsi_initiator/iscsi.c ============================================================================== --- head/sys/dev/iscsi_initiator/iscsi.c Fri Jan 13 17:03:23 2017 (r312080) +++ head/sys/dev/iscsi_initiator/iscsi.c Fri Jan 13 18:36:46 2017 (r312081) @@ -388,20 +388,14 @@ i_setsoc(isc_session_t *sp, int fd, stru if(sp->soc != NULL) isc_stop_receiver(sp); - error = fget(td, fd, cap_rights_init(&rights, CAP_SOCK_CLIENT), &sp->fp); + error = getsock_cap(td, fd, cap_rights_init(&rights, CAP_SOCK_CLIENT), + &sp->fp, NULL, NULL); if(error) return error; - error = fgetsock(td, fd, cap_rights_init(&rights, CAP_SOCK_CLIENT), - &sp->soc, 0); - if(error == 0) { - sp->td = td; - isc_start_receiver(sp); - } - else { - fdrop(sp->fp, td); - sp->fp = NULL; - } + sp->soc = sp->fp->f_data; + sp->td = td; + isc_start_receiver(sp); return error; } From owner-svn-src-all@freebsd.org Fri Jan 13 19:22:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3076ECAE0BF; Fri, 13 Jan 2017 19:22:24 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5A481C42; Fri, 13 Jan 2017 19:22:23 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DJMMds019712; Fri, 13 Jan 2017 19:22:22 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DJMMG9019711; Fri, 13 Jan 2017 19:22:22 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201701131922.v0DJMMG9019711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 13 Jan 2017 19:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312082 - stable/11/sys/tools X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 19:22:24 -0000 Author: lwhsu (ports committer) Date: Fri Jan 13 19:22:22 2017 New Revision: 312082 URL: https://svnweb.freebsd.org/changeset/base/312082 Log: MFC r311881: Replace using of objdump with elfdump In-tree objdump is too old to dump new ELF headers. But for example if we use: `make CROSS_TOOLCHAIN=riscv64-gcc TARGET_ARCH=riscv64` and do not specify CROSS_BINUTILS_PREFIX in env, embed_mfs.sh cannot find the correct objdump. This patch just replaces using of objdump with elfdump to collect needed information. Later we may also put an ELFDUMP in CROSSENV and use it in embed_mfs.sh . Reviewed by: emaste, br Differential Revision: https://reviews.freebsd.org/D9062 Modified: stable/11/sys/tools/embed_mfs.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/tools/embed_mfs.sh ============================================================================== --- stable/11/sys/tools/embed_mfs.sh Fri Jan 13 18:36:46 2017 (r312081) +++ stable/11/sys/tools/embed_mfs.sh Fri Jan 13 19:22:22 2017 (r312082) @@ -36,12 +36,12 @@ mfs_size=`stat -f '%z' $2 2> /dev/null` # If we can't determine MFS image size - bail. [ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1 -sec_info=`objdump -h $1 2> /dev/null | grep " oldmfs "` +sec_info=`elfdump -c $1 2> /dev/null | grep -A 5 -E "sh_name: oldmfs$"` # If we can't find the mfs section within the given kernel - bail. [ -z "${sec_info}" ] && echo "Can't locate mfs section within kernel" && exit 1 -sec_size=`echo ${sec_info} | awk '{printf("%d", "0x" $3)}' 2> /dev/null` -sec_start=`echo ${sec_info} | awk '{printf("%d", "0x" $6)}' 2> /dev/null` +sec_size=`echo "${sec_info}" | awk '/sh_size/ {print $2}' 2> /dev/null` +sec_start=`echo "${sec_info}" | awk '/sh_offset/ {print $2}' 2> /dev/null` # If the mfs section size is smaller than the mfs image - bail. [ ${sec_size} -lt ${mfs_size} ] && echo "MFS image too large" && exit 1 From owner-svn-src-all@freebsd.org Fri Jan 13 19:41:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D488CAE66E; Fri, 13 Jan 2017 19:41:03 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 306CF1712; Fri, 13 Jan 2017 19:41:03 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DJf2T2028363; Fri, 13 Jan 2017 19:41:02 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DJf20j028362; Fri, 13 Jan 2017 19:41:02 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201701131941.v0DJf20j028362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 13 Jan 2017 19:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312083 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 19:41:03 -0000 Author: wblock (doc committer) Date: Fri Jan 13 19:41:02 2017 New Revision: 312083 URL: https://svnweb.freebsd.org/changeset/base/312083 Log: Update the shm_open.2 man page to reflect objective reality. PR: 215612 Submitted by: rwatson MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9066 Modified: head/lib/libc/sys/shm_open.2 Modified: head/lib/libc/sys/shm_open.2 ============================================================================== --- head/lib/libc/sys/shm_open.2 Fri Jan 13 19:22:22 2017 (r312082) +++ head/lib/libc/sys/shm_open.2 Fri Jan 13 19:41:02 2017 (r312083) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2013 +.Dd January 13, 2017 .Dt SHM_OPEN 2 .Os .Sh NAME @@ -171,7 +171,8 @@ and .Dv O_TRUNC flags may be used in portable programs. .Pp -The result of using +.Tn POSIX +specifications state that the result of using .Xr open 2 , .Xr read 2 , or @@ -179,19 +180,43 @@ or on a shared memory object, or on the descriptor returned by .Fn shm_open , is undefined. -It is also undefined whether the shared memory object itself, or its -contents, persist across reboots. -.Pp -In FreeBSD, +However, the +.Fx +kernel implementation explicitly includes support for .Xr read 2 and -.Xr write 2 -on a shared memory object will fail with -.Er EOPNOTSUPP -and neither shared memory objects nor their contents persist across reboots. +.Xr write 2 . +.Pp +Neither shared memory objects nor their contents persist across reboots. +.Pp +Writes do not extend shared memory objects, so +.Xr ftruncate 2 +must be called before any data can be written. +See +.Sx EXAMPLES . +.Sh EXAMPLES +This example fails without the call to +.Xr ftruncate 2 : +.Bd -literal -compact + + uint8_t buffer[getpagesize()]; + ssize_t len; + int fd; + + fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600); + if (fd < 0) + err(EX_OSERR, "%s: shm_open", __func__); + if (ftruncate(fd, getpagesize()) < 0) + err(EX_IOERR, "%s: ftruncate", __func__); + len = pwrite(fd, buffer, getpagesize(), 0); + if (len < 0) + err(EX_IOERR, "%s: pwrite", __func__); + if (len != getpagesize()) + errx(EX_IOERR, "%s: pwrite length mismatch", __func__); +.Ed .Sh ERRORS -The following errors are defined for -.Fn shm_open : +.Fn shm_open +fails with these error codes for these conditions: .Bl -tag -width Er .It Bq Er EINVAL A flag other than @@ -235,8 +260,8 @@ are specified and the named shared memor The required permissions (for reading or reading and writing) are denied. .El .Pp -The following errors are defined for -.Fn shm_unlink : +.Fn shm_unlink +fails with these error codes for these conditions: .Bl -tag -width Er .It Bq Er EFAULT The From owner-svn-src-all@freebsd.org Fri Jan 13 21:30:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB0DACAE6F2; Fri, 13 Jan 2017 21:30:21 +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 9BC32174F; Fri, 13 Jan 2017 21:30:21 +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 v0DLUKPp073798; Fri, 13 Jan 2017 21:30:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DLUIun073775; Fri, 13 Jan 2017 21:30:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701132130.v0DLUIun073775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Jan 2017 21:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312084 - stable/11/usr.bin/truss X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 21:30:22 -0000 Author: jhb Date: Fri Jan 13 21:30:18 2017 New Revision: 312084 URL: https://svnweb.freebsd.org/changeset/base/312084 Log: MFC 309589: Rework syscall structure lookups. Avoid always using an O(n^2) loop over known syscall structures with strcmp() on each system call. Instead, use a per-ABI cache indexed by the system call number. The first 1024 system calls (which should cover all of the normal system calls in currently-supported ABIs) use a flat array indexed by the system call number to find system call structure. For other system calls, a linked list of structures storing an integer to structure mapping is stored in the ABI. The linked list isn't very smart, but it should only be used by buggy applications invoking unknown system calls. This also fixes handling of unknown system calls which currently trigger a NULL pointer dereference. Modified: stable/11/usr.bin/truss/aarch64-cloudabi64.c stable/11/usr.bin/truss/aarch64-freebsd.c stable/11/usr.bin/truss/amd64-cloudabi64.c stable/11/usr.bin/truss/amd64-freebsd.c stable/11/usr.bin/truss/amd64-freebsd32.c stable/11/usr.bin/truss/amd64-linux.c stable/11/usr.bin/truss/amd64-linux32.c stable/11/usr.bin/truss/arm-freebsd.c stable/11/usr.bin/truss/i386-freebsd.c stable/11/usr.bin/truss/i386-linux.c stable/11/usr.bin/truss/mips-freebsd.c stable/11/usr.bin/truss/powerpc-freebsd.c stable/11/usr.bin/truss/powerpc64-freebsd.c stable/11/usr.bin/truss/powerpc64-freebsd32.c stable/11/usr.bin/truss/setup.c stable/11/usr.bin/truss/sparc64-freebsd.c stable/11/usr.bin/truss/syscall.h stable/11/usr.bin/truss/syscalls.c stable/11/usr.bin/truss/truss.h Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/aarch64-cloudabi64.c ============================================================================== --- stable/11/usr.bin/truss/aarch64-cloudabi64.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/aarch64-cloudabi64.c Fri Jan 13 21:30:18 2017 (r312084) @@ -80,7 +80,9 @@ static struct procabi aarch64_cloudabi64 "CloudABI ELF64", SYSDECODE_ABI_CLOUDABI64, aarch64_cloudabi64_fetch_args, - aarch64_cloudabi64_fetch_retval + aarch64_cloudabi64_fetch_retval, + STAILQ_HEAD_INITIALIZER(aarch64_cloudabi64.extra_syscalls), + { NULL } }; PROCABI(aarch64_cloudabi64); Modified: stable/11/usr.bin/truss/aarch64-freebsd.c ============================================================================== --- stable/11/usr.bin/truss/aarch64-freebsd.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/aarch64-freebsd.c Fri Jan 13 21:30:18 2017 (r312084) @@ -102,7 +102,9 @@ static struct procabi aarch64_freebsd = "FreeBSD ELF64", SYSDECODE_ABI_FREEBSD, aarch64_fetch_args, - aarch64_fetch_retval + aarch64_fetch_retval, + STAILQ_HEAD_INITIALIZER(aarch64_freebsd.extra_syscalls), + { NULL } }; PROCABI(aarch64_freebsd); Modified: stable/11/usr.bin/truss/amd64-cloudabi64.c ============================================================================== --- stable/11/usr.bin/truss/amd64-cloudabi64.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/amd64-cloudabi64.c Fri Jan 13 21:30:18 2017 (r312084) @@ -89,7 +89,9 @@ static struct procabi amd64_cloudabi64 = "CloudABI ELF64", SYSDECODE_ABI_CLOUDABI64, amd64_cloudabi64_fetch_args, - amd64_cloudabi64_fetch_retval + amd64_cloudabi64_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_cloudabi64.extra_syscalls), + { NULL } }; PROCABI(amd64_cloudabi64); Modified: stable/11/usr.bin/truss/amd64-freebsd.c ============================================================================== --- stable/11/usr.bin/truss/amd64-freebsd.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/amd64-freebsd.c Fri Jan 13 21:30:18 2017 (r312084) @@ -124,7 +124,9 @@ static struct procabi amd64_freebsd = { "FreeBSD ELF64", SYSDECODE_ABI_FREEBSD, amd64_fetch_args, - amd64_fetch_retval + amd64_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_freebsd.extra_syscalls), + { NULL } }; PROCABI(amd64_freebsd); Modified: stable/11/usr.bin/truss/amd64-freebsd32.c ============================================================================== --- stable/11/usr.bin/truss/amd64-freebsd32.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/amd64-freebsd32.c Fri Jan 13 21:30:18 2017 (r312084) @@ -120,7 +120,9 @@ static struct procabi amd64_freebsd32 = "FreeBSD ELF32", SYSDECODE_ABI_FREEBSD32, amd64_freebsd32_fetch_args, - amd64_freebsd32_fetch_retval + amd64_freebsd32_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_freebsd32.extra_syscalls), + { NULL } }; PROCABI(amd64_freebsd32); @@ -129,7 +131,9 @@ static struct procabi amd64_freebsd32_ao "FreeBSD a.out", SYSDECODE_ABI_FREEBSD32, amd64_freebsd32_fetch_args, - amd64_freebsd32_fetch_retval + amd64_freebsd32_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_freebsd32.extra_syscalls), + { NULL } }; PROCABI(amd64_freebsd32_aout); Modified: stable/11/usr.bin/truss/amd64-linux.c ============================================================================== --- stable/11/usr.bin/truss/amd64-linux.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/amd64-linux.c Fri Jan 13 21:30:18 2017 (r312084) @@ -99,7 +99,9 @@ static struct procabi amd64_linux = { "Linux ELF64", SYSDECODE_ABI_LINUX, amd64_linux_fetch_args, - amd64_linux_fetch_retval + amd64_linux_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_linux.extra_syscalls), + { NULL } }; PROCABI(amd64_linux); Modified: stable/11/usr.bin/truss/amd64-linux32.c ============================================================================== --- stable/11/usr.bin/truss/amd64-linux32.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/amd64-linux32.c Fri Jan 13 21:30:18 2017 (r312084) @@ -109,7 +109,9 @@ static struct procabi amd64_linux32 = { "Linux ELF32", SYSDECODE_ABI_LINUX32, amd64_linux32_fetch_args, - amd64_linux32_fetch_retval + amd64_linux32_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_linux32.extra_syscalls), + { NULL } }; PROCABI(amd64_linux32); Modified: stable/11/usr.bin/truss/arm-freebsd.c ============================================================================== --- stable/11/usr.bin/truss/arm-freebsd.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/arm-freebsd.c Fri Jan 13 21:30:18 2017 (r312084) @@ -131,7 +131,9 @@ static struct procabi arm_freebsd = { "FreeBSD ELF32", SYSDECODE_ABI_FREEBSD, arm_fetch_args, - arm_fetch_retval + arm_fetch_retval, + STAILQ_HEAD_INITIALIZER(arm_freebsd.extra_syscalls), + { NULL } }; PROCABI(arm_freebsd); Modified: stable/11/usr.bin/truss/i386-freebsd.c ============================================================================== --- stable/11/usr.bin/truss/i386-freebsd.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/i386-freebsd.c Fri Jan 13 21:30:18 2017 (r312084) @@ -113,7 +113,9 @@ static struct procabi i386_freebsd = { "FreeBSD ELF32", SYSDECODE_ABI_FREEBSD, i386_fetch_args, - i386_fetch_retval + i386_fetch_retval, + STAILQ_HEAD_INITIALIZER(i386_freebsd.extra_syscalls), + { NULL } }; PROCABI(i386_freebsd); @@ -122,7 +124,9 @@ static struct procabi i386_freebsd_aout "FreeBSD a.out", SYSDECODE_ABI_FREEBSD, i386_fetch_args, - i386_fetch_retval + i386_fetch_retval, + STAILQ_HEAD_INITIALIZER(i386_freebsd_aout.extra_syscalls), + { NULL } }; PROCABI(i386_freebsd_aout); Modified: stable/11/usr.bin/truss/i386-linux.c ============================================================================== --- stable/11/usr.bin/truss/i386-linux.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/i386-linux.c Fri Jan 13 21:30:18 2017 (r312084) @@ -106,7 +106,9 @@ static struct procabi i386_linux = { "Linux ELF", SYSDECODE_ABI_LINUX, i386_linux_fetch_args, - i386_linux_fetch_retval + i386_linux_fetch_retval, + STAILQ_HEAD_INITIALIZER(i386_linux.extra_syscalls), + { NULL } }; PROCABI(i386_linux); Modified: stable/11/usr.bin/truss/mips-freebsd.c ============================================================================== --- stable/11/usr.bin/truss/mips-freebsd.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/mips-freebsd.c Fri Jan 13 21:30:18 2017 (r312084) @@ -134,7 +134,9 @@ static struct procabi mips_freebsd = { #endif SYSDECODE_ABI_FREEBSD, mips_fetch_args, - mips_fetch_retval + mips_fetch_retval, + STAILQ_HEAD_INITIALIZER(mips_freebsd.extra_syscalls), + { NULL } }; PROCABI(mips_freebsd); Modified: stable/11/usr.bin/truss/powerpc-freebsd.c ============================================================================== --- stable/11/usr.bin/truss/powerpc-freebsd.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/powerpc-freebsd.c Fri Jan 13 21:30:18 2017 (r312084) @@ -115,7 +115,9 @@ static struct procabi powerpc_freebsd = "FreeBSD ELF32", SYSDECODE_ABI_FREEBSD, powerpc_fetch_args, - powerpc_fetch_retval + powerpc_fetch_retval, + STAILQ_HEAD_INITIALIZER(powerpc_freebsd.extra_syscalls), + { NULL } }; PROCABI(powerpc_freebsd); Modified: stable/11/usr.bin/truss/powerpc64-freebsd.c ============================================================================== --- stable/11/usr.bin/truss/powerpc64-freebsd.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/powerpc64-freebsd.c Fri Jan 13 21:30:18 2017 (r312084) @@ -111,7 +111,9 @@ static struct procabi powerpc64_freebsd "FreeBSD ELF64", SYSDECODE_ABI_FREEBSD, powerpc64_fetch_args, - powerpc64_fetch_retval + powerpc64_fetch_retval, + STAILQ_HEAD_INITIALIZER(powerpc64_freebsd.extra_syscalls), + { NULL } }; PROCABI(powerpc64_freebsd); Modified: stable/11/usr.bin/truss/powerpc64-freebsd32.c ============================================================================== --- stable/11/usr.bin/truss/powerpc64-freebsd32.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/powerpc64-freebsd32.c Fri Jan 13 21:30:18 2017 (r312084) @@ -120,7 +120,9 @@ static struct procabi powerpc64_freebsd3 "FreeBSD ELF32", SYSDECODE_ABI_FREEBSD32, powerpc64_freebsd32_fetch_args, - powerpc64_freebsd32_fetch_retval + powerpc64_freebsd32_fetch_retval, + STAILQ_HEAD_INITIALIZER(powerpc64_freebsd32.extra_syscalls), + { NULL } }; PROCABI(powerpc64_freebsd32); Modified: stable/11/usr.bin/truss/setup.c ============================================================================== --- stable/11/usr.bin/truss/setup.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/setup.c Fri Jan 13 21:30:18 2017 (r312084) @@ -344,7 +344,7 @@ alloc_syscall(struct threadinfo *t, stru assert(t->in_syscall == 0); assert(t->cs.number == 0); - assert(t->cs.name == NULL); + assert(t->cs.sc == NULL); assert(t->cs.nargs == 0); for (i = 0; i < nitems(t->cs.s_args); i++) assert(t->cs.s_args[i] == NULL); @@ -378,12 +378,11 @@ enter_syscall(struct trussinfo *info, st return; } - t->cs.name = sysdecode_syscallname(t->proc->abi->abi, t->cs.number); - if (t->cs.name == NULL) + sc = get_syscall(t, t->cs.number, narg); + if (sc->unknown) fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n", t->proc->abi->type, t->cs.number); - sc = get_syscall(t->cs.name, narg); t->cs.nargs = sc->nargs; assert(sc->nargs <= nitems(t->cs.s_args)); @@ -396,25 +395,22 @@ enter_syscall(struct trussinfo *info, st * now. This doesn't currently support arguments that are * passed in *and* out, however. */ - if (t->cs.name != NULL) { #if DEBUG - fprintf(stderr, "syscall %s(", t->cs.name); + fprintf(stderr, "syscall %s(", sc->name); #endif - for (i = 0; i < t->cs.nargs; i++) { + for (i = 0; i < t->cs.nargs; i++) { #if DEBUG - fprintf(stderr, "0x%lx%s", sc ? - t->cs.args[sc->args[i].offset] : t->cs.args[i], - i < (t->cs.nargs - 1) ? "," : ""); + fprintf(stderr, "0x%lx%s", t->cs.args[sc->args[i].offset], + i < (t->cs.nargs - 1) ? "," : ""); #endif - if (!(sc->args[i].type & OUT)) { - t->cs.s_args[i] = print_arg(&sc->args[i], - t->cs.args, 0, info); - } + if (!(sc->args[i].type & OUT)) { + t->cs.s_args[i] = print_arg(&sc->args[i], + t->cs.args, 0, info); } + } #if DEBUG - fprintf(stderr, ")\n"); + fprintf(stderr, ")\n"); #endif - } clock_gettime(CLOCK_REALTIME, &t->before); } Modified: stable/11/usr.bin/truss/sparc64-freebsd.c ============================================================================== --- stable/11/usr.bin/truss/sparc64-freebsd.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/sparc64-freebsd.c Fri Jan 13 21:30:18 2017 (r312084) @@ -118,7 +118,9 @@ static struct procabi sparc64_freebsd = "FreeBSD ELF64", SYSDECODE_ABI_FREEBSD, sparc64_fetch_args, - sparc64_fetch_retval + sparc64_fetch_retval, + STAILQ_HEAD_INITIALIZER(sparc64_freebsd.extra_syscalls), + { NULL } }; PROCABI(sparc64_freebsd); Modified: stable/11/usr.bin/truss/syscall.h ============================================================================== --- stable/11/usr.bin/truss/syscall.h Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/syscall.h Fri Jan 13 21:30:18 2017 (r312084) @@ -72,9 +72,10 @@ struct syscall { struct timespec time; /* Time spent for this call */ int ncalls; /* Number of calls */ int nerror; /* Number of calls that returned with error */ + bool unknown; /* Unknown system call */ }; -struct syscall *get_syscall(const char *, int nargs); +struct syscall *get_syscall(struct threadinfo *, u_int, u_int); char *print_arg(struct syscall_args *, unsigned long*, long *, struct trussinfo *); /* Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/syscalls.c Fri Jan 13 21:30:18 2017 (r312084) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -819,21 +820,66 @@ init_syscalls(void) for (sc = decoded_syscalls; sc->name != NULL; sc++) STAILQ_INSERT_HEAD(&syscalls, sc, entries); } + +static struct syscall * +find_syscall(struct procabi *abi, u_int number) +{ + struct extra_syscall *es; + + if (number < nitems(abi->syscalls)) + return (abi->syscalls[number]); + STAILQ_FOREACH(es, &abi->extra_syscalls, entries) { + if (es->number == number) + return (es->sc); + } + return (NULL); +} + +static void +add_syscall(struct procabi *abi, u_int number, struct syscall *sc) +{ + struct extra_syscall *es; + + if (number < nitems(abi->syscalls)) { + assert(abi->syscalls[number] == NULL); + abi->syscalls[number] = sc; + } else { + es = malloc(sizeof(*es)); + es->sc = sc; + es->number = number; + STAILQ_INSERT_TAIL(&abi->extra_syscalls, es, entries); + } +} + /* * If/when the list gets big, it might be desirable to do it * as a hash table or binary search. */ struct syscall * -get_syscall(const char *name, int nargs) +get_syscall(struct threadinfo *t, u_int number, u_int nargs) { struct syscall *sc; - int i; + const char *name; + char *new_name; + u_int i; - if (name == NULL) - return (NULL); - STAILQ_FOREACH(sc, &syscalls, entries) - if (strcmp(name, sc->name) == 0) + sc = find_syscall(t->proc->abi, number); + if (sc != NULL) + return (sc); + + name = sysdecode_syscallname(t->proc->abi->abi, number); + if (name == NULL) { + asprintf(&new_name, "#%d", number); + name = new_name; + } else + new_name = NULL; + STAILQ_FOREACH(sc, &syscalls, entries) { + if (strcmp(name, sc->name) == 0) { + add_syscall(t->proc->abi, number, sc); + free(new_name); return (sc); + } + } /* It is unknown. Add it into the list. */ #if DEBUG @@ -842,7 +888,9 @@ get_syscall(const char *name, int nargs) #endif sc = calloc(1, sizeof(struct syscall)); - sc->name = strdup(name); + sc->name = name; + if (new_name != NULL) + sc->unknown = true; sc->ret_type = 1; sc->nargs = nargs; for (i = 0; i < nargs; i++) { @@ -851,6 +899,7 @@ get_syscall(const char *name, int nargs) sc->args[i].type = LongHex; } STAILQ_INSERT_HEAD(&syscalls, sc, entries); + add_syscall(t->proc->abi, number, sc); return (sc); } @@ -1866,7 +1915,7 @@ print_syscall(struct trussinfo *trussinf t = trussinfo->curthread; - name = t->cs.name; + name = t->cs.sc->name; nargs = t->cs.nargs; s_args = t->cs.s_args; Modified: stable/11/usr.bin/truss/truss.h ============================================================================== --- stable/11/usr.bin/truss/truss.h Fri Jan 13 19:41:02 2017 (r312083) +++ stable/11/usr.bin/truss/truss.h Fri Jan 13 21:30:18 2017 (r312084) @@ -38,13 +38,29 @@ #define DISPLAYTIDS 0x00000080 struct procinfo; +struct syscall; struct trussinfo; +/* + * The lookup of normal system calls are optimized by using a fixed + * array for the first 1024 system calls that can be indexed directly. + * Unknown system calls with other IDs are stored in a linked list. + */ +#define SYSCALL_NORMAL_COUNT 1024 + +struct extra_syscall { + STAILQ_ENTRY(extra_syscall) entries; + struct syscall *sc; + u_int number; +}; + struct procabi { const char *type; enum sysdecode_abi abi; int (*fetch_args)(struct trussinfo *, u_int); int (*fetch_retval)(struct trussinfo *, long *, int *); + STAILQ_HEAD(, extra_syscall) extra_syscalls; + struct syscall *syscalls[SYSCALL_NORMAL_COUNT]; }; #define PROCABI(abi) DATA_SET(procabi, abi) @@ -64,10 +80,9 @@ struct procabi { */ struct current_syscall { struct syscall *sc; - const char *name; - int number; - unsigned long args[10]; + unsigned int number; unsigned int nargs; + unsigned long args[10]; char *s_args[10]; /* the printable arguments */ }; From owner-svn-src-all@freebsd.org Fri Jan 13 21:42:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 944D1CAEF4A; Fri, 13 Jan 2017 21:42:37 +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 46A6113D2; Fri, 13 Jan 2017 21:42:37 +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 v0DLgaVo083846; Fri, 13 Jan 2017 21:42:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DLga4A083845; Fri, 13 Jan 2017 21:42:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701132142.v0DLga4A083845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Jan 2017 21:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312085 - in stable: 10/sys/conf 11/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 21:42:37 -0000 Author: jhb Date: Fri Jan 13 21:42:36 2017 New Revision: 312085 URL: https://svnweb.freebsd.org/changeset/base/312085 Log: MFC 304492,310721,310734: Update cxgbe info in NOTES. 304492: Move cxgb and cxgbe down to the non-mii PCI NIC section. 310721: Mention T6 and 100GbE in description of cxgbe. 310734: Note that the Chelsio T6 also supports 25Gbps. To avoid overflowing 80 columns, condense the cxgbe description a bit. Modified: stable/10/sys/conf/NOTES Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/conf/NOTES Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Fri Jan 13 21:30:18 2017 (r312084) +++ stable/10/sys/conf/NOTES Fri Jan 13 21:42:36 2017 (r312085) @@ -1922,8 +1922,9 @@ device xmphy # XaQti XMAC II # cm: Arcnet SMC COM90c26 / SMC COM90c56 # (and SMC COM90c66 in '56 compatibility mode) adapters. # cxgb: Chelsio T3 based 1GbE/10GbE PCIe Ethernet adapters. -# cxgbe:Chelsio T4 and T5 based 1GbE/10GbE/40GbE PCIe Ethernet adapters. -# cxgbev: Chelsio T4 and T5 based PCIe Virtual Functions. +# cxgbe:Chelsio T4, T5, and T6-based 1/10/25/40/100GbE PCIe Ethernet +# adapters. +# cxgbev: Chelsio T4, T5, and T6-based PCIe Virtual Functions. # dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143 # and various workalikes including: # the ADMtek AL981 Comet and AN985 Centaur, the ASIX Electronics @@ -2072,9 +2073,6 @@ device bce # Broadcom BCM5706/BCM5708 device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn -device cxgb # Chelsio T3 10 Gigabit Ethernet -device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware -device cxgbe # Chelsio T4 and T5 1GbE/10GbE/40GbE device dc # DEC/Intel 21143 and various workalikes device et # Agere ET1310 10/100/Gigabit Ethernet device fxp # Intel EtherExpress PRO/100B (82557, 82558) @@ -2105,7 +2103,10 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. -device cxgbev # Chelsio T4 and T5 1GbE/10GbE/40GbE VF +device cxgb # Chelsio T3 10 Gigabit Ethernet +device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware +device cxgbe # Chelsio T4-T6 1/10/25/40/100 Gigabit Ethernet +device cxgbev # Chelsio T4-T6 Virtual Functions device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet From owner-svn-src-all@freebsd.org Fri Jan 13 21:42:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD2CFCAEF4B; Fri, 13 Jan 2017 21:42:37 +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 64F5413D3; Fri, 13 Jan 2017 21:42:37 +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 v0DLga84083852; Fri, 13 Jan 2017 21:42:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DLgaGG083851; Fri, 13 Jan 2017 21:42:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701132142.v0DLgaGG083851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Jan 2017 21:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312085 - in stable: 10/sys/conf 11/sys/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 21:42:37 -0000 Author: jhb Date: Fri Jan 13 21:42:36 2017 New Revision: 312085 URL: https://svnweb.freebsd.org/changeset/base/312085 Log: MFC 304492,310721,310734: Update cxgbe info in NOTES. 304492: Move cxgb and cxgbe down to the non-mii PCI NIC section. 310721: Mention T6 and 100GbE in description of cxgbe. 310734: Note that the Chelsio T6 also supports 25Gbps. To avoid overflowing 80 columns, condense the cxgbe description a bit. Modified: stable/11/sys/conf/NOTES Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/conf/NOTES Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Fri Jan 13 21:30:18 2017 (r312084) +++ stable/11/sys/conf/NOTES Fri Jan 13 21:42:36 2017 (r312085) @@ -1950,8 +1950,9 @@ device xmphy # XaQti XMAC II # cm: Arcnet SMC COM90c26 / SMC COM90c56 # (and SMC COM90c66 in '56 compatibility mode) adapters. # cxgb: Chelsio T3 based 1GbE/10GbE PCIe Ethernet adapters. -# cxgbe:Chelsio T4 and T5 based 1GbE/10GbE/40GbE PCIe Ethernet adapters. -# cxgbev: Chelsio T4 and T5 based PCIe Virtual Functions. +# cxgbe:Chelsio T4, T5, and T6-based 1/10/25/40/100GbE PCIe Ethernet +# adapters. +# cxgbev: Chelsio T4, T5, and T6-based PCIe Virtual Functions. # dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143 # and various workalikes including: # the ADMtek AL981 Comet and AN985 Centaur, the ASIX Electronics @@ -2102,9 +2103,6 @@ device bce # Broadcom BCM5706/BCM5708 device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn -device cxgb # Chelsio T3 10 Gigabit Ethernet -device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware -device cxgbe # Chelsio T4 and T5 1GbE/10GbE/40GbE device dc # DEC/Intel 21143 and various workalikes device et # Agere ET1310 10/100/Gigabit Ethernet device fxp # Intel EtherExpress PRO/100B (82557, 82558) @@ -2135,7 +2133,10 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. -device cxgbev # Chelsio T4 and T5 1GbE/10GbE/40GbE VF +device cxgb # Chelsio T3 10 Gigabit Ethernet +device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware +device cxgbe # Chelsio T4-T6 1/10/25/40/100 Gigabit Ethernet +device cxgbev # Chelsio T4-T6 Virtual Functions device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet From owner-svn-src-all@freebsd.org Fri Jan 13 21:52:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94807CAE225; Fri, 13 Jan 2017 21:52:54 +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 5B8981B22; Fri, 13 Jan 2017 21:52:54 +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 v0DLqrC3087963; Fri, 13 Jan 2017 21:52:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DLqrMg087961; Fri, 13 Jan 2017 21:52:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701132152.v0DLqrMg087961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Jan 2017 21:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312086 - in head/sys: mips/mips sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 21:52:54 -0000 Author: jhb Date: Fri Jan 13 21:52:53 2017 New Revision: 312086 URL: https://svnweb.freebsd.org/changeset/base/312086 Log: Trim a few comments on platforms that did not implement mmap of /dev/kmem. After r307332, no platforms implement mmap for /dev/kmem, so the lack of it for these platforms is no longer unique. Modified: head/sys/mips/mips/mem.c head/sys/sparc64/sparc64/mem.c Modified: head/sys/mips/mips/mem.c ============================================================================== --- head/sys/mips/mips/mem.c Fri Jan 13 21:42:36 2017 (r312085) +++ head/sys/mips/mips/mem.c Fri Jan 13 21:52:53 2017 (r312086) @@ -151,12 +151,6 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) { - /* - * /dev/mem is the only one that makes sense through this - * interface. For /dev/kmem any physaddr we return here - * could be transient and hence incorrect or invalid at - * a later time. - */ if (dev2unit(dev) != CDEV_MINOR_MEM) return (-1); Modified: head/sys/sparc64/sparc64/mem.c ============================================================================== --- head/sys/sparc64/sparc64/mem.c Fri Jan 13 21:42:36 2017 (r312085) +++ head/sys/sparc64/sparc64/mem.c Fri Jan 13 21:52:53 2017 (r312086) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); /* * Memory special file * - * NOTE: other architectures support mmap()'ing the mem and kmem devices; this + * NOTE: other architectures support mmap()'ing the mem device; this * might cause illegal aliases to be created for the locked kernel page(s), so * it is not implemented. */ From owner-svn-src-all@freebsd.org Fri Jan 13 22:16:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8515CAE79A; Fri, 13 Jan 2017 22:16:42 +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 C2BEF1606; Fri, 13 Jan 2017 22:16:42 +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 v0DMGfnw096201; Fri, 13 Jan 2017 22:16:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DMGfpV096197; Fri, 13 Jan 2017 22:16:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201701132216.v0DMGfpV096197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 13 Jan 2017 22:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312087 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 22:16:43 -0000 Author: glebius Date: Fri Jan 13 22:16:41 2017 New Revision: 312087 URL: https://svnweb.freebsd.org/changeset/base/312087 Log: Remove deprecated fgetsock() and fputsock(). Modified: head/sys/kern/kern_descrip.c head/sys/sys/file.h head/sys/sys/param.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Jan 13 21:52:53 2017 (r312086) +++ head/sys/kern/kern_descrip.c Fri Jan 13 22:16:41 2017 (r312087) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -2840,61 +2839,6 @@ fgetvp_write(struct thread *td, int fd, #endif /* - * Like fget() but loads the underlying socket, or returns an error if the - * descriptor does not represent a socket. - * - * We bump the ref count on the returned socket. XXX Also obtain the SX lock - * in the future. - * - * Note: fgetsock() and fputsock() are deprecated, as consumers should rely - * on their file descriptor reference to prevent the socket from being free'd - * during use. - */ -int -fgetsock(struct thread *td, int fd, cap_rights_t *rightsp, struct socket **spp, - u_int *fflagp) -{ - struct file *fp; - int error; - - *spp = NULL; - if (fflagp != NULL) - *fflagp = 0; - if ((error = _fget(td, fd, &fp, 0, rightsp, NULL)) != 0) - return (error); - if (fp->f_type != DTYPE_SOCKET) { - error = ENOTSOCK; - } else { - *spp = fp->f_data; - if (fflagp) - *fflagp = fp->f_flag; - SOCK_LOCK(*spp); - soref(*spp); - SOCK_UNLOCK(*spp); - } - fdrop(fp, td); - - return (error); -} - -/* - * Drop the reference count on the socket and XXX release the SX lock in the - * future. The last reference closes the socket. - * - * Note: fputsock() is deprecated, see comment for fgetsock(). - */ -void -fputsock(struct socket *so) -{ - - ACCEPT_LOCK(); - SOCK_LOCK(so); - CURVNET_SET(so->so_vnet); - sorele(so); - CURVNET_RESTORE(); -} - -/* * Handle the last reference to a file being closed. */ int Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Fri Jan 13 21:52:53 2017 (r312086) +++ head/sys/sys/file.h Fri Jan 13 22:16:41 2017 (r312087) @@ -50,8 +50,6 @@ struct thread; struct uio; struct knote; struct vnode; -struct socket; - #endif /* _KERNEL */ @@ -267,10 +265,6 @@ int fgetvp_read(struct thread *td, int f int fgetvp_write(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp); -int fgetsock(struct thread *td, int fd, cap_rights_t *rightsp, - struct socket **spp, u_int *fflagp); -void fputsock(struct socket *sp); - static __inline int _fnoop(void) { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jan 13 21:52:53 2017 (r312086) +++ head/sys/sys/param.h Fri Jan 13 22:16:41 2017 (r312087) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200019 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200020 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sat Jan 14 00:24:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5048CAEF47; Sat, 14 Jan 2017 00:24: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 5DF4B177D; Sat, 14 Jan 2017 00:24:45 +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 v0E0OijE051681; Sat, 14 Jan 2017 00:24:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0Oi9E051679; Sat, 14 Jan 2017 00:24:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140024.v0E0Oi9E051679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312088 - stable/11/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:24:45 -0000 Author: ngie Date: Sat Jan 14 00:24:44 2017 New Revision: 312088 URL: https://svnweb.freebsd.org/changeset/base/312088 Log: MFC r310950: MIB-II: use strlcpy when copying interface names to .ifr_name .ifra_name is assumed to be NUL terminated; using strlcpy(3) ensures that it's indeed NUL terminated whereas strncpy does not. Tested and verified as follows with a combination of ifconfig, snmpget, and snmpset: % ifconfig create lo1 127.0.0.2/8 % SNMPARGS="-v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des -X bsnmptest localhost" % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 2 IF-MIB::ifAdminStatus.4 = INTEGER: down(2) % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: down(2) % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 1 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) CID: 1009652-1009656, 1349850 Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII.c stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII.c Fri Jan 13 22:16:41 2017 (r312087) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII.c Sat Jan 14 00:24:44 2017 (r312088) @@ -265,7 +265,7 @@ mib_if_admin(struct mibif *ifp, int up) { struct ifreq ifr; - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "SIOCGIFFLAGS(%s): %m", ifp->name); return (-1); @@ -515,7 +515,7 @@ mib_fetch_ifmib(struct mibif *ifp) } out: - strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); + strlcpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); irr.ifr_buffer.buffer = MIBIF_PRIV(ifp)->alias; irr.ifr_buffer.length = sizeof(MIBIF_PRIV(ifp)->alias); if (ioctl(mib_netsock, SIOCGIFDESCR, &irr) == -1) { @@ -1384,7 +1384,7 @@ siocaifaddr(char *ifname, struct in_addr struct sockaddr_in *sa; memset(&addreq, 0, sizeof(addreq)); - strncpy(addreq.ifra_name, ifname, sizeof(addreq.ifra_name)); + strlcpy(addreq.ifra_name, ifname, sizeof(addreq.ifra_name)); sa = (struct sockaddr_in *)(void *)&addreq.ifra_addr; sa->sin_family = AF_INET; @@ -1414,7 +1414,7 @@ siocdifaddr(const char *ifname, struct i struct sockaddr_in *sa; memset(&delreq, 0, sizeof(delreq)); - strncpy(delreq.ifr_name, ifname, sizeof(delreq.ifr_name)); + strlcpy(delreq.ifr_name, ifname, sizeof(delreq.ifr_name)); sa = (struct sockaddr_in *)(void *)&delreq.ifr_addr; sa->sin_family = AF_INET; sa->sin_len = sizeof(*sa); @@ -1433,7 +1433,7 @@ verify_ifa(const char *name, struct mibi struct sockaddr_in *sa; memset(&req, 0, sizeof(req)); - strncpy(req.ifr_name, name, sizeof(req.ifr_name)); + strlcpy(req.ifr_name, name, sizeof(req.ifr_name)); sa = (struct sockaddr_in *)(void *)&req.ifr_addr; sa->sin_family = AF_INET; sa->sin_len = sizeof(*sa); Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Fri Jan 13 22:16:41 2017 (r312087) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Jan 14 00:24:44 2017 (r312088) @@ -77,7 +77,7 @@ ifchange_func(struct snmp_context *ctx _ switch (op) { case SNMP_DEPOP_COMMIT: - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "GIFFLAGS(%s): %m", ifp->name); return (SNMP_ERR_GENERR); @@ -95,7 +95,7 @@ ifchange_func(struct snmp_context *ctx _ ifc->rb |= IFRB_FLAGS; } if (ifc->rb & IFRB_FLAGS) { - strncpy(ifr1.ifr_name, ifp->name, sizeof(ifr1.ifr_name)); + strlcpy(ifr1.ifr_name, ifp->name, sizeof(ifr1.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr1) == -1) { syslog(LOG_ERR, "GIFFLAGS(%s): %m", ifp->name); return (SNMP_ERR_GENERR); @@ -116,7 +116,7 @@ ifchange_func(struct snmp_context *ctx _ case SNMP_DEPOP_ROLLBACK: if (ifc->rb & IFRB_FLAGS) { - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); ifr.ifr_flags = ifc->rb_flags; if (ioctl(mib_netsock, SIOCSIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "SIFFLAGS(%s): %m", ifp->name); From owner-svn-src-all@freebsd.org Sat Jan 14 00:24:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69179CAEF55; Sat, 14 Jan 2017 00:24:47 +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 2C45A1781; Sat, 14 Jan 2017 00:24:47 +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 v0E0Okr3051728; Sat, 14 Jan 2017 00:24:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0OkL2051726; Sat, 14 Jan 2017 00:24:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140024.v0E0OkL2051726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312089 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:24:47 -0000 Author: ngie Date: Sat Jan 14 00:24:46 2017 New Revision: 312089 URL: https://svnweb.freebsd.org/changeset/base/312089 Log: MFC r310950: MIB-II: use strlcpy when copying interface names to .ifr_name .ifra_name is assumed to be NUL terminated; using strlcpy(3) ensures that it's indeed NUL terminated whereas strncpy does not. Tested and verified as follows with a combination of ifconfig, snmpget, and snmpset: % ifconfig create lo1 127.0.0.2/8 % SNMPARGS="-v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des -X bsnmptest localhost" % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 2 IF-MIB::ifAdminStatus.4 = INTEGER: down(2) % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: down(2) % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 1 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) CID: 1009652-1009656, 1349850 Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.c Sat Jan 14 00:24:44 2017 (r312088) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.c Sat Jan 14 00:24:46 2017 (r312089) @@ -265,7 +265,7 @@ mib_if_admin(struct mibif *ifp, int up) { struct ifreq ifr; - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "SIOCGIFFLAGS(%s): %m", ifp->name); return (-1); @@ -515,7 +515,7 @@ mib_fetch_ifmib(struct mibif *ifp) } out: - strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); + strlcpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); irr.ifr_buffer.buffer = MIBIF_PRIV(ifp)->alias; irr.ifr_buffer.length = sizeof(MIBIF_PRIV(ifp)->alias); if (ioctl(mib_netsock, SIOCGIFDESCR, &irr) == -1) { @@ -1384,7 +1384,7 @@ siocaifaddr(char *ifname, struct in_addr struct sockaddr_in *sa; memset(&addreq, 0, sizeof(addreq)); - strncpy(addreq.ifra_name, ifname, sizeof(addreq.ifra_name)); + strlcpy(addreq.ifra_name, ifname, sizeof(addreq.ifra_name)); sa = (struct sockaddr_in *)(void *)&addreq.ifra_addr; sa->sin_family = AF_INET; @@ -1414,7 +1414,7 @@ siocdifaddr(const char *ifname, struct i struct sockaddr_in *sa; memset(&delreq, 0, sizeof(delreq)); - strncpy(delreq.ifr_name, ifname, sizeof(delreq.ifr_name)); + strlcpy(delreq.ifr_name, ifname, sizeof(delreq.ifr_name)); sa = (struct sockaddr_in *)(void *)&delreq.ifr_addr; sa->sin_family = AF_INET; sa->sin_len = sizeof(*sa); @@ -1433,7 +1433,7 @@ verify_ifa(const char *name, struct mibi struct sockaddr_in *sa; memset(&req, 0, sizeof(req)); - strncpy(req.ifr_name, name, sizeof(req.ifr_name)); + strlcpy(req.ifr_name, name, sizeof(req.ifr_name)); sa = (struct sockaddr_in *)(void *)&req.ifr_addr; sa->sin_family = AF_INET; sa->sin_len = sizeof(*sa); Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Jan 14 00:24:44 2017 (r312088) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Jan 14 00:24:46 2017 (r312089) @@ -77,7 +77,7 @@ ifchange_func(struct snmp_context *ctx _ switch (op) { case SNMP_DEPOP_COMMIT: - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "GIFFLAGS(%s): %m", ifp->name); return (SNMP_ERR_GENERR); @@ -95,7 +95,7 @@ ifchange_func(struct snmp_context *ctx _ ifc->rb |= IFRB_FLAGS; } if (ifc->rb & IFRB_FLAGS) { - strncpy(ifr1.ifr_name, ifp->name, sizeof(ifr1.ifr_name)); + strlcpy(ifr1.ifr_name, ifp->name, sizeof(ifr1.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr1) == -1) { syslog(LOG_ERR, "GIFFLAGS(%s): %m", ifp->name); return (SNMP_ERR_GENERR); @@ -116,7 +116,7 @@ ifchange_func(struct snmp_context *ctx _ case SNMP_DEPOP_ROLLBACK: if (ifc->rb & IFRB_FLAGS) { - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); ifr.ifr_flags = ifc->rb_flags; if (ioctl(mib_netsock, SIOCSIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "SIFFLAGS(%s): %m", ifp->name); From owner-svn-src-all@freebsd.org Sat Jan 14 00:26:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7A33CAD0D9; Sat, 14 Jan 2017 00:26:51 +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 8CE441AB0; Sat, 14 Jan 2017 00:26:51 +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 v0E0QoAv051918; Sat, 14 Jan 2017 00:26:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0QoWt051917; Sat, 14 Jan 2017 00:26:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140026.v0E0QoWt051917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312090 - stable/11/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:26:51 -0000 Author: ngie Date: Sat Jan 14 00:26:50 2017 New Revision: 312090 URL: https://svnweb.freebsd.org/changeset/base/312090 Log: MFC r311227,r311917: r311227: seekdir_basic: fix various Coverity issues Address.. - .. resource leaks of file descriptors and memory - .. unchecked return values from creat(2), mkdir(2), and telldir(3) - .. potential NULL derefs after calling readdir(3) CID: 975255, 975256, 976989, 978989, 978990 r311917: Fix up r311227 Check for creat returning a value != -1, not a non-zero value Pointyhat to: ngie CID: 1368366 Modified: stable/11/contrib/netbsd-tests/lib/libc/gen/t_dir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/gen/t_dir.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/gen/t_dir.c Sat Jan 14 00:24:46 2017 (r312089) +++ stable/11/contrib/netbsd-tests/lib/libc/gen/t_dir.c Sat Jan 14 00:26:50 2017 (r312090) @@ -39,6 +39,10 @@ #include +#ifdef __FreeBSD__ +#include +#endif + ATF_TC(seekdir_basic); ATF_TC_HEAD(seekdir_basic, tc) { @@ -54,10 +58,26 @@ ATF_TC_BODY(seekdir_basic, tc) struct dirent *entry; long here; +#ifdef __FreeBSD__ +#define CREAT(x, m) do { \ + int _creat_fd; \ + ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))) != -1, \ + "creat(%s, %x) failed: %s", (x), (m), \ + strerror(errno)); \ + (void)close(_creat_fd); \ + } while(0); + + ATF_REQUIRE_MSG(mkdir("t", 0755) == 0, + "mkdir failed: %s", strerror(errno)); + CREAT("t/a", 0600); + CREAT("t/b", 0600); + CREAT("t/c", 0600); +#else mkdir("t", 0755); creat("t/a", 0600); creat("t/b", 0600); creat("t/c", 0600); +#endif dp = opendir("t"); if ( dp == NULL) @@ -70,9 +90,17 @@ ATF_TC_BODY(seekdir_basic, tc) /* get first entry */ entry = readdir(dp); here = telldir(dp); +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(here != -1, + "telldir failed: %s", strerror(errno)); +#endif /* get second entry */ entry = readdir(dp); +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(entry != NULL, + "readdir failed: %s", strerror(errno)); +#endif wasname = strdup(entry->d_name); if (wasname == NULL) atf_tc_fail("cannot allocate memory"); @@ -109,6 +137,9 @@ ATF_TC_BODY(seekdir_basic, tc) atf_tc_fail("3rd seekdir found wrong name"); closedir(dp); +#ifdef __FreeBSD__ + free(wasname); +#endif } /* There is no sbrk on AArch64 and RISC-V */ From owner-svn-src-all@freebsd.org Sat Jan 14 00:26:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C982ACAD0E7; Sat, 14 Jan 2017 00:26:53 +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 7E9EF1AB2; Sat, 14 Jan 2017 00:26:53 +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 v0E0QqY8051963; Sat, 14 Jan 2017 00:26:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0QqYY051962; Sat, 14 Jan 2017 00:26:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140026.v0E0QqYY051962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312091 - stable/10/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:26:53 -0000 Author: ngie Date: Sat Jan 14 00:26:52 2017 New Revision: 312091 URL: https://svnweb.freebsd.org/changeset/base/312091 Log: MFC r311227,r311917: r311227: seekdir_basic: fix various Coverity issues Address.. - .. resource leaks of file descriptors and memory - .. unchecked return values from creat(2), mkdir(2), and telldir(3) - .. potential NULL derefs after calling readdir(3) CID: 975255, 975256, 976989, 978989, 978990 r311917: Fix up r311227 Check for creat returning a value != -1, not a non-zero value Pointyhat to: ngie CID: 1368366 Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_dir.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_dir.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/gen/t_dir.c Sat Jan 14 00:26:50 2017 (r312090) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_dir.c Sat Jan 14 00:26:52 2017 (r312091) @@ -39,6 +39,10 @@ #include +#ifdef __FreeBSD__ +#include +#endif + ATF_TC(seekdir_basic); ATF_TC_HEAD(seekdir_basic, tc) { @@ -54,10 +58,26 @@ ATF_TC_BODY(seekdir_basic, tc) struct dirent *entry; long here; +#ifdef __FreeBSD__ +#define CREAT(x, m) do { \ + int _creat_fd; \ + ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))) != -1, \ + "creat(%s, %x) failed: %s", (x), (m), \ + strerror(errno)); \ + (void)close(_creat_fd); \ + } while(0); + + ATF_REQUIRE_MSG(mkdir("t", 0755) == 0, + "mkdir failed: %s", strerror(errno)); + CREAT("t/a", 0600); + CREAT("t/b", 0600); + CREAT("t/c", 0600); +#else mkdir("t", 0755); creat("t/a", 0600); creat("t/b", 0600); creat("t/c", 0600); +#endif dp = opendir("t"); if ( dp == NULL) @@ -70,9 +90,17 @@ ATF_TC_BODY(seekdir_basic, tc) /* get first entry */ entry = readdir(dp); here = telldir(dp); +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(here != -1, + "telldir failed: %s", strerror(errno)); +#endif /* get second entry */ entry = readdir(dp); +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(entry != NULL, + "readdir failed: %s", strerror(errno)); +#endif wasname = strdup(entry->d_name); if (wasname == NULL) atf_tc_fail("cannot allocate memory"); @@ -109,6 +137,9 @@ ATF_TC_BODY(seekdir_basic, tc) atf_tc_fail("3rd seekdir found wrong name"); closedir(dp); +#ifdef __FreeBSD__ + free(wasname); +#endif } ATF_TC(telldir_leak); From owner-svn-src-all@freebsd.org Sat Jan 14 00:28:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54A46CAD1CE; Sat, 14 Jan 2017 00:28:22 +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 263181DA4; Sat, 14 Jan 2017 00:28:22 +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 v0E0SLSb052118; Sat, 14 Jan 2017 00:28:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0SLGG052117; Sat, 14 Jan 2017 00:28:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140028.v0E0SLGG052117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312092 - stable/10/contrib/netbsd-tests/lib/libc/regex X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:28:22 -0000 Author: ngie Date: Sat Jan 14 00:28:21 2017 New Revision: 312092 URL: https://svnweb.freebsd.org/changeset/base/312092 Log: MFC r311926: Consolidate __NetBSD__ #ifdef Modified: stable/10/contrib/netbsd-tests/lib/libc/regex/debug.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/regex/debug.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/regex/debug.c Sat Jan 14 00:26:52 2017 (r312091) +++ stable/10/contrib/netbsd-tests/lib/libc/regex/debug.c Sat Jan 14 00:28:21 2017 (r312092) @@ -48,9 +48,7 @@ #ifdef __NetBSD__ static void s_print(struct re_guts *, FILE *); static char *regchar(int); -#endif -#ifdef __NetBSD__ /* * regprint - print a regexp for debugging */ From owner-svn-src-all@freebsd.org Sat Jan 14 00:28:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01A57CAD1ED; Sat, 14 Jan 2017 00:28:25 +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 C4CB91DA6; Sat, 14 Jan 2017 00:28:24 +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 v0E0SNug052167; Sat, 14 Jan 2017 00:28:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0SNjG052166; Sat, 14 Jan 2017 00:28:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140028.v0E0SNjG052166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312093 - stable/11/contrib/netbsd-tests/lib/libc/regex X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:28:25 -0000 Author: ngie Date: Sat Jan 14 00:28:23 2017 New Revision: 312093 URL: https://svnweb.freebsd.org/changeset/base/312093 Log: MFC r311926: Consolidate __NetBSD__ #ifdef Modified: stable/11/contrib/netbsd-tests/lib/libc/regex/debug.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/regex/debug.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/regex/debug.c Sat Jan 14 00:28:21 2017 (r312092) +++ stable/11/contrib/netbsd-tests/lib/libc/regex/debug.c Sat Jan 14 00:28:23 2017 (r312093) @@ -48,9 +48,7 @@ #ifdef __NetBSD__ static void s_print(struct re_guts *, FILE *); static char *regchar(int); -#endif -#ifdef __NetBSD__ /* * regprint - print a regexp for debugging */ From owner-svn-src-all@freebsd.org Sat Jan 14 00:29:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FA3BCAD2C5; Sat, 14 Jan 2017 00:29:57 +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 D2992109F; Sat, 14 Jan 2017 00:29: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 v0E0Tuu3052347; Sat, 14 Jan 2017 00:29:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0TtMX052345; Sat, 14 Jan 2017 00:29:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140029.v0E0TtMX052345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312095 - stable/10/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:29:57 -0000 Author: ngie Date: Sat Jan 14 00:29:55 2017 New Revision: 312095 URL: https://svnweb.freebsd.org/changeset/base/312095 Log: MFC r311924: Fix whitespace in comment Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Sat Jan 14 00:29:55 2017 (r312094) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Sat Jan 14 00:29:55 2017 (r312095) @@ -64,7 +64,7 @@ ATF_TC_BODY(setdomainname_basic, tc) (void)memset(name, 0, sizeof(name)); #ifdef __FreeBSD__ - /* + /* * Sanity checks to ensure that the wrong invariant isn't being * tested for per PR # 181127 */ Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Sat Jan 14 00:29:55 2017 (r312094) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Sat Jan 14 00:29:55 2017 (r312095) @@ -66,7 +66,7 @@ ATF_TC_BODY(sethostname_basic, tc) (void)memset(name, 0, sizeof(name)); #ifdef __FreeBSD__ - /* + /* * Sanity checks to ensure that the wrong invariant isn't being * tested for per PR # 181127 */ From owner-svn-src-all@freebsd.org Sat Jan 14 00:29:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92FF4CAD2C0; Sat, 14 Jan 2017 00:29: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 61F7F109E; Sat, 14 Jan 2017 00:29: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 v0E0TtIn052315; Sat, 14 Jan 2017 00:29:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0TtGF052304; Sat, 14 Jan 2017 00:29:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140029.v0E0TtGF052304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312094 - stable/11/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:29:56 -0000 Author: ngie Date: Sat Jan 14 00:29:55 2017 New Revision: 312094 URL: https://svnweb.freebsd.org/changeset/base/312094 Log: MFC r311924: Fix whitespace in comment Modified: stable/11/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Sat Jan 14 00:28:23 2017 (r312093) +++ stable/11/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Sat Jan 14 00:29:55 2017 (r312094) @@ -64,7 +64,7 @@ ATF_TC_BODY(setdomainname_basic, tc) (void)memset(name, 0, sizeof(name)); #ifdef __FreeBSD__ - /* + /* * Sanity checks to ensure that the wrong invariant isn't being * tested for per PR # 181127 */ Modified: stable/11/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Sat Jan 14 00:28:23 2017 (r312093) +++ stable/11/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Sat Jan 14 00:29:55 2017 (r312094) @@ -66,7 +66,7 @@ ATF_TC_BODY(sethostname_basic, tc) (void)memset(name, 0, sizeof(name)); #ifdef __FreeBSD__ - /* + /* * Sanity checks to ensure that the wrong invariant isn't being * tested for per PR # 181127 */ From owner-svn-src-all@freebsd.org Sat Jan 14 00:33:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E15ACCAD515; Sat, 14 Jan 2017 00:33:04 +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 B2EAC1678; Sat, 14 Jan 2017 00:33:04 +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 v0E0X340056321; Sat, 14 Jan 2017 00:33:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0X38M056320; Sat, 14 Jan 2017 00:33:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140033.v0E0X38M056320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312096 - stable/10/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:33:05 -0000 Author: ngie Date: Sat Jan 14 00:33:03 2017 New Revision: 312096 URL: https://svnweb.freebsd.org/changeset/base/312096 Log: MFC r311236,r311919: r311236: unlink_fifo: don't leak the file descriptors opened with mkfifo and open MFC fater: 3 days CID: 978316, 978317 r311919: Partially revert r311236 There's no sense in trying to close a file descriptor from the negative cases with unlink_test; it's best to ignore these cases. The mkfifo case does make sense to keep though. Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Sat Jan 14 00:29:55 2017 (r312095) +++ stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Sat Jan 14 00:33:03 2017 (r312096) @@ -111,8 +111,15 @@ ATF_TC_HEAD(unlink_fifo, tc) ATF_TC_BODY(unlink_fifo, tc) { +#ifdef __FreeBSD__ + int fd; + ATF_REQUIRE_MSG((fd = mkfifo(path, 0666)) == 0, + "mkfifo failed: %s", strerror(errno)); + (void)close(fd); +#else ATF_REQUIRE(mkfifo(path, 0666) == 0); +#endif ATF_REQUIRE(unlink(path) == 0); errno = 0; From owner-svn-src-all@freebsd.org Sat Jan 14 00:33:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39EF2CAD557; Sat, 14 Jan 2017 00:33:08 +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 0503D1680; Sat, 14 Jan 2017 00:33:07 +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 v0E0X7bo056371; Sat, 14 Jan 2017 00:33:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0X714056370; Sat, 14 Jan 2017 00:33:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140033.v0E0X714056370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312097 - stable/11/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:33:08 -0000 Author: ngie Date: Sat Jan 14 00:33:07 2017 New Revision: 312097 URL: https://svnweb.freebsd.org/changeset/base/312097 Log: MFC r311236,r311919: r311236: unlink_fifo: don't leak the file descriptors opened with mkfifo and open MFC fater: 3 days CID: 978316, 978317 r311919: Partially revert r311236 There's no sense in trying to close a file descriptor from the negative cases with unlink_test; it's best to ignore these cases. The mkfifo case does make sense to keep though. Modified: stable/11/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/sys/t_unlink.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Sat Jan 14 00:33:03 2017 (r312096) +++ stable/11/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Sat Jan 14 00:33:07 2017 (r312097) @@ -111,8 +111,15 @@ ATF_TC_HEAD(unlink_fifo, tc) ATF_TC_BODY(unlink_fifo, tc) { +#ifdef __FreeBSD__ + int fd; + ATF_REQUIRE_MSG((fd = mkfifo(path, 0666)) == 0, + "mkfifo failed: %s", strerror(errno)); + (void)close(fd); +#else ATF_REQUIRE(mkfifo(path, 0666) == 0); +#endif ATF_REQUIRE(unlink(path) == 0); errno = 0; From owner-svn-src-all@freebsd.org Sat Jan 14 00:36:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 981BCCAD771; Sat, 14 Jan 2017 00:36:51 +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 4DD301A46; Sat, 14 Jan 2017 00:36:51 +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 v0E0aoGT056674; Sat, 14 Jan 2017 00:36:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0aomH056673; Sat, 14 Jan 2017 00:36:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140036.v0E0aomH056673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312099 - stable/11/contrib/bsnmp/gensnmpdef X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:36:51 -0000 Author: ngie Date: Sat Jan 14 00:36:50 2017 New Revision: 312099 URL: https://svnweb.freebsd.org/changeset/base/312099 Log: MFC r311750,r311754,r311757: r311750: Check result from smiGetFirstNode and smiGetNodeByOID This avoids a segfault with malformed or unanticipated files, like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS). Found with: gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt r311754: Use calloc instead of malloc + memset(.., 0, ..) r311757: Similar to r311750, check for the result from smiGetModule to avoid a segfault when dereferencing a NULL pointer later on. Choose to just check for the NULL pointer in the next for-loop for now to fix the issue with a minimal amount of code churn sys/queue.h use here would make more sense than using a static table Modified: stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.c ============================================================================== --- stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.c Sat Jan 14 00:36:48 2017 (r312098) +++ stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.c Sat Jan 14 00:36:50 2017 (r312099) @@ -126,9 +126,11 @@ open_node(const SmiNode *n, u_int level, while (level < n->oidlen - 1) { if (level >= cut) { + n1 = smiGetNodeByOID(level + 1, n->oid); + if (n1 == NULL) + continue; pindent(level); printf("(%u", n->oid[level]); - n1 = smiGetNodeByOID(level + 1, n->oid); printf(" "); print_name(n1); printf("\n"); @@ -397,12 +399,11 @@ static void save_typdef(char *name) { struct tdef *t; - t = malloc(sizeof(struct tdef)); + t = calloc(1, sizeof(struct tdef)); if (t == NULL) err(1, NULL); - memset(t, 0 , sizeof(struct tdef)); t->name = name; SLIST_INSERT_HEAD(&tdefs, t, link); } @@ -559,7 +560,11 @@ main(int argc, char *argv[]) level = 0; last = NULL; for (opt = 0; opt < argc; opt++) { + if (mods[opt] == NULL) /* smiGetModule failed above */ + continue; n = smiGetFirstNode(mods[opt], SMI_NODEKIND_ANY); + if (n == NULL) + continue; for (;;) { if (do_typedef == 0) { level = open_node(n, level, &last); From owner-svn-src-all@freebsd.org Sat Jan 14 00:36:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FA7DCAD769; Sat, 14 Jan 2017 00:36:49 +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 31E581A45; Sat, 14 Jan 2017 00:36:49 +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 v0E0amnv056629; Sat, 14 Jan 2017 00:36:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0amFg056628; Sat, 14 Jan 2017 00:36:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140036.v0E0amFg056628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312098 - stable/10/contrib/bsnmp/gensnmpdef X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:36:49 -0000 Author: ngie Date: Sat Jan 14 00:36:48 2017 New Revision: 312098 URL: https://svnweb.freebsd.org/changeset/base/312098 Log: MFC r311750,r311754,r311757: r311750: Check result from smiGetFirstNode and smiGetNodeByOID This avoids a segfault with malformed or unanticipated files, like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS). Found with: gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt r311754: Use calloc instead of malloc + memset(.., 0, ..) r311757: Similar to r311750, check for the result from smiGetModule to avoid a segfault when dereferencing a NULL pointer later on. Choose to just check for the NULL pointer in the next for-loop for now to fix the issue with a minimal amount of code churn sys/queue.h use here would make more sense than using a static table Modified: stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c ============================================================================== --- stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c Sat Jan 14 00:33:07 2017 (r312097) +++ stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c Sat Jan 14 00:36:48 2017 (r312098) @@ -126,9 +126,11 @@ open_node(const SmiNode *n, u_int level, while (level < n->oidlen - 1) { if (level >= cut) { + n1 = smiGetNodeByOID(level + 1, n->oid); + if (n1 == NULL) + continue; pindent(level); printf("(%u", n->oid[level]); - n1 = smiGetNodeByOID(level + 1, n->oid); printf(" "); print_name(n1); printf("\n"); @@ -397,12 +399,11 @@ static void save_typdef(char *name) { struct tdef *t; - t = malloc(sizeof(struct tdef)); + t = calloc(1, sizeof(struct tdef)); if (t == NULL) err(1, NULL); - memset(t, 0 , sizeof(struct tdef)); t->name = name; SLIST_INSERT_HEAD(&tdefs, t, link); } @@ -559,7 +560,11 @@ main(int argc, char *argv[]) level = 0; last = NULL; for (opt = 0; opt < argc; opt++) { + if (mods[opt] == NULL) /* smiGetModule failed above */ + continue; n = smiGetFirstNode(mods[opt], SMI_NODEKIND_ANY); + if (n == NULL) + continue; for (;;) { if (do_typedef == 0) { level = open_node(n, level, &last); From owner-svn-src-all@freebsd.org Sat Jan 14 00:37:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A0E8CAD7EE; Sat, 14 Jan 2017 00:37:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) (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 08F5C1B02; Sat, 14 Jan 2017 00:36:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f48.google.com with SMTP id n129so15746221wmn.0; Fri, 13 Jan 2017 16:36:59 -0800 (PST) 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=rIJcztu5sNA0lB898Q1sD+P9a0YpUOOLCP6QpYOHSUY=; b=mG+2BsPkxaXRK0/r6DCq3TrmeCTwzaokZEFFmlKsxEDeNXYjcGAFYN9wW9YcsTRsHg RNzaEJDK6ddabaAF+j3dnyRTOHTgxxRCqcJpgcFvnfZ0X2TwCdMeglkW8oUszKglqCV4 y2YbGFYiIPMdaMCalp9OBwpejaJxxumI1umEeQh4dLqrpSR4wrChm87F+7JyAOxcxVo5 ufFcaruTIWVx+G8mMC22eCssPr86hqlp2jViAkoPAN11HpjhCTW3xT3VXU0igSlCQlHT XJVUecOG5iGCK6XMJwKxGwvZiw3UQK9/CtGOnOKUXfOUQQQ10NBgQlZa5iPiIbZPylJo t90A== X-Gm-Message-State: AIkVDXKa4NRv4AYTG3EC4875RG8zFML5M9Rpz/OE/GUKMpvb2y6AxxsxeeMMEAKvo2gB3Q== X-Received: by 10.28.147.147 with SMTP id v141mr4471032wmd.110.1484352559816; Fri, 13 Jan 2017 16:09:19 -0800 (PST) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com. [74.125.82.41]) by smtp.gmail.com with ESMTPSA id s20sm7968534wmb.9.2017.01.13.16.09.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 16:09:19 -0800 (PST) Received: by mail-wm0-f41.google.com with SMTP id c206so93684413wme.0; Fri, 13 Jan 2017 16:09:19 -0800 (PST) X-Received: by 10.223.154.132 with SMTP id a4mr15826415wrc.188.1484352559430; Fri, 13 Jan 2017 16:09:19 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.29.72 with HTTP; Fri, 13 Jan 2017 16:09:18 -0800 (PST) In-Reply-To: <201701010401.v0141RpZ072608@repo.freebsd.org> References: <201701010401.v0141RpZ072608@repo.freebsd.org> From: Conrad Meyer Date: Fri, 13 Jan 2017 16:09:18 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r310994 - head/tests/sys/vfs To: Ngie Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:37:00 -0000 Um, this is garbage and ruins the entire point of using a standardized framework like ATF. Please revert it. Instead, just have the Kyua framework preopen its output files before running tests. The diff will be an order of magnitude smaller than this one is and it will fix the problem generally instead of adding fork/wait cruft and undetailed assert()s to every test. Conrad On Sat, Dec 31, 2016 at 8:01 PM, Ngie Cooper wrote: > Author: ngie > Date: Sun Jan 1 04:01:27 2017 > New Revision: 310994 > URL: https://svnweb.freebsd.org/changeset/base/310994 > > Log: > Make sys/vfs/lookup_cap_dotdot actually work with "kyua test" > > The tests don't work when reading/writing to file descriptors in the > sandbox after entering capability mode (and wouldn't have, regardless > of the framework), so adjust the tests so they function within the > framework. > > For tests that enter capability mode over the course of the test, the > following is now done: > > 1. Fork child process for capability mode test. > 2. In child... > i. Enter capability mode. > ii. Test invariants. > iii. Exit after calling test function. > 3. Collect status for child and determine whether or not it completed > successfully. > > In order to test the invariants in the child process, they now use assert(3) > instead of ATF_REQUIRE*, as the atf-c-api functions right to results files > in the directories in order to determine where and how tests fail. > > While in the area, fix several -Wshadow and -Wunused warnings found when I > bumped WARNS up to 6, and fix some minor style(9) issues with indentation > and type alignment. > > PR: 215690 > > Modified: > head/tests/sys/vfs/lookup_cap_dotdot.c > > Modified: head/tests/sys/vfs/lookup_cap_dotdot.c > ============================================================================== > --- head/tests/sys/vfs/lookup_cap_dotdot.c Sun Jan 1 00:43:20 2017 (r310993) > +++ head/tests/sys/vfs/lookup_cap_dotdot.c Sun Jan 1 04:01:27 2017 (r310994) > @@ -31,23 +31,27 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include > +#include > #include > #include > #include > > #include "freebsd_test_suite/macros.h" > > -static int dirfd = -1; > -static char *abspath; > +static char *abspath; > +static int dirfd = -1; > + > +typedef void (*child_test_fn_t)(void); > > static void > -touchat(int dirfd, const char *name) > +touchat(int _dirfd, const char *name) > { > int fd; > > - ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, > + ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, > 0777)) >= 0); > ATF_REQUIRE(close(fd) == 0); > } > @@ -78,10 +82,43 @@ prepare_dotdot_tests(void) > static void > check_capsicum(void) > { > + > ATF_REQUIRE_FEATURE("security_capabilities"); > ATF_REQUIRE_FEATURE("security_capability_mode"); > } > > +static void > +run_capsicum_test(child_test_fn_t test_func) > +{ > + int child_exit_code, child_status; > + pid_t child_pid; > + > + check_capsicum(); > + prepare_dotdot_tests(); > + > + ATF_REQUIRE_MSG((child_pid = fork()) != -1, > + "fork failed: %s", strerror(errno)); > + > + if (child_pid == 0) { > + test_func(); > + _exit(0); > + } > + > + ATF_REQUIRE_MSG(waitpid(child_pid, &child_status, 0) != -1, > + "waitpid failed: %s", strerror(errno)); > + if (WIFEXITED(child_status)) { > + child_exit_code = WEXITSTATUS(child_status); > + ATF_REQUIRE_MSG(child_exit_code == 0, > + "child exited with non-zero exit code: %d", > + child_exit_code); > + } else if (WIFSIGNALED(child_status)) > + atf_tc_fail("child exited with signal: %d", > + WTERMSIG(child_status)); > + else > + atf_tc_fail("child exited with unexpected status: %d", > + child_status); > +} > + > /* > * Positive tests > */ > @@ -93,6 +130,7 @@ ATF_TC_HEAD(openat__basic_positive, tc) > > ATF_TC_BODY(openat__basic_positive, tc) > { > + > prepare_dotdot_tests(); > > ATF_REQUIRE(openat(dirfd, "d1/d2/d3/f3", O_RDONLY) >= 0); > @@ -114,21 +152,22 @@ ATF_TC_HEAD(lookup_cap_dotdot__basic, tc > "Validate cap-mode (testdir)/d1/.. lookup"); > } > > -ATF_TC_BODY(lookup_cap_dotdot__basic, tc) > +static void > +lookup_cap_dotdot__basic_child(void) > { > cap_rights_t rights; > - int fd; > - > - check_capsicum(); > - prepare_dotdot_tests(); > > cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); > - ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); > > - ATF_REQUIRE(cap_enter() >= 0); > + assert(cap_rights_limit(dirfd, &rights) >= 0); > + assert(cap_enter() >= 0); > + assert(openat(dirfd, "d1/..", O_RDONLY) >= 0); > +} > + > +ATF_TC_BODY(lookup_cap_dotdot__basic, tc) > +{ > > - ATF_REQUIRE_MSG(openat(dirfd, "d1/..", O_RDONLY) >= 0, "%s", > - strerror(errno)); > + run_capsicum_test(lookup_cap_dotdot__basic_child); > } > > ATF_TC(lookup_cap_dotdot__advanced); > @@ -138,23 +177,26 @@ ATF_TC_HEAD(lookup_cap_dotdot__advanced, > "Validate cap-mode (testdir)/d1/.. lookup"); > } > > -ATF_TC_BODY(lookup_cap_dotdot__advanced, tc) > +static void > +lookup_cap_dotdot__advanced_child(void) > { > cap_rights_t rights; > - int fd; > - > - check_capsicum(); > - prepare_dotdot_tests(); > > cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); > - ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); > + assert(cap_rights_limit(dirfd, &rights) >= 0); > > - ATF_REQUIRE(cap_enter() >= 0); > + assert(cap_enter() >= 0); > > - ATF_REQUIRE(openat(dirfd, "d1/d2/d3/../../f1", O_RDONLY) >= 0); > - ATF_REQUIRE(openat(dirfd, "l3/../../f1", O_RDONLY) >= 0); > - ATF_REQUIRE(openat(dirfd, "l3/ld1", O_RDONLY) >= 0); > - ATF_REQUIRE(openat(dirfd, "l3/lf1", O_RDONLY) >= 0); > + assert(openat(dirfd, "d1/d2/d3/../../f1", O_RDONLY) >= 0); > + assert(openat(dirfd, "l3/../../f1", O_RDONLY) >= 0); > + assert(openat(dirfd, "l3/ld1", O_RDONLY) >= 0); > + assert(openat(dirfd, "l3/lf1", O_RDONLY) >= 0); > +} > + > +ATF_TC_BODY(lookup_cap_dotdot__advanced, tc) > +{ > + > + run_capsicum_test(lookup_cap_dotdot__advanced_child); > } > > /* > @@ -168,6 +210,7 @@ ATF_TC_HEAD(openat__basic_negative, tc) > > ATF_TC_BODY(openat__basic_negative, tc) > { > + > prepare_dotdot_tests(); > > ATF_REQUIRE_ERRNO(ENOENT, > @@ -182,32 +225,43 @@ ATF_TC_HEAD(capmode__negative, tc) > atf_tc_set_md_var(tc, "descr", "Negative Capability mode testcases"); > } > > -ATF_TC_BODY(capmode__negative, tc) > +static void > +capmode__negative_child(void) > { > int subdirfd; > > - check_capsicum(); > - prepare_dotdot_tests(); > - > - ATF_REQUIRE(cap_enter() == 0); > + assert(cap_enter() == 0); > > /* open() not permitted in capability mode */ > - ATF_REQUIRE_ERRNO(ECAPMODE, open("testdir", O_RDONLY) < 0); > + assert(open("testdir", O_RDONLY) < 0); > + assert(errno == ECAPMODE); > > /* AT_FDCWD not permitted in capability mode */ > - ATF_REQUIRE_ERRNO(ECAPMODE, openat(AT_FDCWD, "d1/f1", O_RDONLY) < 0); > + assert(openat(AT_FDCWD, "d1/f1", O_RDONLY) < 0); > + assert(errno == ECAPMODE); > > /* Relative path above dirfd not capable */ > - ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0); > - ATF_REQUIRE((subdirfd = openat(dirfd, "l3", O_RDONLY)) >= 0); > - ATF_REQUIRE_ERRNO(ENOTCAPABLE, > - openat(subdirfd, "../../f1", O_RDONLY) < 0); > + assert(openat(dirfd, "..", O_RDONLY) < 0); > + assert(errno == ENOTCAPABLE); > + > + assert((subdirfd = openat(dirfd, "l3", O_RDONLY)) >= 0); > + assert(openat(subdirfd, "../../f1", O_RDONLY) < 0); > + assert(errno == ENOTCAPABLE); > + (void)close(subdirfd); > > /* Absolute paths not capable */ > - ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, abspath, O_RDONLY) < 0); > + assert(openat(dirfd, abspath, O_RDONLY) < 0); > + assert(errno == ENOTCAPABLE); > > /* Symlink above dirfd */ > - ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "lup/f1", O_RDONLY) < 0); > + assert(openat(dirfd, "lup/f1", O_RDONLY) < 0); > + assert(errno == ENOTCAPABLE); > +} > + > +ATF_TC_BODY(capmode__negative, tc) > +{ > + > + run_capsicum_test(capmode__negative_child); > } > > ATF_TC(lookup_cap_dotdot__negative); > @@ -217,22 +271,30 @@ ATF_TC_HEAD(lookup_cap_dotdot__negative, > "Validate cap-mode (testdir)/.. lookup fails"); > } > > -ATF_TC_BODY(lookup_cap_dotdot__negative, tc) > +static void > +lookup_cap_dotdot__negative_child(void) > { > cap_rights_t rights; > - int fd; > - > - check_capsicum(); > - prepare_dotdot_tests(); > > cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); > - ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); > + assert(cap_rights_limit(dirfd, &rights) >= 0); > > - ATF_REQUIRE(cap_enter() >= 0); > + assert(cap_enter() >= 0); > + > + assert(openat(dirfd, "..", O_RDONLY) < 0); > + assert(errno == ENOTCAPABLE); > + > + assert(openat(dirfd, "d1/../..", O_RDONLY) < 0); > + assert(errno == ENOTCAPABLE); > + > + assert(openat(dirfd, "../testdir/d1/f1", O_RDONLY) < 0); > + assert(errno == ENOTCAPABLE); > +} > + > +ATF_TC_BODY(lookup_cap_dotdot__negative, tc) > +{ > > - ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0); > - ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "d1/../..", O_RDONLY) < 0); > - ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "../testdir/d1/f1", O_RDONLY) < 0); > + run_capsicum_test(lookup_cap_dotdot__negative_child); > } > > ATF_TP_ADD_TCS(tp) > From owner-svn-src-all@freebsd.org Sat Jan 14 00:38:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 377F0CAD959; Sat, 14 Jan 2017 00:38:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (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 EFBDD1F29; Sat, 14 Jan 2017 00:38:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x244.google.com with SMTP id 101so7204632iom.0; Fri, 13 Jan 2017 16:38:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=d/5pIV9j4E0kBYOhUrStrAwvLY8T5Zeqm9NWFHPE2sI=; b=XMDECWIO9Rgw2xN0CuJV1EGrQH7x1rMC+CQxY6w6bZpdGvhxqF2MeIFjGVwDiv+CgZ ePS8PlpBEHr9ZEsJE+WViYNlqtoTzUmLHgHICiC15TLR/EBYxQipzDfcDneCJU/N+bvf R8Q3of2hSrjB4JmSjA++2u5GB0tZE1koF8fXBWRNX2go14LY3WTHGJQJ30AtGJlIasFF m+g3Y5r2+Hbbtgyd9sQr+Re5kzp/znJqwACiyBMMD7V4JVJjHC066nLmP+KfT6EiowtT Lwisrdtq1dAR0BGVQiY3OQ6B5TcsTHyOt2WnRAdeKJxQr9yUgG41sT7bXKK47f/vbAXt B9qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=d/5pIV9j4E0kBYOhUrStrAwvLY8T5Zeqm9NWFHPE2sI=; b=H+G0qIt4gcgkyaA7AhXBcJ0bWIiekAjr2uqFHbBueFE6ZG4c7aKgOvWXFDsKxAQMe+ kwT2OqG7JhInQbbNu0dEVJjJ33xMCsJS64Om7nrEQCyHN/H2wybvgi0+svXjyXa9kfco qaDuGLBS0V9bNR0FSxT6BpplC/strM268n6+OD6R3beghH+6BL9665Cq5Q98TQzjY7C4 6hgqp5Tkx5nfAwONcboiy6IBOGY2erfbyVu+0qLtlb6d0WFMNaaEXvISFVamJVCm/IQv NKpvbjy9Bgz3kEp7yXKd2VTgJGd74mK+uHAEF/rnJ6gPxqE6NHMhaod5jyJB0xyGenIO Z/tQ== X-Gm-Message-State: AIkVDXKg5ThsU8E6pDlaHZg0E8W1aacZzihttb8zJyYIzQjIOst2i3mDM33bDe1WNbzcJA== X-Received: by 10.107.41.20 with SMTP id p20mr22282321iop.124.1484354319218; Fri, 13 Jan 2017 16:38:39 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id n134sm1727793itg.19.2017.01.13.16.38.38 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 16:38:38 -0800 (PST) Subject: Re: svn commit: r310994 - head/tests/sys/vfs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_065C1C5B-5885-40D2-ABF2-54EDF51C8BA0"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Fri, 13 Jan 2017 16:38:36 -0800 Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <0C3A305C-F089-4014-8548-60B33887423F@gmail.com> References: <201701010401.v0141RpZ072608@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:38:40 -0000 --Apple-Mail=_065C1C5B-5885-40D2-ABF2-54EDF51C8BA0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jan 13, 2017, at 16:09, Conrad Meyer wrote: >=20 > Um, this is garbage and ruins the entire point of using a standardized > framework like ATF. Please revert it. >=20 > Instead, just have the Kyua framework preopen its output files before > running tests. The diff will be an order of magnitude smaller than > this one is and it will fix the problem generally instead of adding > fork/wait cruft and undetailed assert()s to every test. If you know how to fix it to work with kyua and make it work more = optimally, please be my guest. Thanks, -Ngie --Apple-Mail=_065C1C5B-5885-40D2-ABF2-54EDF51C8BA0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYeXMNAAoJEPWDqSZpMIYVn2MP/RCgoxo1dGYnT3OiIumIKIh2 RcfliuE5ekCEUF5TSYMdvoT8iCJWxInyq4GFB8a6/XieTc0empo4eu+t1JntDXis 7r6zAZQNglTZs2JeOgYS3IxRulNK+m55B3QEiNE/nfZ1WJVh3t6kZbnmJhtSMZkT tICfa0hYcMXWxqNUJIOdn80Wzw1DERfeM410XnDcLrplDQA7JzQ25j1jOPOwIlvG WHvLz2h6RGKfoR1fZusKdNkauSdTTqz/i70ocsUeTp+YEZBTzajdwqSv6JFXQMro bYI1Exj6FJAicMh+DzNtM7TEpqffKz5SNVCFsxw6JDlCHWMXHjDQdc5Qo5nar9hi 4oInLDYIc6wqTt841jeZI3cgZwBAEKOwgaBTeV+OoD1T6dd5QpMh2GDXch1pa5Id HDSYicZZ7OqNW97UQRy1rB9TcAfLGqn6cpRWPhp7a9w4v+3TjfTk+g238M9qzoHC arnqnwpjZ5wArh/Hn94ZgZwxDDWmamrz6CkooN6EHC4GfzIg6fC9+a1OVIzfp+G8 Cg9PnyYM/bLxXWXlBFq9ajwnVAmdPVSowAqXkEbIxf+L8uCFeaF7YNJHkXLEYvsA Z0ZHPrDNPM7O7cflGkHJ9Cug4zbus0rDV/LIFPhMlwP52m2jfqKEVcuOAsrj8cFf WozmnzOfcMd7qjZvNBEA =JOE9 -----END PGP SIGNATURE----- --Apple-Mail=_065C1C5B-5885-40D2-ABF2-54EDF51C8BA0-- From owner-svn-src-all@freebsd.org Sat Jan 14 00:39:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FFF3CAD9F7; Sat, 14 Jan 2017 00:39: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 2FF8810B0; Sat, 14 Jan 2017 00:39: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 v0E0dt1N056856; Sat, 14 Jan 2017 00:39:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0dt3I056855; Sat, 14 Jan 2017 00:39:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140039.v0E0dt3I056855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312100 - stable/10/tools/tools/gensnmpdef X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:39:56 -0000 Author: ngie Date: Sat Jan 14 00:39:55 2017 New Revision: 312100 URL: https://svnweb.freebsd.org/changeset/base/312100 Log: MFC r311748: Bump WARNS up from 0 to 6 Modified: stable/10/tools/tools/gensnmpdef/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/gensnmpdef/Makefile ============================================================================== --- stable/10/tools/tools/gensnmpdef/Makefile Sat Jan 14 00:36:50 2017 (r312099) +++ stable/10/tools/tools/gensnmpdef/Makefile Sat Jan 14 00:39:55 2017 (r312100) @@ -19,4 +19,6 @@ LDFLAGS+= -L${LOCALBASE}/lib LDADD+= -lsmi +WARNS?= 6 + .include From owner-svn-src-all@freebsd.org Sat Jan 14 00:39:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9AD5CADA3B; Sat, 14 Jan 2017 00:39:59 +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 B142210BC; Sat, 14 Jan 2017 00:39:59 +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 v0E0dwj7056905; Sat, 14 Jan 2017 00:39:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0dwUU056904; Sat, 14 Jan 2017 00:39:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140039.v0E0dwUU056904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312101 - stable/11/tools/tools/gensnmpdef X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:40:00 -0000 Author: ngie Date: Sat Jan 14 00:39:58 2017 New Revision: 312101 URL: https://svnweb.freebsd.org/changeset/base/312101 Log: MFC r311748: Bump WARNS up from 0 to 6 Modified: stable/11/tools/tools/gensnmpdef/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/tools/gensnmpdef/Makefile ============================================================================== --- stable/11/tools/tools/gensnmpdef/Makefile Sat Jan 14 00:39:55 2017 (r312100) +++ stable/11/tools/tools/gensnmpdef/Makefile Sat Jan 14 00:39:58 2017 (r312101) @@ -19,4 +19,6 @@ LDFLAGS+= -L${LOCALBASE}/lib LDADD+= -lsmi +WARNS?= 6 + .include From owner-svn-src-all@freebsd.org Sat Jan 14 01:01:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9874CADF1E; Sat, 14 Jan 2017 01:01:03 +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 899481A81; Sat, 14 Jan 2017 01:01:03 +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 v0E11205067892; Sat, 14 Jan 2017 01:01:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E112Hs067891; Sat, 14 Jan 2017 01:01:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140101.v0E112Hs067891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 01:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312102 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 01:01:03 -0000 Author: ngie Date: Sat Jan 14 01:01:02 2017 New Revision: 312102 URL: https://svnweb.freebsd.org/changeset/base/312102 Log: Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD MFC after: 12 days X-MFC with: r305358 Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Sat Jan 14 00:39:58 2017 (r312101) +++ head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Sat Jan 14 01:01:02 2017 (r312102) @@ -27,6 +27,7 @@ */ #ifdef __FreeBSD__ +/* kqueue(2) on FreeBSD requires sys/types.h for uintptr_t; NetBSD doesn't. */ #include #endif #include From owner-svn-src-all@freebsd.org Sat Jan 14 01:03:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 875BCCAE15D; Sat, 14 Jan 2017 01:03:21 +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 48BA31E32; Sat, 14 Jan 2017 01:03:21 +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 v0E13Kd0068875; Sat, 14 Jan 2017 01:03:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E13K8b068874; Sat, 14 Jan 2017 01:03:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701140103.v0E13K8b068874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 14 Jan 2017 01:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312103 - head/tests/sys/vfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 01:03:21 -0000 Author: cem Date: Sat Jan 14 01:03:20 2017 New Revision: 312103 URL: https://svnweb.freebsd.org/changeset/base/312103 Log: Revert r310994 Don't implement some terrible hack on a test by test basis. The framework fix is straightforward and can be chased up in the original bug. Reviewed by: ngie ("be my guest") Modified: head/tests/sys/vfs/lookup_cap_dotdot.c Modified: head/tests/sys/vfs/lookup_cap_dotdot.c ============================================================================== --- head/tests/sys/vfs/lookup_cap_dotdot.c Sat Jan 14 01:01:02 2017 (r312102) +++ head/tests/sys/vfs/lookup_cap_dotdot.c Sat Jan 14 01:03:20 2017 (r312103) @@ -31,27 +31,23 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include #include "freebsd_test_suite/macros.h" -static char *abspath; -static int dirfd = -1; - -typedef void (*child_test_fn_t)(void); +static int dirfd = -1; +static char *abspath; static void -touchat(int _dirfd, const char *name) +touchat(int dirfd, const char *name) { int fd; - ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, + ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, 0777)) >= 0); ATF_REQUIRE(close(fd) == 0); } @@ -82,43 +78,10 @@ prepare_dotdot_tests(void) static void check_capsicum(void) { - ATF_REQUIRE_FEATURE("security_capabilities"); ATF_REQUIRE_FEATURE("security_capability_mode"); } -static void -run_capsicum_test(child_test_fn_t test_func) -{ - int child_exit_code, child_status; - pid_t child_pid; - - check_capsicum(); - prepare_dotdot_tests(); - - ATF_REQUIRE_MSG((child_pid = fork()) != -1, - "fork failed: %s", strerror(errno)); - - if (child_pid == 0) { - test_func(); - _exit(0); - } - - ATF_REQUIRE_MSG(waitpid(child_pid, &child_status, 0) != -1, - "waitpid failed: %s", strerror(errno)); - if (WIFEXITED(child_status)) { - child_exit_code = WEXITSTATUS(child_status); - ATF_REQUIRE_MSG(child_exit_code == 0, - "child exited with non-zero exit code: %d", - child_exit_code); - } else if (WIFSIGNALED(child_status)) - atf_tc_fail("child exited with signal: %d", - WTERMSIG(child_status)); - else - atf_tc_fail("child exited with unexpected status: %d", - child_status); -} - /* * Positive tests */ @@ -130,7 +93,6 @@ ATF_TC_HEAD(openat__basic_positive, tc) ATF_TC_BODY(openat__basic_positive, tc) { - prepare_dotdot_tests(); ATF_REQUIRE(openat(dirfd, "d1/d2/d3/f3", O_RDONLY) >= 0); @@ -152,22 +114,21 @@ ATF_TC_HEAD(lookup_cap_dotdot__basic, tc "Validate cap-mode (testdir)/d1/.. lookup"); } -static void -lookup_cap_dotdot__basic_child(void) +ATF_TC_BODY(lookup_cap_dotdot__basic, tc) { cap_rights_t rights; + int fd; - cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); + check_capsicum(); + prepare_dotdot_tests(); - assert(cap_rights_limit(dirfd, &rights) >= 0); - assert(cap_enter() >= 0); - assert(openat(dirfd, "d1/..", O_RDONLY) >= 0); -} + cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); + ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); -ATF_TC_BODY(lookup_cap_dotdot__basic, tc) -{ + ATF_REQUIRE(cap_enter() >= 0); - run_capsicum_test(lookup_cap_dotdot__basic_child); + ATF_REQUIRE_MSG(openat(dirfd, "d1/..", O_RDONLY) >= 0, "%s", + strerror(errno)); } ATF_TC(lookup_cap_dotdot__advanced); @@ -177,26 +138,23 @@ ATF_TC_HEAD(lookup_cap_dotdot__advanced, "Validate cap-mode (testdir)/d1/.. lookup"); } -static void -lookup_cap_dotdot__advanced_child(void) +ATF_TC_BODY(lookup_cap_dotdot__advanced, tc) { cap_rights_t rights; + int fd; - cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); - assert(cap_rights_limit(dirfd, &rights) >= 0); - - assert(cap_enter() >= 0); + check_capsicum(); + prepare_dotdot_tests(); - assert(openat(dirfd, "d1/d2/d3/../../f1", O_RDONLY) >= 0); - assert(openat(dirfd, "l3/../../f1", O_RDONLY) >= 0); - assert(openat(dirfd, "l3/ld1", O_RDONLY) >= 0); - assert(openat(dirfd, "l3/lf1", O_RDONLY) >= 0); -} + cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); + ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); -ATF_TC_BODY(lookup_cap_dotdot__advanced, tc) -{ + ATF_REQUIRE(cap_enter() >= 0); - run_capsicum_test(lookup_cap_dotdot__advanced_child); + ATF_REQUIRE(openat(dirfd, "d1/d2/d3/../../f1", O_RDONLY) >= 0); + ATF_REQUIRE(openat(dirfd, "l3/../../f1", O_RDONLY) >= 0); + ATF_REQUIRE(openat(dirfd, "l3/ld1", O_RDONLY) >= 0); + ATF_REQUIRE(openat(dirfd, "l3/lf1", O_RDONLY) >= 0); } /* @@ -210,7 +168,6 @@ ATF_TC_HEAD(openat__basic_negative, tc) ATF_TC_BODY(openat__basic_negative, tc) { - prepare_dotdot_tests(); ATF_REQUIRE_ERRNO(ENOENT, @@ -225,43 +182,32 @@ ATF_TC_HEAD(capmode__negative, tc) atf_tc_set_md_var(tc, "descr", "Negative Capability mode testcases"); } -static void -capmode__negative_child(void) +ATF_TC_BODY(capmode__negative, tc) { int subdirfd; - assert(cap_enter() == 0); + check_capsicum(); + prepare_dotdot_tests(); + + ATF_REQUIRE(cap_enter() == 0); /* open() not permitted in capability mode */ - assert(open("testdir", O_RDONLY) < 0); - assert(errno == ECAPMODE); + ATF_REQUIRE_ERRNO(ECAPMODE, open("testdir", O_RDONLY) < 0); /* AT_FDCWD not permitted in capability mode */ - assert(openat(AT_FDCWD, "d1/f1", O_RDONLY) < 0); - assert(errno == ECAPMODE); + ATF_REQUIRE_ERRNO(ECAPMODE, openat(AT_FDCWD, "d1/f1", O_RDONLY) < 0); /* Relative path above dirfd not capable */ - assert(openat(dirfd, "..", O_RDONLY) < 0); - assert(errno == ENOTCAPABLE); - - assert((subdirfd = openat(dirfd, "l3", O_RDONLY)) >= 0); - assert(openat(subdirfd, "../../f1", O_RDONLY) < 0); - assert(errno == ENOTCAPABLE); - (void)close(subdirfd); + ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0); + ATF_REQUIRE((subdirfd = openat(dirfd, "l3", O_RDONLY)) >= 0); + ATF_REQUIRE_ERRNO(ENOTCAPABLE, + openat(subdirfd, "../../f1", O_RDONLY) < 0); /* Absolute paths not capable */ - assert(openat(dirfd, abspath, O_RDONLY) < 0); - assert(errno == ENOTCAPABLE); + ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, abspath, O_RDONLY) < 0); /* Symlink above dirfd */ - assert(openat(dirfd, "lup/f1", O_RDONLY) < 0); - assert(errno == ENOTCAPABLE); -} - -ATF_TC_BODY(capmode__negative, tc) -{ - - run_capsicum_test(capmode__negative_child); + ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "lup/f1", O_RDONLY) < 0); } ATF_TC(lookup_cap_dotdot__negative); @@ -271,30 +217,22 @@ ATF_TC_HEAD(lookup_cap_dotdot__negative, "Validate cap-mode (testdir)/.. lookup fails"); } -static void -lookup_cap_dotdot__negative_child(void) +ATF_TC_BODY(lookup_cap_dotdot__negative, tc) { cap_rights_t rights; + int fd; - cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); - assert(cap_rights_limit(dirfd, &rights) >= 0); - - assert(cap_enter() >= 0); - - assert(openat(dirfd, "..", O_RDONLY) < 0); - assert(errno == ENOTCAPABLE); - - assert(openat(dirfd, "d1/../..", O_RDONLY) < 0); - assert(errno == ENOTCAPABLE); + check_capsicum(); + prepare_dotdot_tests(); - assert(openat(dirfd, "../testdir/d1/f1", O_RDONLY) < 0); - assert(errno == ENOTCAPABLE); -} + cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); + ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); -ATF_TC_BODY(lookup_cap_dotdot__negative, tc) -{ + ATF_REQUIRE(cap_enter() >= 0); - run_capsicum_test(lookup_cap_dotdot__negative_child); + ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0); + ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "d1/../..", O_RDONLY) < 0); + ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "../testdir/d1/f1", O_RDONLY) < 0); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Sat Jan 14 01:06:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 751E6CAE1EF; Sat, 14 Jan 2017 01:06:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (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 37F671046; Sat, 14 Jan 2017 01:06:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x243.google.com with SMTP id c80so7261285iod.1; Fri, 13 Jan 2017 17:06:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=o+uKsnFtG4/OiG9NJ90ey4glRCodwuAR9EneF9yXBHI=; b=vKbWOElmmP/d4+6JsFqW1zqH0f4+GeGesl1b9Actr4wBts3pQfqDknASMgljZpYAbe MeNhpX9VoyRxfV/Mo/rKEriKCwsUNWAyhnP9hFmO21wwvyISeD8CxU2fZpEZDrNcE3+b Ut9shh70ZDeqknz2Nr9uIG1UZ43qooJQIDWLCM+wSQnhxkguk4/kltULAja2ecEIygGc 4MMdEycA43S6tJn5emTy+bfpaG5u8CMLH5vfEwLxU1m6A2rpOx0YH8VTPsqS9JJoaUWX O+4vnwZjYKQ+xG7KRzEazntRhBOG/GghRhmA5Zs6ypjI/WHZgmNslzt2fwXUn0xs8Uda tetA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=o+uKsnFtG4/OiG9NJ90ey4glRCodwuAR9EneF9yXBHI=; b=CUT8zQNcwjIp6bY5b2nJW1fj18Z5vnCdq3eCX7jVUqlpi/L3tO1U2iJzCyYml6AErq braAcxC4rtxd1lTdJAqubrnecNHb0I91d4Yq3QNPf7kBIQCihtvqAwEUVh2N19r8aBH2 XBIGXnlzaLrBufc5ennOe0wutt0lkJTVdVLARN/615iK/lX+t7AcVzUU7qmfN5d/fMF2 VPYO3YxEk7aXktTTIQ7cuZq6/Rh6FCCUNHAhPJUwrmQFxodN1dc8ONK2Vsx4ksDT0FjE OND6b1iD3Ojth2OIBHA5CzYW02ifndJ4yfwH3Jh4RoEZvgUPvi15vX1z3diVjV7zArba R2hQ== X-Gm-Message-State: AIkVDXIOh5UNSQLXnlftmb8tuQMOMvTEMzmOgZUEET6BcJC9FmUZN++cFLoSAcxsQnjmHw== X-Received: by 10.107.180.8 with SMTP id d8mr21653739iof.101.1484356013375; Fri, 13 Jan 2017 17:06:53 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id o191sm7528254iod.11.2017.01.13.17.06.52 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 17:06:52 -0800 (PST) Subject: Re: svn commit: r312103 - head/tests/sys/vfs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_1003B9C2-2D3A-4750-8B02-E47163CDD77D"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701140103.v0E13K8b068874@repo.freebsd.org> Date: Fri, 13 Jan 2017 17:06:51 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Julio Merino Message-Id: <07802033-D072-404C-8920-3E598C1C567F@gmail.com> References: <201701140103.v0E13K8b068874@repo.freebsd.org> To: "Conrad E. Meyer" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 01:06:54 -0000 --Apple-Mail=_1003B9C2-2D3A-4750-8B02-E47163CDD77D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 13, 2017, at 17:03, Conrad E. Meyer wrote: >=20 > Author: cem > Date: Sat Jan 14 01:03:20 2017 > New Revision: 312103 > URL: https://svnweb.freebsd.org/changeset/base/312103 >=20 > Log: > Revert r310994 >=20 > Don't implement some terrible hack on a test by test basis. The > framework fix is straightforward and can be chased up in the original > bug. >=20 > Reviewed by: ngie ("be my guest") You should have filed an issue with atf/kyua, had the fix done, then = done the necessary parts in releasing a new port/package. Please disable = the test because it doesn=E2=80=99t work at all right now on CURRENT and = it will ping the sh=E2=80=99t out of the jenkins email until fixed. -Ngie --Apple-Mail=_1003B9C2-2D3A-4750-8B02-E47163CDD77D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYeXmrAAoJEPWDqSZpMIYV/OEP/1M5f3HRF+KVSviwAj7DSpdb hBZq0JHZbINJ4QlkbG7aE+DuSGjLihiOipmp4cD5ujT0xP/K89Bp5XeXP7iEbeAv J5hMToxN6QjtY9hPMeIalWSH15oNV2Hi81tHjYMqZ2FH6Ed1EjQFPhOemkXH+XJp sZ3VqwujYgX9GNdInQ2JnAbYiUa+WOh58sBl1/GsoG70AwTc9D138W/W9w9uKC3F 4EZO8v1VvYES5v34UKeAb2avsJiI3k9XhqNSNjA/PvDxoLmZMPryfCWmI8Kx3Gg5 hJ4Zp+BQqLFtPNvZJttjHSfPSHOEWmkih+9tzlHwvY+hYVu/Bknb5QYYaL8sbV1/ hWA49OWT+63bQKGJLN5HGPSxHw2WHg2LJq+bTyQV7DmqA16XjSLqO6QyE9PmKgbk i8TtgoulI3WMeQYRJnX4cGM4mRL44wv0GQAzBM/pu+HKnmUcMykUgHv++NQPpwxm txnvaOg2P8xwiaU8vIE4Sf9SoKPnxr5mbfRvMqvCblpvZVpKBMwJlls9DYhbKuyN TGcurhT8+vJSElhfRrljjtvZ3lwikNnNwKWmt+u4UWiziyteRjhCuGZmX4HFc1SQ rQ1Xcy/qHyWFkWChD83mGTH9CwL9M7aPvJWyQnnI4ogQQXr/UVtgBVEwIRLGSmeo Pe/t7Pw7sSjXhOI1HL+P =AVus -----END PGP SIGNATURE----- --Apple-Mail=_1003B9C2-2D3A-4750-8B02-E47163CDD77D-- From owner-svn-src-all@freebsd.org Sat Jan 14 01:07:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08401CAE276; Sat, 14 Jan 2017 01:07:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (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 C05F011DD; Sat, 14 Jan 2017 01:07:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-it0-x244.google.com with SMTP id v14so6790952itb.0; Fri, 13 Jan 2017 17:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Dn0ClkKHdgpBVyLE91BDh1Pi0lPFleJOnzMZ3Y5/3Go=; b=CyAgQQh6Bsfrv/eLYPkayj0StVYe0+Rgm/tMdt1ogYb0wbjKYNNo7ryVxS4lVeKmLL k9bUxaEoZqIhgv35UJYQOeHMzzM86R5pic+vXQtG+Z6WhWxHM0MeVxbnOSWP+gSuffDl v5ifnSwEQnseX0FRpw2vdYDgLDn1c0r/yGgjYaf6j/l/XrtdpIk81XR9RgZVuQa2tuFV IP8Y94pdWixhHH/kcP6AYjt6szyHSPND1bmgZRRkftRJjZo/vBV9PnXy0vrjrXPEAHsL jNPWXrMyaEE7H/PqvpEbgMyHqilZ5ViyKNBwzTNUcBgg2QrpnfJGUsZsQZWTRz0wkO0A ZFsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Dn0ClkKHdgpBVyLE91BDh1Pi0lPFleJOnzMZ3Y5/3Go=; b=LKosaXXuSQdAxR94/XFHJ6aJjoBuorLEbi6w8ltCH6bBcpaNktO4RT+hDZP8yRwvhe j8eWGoe4GFnjff2edytA+SYUNtVj47To01c35f9gXxdUi+0J5WcHDaW0Z9gyW1GSNP9x qYe9oQmaQWUeFVFkOm86zQH2ZE31yzg1rqPUtBLZy/bvRUZzxInyk2fnLLafr+JqMvkC Fn3+OhkaFPUlF1Y0CrI3FqMjGs7wOuPYEX/QQuK2hIQjakJPAJv5NC0Q6/U6UYkx6w82 4ubQltF8nwEMsxUvhWJD2PDafJnGKTro+occ08hbvtTsqq4xkDP0/7UDnIVpu29m++f5 XoqA== X-Gm-Message-State: AIkVDXKss3jMZkYBYgrlwz6kFlvZnAUlRTKeUW84yO7sS4kLwGPlGjQ/J2o3wqAtDDwkow== X-Received: by 10.36.219.196 with SMTP id c187mr5638944itg.23.1484356065156; Fri, 13 Jan 2017 17:07:45 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id o191sm7528254iod.11.2017.01.13.17.07.44 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 17:07:44 -0800 (PST) Subject: Re: svn commit: r312103 - head/tests/sys/vfs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_9FB67D4B-B074-433D-A279-02DD43310508"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <07802033-D072-404C-8920-3E598C1C567F@gmail.com> Date: Fri, 13 Jan 2017 17:07:43 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Julio Merino Message-Id: <73E9CEF8-F9B4-4108-9421-CD8A456BB32D@gmail.com> References: <201701140103.v0E13K8b068874@repo.freebsd.org> <07802033-D072-404C-8920-3E598C1C567F@gmail.com> To: "Conrad E. Meyer" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 01:07:46 -0000 --Apple-Mail=_9FB67D4B-B074-433D-A279-02DD43310508 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 13, 2017, at 17:06, Ngie Cooper (yaneurabeya) = wrote: >=20 >>=20 >> On Jan 13, 2017, at 17:03, Conrad E. Meyer wrote: >>=20 >> Author: cem >> Date: Sat Jan 14 01:03:20 2017 >> New Revision: 312103 >> URL: https://svnweb.freebsd.org/changeset/base/312103 >>=20 >> Log: >> Revert r310994 >>=20 >> Don't implement some terrible hack on a test by test basis. The >> framework fix is straightforward and can be chased up in the original >> bug. >>=20 >> Reviewed by: ngie ("be my guest") >=20 > You should have filed an issue with atf/kyua, had the fix done, then = done the necessary parts in releasing a new port/package. Please disable = the test because it doesn=E2=80=99t work at all right now on CURRENT and = it will ping the sh=E2=80=99t out of the jenkins email until fixed. > -Ngie PS Saying =E2=80=9Cbe my guest=E2=80=9D isn=E2=80=99t review in any = shape or form, nor is it my consent towards your change being = implemented now. --Apple-Mail=_9FB67D4B-B074-433D-A279-02DD43310508 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYeXnfAAoJEPWDqSZpMIYVWc8P/i185FJjveEFoFytxIDKMQ66 pzAsTqF/F6mYEc7sixFm8TVtrf7I0e2fw+Uy2DMThiZ/rrplD3k9twj68RzVTIFn I2ENq8ZaxLi7vEIBAKz7YnojcK1R8Ag9D8Z7BpBtlVTqVdKHyPqD4/bbDlJ8Du8Q tp6x1/awYzak5sbkS0JlcTiTqTDiX02vckI0tBHFyPv0Sj+6O5hrLCzwA/xgp0yv Peql/vW0xuFwGcYj2XEdUReFkloH8ypmQrw2bD2Yp+o6sVTV1jkXjFkjCEY6hDJj 443fGQquxGHWMEZF4PpPLZh8o5dUVbqFi0pPTL7+xJwJmCyT9MmQFIRemwZm/stO Lxj459OuAoe3YlPemuggLfiBQEW9V+V73Xbx3g3jITPM29GMlxCcf/vSljMwmoPt tFrxBKCj3Cmvi3BB6dOGXQK73Uo7DxwQwr2SbbSDZlQrRt5X/0XLUc4ACQXxzkuX o0KHApRWlyenzwyaKUO8SFruIIEElZgcp0z5ID7yHhYky7tvMVltVX+bGtQY1ofC C6WgYDlRxi7Z5DQqzLWI7aZM52rn5972/3/9TvaSpsUgD3aB/2wiEmKABzO0U+5E 3k1zHsxv7+C3XFoAG66nOUkFzaBhiAitHNL7EuBQ2NQBkzEja0Aw1q2TAhjWu3t+ n4W4lxvGvs4NKcn0VLAe =J65u -----END PGP SIGNATURE----- --Apple-Mail=_9FB67D4B-B074-433D-A279-02DD43310508-- From owner-svn-src-all@freebsd.org Sat Jan 14 01:08:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C01BCAE2F3; Sat, 14 Jan 2017 01:08:06 +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 DF80B1363; Sat, 14 Jan 2017 01:08:05 +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 v0E185Xk069082; Sat, 14 Jan 2017 01:08:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E185DE069081; Sat, 14 Jan 2017 01:08:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701140108.v0E185DE069081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 14 Jan 2017 01:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312104 - head/usr.sbin/fstyp/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 01:08:06 -0000 Author: cem Date: Sat Jan 14 01:08:04 2017 New Revision: 312104 URL: https://svnweb.freebsd.org/changeset/base/312104 Log: Fix broken fstyp exfat testcase Introduced in r312010. It helps to read the documentation before trying to test something. Modified: head/usr.sbin/fstyp/tests/fstyp_test.sh Modified: head/usr.sbin/fstyp/tests/fstyp_test.sh ============================================================================== --- head/usr.sbin/fstyp/tests/fstyp_test.sh Sat Jan 14 01:03:20 2017 (r312103) +++ head/usr.sbin/fstyp/tests/fstyp_test.sh Sat Jan 14 01:08:04 2017 (r312104) @@ -64,7 +64,7 @@ exfat_head() { } exfat_body() { bzcat $(atf_get_srcdir)/dfr-01-xfat.img.bz2 > exfat.img - atf_check -s exit:0 -o inline:"exfat\n" fstyp exfat.img + atf_check -s exit:0 -o inline:"exfat\n" fstyp -u exfat.img } atf_test_case empty From owner-svn-src-all@freebsd.org Sat Jan 14 01:10:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2681CAE5E5; Sat, 14 Jan 2017 01:10:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (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 B71BC1682; Sat, 14 Jan 2017 01:10:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-it0-x244.google.com with SMTP id 203so6774727ith.2; Fri, 13 Jan 2017 17:10:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=ywdxr4JO0REHLAa1q/46NQCMU23LcJI2IkZba/DAI+Y=; b=TUdHdMBaA807XFiIbVc88MWCNGzBYta8iBIhxjzc6hPvcLQ5BhRqjSZtNsj5/K5h4w ofLjbLKtX9OvxtqY9YF8eEVr6aBnU8mZ1ARwgWfznzaqtPheMtbsmrkfxsRkL+KcBYdE hCs+m+eQ922WO+oSFrnUcyJIYMq3LEwPO2P3qZHE3uJ2d/p3+BQ7SG0y2yBZAfvALpvQ vznflW6RZ7Yo+cy5K2vPGANdbY7ZunewbVels33VjVsPBXeH4P6SCY4+7Jv6Wf+EHB6t o9wC/lrEjMK7HJrWyoZzgPzhT4FVhYlJp299cWqL5Qac8WrauPvUJbix51NPVHc969XJ WAaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=ywdxr4JO0REHLAa1q/46NQCMU23LcJI2IkZba/DAI+Y=; b=sAizMwN781pGl6NvYgn+PvkqiQfFamG39RJ1kDQpqItKedEDjcsFBVqz6Yo0yH0G6r oC45dlBkpkXFv9WLuLvovtIj6SZZLxwwF/0ZpOoGnYqs6Cxb4/5CwAajkKpWdWaLsq8w P4+khJJBMCrrX/vGaVZIGlH9pcT65yzojgqNtF2UljGYc8egAyXueS4loqfApel6hOuH EHd2ZoTNaOGT2rZbbbqTAmVEMz9bWBT2MGvVARvkZI6Y0rcRwC0zu595e5uKgPJxgNry EiGhN/bIqO76M5ky1t5qB1MfV212ugjSGKjcWB6xuEDcN2yjlBggv59lP/AJaUeVrsEu zIXw== X-Gm-Message-State: AIkVDXIY0biPLLFZrT4tz5J8qBhwhTkfMPrH3U1EgbUbPPQds3MF7hMbD9l9oUNfAvma5w== X-Received: by 10.36.51.143 with SMTP id k137mr5546277itk.11.1484356222053; Fri, 13 Jan 2017 17:10:22 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id y125sm1820860ity.13.2017.01.13.17.10.21 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 17:10:21 -0800 (PST) Subject: Re: svn commit: r312104 - head/usr.sbin/fstyp/tests Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_4D4E6DEE-2FCA-4367-A78F-01F468CC120A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701140108.v0E185DE069081@repo.freebsd.org> Date: Fri, 13 Jan 2017 17:10:20 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <022BCAAB-CB93-49A6-BDE1-C7449EE180E9@gmail.com> References: <201701140108.v0E185DE069081@repo.freebsd.org> To: "Conrad E. Meyer" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 01:10:23 -0000 --Apple-Mail=_4D4E6DEE-2FCA-4367-A78F-01F468CC120A Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jan 13, 2017, at 17:08, Conrad E. Meyer wrote: > > Author: cem > Date: Sat Jan 14 01:08:04 2017 > New Revision: 312104 > URL: https://svnweb.freebsd.org/changeset/base/312104 > > Log: > Fix broken fstyp exfat testcase > > Introduced in r312010. > > It helps to read the documentation before trying to test something. It helps when the documentation is correct as well. Not fixed until r312078. -Ngie --Apple-Mail=_4D4E6DEE-2FCA-4367-A78F-01F468CC120A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYeXp8AAoJEPWDqSZpMIYVLXAP/AmM5XNlVfS8E/ak53qRbhm3 6uM0PlOgC5lVp4D8lEoQDYk6QT0z+HGgwkawy46biey0HyuYPm2BfsX2+5QYgt1K 8pOzIePRa/LD6chWTZMrBPml3N0GB13WWzoqLFUGs6H0Qw2tTDeya60WZkDjMddf m8FLfP6OeZFYYC0ae5TnuSIzq8EkHANgY+gDkPhw5JzYg4WAMgAAkHIqYT7l+316 K6EIcdsjwGg/jappVU0XWMeaoC4GlULZXfVSK8uBcgU8lgo3J1izZW4VyopXljbp 4/DIxR74og0r0pxVmGvC4VhOuqlRGj6C4ueqi6TRoB0Huqj67wTVc2G/dQCYjSDw YQ4vRjDvjnU3PpMMfF6bxH50taJxErdxqEdHEKYQFOGaDK2R6clNJFF4TvP3ll/j XPBOUZH1hEwamySNnb3WmWvBpD4VWpMAlvNfL982MnkpETAq5gz5SBowtUnZjq41 a55YzJS1IzR+ZtNLGDJwyOYgGu0o4w6IuRSTIWryVVrb2Fv1U3cyBmIRuDE109l/ NS6M4+/Lt/1JoPq01GhqArfSybDUyUe0Xu7WXOCnwfDpbiBrBNsDPDORGBXX1N7S e+VsihW0qUUIzNlhyqSZA49DzRQsYdJQZKmtduGSnKLsE4e59ZywlWXKlyXT035o AkSXcCzA94nQXbKoZ0zc =ehE4 -----END PGP SIGNATURE----- --Apple-Mail=_4D4E6DEE-2FCA-4367-A78F-01F468CC120A-- From owner-svn-src-all@freebsd.org Sat Jan 14 01:37:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF8C0CAF81B; Sat, 14 Jan 2017 01:37:04 +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 A1CB41880; Sat, 14 Jan 2017 01:37:04 +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 v0E1b3w2081267; Sat, 14 Jan 2017 01:37:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E1b3cK081265; Sat, 14 Jan 2017 01:37:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140137.v0E1b3cK081265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 01:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312105 - head/usr.sbin/inetd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 01:37:05 -0000 Author: ngie Date: Sat Jan 14 01:37:03 2017 New Revision: 312105 URL: https://svnweb.freebsd.org/changeset/base/312105 Log: Conditionalize libwrap support into inetd based on MK_TCP_WRAPPERS This will allow inetd to stand by itself without libwrap. MFC after: 2 weeks Relnotes: yes Reviewed by: hrs (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9056 Modified: head/usr.sbin/inetd/Makefile head/usr.sbin/inetd/inetd.c Modified: head/usr.sbin/inetd/Makefile ============================================================================== --- head/usr.sbin/inetd/Makefile Sat Jan 14 01:08:04 2017 (r312104) +++ head/usr.sbin/inetd/Makefile Sat Jan 14 01:37:03 2017 (r312105) @@ -16,7 +16,12 @@ CFLAGS+= -DLOGIN_CAP CFLAGS+= -DINET6 .endif -LIBADD= util wrap +LIBADD= util + +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DLIBWRAP +LIBADD+= wrap +.endif # XXX for src/release/picobsd .if !defined(RELEASE_CRUNCH) Modified: head/usr.sbin/inetd/inetd.c ============================================================================== --- head/usr.sbin/inetd/inetd.c Sat Jan 14 01:08:04 2017 (r312104) +++ head/usr.sbin/inetd/inetd.c Sat Jan 14 01:37:03 2017 (r312105) @@ -336,9 +336,11 @@ main(int argc, char **argv) #ifdef LOGIN_CAP login_cap_t *lc = NULL; #endif +#ifdef LIBWRAP struct request_info req; int denied; char *service = NULL; +#endif struct sockaddr_storage peer; int i; struct addrinfo hints, *res; @@ -748,6 +750,7 @@ main(int argc, char **argv) _exit(0); } } +#ifdef LIBWRAP if (ISWRAP(sep)) { inetd_setproctitle("wrapping", ctrl); service = sep->se_server_name ? @@ -776,6 +779,7 @@ main(int argc, char **argv) (whichaf(&req) == AF_INET6) ? "6" : ""); } } +#endif if (sep->se_bi) { (*sep->se_bi->bi_fn)(ctrl, sep); } else { From owner-svn-src-all@freebsd.org Sat Jan 14 02:19:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0B0FCAF0CA; Sat, 14 Jan 2017 02:19:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8469718DD; Sat, 14 Jan 2017 02:19:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-it0-x242.google.com with SMTP id v14so6920132itb.0; Fri, 13 Jan 2017 18:19:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=6oWCGMklvfw5wOtWb94p8Q8mOq8opE/AART3nYZajqY=; b=N+d1m7NtFxUQ+oxYlHSfr5j05wk5Y9rdzSkfE8lHj73PiW9y3fMoWKabhiRrfgJIl2 4gDQh5DhKMsVtQcx0WYzRNsd7z9sOACHbZKdB20Kcuq/3Nu4U5ZqDWhTihfU7EBmZ27/ 1ZJwyVjiZeYlsDhi9nZkT29XQPBOZOHs+xi9ceCGLsWwywgxKugxiRYSifPPO5zbPn6T ChnrDsU1ZMr8NNuyGh7P7N8q9KeTk3jrCFVl1KrIj4vHhXGDPEos3rPom33wqtt4J4uE E2HtembzfG5/wTTAiDU1BGi3gIOn6+QIn5sKRzx++0hPHSio7yp49G9b2vHf8jJPvfwJ 5c6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=6oWCGMklvfw5wOtWb94p8Q8mOq8opE/AART3nYZajqY=; b=fiftvZbKSFEW8rCXH/Lhq+rQElFQvmtxUIANAGh8ziHbNX8xih2d1pDJRvSk2YakYm K2A+rFxIxMxHWmI+QHNHaYZgpsVB/aZxvo8riqA1Kp12r9c7PI5k8Ab1kEp432BCyEXb HHyEAlWVmh0CKt6lF6+DhxdFCsjJ/nJTNqDHY6CLdzoVh1JvHw9+bpLnsQLYRVXUcFFa teWdYHzqDcVyFW/mmB1PdTfIKJoex0F6+QJgON6r4irj3JGlaKe1mB/Q6MTAHXmDd3Su gIGDHHun93pz7k8QZysU75Xfuofthaaw6be7hbFjNnpJ7JCJ/ZZ1k1pM1n036V4pbH93 LpRQ== X-Gm-Message-State: AIkVDXJcblaCaECtBZKx5xDMvsL/8d3pnqdDmAmFGWyZoPtWoPGO6dCa7gj9004PljGdpw== X-Received: by 10.36.120.5 with SMTP id p5mr5695221itc.5.1484360379827; Fri, 13 Jan 2017 18:19:39 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 7sm7662939iox.39.2017.01.13.18.19.38 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 18:19:39 -0800 (PST) Subject: Re: svn commit: r312103 - head/tests/sys/vfs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_EAEE4433-B736-49EB-A2F5-7D8E03FA31CF"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <73E9CEF8-F9B4-4108-9421-CD8A456BB32D@gmail.com> Date: Fri, 13 Jan 2017 18:19:37 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Julio Merino Message-Id: References: <201701140103.v0E13K8b068874@repo.freebsd.org> <07802033-D072-404C-8920-3E598C1C567F@gmail.com> <73E9CEF8-F9B4-4108-9421-CD8A456BB32D@gmail.com> To: "Conrad E. Meyer" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 02:19:40 -0000 --Apple-Mail=_EAEE4433-B736-49EB-A2F5-7D8E03FA31CF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 13, 2017, at 17:07, Ngie Cooper (yaneurabeya) = wrote: >=20 >=20 >> On Jan 13, 2017, at 17:06, Ngie Cooper (yaneurabeya) = wrote: >>=20 >>>=20 >>> On Jan 13, 2017, at 17:03, Conrad E. Meyer wrote: >>>=20 >>> Author: cem >>> Date: Sat Jan 14 01:03:20 2017 >>> New Revision: 312103 >>> URL: https://svnweb.freebsd.org/changeset/base/312103 >>>=20 >>> Log: >>> Revert r310994 >>>=20 >>> Don't implement some terrible hack on a test by test basis. The >>> framework fix is straightforward and can be chased up in the = original >>> bug. >>>=20 >>> Reviewed by: ngie ("be my guest") >>=20 >> You should have filed an issue with atf/kyua, had the fix done, then = done the necessary parts in releasing a new port/package. Please disable = the test because it doesn=E2=80=99t work at all right now on CURRENT and = it will ping the sh=E2=80=99t out of the jenkins email until fixed. >> -Ngie >=20 > PS Saying =E2=80=9Cbe my guest=E2=80=9D isn=E2=80=99t review in any = shape or form, nor is it my consent towards your change being = implemented now. Oh yeah=E2=80=A6 this commit broke the build too because I turned on = WARNS: https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/4653/ Cheers, -Ngie --Apple-Mail=_EAEE4433-B736-49EB-A2F5-7D8E03FA31CF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYeYq6AAoJEPWDqSZpMIYV4UYQAI2ugY5zQzbQZydGNxZ2Sgfw vnmtZ8hougZEbRYrbQrLOYrY+sB0l0sCZ925l0dpVSosKBO2YQdwrutkFvUTpFk0 XjAbfc+s9M42oB6s3jB6krK9lUw70P4e9C9GAG0W14+q3RbeLXfUnay5ez5mz61W bn/ETmFhbZOEyXJ/m8VldyN2eYeig9JwMaPzV8C6TMl6Ez+2tH1OeUOYDFRhR186 M7UdLz8gVLUYENYypLOAbK+rhyO4x+jN8VDWQhpE3brSv5yflu76c9v/s+Xhz4nG UsRoiV8Z1TNrHpIRi9AhP/26wZtIWR4fInePv+Q9CgsNXQYErUasmA15F7g317iQ DDsEOsWLgWwaE56CiR59pAIf6ynxPOxIx6nKDCL+w5bwQHaz9UK1sWHubSr8ws9h DgODqmzcjRmkQVtkjQHLaeKaWAgDNYwBYPw9+xUD8qbn9wRmC3jWujX4QQ5RhnqE n+EV8i9hOZRc9ojneXNYyn3lDh5PEKdRv4Q4R/dycrAEBMjfHubH6zRwMHMwRP8s cBqJL81yDJ+9Vzph7romzEXXASMUU0pgSBo30ta8bhK2LGuR8Ghi3OTnmZX2C3RB L3XsxeIRgCtY8PSRoX7a2dFLYcckahHWvki2E7jGzu08tPIZoMSP3H1L7dqAbHiI oijHFccXKWU3BITJ1i1m =KTRg -----END PGP SIGNATURE----- --Apple-Mail=_EAEE4433-B736-49EB-A2F5-7D8E03FA31CF-- From owner-svn-src-all@freebsd.org Sat Jan 14 02:26:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB61BCAF551; Sat, 14 Jan 2017 02:26:53 +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 591782000; Sat, 14 Jan 2017 02:26:53 +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 v0E2QqFR001561; Sat, 14 Jan 2017 02:26:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E2QlJt001507; Sat, 14 Jan 2017 02:26:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140226.v0E2QlJt001507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 02:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312106 - in vendor/NetBSD/tests/dist: dev/cgd dev/scsipi dev/sysmon fs/common fs/ffs fs/hfs fs/kernfs fs/lfs fs/msdosfs fs/nfs fs/nullfs fs/ptyfs fs/puffs fs/tmpfs fs/umapfs fs/union f... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 02:26:53 -0000 Author: ngie Date: Sat Jan 14 02:26:46 2017 New Revision: 312106 URL: https://svnweb.freebsd.org/changeset/base/312106 Log: Commit more accepted upstream changes from /tests/... This includes a number of accepted patches for: - lib/libc/sys - lib/libm christos was also nice enough to do the heavy lifting with the h_macros.h #includes so testcases which use h_macros.h now can work more easily with the FreeBSD tree's layout for contrib/netbsd-tests vs the testcases. Modified: vendor/NetBSD/tests/dist/dev/cgd/t_cgd_3des.c vendor/NetBSD/tests/dist/dev/cgd/t_cgd_aes.c vendor/NetBSD/tests/dist/dev/cgd/t_cgd_blowfish.c vendor/NetBSD/tests/dist/dev/scsipi/t_cd.c vendor/NetBSD/tests/dist/dev/sysmon/t_swwdog.c vendor/NetBSD/tests/dist/fs/common/h_fsmacros.h vendor/NetBSD/tests/dist/fs/ffs/h_quota2_tests.c vendor/NetBSD/tests/dist/fs/ffs/t_fifos.c vendor/NetBSD/tests/dist/fs/ffs/t_mount.c vendor/NetBSD/tests/dist/fs/ffs/t_quota2_1.c vendor/NetBSD/tests/dist/fs/ffs/t_quota2_remount.c vendor/NetBSD/tests/dist/fs/ffs/t_snapshot.c vendor/NetBSD/tests/dist/fs/ffs/t_snapshot_log.c vendor/NetBSD/tests/dist/fs/ffs/t_snapshot_v2.c vendor/NetBSD/tests/dist/fs/hfs/t_pathconvert.c vendor/NetBSD/tests/dist/fs/kernfs/t_basic.c vendor/NetBSD/tests/dist/fs/lfs/t_pr.c vendor/NetBSD/tests/dist/fs/msdosfs/t_snapshot.c vendor/NetBSD/tests/dist/fs/nfs/t_mountd.c vendor/NetBSD/tests/dist/fs/nullfs/t_basic.c vendor/NetBSD/tests/dist/fs/ptyfs/t_nullpts.c vendor/NetBSD/tests/dist/fs/ptyfs/t_ptyfs.c vendor/NetBSD/tests/dist/fs/puffs/t_basic.c vendor/NetBSD/tests/dist/fs/puffs/t_fuzz.c vendor/NetBSD/tests/dist/fs/puffs/t_io.c vendor/NetBSD/tests/dist/fs/tmpfs/t_renamerace.c vendor/NetBSD/tests/dist/fs/umapfs/t_basic.c vendor/NetBSD/tests/dist/fs/union/t_pr.c vendor/NetBSD/tests/dist/fs/vfs/t_full.c vendor/NetBSD/tests/dist/fs/vfs/t_io.c vendor/NetBSD/tests/dist/fs/vfs/t_renamerace.c vendor/NetBSD/tests/dist/fs/vfs/t_ro.c vendor/NetBSD/tests/dist/fs/vfs/t_union.c vendor/NetBSD/tests/dist/fs/vfs/t_unpriv.c vendor/NetBSD/tests/dist/fs/vfs/t_vfsops.c vendor/NetBSD/tests/dist/fs/vfs/t_vnops.c vendor/NetBSD/tests/dist/include/sys/t_socket.c vendor/NetBSD/tests/dist/kernel/kqueue/read/t_fifo.c vendor/NetBSD/tests/dist/kernel/kqueue/read/t_file.c vendor/NetBSD/tests/dist/kernel/kqueue/read/t_file2.c vendor/NetBSD/tests/dist/kernel/kqueue/read/t_pipe.c vendor/NetBSD/tests/dist/kernel/kqueue/read/t_ttypty.c vendor/NetBSD/tests/dist/kernel/kqueue/t_ioctl.c vendor/NetBSD/tests/dist/kernel/kqueue/t_proc1.c vendor/NetBSD/tests/dist/kernel/kqueue/t_proc2.c vendor/NetBSD/tests/dist/kernel/kqueue/t_proc3.c vendor/NetBSD/tests/dist/kernel/kqueue/t_sig.c vendor/NetBSD/tests/dist/kernel/kqueue/write/t_fifo.c vendor/NetBSD/tests/dist/kernel/kqueue/write/t_pipe.c vendor/NetBSD/tests/dist/kernel/kqueue/write/t_ttypty.c vendor/NetBSD/tests/dist/kernel/t_extent.c vendor/NetBSD/tests/dist/kernel/t_filedesc.c vendor/NetBSD/tests/dist/kernel/t_lock.c vendor/NetBSD/tests/dist/kernel/t_ptrace.c vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.c vendor/NetBSD/tests/dist/kernel/t_pty.c vendor/NetBSD/tests/dist/kernel/t_rnd.c vendor/NetBSD/tests/dist/lib/libc/gen/t_glob.c vendor/NetBSD/tests/dist/lib/libc/regex/debug.c vendor/NetBSD/tests/dist/lib/libc/regex/t_exhaust.c vendor/NetBSD/tests/dist/lib/libc/regex/t_regex_att.c vendor/NetBSD/tests/dist/lib/libc/sys/t_clock_gettime.c vendor/NetBSD/tests/dist/lib/libc/sys/t_connect.c vendor/NetBSD/tests/dist/lib/libc/sys/t_dup.c vendor/NetBSD/tests/dist/lib/libc/sys/t_getrusage.c vendor/NetBSD/tests/dist/lib/libc/sys/t_link.c vendor/NetBSD/tests/dist/lib/libc/sys/t_listen.c vendor/NetBSD/tests/dist/lib/libc/sys/t_mmap.c vendor/NetBSD/tests/dist/lib/libc/sys/t_msgctl.c vendor/NetBSD/tests/dist/lib/libc/sys/t_msgrcv.c vendor/NetBSD/tests/dist/lib/libc/sys/t_msgsnd.c vendor/NetBSD/tests/dist/lib/libc/sys/t_nanosleep.c vendor/NetBSD/tests/dist/lib/libc/sys/t_pipe.c vendor/NetBSD/tests/dist/lib/libc/sys/t_pipe2.c vendor/NetBSD/tests/dist/lib/libc/sys/t_posix_fadvise.c vendor/NetBSD/tests/dist/lib/libc/sys/t_revoke.c vendor/NetBSD/tests/dist/lib/libc/sys/t_select.c vendor/NetBSD/tests/dist/lib/libc/sys/t_setrlimit.c vendor/NetBSD/tests/dist/lib/libc/sys/t_sigaction.c vendor/NetBSD/tests/dist/lib/libc/sys/t_sigqueue.c vendor/NetBSD/tests/dist/lib/libc/sys/t_socketpair.c vendor/NetBSD/tests/dist/lib/libc/sys/t_stat.c vendor/NetBSD/tests/dist/lib/libc/sys/t_truncate.c vendor/NetBSD/tests/dist/lib/libc/sys/t_umask.c vendor/NetBSD/tests/dist/lib/libc/sys/t_unlink.c vendor/NetBSD/tests/dist/lib/libc/sys/t_wait.c vendor/NetBSD/tests/dist/lib/libc/sys/t_write.c vendor/NetBSD/tests/dist/lib/libm/t_ilogb.c vendor/NetBSD/tests/dist/lib/libm/t_scalbn.c vendor/NetBSD/tests/dist/lib/libposix/t_rename.c vendor/NetBSD/tests/dist/lib/librumpclient/t_fd.c vendor/NetBSD/tests/dist/lib/semaphore/sem.c vendor/NetBSD/tests/dist/libexec/ld.elf_so/t_dlerror-cleared.c vendor/NetBSD/tests/dist/libexec/ld.elf_so/t_dlerror-false.c vendor/NetBSD/tests/dist/libexec/ld.elf_so/t_dlinfo.c vendor/NetBSD/tests/dist/libexec/ld.elf_so/t_ifunc.c vendor/NetBSD/tests/dist/modules/t_builtin.c vendor/NetBSD/tests/dist/net/bpf/t_bpf.c vendor/NetBSD/tests/dist/net/bpf/t_mbuf.c vendor/NetBSD/tests/dist/net/bpfilter/t_bpfilter.c vendor/NetBSD/tests/dist/net/bpfjit/t_bpfjit.c vendor/NetBSD/tests/dist/net/bpfjit/t_cop.c vendor/NetBSD/tests/dist/net/bpfjit/t_extmem.c vendor/NetBSD/tests/dist/net/bpfjit/t_mbuf.c vendor/NetBSD/tests/dist/net/carp/t_basic.c vendor/NetBSD/tests/dist/net/config/netconfig.c vendor/NetBSD/tests/dist/net/icmp/t_forward.c vendor/NetBSD/tests/dist/net/icmp/t_ping.c vendor/NetBSD/tests/dist/net/if_loop/t_pr.c vendor/NetBSD/tests/dist/net/ndp/t_ra.sh vendor/NetBSD/tests/dist/net/net/t_raw.c vendor/NetBSD/tests/dist/rump/modautoload/t_modautoload.c vendor/NetBSD/tests/dist/rump/rumpkern/t_kern.c vendor/NetBSD/tests/dist/rump/rumpkern/t_lwproc.c vendor/NetBSD/tests/dist/rump/rumpkern/t_modcmd.c vendor/NetBSD/tests/dist/rump/rumpkern/t_modlinkset.c vendor/NetBSD/tests/dist/rump/rumpkern/t_signals.c vendor/NetBSD/tests/dist/rump/rumpkern/t_threads.c vendor/NetBSD/tests/dist/rump/rumpkern/t_tsleep.c vendor/NetBSD/tests/dist/rump/rumpkern/t_vm.c vendor/NetBSD/tests/dist/rump/rumpvfs/t_basic.c vendor/NetBSD/tests/dist/rump/rumpvfs/t_etfs.c vendor/NetBSD/tests/dist/rump/rumpvfs/t_p2kifs.c Modified: vendor/NetBSD/tests/dist/dev/cgd/t_cgd_3des.c ============================================================================== --- vendor/NetBSD/tests/dist/dev/cgd/t_cgd_3des.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/dev/cgd/t_cgd_3des.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_cgd_3des.c,v 1.1 2016/11/11 07:39:58 alnsn Exp $ */ +/* $NetBSD: t_cgd_3des.c,v 1.2 2017/01/13 21:30:39 christos Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. * All rights reserved. @@ -48,7 +48,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #define SECSIZE 512 Modified: vendor/NetBSD/tests/dist/dev/cgd/t_cgd_aes.c ============================================================================== --- vendor/NetBSD/tests/dist/dev/cgd/t_cgd_aes.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/dev/cgd/t_cgd_aes.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_cgd_aes.c,v 1.5 2016/12/11 00:23:44 alnsn Exp $ */ +/* $NetBSD: t_cgd_aes.c,v 1.6 2017/01/13 21:30:39 christos Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. * Copyright (c) 2007 The Institute of Electrical and Electronics Engineers, Inc @@ -49,7 +49,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #define SECSIZE 512 Modified: vendor/NetBSD/tests/dist/dev/cgd/t_cgd_blowfish.c ============================================================================== --- vendor/NetBSD/tests/dist/dev/cgd/t_cgd_blowfish.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/dev/cgd/t_cgd_blowfish.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_cgd_blowfish.c,v 1.1 2016/11/10 23:44:36 alnsn Exp $ */ +/* $NetBSD: t_cgd_blowfish.c,v 1.2 2017/01/13 21:30:39 christos Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. * All rights reserved. @@ -48,7 +48,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #define SECSIZE 512 Modified: vendor/NetBSD/tests/dist/dev/scsipi/t_cd.c ============================================================================== --- vendor/NetBSD/tests/dist/dev/scsipi/t_cd.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/dev/scsipi/t_cd.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_cd.c,v 1.7 2014/04/25 00:24:39 pooka Exp $ */ +/* $NetBSD: t_cd.c,v 1.8 2017/01/13 21:30:39 christos Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -39,7 +39,7 @@ #include "scsitest.h" -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(noisyeject); ATF_TC_HEAD(noisyeject, tc) Modified: vendor/NetBSD/tests/dist/dev/sysmon/t_swwdog.c ============================================================================== --- vendor/NetBSD/tests/dist/dev/sysmon/t_swwdog.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/dev/sysmon/t_swwdog.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_swwdog.c,v 1.6 2015/04/23 04:49:37 pgoyette Exp $ */ +/* $NetBSD: t_swwdog.c,v 1.7 2017/01/13 21:30:39 christos Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -43,7 +43,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" static volatile sig_atomic_t tcount; Modified: vendor/NetBSD/tests/dist/fs/common/h_fsmacros.h ============================================================================== --- vendor/NetBSD/tests/dist/fs/common/h_fsmacros.h Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/common/h_fsmacros.h Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: h_fsmacros.h,v 1.40 2015/08/29 19:19:43 dholland Exp $ */ +/* $NetBSD: h_fsmacros.h,v 1.41 2017/01/13 21:30:39 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ #include -#include "../../h_macros.h" +#include "h_macros.h" #define FSPROTOS(_fs_) \ int _fs_##_fstest_newfs(const atf_tc_t *, void **, const char *, \ Modified: vendor/NetBSD/tests/dist/fs/ffs/h_quota2_tests.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/ffs/h_quota2_tests.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/ffs/h_quota2_tests.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: h_quota2_tests.c,v 1.4 2012/09/30 21:26:57 bouyer Exp $ */ +/* $NetBSD: h_quota2_tests.c,v 1.5 2017/01/13 21:30:39 christos Exp $ */ /* * rump server for advanced quota tests @@ -22,7 +22,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" int background = 0; Modified: vendor/NetBSD/tests/dist/fs/ffs/t_fifos.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/ffs/t_fifos.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/ffs/t_fifos.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fifos.c,v 1.5 2010/11/07 17:51:17 jmmv Exp $ */ +/* $NetBSD: t_fifos.c,v 1.6 2017/01/13 21:30:39 christos Exp $ */ #include #include @@ -17,7 +17,7 @@ #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC_WITH_CLEANUP(fifos); ATF_TC_HEAD(fifos, tc) Modified: vendor/NetBSD/tests/dist/fs/ffs/t_mount.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/ffs/t_mount.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/ffs/t_mount.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mount.c,v 1.13 2012/11/27 16:01:49 jakllsch Exp $ */ +/* $NetBSD: t_mount.c,v 1.14 2017/01/13 21:30:39 christos Exp $ */ /* * Basic tests for mounting @@ -25,7 +25,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(48Kimage); ATF_TC_HEAD(48Kimage, tc) Modified: vendor/NetBSD/tests/dist/fs/ffs/t_quota2_1.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/ffs/t_quota2_1.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/ffs/t_quota2_1.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_quota2_1.c,v 1.4 2012/03/15 02:02:22 joerg Exp $ */ +/* $NetBSD: t_quota2_1.c,v 1.5 2017/01/13 21:30:39 christos Exp $ */ /* * Basic tests for quota2 @@ -18,7 +18,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" static void do_quota(const atf_tc_t *tc, int n, const char *newfs_opts, int log) Modified: vendor/NetBSD/tests/dist/fs/ffs/t_quota2_remount.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/ffs/t_quota2_remount.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/ffs/t_quota2_remount.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_quota2_remount.c,v 1.4 2012/03/15 02:02:22 joerg Exp $ */ +/* $NetBSD: t_quota2_remount.c,v 1.5 2017/01/13 21:30:39 christos Exp $ */ /* * Basic tests for quota2 @@ -19,7 +19,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" static void do_quota(const atf_tc_t *tc, int n, const char *newfs_opts, int log) Modified: vendor/NetBSD/tests/dist/fs/ffs/t_snapshot.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/ffs/t_snapshot.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/ffs/t_snapshot.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_snapshot.c,v 1.6 2013/02/06 09:05:01 hannken Exp $ */ +/* $NetBSD: t_snapshot.c,v 1.7 2017/01/13 21:30:39 christos Exp $ */ #include #include @@ -15,7 +15,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #define IMGNAME "ffs.img" #define NEWFS "newfs -F -s 10000 " IMGNAME Modified: vendor/NetBSD/tests/dist/fs/ffs/t_snapshot_log.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/ffs/t_snapshot_log.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/ffs/t_snapshot_log.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_snapshot_log.c,v 1.2 2013/02/06 09:05:01 hannken Exp $ */ +/* $NetBSD: t_snapshot_log.c,v 1.3 2017/01/13 21:30:39 christos Exp $ */ #include #include @@ -15,7 +15,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #define IMGNAME "ffs.img" #define NEWFS "newfs -F -s 10000 " IMGNAME Modified: vendor/NetBSD/tests/dist/fs/ffs/t_snapshot_v2.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/ffs/t_snapshot_v2.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/ffs/t_snapshot_v2.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_snapshot_v2.c,v 1.2 2013/02/06 09:05:01 hannken Exp $ */ +/* $NetBSD: t_snapshot_v2.c,v 1.3 2017/01/13 21:30:39 christos Exp $ */ #include #include @@ -15,7 +15,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #define IMGNAME "ffs.img" #define NEWFS "newfs -F -s 10000 -O 2 " IMGNAME Modified: vendor/NetBSD/tests/dist/fs/hfs/t_pathconvert.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/hfs/t_pathconvert.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/hfs/t_pathconvert.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_pathconvert.c,v 1.5 2011/02/25 20:54:18 martin Exp $ */ +/* $NetBSD: t_pathconvert.c,v 1.6 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -18,7 +18,7 @@ #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(colonslash); ATF_TC_HEAD(colonslash, tc) Modified: vendor/NetBSD/tests/dist/fs/kernfs/t_basic.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/kernfs/t_basic.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/kernfs/t_basic.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_basic.c,v 1.3 2010/05/31 23:44:54 pooka Exp $ */ +/* $NetBSD: t_basic.c,v 1.4 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -20,7 +20,7 @@ #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(getdents); ATF_TC_HEAD(getdents, tc) Modified: vendor/NetBSD/tests/dist/fs/lfs/t_pr.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/lfs/t_pr.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/lfs/t_pr.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_pr.c,v 1.6 2011/02/22 18:41:05 pooka Exp $ */ +/* $NetBSD: t_pr.c,v 1.7 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -17,7 +17,7 @@ #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(mknod); ATF_TC_HEAD(mknod, tc) Modified: vendor/NetBSD/tests/dist/fs/msdosfs/t_snapshot.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/msdosfs/t_snapshot.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/msdosfs/t_snapshot.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_snapshot.c,v 1.3 2014/06/10 13:15:18 martin Exp $ */ +/* $NetBSD: t_snapshot.c,v 1.4 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -17,7 +17,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #define IMGNAME "msdosfs.img" #define NEWFS "newfs_msdos -C 5M " IMGNAME Modified: vendor/NetBSD/tests/dist/fs/nfs/t_mountd.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/nfs/t_mountd.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/nfs/t_mountd.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mountd.c,v 1.5 2012/02/24 13:53:46 joerg Exp $ */ +/* $NetBSD: t_mountd.c,v 1.6 2017/01/13 21:30:40 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #include "../common/h_fsmacros.h" ATF_TC(mountdhup); Modified: vendor/NetBSD/tests/dist/fs/nullfs/t_basic.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/nullfs/t_basic.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/nullfs/t_basic.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_basic.c,v 1.3 2010/06/09 08:37:16 pooka Exp $ */ +/* $NetBSD: t_basic.c,v 1.4 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -18,7 +18,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(basic); ATF_TC_HEAD(basic, tc) Modified: vendor/NetBSD/tests/dist/fs/ptyfs/t_nullpts.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/ptyfs/t_nullpts.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/ptyfs/t_nullpts.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_nullpts.c,v 1.5 2011/01/10 11:11:04 hannken Exp $ */ +/* $NetBSD: t_nullpts.c,v 1.6 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -19,7 +19,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" static void mountptyfs(const char *mp, int flags) Modified: vendor/NetBSD/tests/dist/fs/ptyfs/t_ptyfs.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/ptyfs/t_ptyfs.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/ptyfs/t_ptyfs.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptyfs.c,v 1.1 2010/06/11 23:52:38 pooka Exp $ */ +/* $NetBSD: t_ptyfs.c,v 1.2 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -17,7 +17,7 @@ #include -#include "../../h_macros.h" +#include "h_macros.h" static void mountptyfs(const char *mp, int flags) Modified: vendor/NetBSD/tests/dist/fs/puffs/t_basic.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/puffs/t_basic.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/puffs/t_basic.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_basic.c,v 1.13 2016/12/01 14:49:04 hannken Exp $ */ +/* $NetBSD: t_basic.c,v 1.14 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -20,7 +20,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #include "../common/h_fsmacros.h" /* Modified: vendor/NetBSD/tests/dist/fs/puffs/t_fuzz.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/puffs/t_fuzz.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/puffs/t_fuzz.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fuzz.c,v 1.5 2012/04/21 01:03:46 manu Exp $ */ +/* $NetBSD: t_fuzz.c,v 1.6 2017/01/13 21:30:40 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -56,7 +56,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #define ITERATIONS 100 Modified: vendor/NetBSD/tests/dist/fs/puffs/t_io.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/puffs/t_io.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/puffs/t_io.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_io.c,v 1.1 2010/11/12 17:33:28 pooka Exp $ */ +/* $NetBSD: t_io.c,v 1.2 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -20,7 +20,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" #include "../common/h_fsmacros.h" #define MAKEOPTS(...) \ Modified: vendor/NetBSD/tests/dist/fs/tmpfs/t_renamerace.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/tmpfs/t_renamerace.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/tmpfs/t_renamerace.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_renamerace.c,v 1.13 2011/08/18 21:44:55 riastradh Exp $ */ +/* $NetBSD: t_renamerace.c,v 1.14 2017/01/13 21:30:40 christos Exp $ */ /* * Modified for rump and atf from a program supplied @@ -23,7 +23,7 @@ #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(renamerace2); ATF_TC_HEAD(renamerace2, tc) Modified: vendor/NetBSD/tests/dist/fs/umapfs/t_basic.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/umapfs/t_basic.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/umapfs/t_basic.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_basic.c,v 1.4 2010/07/19 15:35:39 pooka Exp $ */ +/* $NetBSD: t_basic.c,v 1.5 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -20,7 +20,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(basic); ATF_TC_HEAD(basic, tc) Modified: vendor/NetBSD/tests/dist/fs/union/t_pr.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/union/t_pr.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/union/t_pr.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_pr.c,v 1.8 2011/08/10 06:27:02 hannken Exp $ */ +/* $NetBSD: t_pr.c,v 1.9 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -17,7 +17,7 @@ #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(multilayer); ATF_TC_HEAD(multilayer, tc) Modified: vendor/NetBSD/tests/dist/fs/vfs/t_full.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/vfs/t_full.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/vfs/t_full.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_full.c,v 1.8 2013/03/16 05:45:37 jmmv Exp $ */ +/* $NetBSD: t_full.c,v 1.9 2017/01/13 21:30:40 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include #include "../common/h_fsmacros.h" -#include "../../h_macros.h" +#include "h_macros.h" /* * Write this much over the image size. This is to force an NFS commit, Modified: vendor/NetBSD/tests/dist/fs/vfs/t_io.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/vfs/t_io.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/vfs/t_io.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_io.c,v 1.16 2015/04/04 12:34:44 riastradh Exp $ */ +/* $NetBSD: t_io.c,v 1.17 2017/01/13 21:30:40 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include #include "../common/h_fsmacros.h" -#include "../../h_macros.h" +#include "h_macros.h" #define TESTSTR "this is a string. collect enough and you'll have Em" #define TESTSZ sizeof(TESTSTR) Modified: vendor/NetBSD/tests/dist/fs/vfs/t_renamerace.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/vfs/t_renamerace.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/vfs/t_renamerace.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_renamerace.c,v 1.33 2016/05/04 08:30:22 dholland Exp $ */ +/* $NetBSD: t_renamerace.c,v 1.34 2017/01/13 21:30:40 christos Exp $ */ /* * Modified for rump and atf from a program supplied @@ -34,7 +34,7 @@ #define FSTEST_IMGSIZE (50000 * 512) #include "../common/h_fsmacros.h" -#include "../../h_macros.h" +#include "h_macros.h" static volatile int quittingtime; pid_t wrkpid; Modified: vendor/NetBSD/tests/dist/fs/vfs/t_ro.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/vfs/t_ro.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/vfs/t_ro.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ro.c,v 1.5 2011/02/22 21:23:19 yamt Exp $ */ +/* $NetBSD: t_ro.c,v 1.6 2017/01/13 21:30:40 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include #include "../common/h_fsmacros.h" -#include "../../h_macros.h" +#include "h_macros.h" #define AFILE "testfile" #define ADIR "testdir" Modified: vendor/NetBSD/tests/dist/fs/vfs/t_union.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/vfs/t_union.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/vfs/t_union.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_union.c,v 1.8 2011/08/07 06:01:51 hannken Exp $ */ +/* $NetBSD: t_union.c,v 1.9 2017/01/13 21:30:40 christos Exp $ */ #include #include @@ -17,7 +17,7 @@ #include -#include "../../h_macros.h" +#include "h_macros.h" #include "../common/h_fsmacros.h" #define MSTR "magic bus" Modified: vendor/NetBSD/tests/dist/fs/vfs/t_unpriv.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/vfs/t_unpriv.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/vfs/t_unpriv.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_unpriv.c,v 1.12 2015/04/09 19:51:13 riastradh Exp $ */ +/* $NetBSD: t_unpriv.c,v 1.13 2017/01/13 21:30:40 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #include "../common/h_fsmacros.h" -#include "../../h_macros.h" +#include "h_macros.h" #define USES_OWNER \ if (FSTYPE_MSDOS(tc)) \ Modified: vendor/NetBSD/tests/dist/fs/vfs/t_vfsops.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/vfs/t_vfsops.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/vfs/t_vfsops.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_vfsops.c,v 1.11 2011/04/04 19:16:58 hannken Exp $ */ +/* $NetBSD: t_vfsops.c,v 1.12 2017/01/13 21:30:40 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include #include "../common/h_fsmacros.h" -#include "../../h_macros.h" +#include "h_macros.h" static void tmount(const atf_tc_t *tc, const char *path) Modified: vendor/NetBSD/tests/dist/fs/vfs/t_vnops.c ============================================================================== --- vendor/NetBSD/tests/dist/fs/vfs/t_vnops.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/fs/vfs/t_vnops.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_vnops.c,v 1.58 2016/08/29 02:31:46 kre Exp $ */ +/* $NetBSD: t_vnops.c,v 1.59 2017/01/13 21:30:40 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ #include #include "../common/h_fsmacros.h" -#include "../../h_macros.h" +#include "h_macros.h" #define TESTFILE "afile" Modified: vendor/NetBSD/tests/dist/include/sys/t_socket.c ============================================================================== --- vendor/NetBSD/tests/dist/include/sys/t_socket.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/include/sys/t_socket.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_socket.c,v 1.4 2015/02/27 08:30:30 martin Exp $ */ +/* $NetBSD: t_socket.c,v 1.5 2017/01/13 21:30:41 christos Exp $ */ #include #include @@ -18,7 +18,7 @@ #include #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(cmsg_sendfd_bounds); ATF_TC_HEAD(cmsg_sendfd_bounds, tc) Modified: vendor/NetBSD/tests/dist/kernel/kqueue/read/t_fifo.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/read/t_fifo.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/read/t_fifo.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */ +/* $NetBSD: t_fifo.c,v 1.4 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $"); +__RCSID("$NetBSD: t_fifo.c,v 1.4 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -46,7 +46,7 @@ __RCSID("$NetBSD: t_fifo.c,v 1.3 2010/11 #include -#include "../../../h_macros.h" +#include "h_macros.h" #define FIFONAME "fifo" Modified: vendor/NetBSD/tests/dist/kernel/kqueue/read/t_file.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/read/t_file.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/read/t_file.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_file.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */ +/* $NetBSD: t_file.c,v 1.4 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_file.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $"); +__RCSID("$NetBSD: t_file.c,v 1.4 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -50,7 +50,7 @@ __RCSID("$NetBSD: t_file.c,v 1.3 2010/11 #include -#include "../../../h_macros.h" +#include "h_macros.h" #define FILENAME "file" #define NLINES 5 Modified: vendor/NetBSD/tests/dist/kernel/kqueue/read/t_file2.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/read/t_file2.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/read/t_file2.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_file2.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */ +/* $NetBSD: t_file2.c,v 1.4 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_file2.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $"); +__RCSID("$NetBSD: t_file2.c,v 1.4 2017/01/13 21:30:41 christos Exp $"); #include @@ -41,7 +41,7 @@ __RCSID("$NetBSD: t_file2.c,v 1.3 2010/1 #include -#include "../../../h_macros.h" +#include "h_macros.h" ATF_TC(file2); ATF_TC_HEAD(file2, tc) Modified: vendor/NetBSD/tests/dist/kernel/kqueue/read/t_pipe.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/read/t_pipe.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/read/t_pipe.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */ +/* $NetBSD: t_pipe.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $"); +__RCSID("$NetBSD: t_pipe.c,v 1.2 2017/01/13 21:30:41 christos Exp $"); #include @@ -41,7 +41,7 @@ __RCSID("$NetBSD: t_pipe.c,v 1.1 2009/02 #include -#include "../../../h_macros.h" +#include "h_macros.h" ATF_TC(pipe); ATF_TC_HEAD(pipe, tc) Modified: vendor/NetBSD/tests/dist/kernel/kqueue/read/t_ttypty.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/read/t_ttypty.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/read/t_ttypty.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */ +/* $NetBSD: t_ttypty.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $"); +__RCSID("$NetBSD: t_ttypty.c,v 1.2 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_ttypty.c,v 1.1 2009/ #include -#include "../../../h_macros.h" +#include "h_macros.h" static void h_check(bool check_master) Modified: vendor/NetBSD/tests/dist/kernel/kqueue/t_ioctl.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/t_ioctl.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/t_ioctl.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ioctl.c,v 1.2 2015/01/14 22:22:32 christos Exp $ */ +/* $NetBSD: t_ioctl.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_ioctl.c,v 1.2 2015/01/14 22:22:32 christos Exp $"); +__RCSID("$NetBSD: t_ioctl.c,v 1.3 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -42,7 +42,7 @@ __RCSID("$NetBSD: t_ioctl.c,v 1.2 2015/0 #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(kfilter_byfilter); ATF_TC_HEAD(kfilter_byfilter, tc) Modified: vendor/NetBSD/tests/dist/kernel/kqueue/t_proc1.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/t_proc1.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/t_proc1.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_proc1.c,v 1.2 2015/01/14 22:22:32 christos Exp $ */ +/* $NetBSD: t_proc1.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_proc1.c,v 1.2 2015/01/14 22:22:32 christos Exp $"); +__RCSID("$NetBSD: t_proc1.c,v 1.3 2017/01/13 21:30:41 christos Exp $"); /* * this also used to trigger problem fixed in @@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_proc1.c,v 1.2 2015/0 #include -#include "../../h_macros.h" +#include "h_macros.h" static int child(void) Modified: vendor/NetBSD/tests/dist/kernel/kqueue/t_proc2.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/t_proc2.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/t_proc2.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_proc2.c,v 1.2 2015/01/14 22:22:32 christos Exp $ */ +/* $NetBSD: t_proc2.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_proc2.c,v 1.2 2015/01/14 22:22:32 christos Exp $"); +__RCSID("$NetBSD: t_proc2.c,v 1.3 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -47,7 +47,7 @@ __RCSID("$NetBSD: t_proc2.c,v 1.2 2015/0 #include -#include "../../h_macros.h" +#include "h_macros.h" static void child_two(void) Modified: vendor/NetBSD/tests/dist/kernel/kqueue/t_proc3.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/t_proc3.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/t_proc3.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_proc3.c,v 1.2 2015/01/14 22:22:32 christos Exp $ */ +/* $NetBSD: t_proc3.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: t_proc3.c,v 1.2 2015/01/14 22:22:32 christos Exp $"); +__RCSID("$NetBSD: t_proc3.c,v 1.3 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_proc3.c,v 1.2 2015/0 #include -#include "../../h_macros.h" +#include "h_macros.h" ATF_TC(proc3); ATF_TC_HEAD(proc3, tc) Modified: vendor/NetBSD/tests/dist/kernel/kqueue/t_sig.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/t_sig.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/t_sig.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $ */ +/* $NetBSD: t_sig.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $"); +__RCSID("$NetBSD: t_sig.c,v 1.3 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -48,7 +48,7 @@ __RCSID("$NetBSD: t_sig.c,v 1.2 2010/11/ #include -#include "../../h_macros.h" +#include "h_macros.h" #define NSIGNALS 5 Modified: vendor/NetBSD/tests/dist/kernel/kqueue/write/t_fifo.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/write/t_fifo.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/write/t_fifo.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */ +/* $NetBSD: t_fifo.c,v 1.4 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $"); +__RCSID("$NetBSD: t_fifo.c,v 1.4 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -46,7 +46,7 @@ __RCSID("$NetBSD: t_fifo.c,v 1.3 2010/11 #include -#include "../../../h_macros.h" +#include "h_macros.h" #define FIFONAME "fifo" Modified: vendor/NetBSD/tests/dist/kernel/kqueue/write/t_pipe.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/write/t_pipe.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/write/t_pipe.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */ +/* $NetBSD: t_pipe.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $"); +__RCSID("$NetBSD: t_pipe.c,v 1.2 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -44,7 +44,7 @@ __RCSID("$NetBSD: t_pipe.c,v 1.1 2009/02 #include -#include "../../../h_macros.h" +#include "h_macros.h" ATF_TC(pipe1); ATF_TC_HEAD(pipe1, tc) Modified: vendor/NetBSD/tests/dist/kernel/kqueue/write/t_ttypty.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/kqueue/write/t_ttypty.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/kqueue/write/t_ttypty.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:58 jmmv Exp $ */ +/* $NetBSD: t_ttypty.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:58 jmmv Exp $"); +__RCSID("$NetBSD: t_ttypty.c,v 1.2 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -47,7 +47,7 @@ __RCSID("$NetBSD: t_ttypty.c,v 1.1 2009/ #include -#include "../../../h_macros.h" +#include "h_macros.h" static void h_check(bool check_master) Modified: vendor/NetBSD/tests/dist/kernel/t_extent.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/t_extent.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/t_extent.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_extent.c,v 1.4 2012/01/27 18:53:10 para Exp $ */ +/* $NetBSD: t_extent.c,v 1.5 2017/01/13 21:30:41 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_extent.c,v 1.4 2012/01/27 18:53:10 para Exp $"); +__RCSID("$NetBSD: t_extent.c,v 1.5 2017/01/13 21:30:41 christos Exp $"); #include #include @@ -41,7 +41,7 @@ __RCSID("$NetBSD: t_extent.c,v 1.4 2012/ #include -#include "../h_macros.h" +#include "h_macros.h" static int ret; static struct extent *ex; Modified: vendor/NetBSD/tests/dist/kernel/t_filedesc.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/t_filedesc.c Sat Jan 14 01:37:03 2017 (r312105) +++ vendor/NetBSD/tests/dist/kernel/t_filedesc.c Sat Jan 14 02:26:46 2017 (r312106) @@ -1,4 +1,4 @@ -/* $NetBSD: t_filedesc.c,v 1.5 2012/03/18 09:46:50 jruoho Exp $ */ +/* $NetBSD: t_filedesc.c,v 1.6 2017/01/13 21:30:41 christos Exp $ */ /*- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 14 02:29:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2584ECAF5C6; Sat, 14 Jan 2017 02:29:27 +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 E93581172; Sat, 14 Jan 2017 02:29:26 +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 v0E2TQcc001709; Sat, 14 Jan 2017 02:29:26 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E2TQrd001708; Sat, 14 Jan 2017 02:29:26 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701140229.v0E2TQrd001708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 14 Jan 2017 02:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312107 - head/tests/sys/vfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 02:29:27 -0000 Author: cem Date: Sat Jan 14 02:29:25 2017 New Revision: 312107 URL: https://svnweb.freebsd.org/changeset/base/312107 Log: Follow-up to r312103: Revert r310995 as well. Modified: head/tests/sys/vfs/Makefile Modified: head/tests/sys/vfs/Makefile ============================================================================== --- head/tests/sys/vfs/Makefile Sat Jan 14 02:26:46 2017 (r312106) +++ head/tests/sys/vfs/Makefile Sat Jan 14 02:29:25 2017 (r312107) @@ -9,6 +9,4 @@ CFLAGS.lookup_cap_dotdot.c+= -I${SRCTOP} PLAIN_TESTS_SH+= trailing_slash -WARNS?= 6 - .include From owner-svn-src-all@freebsd.org Sat Jan 14 02:30:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79077CAF637; Sat, 14 Jan 2017 02:30:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (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 3E5791342; Sat, 14 Jan 2017 02:30:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-it0-x243.google.com with SMTP id v14so6939419itb.0; Fri, 13 Jan 2017 18:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=FPr7S0ByEzI4mhUNp12nhaNIdPOO97QCKI2t8WdG0TU=; b=BSS7pJf/caHsWiKDS+vh2ACLuuxitRGot7OvVgu7TJbYLWhHfekCpY+rweySaxUyoR KeqilqqoN6+YV8C5e8aKg1F5yjc67W+WKIF2RTyAgWFqqBu2QnBoUTgv1rk4cxYcJgH8 ffPlRgfIKZjoqfz2kYjmnl2l4BxxBh3Efphw+D/rqU+h+GLiCDVrRz+j58FlfW7Z7ZuY Gy/nYau48SGHaawWNzZQ5+23QQTt+0FPFoF1Yoa7R8bXd1S2E9T00t7dNzjUvSQSOJ3S zrQVbCKWolHkpiEbcB2Un6Rkf2jO8LxVyizpWUoZ/sxVS6fUYNf0o0zA698u+Z6U8f93 2XcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=FPr7S0ByEzI4mhUNp12nhaNIdPOO97QCKI2t8WdG0TU=; b=kuiksA4Speg7xAf0gBlorwPQYFKUopnh2oZSKP/N7KPbPM5DmPmMyVPt5FvpuGrKlQ WtxviyvV3acsqX2mmHnzFsk2w1rmLXd6gxWk4QmbAptnpKLdkqOmn6dNmJ3/5OrQ7oat 46rXf/234ndHsaUV6dxdHRJxLxAAaBvYSRuE5dlal6Qi6OfMHjUi3qHCg5np9HHC/g9r pwSdGoG40ssdB7m9NqLfU0ujVR1+VUINvSAe1MOs6N5wt/UyjEkKgJYNFFBvgB7rXLFY XFbX2UjYi9BeOwAnyMuc2QDvEixbQkKW/ZLLEhPQdjTl/+As+C1hqoNbXtZxtC80huWf 9IGw== X-Gm-Message-State: AIkVDXJQu1A07DvX1pFJMxqUMBFZk9ueyoaoYNMWUv0s8A/9xjnNB6xF8mVbjoxtcsLp1g== X-Received: by 10.36.79.71 with SMTP id c68mr6076853itb.47.1484361049499; Fri, 13 Jan 2017 18:30:49 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i200sm2009359itb.0.2017.01.13.18.30.48 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 18:30:48 -0800 (PST) Subject: Re: svn commit: r312107 - head/tests/sys/vfs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_55FE3218-5D95-4A0C-90D5-6E6E5061D16A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701140229.v0E2TQrd001708@repo.freebsd.org> Date: Fri, 13 Jan 2017 18:30:47 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <14F9D1E0-B4A1-4B9A-80E0-10C9EBDCBD12@gmail.com> References: <201701140229.v0E2TQrd001708@repo.freebsd.org> To: "Conrad E. Meyer" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 02:30:50 -0000 --Apple-Mail=_55FE3218-5D95-4A0C-90D5-6E6E5061D16A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 13, 2017, at 18:29, Conrad E. Meyer wrote: >=20 > Author: cem > Date: Sat Jan 14 02:29:25 2017 > New Revision: 312107 > URL: https://svnweb.freebsd.org/changeset/base/312107 >=20 > Log: > Follow-up to r312103: >=20 > Revert r310995 as well. >=20 > Modified: > head/tests/sys/vfs/Makefile >=20 > Modified: head/tests/sys/vfs/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/tests/sys/vfs/Makefile Sat Jan 14 02:26:46 2017 = (r312106) > +++ head/tests/sys/vfs/Makefile Sat Jan 14 02:29:25 2017 = (r312107) > @@ -9,6 +9,4 @@ CFLAGS.lookup_cap_dotdot.c+=3D -I${SRCTOP} >=20 > PLAIN_TESTS_SH+=3D trailing_slash >=20 > -WARNS?=3D 6 > - > .include Why don=E2=80=99t you fix the test code to be -Werror clean instead with = WARNS? --Apple-Mail=_55FE3218-5D95-4A0C-90D5-6E6E5061D16A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYeY1XAAoJEPWDqSZpMIYVs/MP/Rptl71BVpDDGJPtYdBJh3a7 aJ2QOcy+wyXddo+0p7OBq2KTeaiKYWsoYmYeCVIoIjKGToWHwagK79Yalot17tv0 F7J7Lh4A6vdnZ7LJu8hI9i3LKT5l89LW0I6SXsfaIUnZMvmYi4VV5mXTmuEm65jd E7ZsSBAAopZMIe29d1niek2NH4ofRLNsCk2j1WNuHsMn6uKeyNncfAV4LIY0bW9B wU2+ATHUMApmdIrGCYjLJLkinlU+f+OyQhSG+MzvXNed+OpJxZAD5HxiwUfqGcVO fqXSDxnfG+hTOt42WrORK5qMgGD7CpWcMUezLUb0B/jzCMGHJIbP5Rdu39xZq/P5 T2OF9ULmZWRrwPpul+ZfonL7Er9smVBj3wWZ+4lXv7cgmRchSSXSxpK78BO1C6W3 q2domabdgOteYG04EVEoGZPCZ8bxnPlUAUVCrjXZM0F0KMrS21ZZOvzEdMiexVv3 IBJu0jHzHMPGFaZoa197zU7Co2vlrIxc61CXcuIKzym345LTsC8lD0eu6Qzr3l+p T+RTwl0QcTIX9I61pe+hruDcJpM9HupvIfILcIa+llmnsEbpYUckpJuNGw9Jwg26 xQpGlJDJGN4+VobhjOAzyTyqr4McCZRi6tDaXJmXvCy+i9kMxsaKlSvjfCPkBbEl zcdPfvNgNMoPlcpN/ukA =qrZL -----END PGP SIGNATURE----- --Apple-Mail=_55FE3218-5D95-4A0C-90D5-6E6E5061D16A-- From owner-svn-src-all@freebsd.org Sat Jan 14 02:40:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA01DCAF833; Sat, 14 Jan 2017 02:40:02 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 90A5D1830; Sat, 14 Jan 2017 02:40:01 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id SEFzcIwwMC8pGSEG0cIVkb; Fri, 13 Jan 2017 19:39:53 -0700 X-Authority-Analysis: v=2.2 cv=WoZbCZXv c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=IgFoBzBjUZAA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=rNrjpBi0COSOxzXsiRMA:9 a=CjuIK1q_8ugA: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 0DCD49F5; Fri, 13 Jan 2017 18:39:51 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v0E2doD2069898; Fri, 13 Jan 2017 18:39:50 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201701140239.v0E2doD2069898@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: "Conrad E. Meyer" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312103 - head/tests/sys/vfs In-Reply-To: Message from "Conrad E. Meyer" of "Sat, 14 Jan 2017 01:03:20 +0000." <201701140103.v0E13K8b068874@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 13 Jan 2017 18:39:50 -0800 X-CMAE-Envelope: MS4wfDDEuTijvSGHAP2nOZnWRvwn04c9ETwG33S5TwAtXmsyhKvGbHEx8ipiHSpJHCIJ7ekE+XYt8pGbT+xs7dpiw7UHtnnTjrlmxLbpqj1K2menz6ZdN4EL 3hQIiTvICqueLfo23X7v347gIe3945MYzW2QqQB2h/bbxLNTUPY90x/bFNUc+PChmISZ4oSLl6kmOXvorpOD2wKzvkqOBNK7aJ5QOjfjyzM9eIJkeMo6O4xy k/dSF/959Yn/Dd0RyKvYDGLc+vQ10/LbI+IXmCc61LAZoahvb9w7kOnJUEGcJnHW X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 02:40:03 -0000 In message <201701140103.v0E13K8b068874@repo.freebsd.org>, "Conrad E. Meyer" wr ites: > Author: cem > Date: Sat Jan 14 01:03:20 2017 > New Revision: 312103 > URL: https://svnweb.freebsd.org/changeset/base/312103 > > Log: > Revert r310994 > > Don't implement some terrible hack on a test by test basis. The > framework fix is straightforward and can be chased up in the original > bug. > > Reviewed by: ngie ("be my guest") > > Modified: > head/tests/sys/vfs/lookup_cap_dotdot.c > > Modified: head/tests/sys/vfs/lookup_cap_dotdot.c > ============================================================================= > = > --- head/tests/sys/vfs/lookup_cap_dotdot.c Sat Jan 14 01:01:02 2017 > (r312102) > +++ head/tests/sys/vfs/lookup_cap_dotdot.c Sat Jan 14 01:03:20 2017 > (r312103) > @@ -31,27 +31,23 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > > #include > -#include > #include > #include > #include > > #include "freebsd_test_suite/macros.h" > > -static char *abspath; > -static int dirfd = -1; > - > -typedef void (*child_test_fn_t)(void); > +static int dirfd = -1; > +static char *abspath; > > static void > -touchat(int _dirfd, const char *name) > +touchat(int dirfd, const char *name) Buildworld is busted right here. It's probably best to leave the underbar here and in the ATF_REQIRE below. > { > int fd; > > - ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, > + ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, Here too. > 0777)) >= 0); > ATF_REQUIRE(close(fd) == 0); > } -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Jan 14 03:50:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C087CAEA5C; Sat, 14 Jan 2017 03:50:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) (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 C92D01A85; Sat, 14 Jan 2017 03:50:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f68.google.com with SMTP id l2so16083131wml.2; Fri, 13 Jan 2017 19:50:30 -0800 (PST) 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=IkxXkYWnZf6HDwhA/IL5MWaOVlO3bqy9+2Tds24WA/Y=; b=GjuA/UpmFVb8/2aysAZEFsWjRZIAu/jPKFkOWD8uPOYkqzxnrQWM3OdAhHnLJc5VQR ZqrGLpNrHE4JciqcTdEVXVtzqFZ8AfymGMpOiBpF0r9ygDL2dwwYznOiAeY0rDZX3jv9 Fz54cxjrDpmx9tnZVXpVLBJCHzD+bo4P6h3aUMEMJe4QeXKGV6cuKGTXb6yleAVzeQA0 mPLHc5t6md6Z/0HUydakhj+GeoLDp8BMtE+r78VGh3cInHFxahPDI2Y/Va9of/8UZjhY jLjzeULuzG3kXahcsS7kCdk4x8KQifSFJOkFdXG9B3raR5GCBmTYi5uyU/SVcH8nD+16 K7og== X-Gm-Message-State: AIkVDXJQJav+1ISVkYWzYMG5sAn+79XrG0ao3fG8kXWPUIRyaQr0boQBmOtSX5hhrYbMWA== X-Received: by 10.223.171.141 with SMTP id s13mr55707wrc.23.1484365823076; Fri, 13 Jan 2017 19:50:23 -0800 (PST) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com. [74.125.82.53]) by smtp.gmail.com with ESMTPSA id u81sm9086258wmu.10.2017.01.13.19.50.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 19:50:22 -0800 (PST) Received: by mail-wm0-f53.google.com with SMTP id c85so89661027wmi.1; Fri, 13 Jan 2017 19:50:22 -0800 (PST) X-Received: by 10.28.6.210 with SMTP id 201mr4794665wmg.85.1484365822219; Fri, 13 Jan 2017 19:50:22 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.29.72 with HTTP; Fri, 13 Jan 2017 19:50:21 -0800 (PST) In-Reply-To: <201701140239.v0E2doD2069898@slippy.cwsent.com> References: <201701140103.v0E13K8b068874@repo.freebsd.org> <201701140239.v0E2doD2069898@slippy.cwsent.com> From: Conrad Meyer Date: Fri, 13 Jan 2017 19:50:21 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r312103 - head/tests/sys/vfs To: Cy Schubert Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 03:50:31 -0000 Hi Cy, r312107 fixes it. If the warning-cleanups and major changes were committed separately, the more major changes could then have been reverted independently. Unfortunately, they were not. The warnings are harmless, though, so just turning them down again is fine. Best, Conrad On Fri, Jan 13, 2017 at 6:39 PM, Cy Schubert wrote: > In message <201701140103.v0E13K8b068874@repo.freebsd.org>, "Conrad E. > Meyer" wr > ites: >> Author: cem >> Date: Sat Jan 14 01:03:20 2017 >> New Revision: 312103 >> URL: https://svnweb.freebsd.org/changeset/base/312103 >> >> Log: >> Revert r310994 >> >> Don't implement some terrible hack on a test by test basis. The >> framework fix is straightforward and can be chased up in the original >> bug. >> >> Reviewed by: ngie ("be my guest") >> >> Modified: >> head/tests/sys/vfs/lookup_cap_dotdot.c >> >> Modified: head/tests/sys/vfs/lookup_cap_dotdot.c >> ============================================================================= >> = >> --- head/tests/sys/vfs/lookup_cap_dotdot.c Sat Jan 14 01:01:02 2017 >> (r312102) >> +++ head/tests/sys/vfs/lookup_cap_dotdot.c Sat Jan 14 01:03:20 2017 >> (r312103) >> @@ -31,27 +31,23 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> -#include >> >> #include >> -#include >> #include >> #include >> #include >> >> #include "freebsd_test_suite/macros.h" >> >> -static char *abspath; >> -static int dirfd = -1; >> - >> -typedef void (*child_test_fn_t)(void); >> +static int dirfd = -1; >> +static char *abspath; >> >> static void >> -touchat(int _dirfd, const char *name) >> +touchat(int dirfd, const char *name) > > Buildworld is busted right here. It's probably best to leave the underbar > here and in the ATF_REQIRE below. > >> { >> int fd; >> >> - ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, >> + ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, > > Here too. > >> 0777)) >= 0); >> ATF_REQUIRE(close(fd) == 0); >> } > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > From owner-svn-src-all@freebsd.org Sat Jan 14 03:54:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1107CAEC99; Sat, 14 Jan 2017 03:54: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 7F7221EEF; Sat, 14 Jan 2017 03:54:24 +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 v0E3sNSO038813; Sat, 14 Jan 2017 03:54:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E3sNKA038812; Sat, 14 Jan 2017 03:54:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140354.v0E3sNKA038812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 03:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312108 - head/contrib/netbsd-tests/lib/libc/gen/posix_spawn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 03:54:24 -0000 Author: ngie Date: Sat Jan 14 03:54:23 2017 New Revision: 312108 URL: https://svnweb.freebsd.org/changeset/base/312108 Log: Delete trailing whitespace and use __arraycount instead of nitems in contrib code MFC after: 1 week Modified: head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c Modified: head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c Sat Jan 14 02:29:25 2017 (r312107) +++ head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c Sat Jan 14 03:54:23 2017 (r312108) @@ -60,16 +60,16 @@ get_different_scheduler(void) /* get current schedule policy */ scheduler = sched_getscheduler(0); - for (i = 0; i < nitems(schedulers); i++) { + for (i = 0; i < __arraycount(schedulers); i++) { if (schedulers[i] == scheduler) break; } - ATF_REQUIRE_MSG(i < nitems(schedulers), + ATF_REQUIRE_MSG(i < __arraycount(schedulers), "Unknown current scheduler %d", scheduler); - + /* new scheduler */ i++; - if (i >= nitems(schedulers)) + if (i >= __arraycount(schedulers)) i = 0; return schedulers[i]; } @@ -85,7 +85,7 @@ get_different_priority(int scheduler) sched_getparam(0, ¶m); priority = param.sched_priority; - + /* * Change numerical value of the priority, to ensure that it * was set for the spawned child. @@ -127,7 +127,7 @@ ATF_TC_BODY(t_spawnattr, tc) scheduler = get_different_scheduler(); priority = get_different_priority(scheduler); sp.sched_priority = priority; - + sigemptyset(&sig); sigaddset(&sig, SIGUSR1); From owner-svn-src-all@freebsd.org Sat Jan 14 04:00:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8B38CAED7E; Sat, 14 Jan 2017 04:00:27 +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 60DD110F7; Sat, 14 Jan 2017 04:00:27 +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 v0E40QIq039148; Sat, 14 Jan 2017 04:00:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E40QZQ039146; Sat, 14 Jan 2017 04:00:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140400.v0E40QZQ039146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 04:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312109 - head/tests/sys/vfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:00:27 -0000 Author: ngie Date: Sat Jan 14 04:00:26 2017 New Revision: 312109 URL: https://svnweb.freebsd.org/changeset/base/312109 Log: Bump WARNS up to 6 again Has not been tested (can't be after r312103 without cem's hacks to atf/kyua)! Modified: head/tests/sys/vfs/Makefile head/tests/sys/vfs/lookup_cap_dotdot.c Modified: head/tests/sys/vfs/Makefile ============================================================================== --- head/tests/sys/vfs/Makefile Sat Jan 14 03:54:23 2017 (r312108) +++ head/tests/sys/vfs/Makefile Sat Jan 14 04:00:26 2017 (r312109) @@ -9,4 +9,6 @@ CFLAGS.lookup_cap_dotdot.c+= -I${SRCTOP} PLAIN_TESTS_SH+= trailing_slash +WARNS?= 6 + .include Modified: head/tests/sys/vfs/lookup_cap_dotdot.c ============================================================================== --- head/tests/sys/vfs/lookup_cap_dotdot.c Sat Jan 14 03:54:23 2017 (r312108) +++ head/tests/sys/vfs/lookup_cap_dotdot.c Sat Jan 14 04:00:26 2017 (r312109) @@ -43,11 +43,11 @@ static int dirfd = -1; static char *abspath; static void -touchat(int dirfd, const char *name) +touchat(int _dirfd, const char *name) { int fd; - ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, + ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, 0777)) >= 0); ATF_REQUIRE(close(fd) == 0); } @@ -117,7 +117,6 @@ ATF_TC_HEAD(lookup_cap_dotdot__basic, tc ATF_TC_BODY(lookup_cap_dotdot__basic, tc) { cap_rights_t rights; - int fd; check_capsicum(); prepare_dotdot_tests(); @@ -141,7 +140,6 @@ ATF_TC_HEAD(lookup_cap_dotdot__advanced, ATF_TC_BODY(lookup_cap_dotdot__advanced, tc) { cap_rights_t rights; - int fd; check_capsicum(); prepare_dotdot_tests(); @@ -220,7 +218,6 @@ ATF_TC_HEAD(lookup_cap_dotdot__negative, ATF_TC_BODY(lookup_cap_dotdot__negative, tc) { cap_rights_t rights; - int fd; check_capsicum(); prepare_dotdot_tests(); From owner-svn-src-all@freebsd.org Sat Jan 14 04:07:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C4CECAF039; Sat, 14 Jan 2017 04:07:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (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 6B2891685; Sat, 14 Jan 2017 04:07:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id b1so159367pgc.1; Fri, 13 Jan 2017 20:07:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XDJwGUlzmWW4a+SyDLvoIoiKJPH2ri0I+mk6ejACE6o=; b=NUvFza+jBK9ReOvbT84ZSXmyCO9D55L+E1W2SXo0v0OAsk8m2MOkIH3of6JBCzXGVu 7jIkBaLvZ7BEP4nEsv4kp7JEnNXjIGWcYdluguSMXt/YAL85vPbFVr2+6PdaWvZWj0yq WgOHBtVr1eOerIRhxcPfGkKGPHLmk0rozxcUrm8vuXHmOb6hLPx/08dw5Z3C55zQNL+m 4pImozSjj7mV7LnbThHCqvzKUjjHMJ6JmwvMBqxg2zGP8vWwmxR0cSTkGnZ8lY1mkMbE KcUpBXxV0vPmYLGU0i0yFy1TKPMKJkcVL5NEkZM5AI70ZpUgnPNv1J56oLitXqTqyoSH i5qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XDJwGUlzmWW4a+SyDLvoIoiKJPH2ri0I+mk6ejACE6o=; b=Ozxh25uvyaMjauMyFYoQwwz0iXob8WQaf3Lm+SC0BY0ww1QTJp0TyEtG60re4BsPBd nrWaLUX7iqzMWf6pPRqKGxr7CeB69ZfJlZ/uOV++EcfqWzHsJWhsWAnLSPLprLPdXW4Z z1+TgSXhmx1GJgW4phH+ijnN+K6GYG2qU8W0mL08ym3u/9sbW1Gsfb19+9NAOHeqdM2e DKO8WQnffAljhmKX2y9/P8sL5Etw2nGdc88EhiFQUxFHa2lFdcubaRwxG33H/fWdTJ4h qo3vIRlldqXL1ZDUeWCmJiVJseDlINpS+UocYJxuairZnuJ/2ybOttyqGctVQKig2k/Q 2rng== X-Gm-Message-State: AIkVDXKYpXMLJOmHvzW5hp+NnNHWmAVY5B7amgRf9TWJmGMdtJcIiaNMe0Hs0WzaUOgt/Q== X-Received: by 10.84.205.69 with SMTP id o5mr33632992plh.70.1484366871709; Fri, 13 Jan 2017 20:07:51 -0800 (PST) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id t21sm32226704pfa.1.2017.01.13.20.07.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 20:07:51 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r312103 - head/tests/sys/vfs From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Fri, 13 Jan 2017 20:07:50 -0800 Cc: Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <822E173E-C5FE-4E1C-9012-38A48A9E3703@gmail.com> References: <201701140103.v0E13K8b068874@repo.freebsd.org> <201701140239.v0E2doD2069898@slippy.cwsent.com> To: cem@freebsd.org X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:07:52 -0000 > On Jan 13, 2017, at 7:50 PM, Conrad Meyer wrote: > > Hi Cy, > > r312107 fixes it. If the warning-cleanups and major changes were > committed separately, the more major changes could then have been > reverted independently. Unfortunately, they were not. The warnings > are harmless, though, so just turning them down again is fine. Trivial fixes reapplied in r312109. From owner-svn-src-all@freebsd.org Sat Jan 14 04:09:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A61F5CAF0AA; Sat, 14 Jan 2017 04:09:02 +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 78599181C; Sat, 14 Jan 2017 04:09:02 +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 v0E49113043298; Sat, 14 Jan 2017 04:09:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E4914j043297; Sat, 14 Jan 2017 04:09:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140409.v0E4914j043297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 04:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312110 - head/tests/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:09:02 -0000 Author: ngie Date: Sat Jan 14 04:09:01 2017 New Revision: 312110 URL: https://svnweb.freebsd.org/changeset/base/312110 Log: Fix -Wsign-compare warnings The loop index (i) doesn't need to be size_t as its comparison is signed MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/tests/sys/vm/mmap_test.c Modified: head/tests/sys/vm/mmap_test.c ============================================================================== --- head/tests/sys/vm/mmap_test.c Sat Jan 14 04:00:26 2017 (r312109) +++ head/tests/sys/vm/mmap_test.c Sat Jan 14 04:09:01 2017 (r312110) @@ -184,8 +184,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_priva ATF_TC_BODY(mmap__dev_zero_private, tc) { char *p1, *p2, *p3; - size_t i; - int fd, pagesize; + int fd, i, pagesize; ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0); @@ -197,7 +196,7 @@ ATF_TC_BODY(mmap__dev_zero_private, tc) ATF_REQUIRE(p2 != MAP_FAILED); for (i = 0; i < pagesize; i++) - ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); + ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]); ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0); @@ -224,8 +223,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_share ATF_TC_BODY(mmap__dev_zero_shared, tc) { char *p1, *p2, *p3; - size_t i; - int fd, pagesize; + int fd, i, pagesize; ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0); @@ -237,7 +235,7 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc) ATF_REQUIRE(p2 != MAP_FAILED); for (i = 0; i < pagesize; i++) - ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); + ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]); ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0); From owner-svn-src-all@freebsd.org Sat Jan 14 04:10:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60E28CAF123; Sat, 14 Jan 2017 04:10:05 +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 3078519A9; Sat, 14 Jan 2017 04:10:05 +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 v0E4A44v043400; Sat, 14 Jan 2017 04:10:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E4A4P0043399; Sat, 14 Jan 2017 04:10:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140410.v0E4A4P0043399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 04:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312111 - head/tests/sys/file X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:10:05 -0000 Author: ngie Date: Sat Jan 14 04:10:04 2017 New Revision: 312111 URL: https://svnweb.freebsd.org/changeset/base/312111 Log: Remove unused vars to fix -Wunused issues MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/tests/sys/file/ftruncate_test.c Modified: head/tests/sys/file/ftruncate_test.c ============================================================================== --- head/tests/sys/file/ftruncate_test.c Sat Jan 14 04:09:01 2017 (r312110) +++ head/tests/sys/file/ftruncate_test.c Sat Jan 14 04:10:04 2017 (r312111) @@ -57,7 +57,7 @@ static off_t lengths[] = {0, 1, 2, 3, 4, static int lengths_count = sizeof(lengths) / sizeof(off_t); int -main(int argc, char *argv[]) +main(void) { int error, fd, fds[2], i, read_only_fd; char path[PATH_MAX]; From owner-svn-src-all@freebsd.org Sat Jan 14 04:13:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49467CAF2AE; Sat, 14 Jan 2017 04:13:29 +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 19B791DD1; Sat, 14 Jan 2017 04:13:29 +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 v0E4DSKg047070; Sat, 14 Jan 2017 04:13:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E4DSrq047069; Sat, 14 Jan 2017 04:13:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140413.v0E4DSrq047069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 04:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312112 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:13:29 -0000 Author: ngie Date: Sat Jan 14 04:13:28 2017 New Revision: 312112 URL: https://svnweb.freebsd.org/changeset/base/312112 Log: Fix -Wunused on gcc 4.9 (x was set but not used) MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/sys/kern/subr_unit.c Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Sat Jan 14 04:10:04 2017 (r312111) +++ head/sys/kern/subr_unit.c Sat Jan 14 04:13:28 2017 (r312112) @@ -986,7 +986,7 @@ main(int argc, char **argv) long count = 10000; /* Number of unrs to test */ long reps = 1, m; int ch; - u_int i, x, j; + u_int i, j; verbose = false; @@ -999,7 +999,7 @@ main(int argc, char **argv) usage(argv); exit(2); } - + break; case 'v': verbose = true; @@ -1026,7 +1026,6 @@ main(int argc, char **argv) printf("sizeof(struct unrb) %zu\n", sizeof(struct unrb)); printf("sizeof(struct unrhdr) %zu\n", sizeof(struct unrhdr)); printf("NBITS %lu\n", (unsigned long)NBITS); - x = 1; for (m = 0; m < count * reps; m++) { j = random(); i = (j >> 1) % count; From owner-svn-src-all@freebsd.org Sat Jan 14 04:16:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DA57CAF356; Sat, 14 Jan 2017 04:16:15 +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 0439D10DC; Sat, 14 Jan 2017 04:16:14 +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 v0E4GENW047589; Sat, 14 Jan 2017 04:16:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E4GEju047588; Sat, 14 Jan 2017 04:16:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140416.v0E4GEju047588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 04:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312113 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:16:15 -0000 Author: ngie Date: Sat Jan 14 04:16:13 2017 New Revision: 312113 URL: https://svnweb.freebsd.org/changeset/base/312113 Log: Clean up trailing whitespace MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/sys/kern/subr_unit.c Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Sat Jan 14 04:13:28 2017 (r312112) +++ head/sys/kern/subr_unit.c Sat Jan 14 04:16:13 2017 (r312113) @@ -216,7 +216,7 @@ ub_full(struct unrb *ub, int len) * Consistency check function. * * Checks the internal consistency as well as we can. - * + * * Called at all boundaries of this API. */ static void @@ -240,7 +240,7 @@ check_unrhdr(struct unrhdr *uh, int line w = 0; bit_count(ub->map, 0, up->len, &w); y += w; - } else if (up->ptr != NULL) + } else if (up->ptr != NULL) y += up->len; } KASSERT (y == uh->busy, @@ -375,7 +375,7 @@ is_bitmap(struct unrhdr *uh, struct unr /* * Look for sequence of items which can be combined into a bitmap, if * multiple are present, take the one which saves most memory. - * + * * Return (1) if a sequence was found to indicate that another call * might be able to do more. Return (0) if we found no suitable sequence. * @@ -591,7 +591,7 @@ alloc_unrl(struct unrhdr *uh) } /* - * We can always allocate from the first list element, so if we have + * We can always allocate from the first list element, so if we have * nothing on the list, we must have run out of unit numbers. */ if (up == NULL) @@ -803,7 +803,7 @@ free_unrl(struct unrhdr *uh, u_int item, /* Handle bitmap items */ if (is_bitmap(uh, up)) { ub = up->ptr; - + KASSERT(bit_test(ub->map, item) != 0, ("UNR: Freeing free item %d (bitmap)\n", item)); bit_clear(ub->map, item); @@ -909,7 +909,7 @@ print_unr(struct unrhdr *uh, struct unr for (x = 0; x < up->len; x++) { if (bit_test(ub->map, x)) printf("#"); - else + else printf(" "); } printf("]\n"); From owner-svn-src-all@freebsd.org Sat Jan 14 04:20:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66F09CAF434; Sat, 14 Jan 2017 04:20:07 +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 33D7C1397; Sat, 14 Jan 2017 04:20:07 +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 v0E4K6qJ047793; Sat, 14 Jan 2017 04:20:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E4K61u047792; Sat, 14 Jan 2017 04:20:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140420.v0E4K61u047792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 04:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312114 - head/tests/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:20:07 -0000 Author: ngie Date: Sat Jan 14 04:20:06 2017 New Revision: 312114 URL: https://svnweb.freebsd.org/changeset/base/312114 Log: Enable WARNS?= 6 across all of tests/sys MFC after: 1 week Sponsored by: Dell EMC Isilon Added: head/tests/sys/Makefile.inc (contents, props changed) Added: head/tests/sys/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/Makefile.inc Sat Jan 14 04:20:06 2017 (r312114) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +WARNS?= 6 From owner-svn-src-all@freebsd.org Sat Jan 14 04:20:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22CFECAF4AC; Sat, 14 Jan 2017 04:20:44 +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 E6A1E15D0; Sat, 14 Jan 2017 04:20: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 v0E4Khaj047865; Sat, 14 Jan 2017 04:20:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E4Khg0047864; Sat, 14 Jan 2017 04:20:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140420.v0E4Khg0047864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 04:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312115 - head/tests/sys/vfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:20:44 -0000 Author: ngie Date: Sat Jan 14 04:20:42 2017 New Revision: 312115 URL: https://svnweb.freebsd.org/changeset/base/312115 Log: Remove WARNS set globally by ../Makefile.inc now Sponsored by: Dell EMC Isilon Modified: head/tests/sys/vfs/Makefile Modified: head/tests/sys/vfs/Makefile ============================================================================== --- head/tests/sys/vfs/Makefile Sat Jan 14 04:20:06 2017 (r312114) +++ head/tests/sys/vfs/Makefile Sat Jan 14 04:20:42 2017 (r312115) @@ -9,6 +9,4 @@ CFLAGS.lookup_cap_dotdot.c+= -I${SRCTOP} PLAIN_TESTS_SH+= trailing_slash -WARNS?= 6 - .include From owner-svn-src-all@freebsd.org Sat Jan 14 04:23:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE954CAF61C; Sat, 14 Jan 2017 04:23:42 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 74AB71A07; Sat, 14 Jan 2017 04:23:42 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id SFsKcbKFKcWiHSFsLc9Bcy; Fri, 13 Jan 2017 21:23:34 -0700 X-Authority-Analysis: v=2.2 cv=JLBLi4Cb c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=IgFoBzBjUZAA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=Ot_gtzyipYd0_Kvi8l8A:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 72DBCABE; Fri, 13 Jan 2017 20:23:32 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v0E4NVuC090024; Fri, 13 Jan 2017 20:23:31 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201701140423.v0E4NVuC090024@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: cem@freebsd.org cc: Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312103 - head/tests/sys/vfs In-Reply-To: Message from Conrad Meyer of "Fri, 13 Jan 2017 19:50:21 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 13 Jan 2017 20:23:31 -0800 X-CMAE-Envelope: MS4wfNc9jXqM3oNrPwzlDMKndgzCb+OZXX3Zyj1IcammmeLRTZRhd7pheUywhcLQb8M2Klv7oyyBH/xTl83jnpfg4EHOKx5HIm5A6bSjsprQmbtHt8ZP18/n UOk7ZjuBmPi65qCfAQfXZPaPY/PIZt4/MUc/cImVhWfqBqAvwOLX5OD/zUGEIRIBTlyohuxZQfvqZoWJwUw0EI5CruNn5EubG4OU7cE5UWimjQSN4OgDvfoS P4KuIdQnkaai//6RmX1Lqij+gbcb2igT6A58HSPv2fBOQUe/IP0/2y4JN8lSTow4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:23:42 -0000 No problem. My make.conf doesn't adjust any warning levels, they're vanilla so, the build barfed at that line. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. In message , Conrad Meyer writes: > Hi Cy, > > r312107 fixes it. If the warning-cleanups and major changes were > committed separately, the more major changes could then have been > reverted independently. Unfortunately, they were not. The warnings > are harmless, though, so just turning them down again is fine. > > Best, > Conrad > > On Fri, Jan 13, 2017 at 6:39 PM, Cy Schubert wrote > : > > In message <201701140103.v0E13K8b068874@repo.freebsd.org>, "Conrad E. > > Meyer" wr > > ites: > >> Author: cem > >> Date: Sat Jan 14 01:03:20 2017 > >> New Revision: 312103 > >> URL: https://svnweb.freebsd.org/changeset/base/312103 > >> > >> Log: > >> Revert r310994 > >> > >> Don't implement some terrible hack on a test by test basis. The > >> framework fix is straightforward and can be chased up in the original > >> bug. > >> > >> Reviewed by: ngie ("be my guest") > >> > >> Modified: > >> head/tests/sys/vfs/lookup_cap_dotdot.c > >> > >> Modified: head/tests/sys/vfs/lookup_cap_dotdot.c > >> ========================================================================== > === > >> = > >> --- head/tests/sys/vfs/lookup_cap_dotdot.c Sat Jan 14 01:01:02 2017 > >> (r312102) > >> +++ head/tests/sys/vfs/lookup_cap_dotdot.c Sat Jan 14 01:03:20 2017 > >> (r312103) > >> @@ -31,27 +31,23 @@ __FBSDID("$FreeBSD$"); > >> #include > >> #include > >> #include > >> -#include > >> > >> #include > >> -#include > >> #include > >> #include > >> #include > >> > >> #include "freebsd_test_suite/macros.h" > >> > >> -static char *abspath; > >> -static int dirfd = -1; > >> - > >> -typedef void (*child_test_fn_t)(void); > >> +static int dirfd = -1; > >> +static char *abspath; > >> > >> static void > >> -touchat(int _dirfd, const char *name) > >> +touchat(int dirfd, const char *name) > > > > Buildworld is busted right here. It's probably best to leave the underbar > > here and in the ATF_REQIRE below. > > > >> { > >> int fd; > >> > >> - ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, > >> + ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY, > > > > Here too. > > > >> 0777)) >= 0); > >> ATF_REQUIRE(close(fd) == 0); > >> } > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > > From owner-svn-src-all@freebsd.org Sat Jan 14 04:24:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03F59CAF6A4; Sat, 14 Jan 2017 04:24:51 +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 BC13C1BC2; Sat, 14 Jan 2017 04:24:50 +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 v0E4OneS051839; Sat, 14 Jan 2017 04:24:49 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E4Onng051833; Sat, 14 Jan 2017 04:24:49 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701140424.v0E4Onng051833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Jan 2017 04:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312116 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:24:51 -0000 Author: np Date: Sat Jan 14 04:24:49 2017 New Revision: 312116 URL: https://svnweb.freebsd.org/changeset/base/312116 Log: MFC r311569, r311657, and r311949. r311569: Fix comment in t4_tom. No functional change. r311657: cxgbe/t4_tom: Fix tid accounting. An offloaded IPv6 connection uses 2 tids, not 1, in the hardware. r311949: cxgbe/tom: Add VIMAGE support to the TOE driver. Active Open: - Save the socket's vnet at the time of the active open (t4_connect) and switch to it when processing the reply (do_act_open_rpl or do_act_establish). Passive Open: - Save the listening socket's vnet in the driver's listen_ctx and switch to it when processing incoming SYNs for the socket. - Reject SYNs that arrive on an ifnet that's not in the same vnet as the listening socket. CLIP (Compressed Local IPv6) table: - Add only those IPv6 addresses to the CLIP that are in a vnet associated with one of the card's ifnets. Misc: - Set vnet from the toepcb when processing TCP state transitions. - The kernel sets the vnet when calling the driver's output routine so t4_push_frames runs in proper vnet context already. One exception is when incoming credits trigger tx within the driver's ithread. Set the vnet explicitly in do_fw4_ack for that case. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_ddp.c stable/11/sys/dev/cxgbe/tom/t4_listen.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_connect.c Sat Jan 14 04:20:42 2017 (r312115) +++ stable/11/sys/dev/cxgbe/tom/t4_connect.c Sat Jan 14 04:24:49 2017 (r312116) @@ -107,7 +107,7 @@ free_atid(struct adapter *sc, int atid) } /* - * Active open failed. + * Active open succeeded. */ static int do_act_establish(struct sge_iq *iq, const struct rss_header *rss, @@ -126,9 +126,10 @@ do_act_establish(struct sge_iq *iq, cons CTR3(KTR_CXGBE, "%s: atid %u, tid %u", __func__, atid, tid); free_atid(sc, atid); + CURVNET_SET(toep->vnet); INP_WLOCK(inp); toep->tid = tid; - insert_tid(sc, tid, toep); + insert_tid(sc, tid, toep, inp->inp_vflag & INP_IPV6 ? 2 : 1); if (inp->inp_flags & INP_DROPPED) { /* socket closed by the kernel before hw told us it connected */ @@ -141,6 +142,7 @@ do_act_establish(struct sge_iq *iq, cons make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); done: INP_WUNLOCK(inp); + CURVNET_RESTORE(); return (0); } @@ -178,6 +180,7 @@ act_open_failure_cleanup(struct adapter free_atid(sc, atid); toep->tid = -1; + CURVNET_SET(toep->vnet); if (status != EAGAIN) INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); @@ -185,8 +188,12 @@ act_open_failure_cleanup(struct adapter final_cpl_received(toep); /* unlocks inp */ if (status != EAGAIN) INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); } +/* + * Active open failed. + */ static int do_act_open_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) @@ -357,6 +364,7 @@ t4_connect(struct toedev *tod, struct so if (wr == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); + toep->vnet = so->so_vnet; if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) set_tcpddp_ulp_mode(toep); else Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Jan 14 04:20:42 2017 (r312115) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Jan 14 04:24:49 2017 (r312116) @@ -306,7 +306,6 @@ make_established(struct toepcb *toep, ui uint16_t tcpopt = be16toh(opt); struct flowc_tx_params ftxp; - CURVNET_SET(so->so_vnet); INP_WLOCK_ASSERT(inp); KASSERT(tp->t_state == TCPS_SYN_SENT || tp->t_state == TCPS_SYN_RECEIVED, @@ -357,7 +356,6 @@ make_established(struct toepcb *toep, ui send_flowc_wr(toep, &ftxp); soisconnected(so); - CURVNET_RESTORE(); } static int @@ -1146,6 +1144,7 @@ do_peer_close(struct sge_iq *iq, const s KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1191,6 +1190,7 @@ do_peer_close(struct sge_iq *iq, const s tcp_twstart(tp); INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); INP_WLOCK(inp); final_cpl_received(toep); @@ -1203,6 +1203,7 @@ do_peer_close(struct sge_iq *iq, const s done: INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1229,6 +1230,7 @@ do_close_con_rpl(struct sge_iq *iq, cons KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1248,6 +1250,7 @@ do_close_con_rpl(struct sge_iq *iq, cons release: INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); INP_WLOCK(inp); final_cpl_received(toep); /* no more CPLs expected */ @@ -1272,6 +1275,7 @@ release: done: INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1345,6 +1349,7 @@ do_abort_req(struct sge_iq *iq, const st } inp = toep->inp; + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); /* for tcp_close */ INP_WLOCK(inp); @@ -1380,6 +1385,7 @@ do_abort_req(struct sge_iq *iq, const st final_cpl_received(toep); done: INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); send_abort_rpl(sc, ofld_txq, tid, CPL_ABORT_NO_RST); return (0); } @@ -1501,18 +1507,21 @@ do_rx_data(struct sge_iq *iq, const stru DDP_UNLOCK(toep); INP_WUNLOCK(inp); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } /* receive buffer autosize */ - CURVNET_SET(so->so_vnet); + MPASS(toep->vnet == so->so_vnet); + CURVNET_SET(toep->vnet); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && @@ -1713,10 +1722,12 @@ do_fw4_ack(struct sge_iq *iq, const stru tid); #endif toep->flags &= ~TPF_TX_SUSPENDED; + CURVNET_SET(toep->vnet); if (toep->ulp_mode == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, plen); else t4_push_frames(sc, toep, plen); + CURVNET_RESTORE(); } else if (plen > 0) { struct sockbuf *sb = &so->so_snd; int sbu; @@ -2143,7 +2154,7 @@ t4_aiotx_task(void *context, int pending struct socket *so = inp->inp_socket; struct kaiocb *job; - CURVNET_SET(so->so_vnet); + CURVNET_SET(toep->vnet); SOCKBUF_LOCK(&so->so_snd); while (!TAILQ_EMPTY(&toep->aiotx_jobq) && sowriteable(so)) { job = TAILQ_FIRST(&toep->aiotx_jobq); Modified: stable/11/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_ddp.c Sat Jan 14 04:20:42 2017 (r312115) +++ stable/11/sys/dev/cxgbe/tom/t4_ddp.c Sat Jan 14 04:24:49 2017 (r312116) @@ -546,7 +546,8 @@ handle_ddp_data(struct toepcb *toep, __b #endif /* receive buffer autosize */ - CURVNET_SET(so->so_vnet); + MPASS(toep->vnet == so->so_vnet); + CURVNET_SET(toep->vnet); SOCKBUF_LOCK(sb); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_listen.c Sat Jan 14 04:20:42 2017 (r312115) +++ stable/11/sys/dev/cxgbe/tom/t4_listen.c Sat Jan 14 04:24:49 2017 (r312116) @@ -222,6 +222,7 @@ alloc_lctx(struct adapter *sc, struct in TAILQ_INIT(&lctx->synq); lctx->inp = inp; + lctx->vnet = inp->inp_socket->so_vnet; in_pcbref(inp); return (lctx); @@ -824,14 +825,16 @@ done_with_synqe(struct adapter *sc, stru struct inpcb *inp = lctx->inp; struct vi_info *vi = synqe->syn->m_pkthdr.rcvif->if_softc; struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + int ntids; INP_WLOCK_ASSERT(inp); + ntids = inp->inp_vflag & INP_IPV6 ? 2 : 1; TAILQ_REMOVE(&lctx->synq, synqe, link); inp = release_lctx(sc, lctx); if (inp) INP_WUNLOCK(inp); - remove_tid(sc, synqe->tid); + remove_tid(sc, synqe->tid, ntids); release_tid(sc, synqe->tid, &sc->sge.ctrlq[vi->pi->port_id]); t4_l2t_release(e); release_synqe(synqe); /* removed from synq list */ @@ -1180,7 +1183,7 @@ do_pass_accept_req(struct sge_iq *iq, co struct l2t_entry *e = NULL; int rscale, mtu_idx, rx_credits, rxqid, ulp_mode; struct synq_entry *synqe = NULL; - int reject_reason, v; + int reject_reason, v, ntids; uint16_t vid; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); @@ -1198,6 +1201,8 @@ do_pass_accept_req(struct sge_iq *iq, co pi = sc->port[G_SYN_INTF(be16toh(cpl->l2info))]; + CURVNET_SET(lctx->vnet); + /* * Use the MAC index to lookup the associated VI. If this SYN * didn't match a perfect MAC filter, punt. @@ -1254,6 +1259,8 @@ found: */ if (!in6_ifhasaddr(ifp, &inc.inc6_laddr)) REJECT_PASS_ACCEPT(); + + ntids = 2; } else { /* Don't offload if the ifcap isn't enabled */ @@ -1266,8 +1273,17 @@ found: */ if (!in_ifhasaddr(ifp, inc.inc_laddr)) REJECT_PASS_ACCEPT(); + + ntids = 1; } + /* + * Don't offload if the ifnet that the SYN came in on is not in the same + * vnet as the listening socket. + */ + if (lctx->vnet != ifp->if_vnet) + REJECT_PASS_ACCEPT(); + e = get_l2te_for_nexthop(pi, ifp, &inc); if (e == NULL) REJECT_PASS_ACCEPT(); @@ -1307,7 +1323,6 @@ found: REJECT_PASS_ACCEPT(); } so = inp->inp_socket; - CURVNET_SET(so->so_vnet); mtu_idx = find_best_mtu_idx(sc, &inc, be16toh(cpl->tcpopt.mss)); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; @@ -1343,7 +1358,7 @@ found: synqe->rcv_bufsize = rx_credits; atomic_store_rel_ptr(&synqe->wr, (uintptr_t)wr); - insert_tid(sc, tid, synqe); + insert_tid(sc, tid, synqe, ntids); TAILQ_INSERT_TAIL(&lctx->synq, synqe, link); hold_synqe(synqe); /* hold for the duration it's in the synq */ hold_lctx(lctx); /* A synqe on the list has a ref on its lctx */ @@ -1354,7 +1369,6 @@ found: */ toe_syncache_add(&inc, &to, &th, inp, tod, synqe); INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */ - CURVNET_RESTORE(); /* * If we replied during syncache_add (synqe->wr has been consumed), @@ -1372,7 +1386,7 @@ found: if (m) m->m_pkthdr.rcvif = hw_ifp; - remove_tid(sc, synqe->tid); + remove_tid(sc, synqe->tid, ntids); free(wr, M_CXGBE); /* Yank the synqe out of the lctx synq. */ @@ -1409,10 +1423,12 @@ found: return (__LINE__); } INP_WUNLOCK(inp); + CURVNET_RESTORE(); release_synqe(synqe); /* extra hold */ return (0); reject: + CURVNET_RESTORE(); CTR4(KTR_CXGBE, "%s: stid %u, tid %u, REJECT (%d)", __func__, stid, tid, reject_reason); @@ -1484,6 +1500,7 @@ do_pass_establish(struct sge_iq *iq, con KASSERT(synqe->flags & TPF_SYNQE, ("%s: tid %u (ctx %p) not a synqe", __func__, tid, synqe)); + CURVNET_SET(lctx->vnet); INP_INFO_RLOCK(&V_tcbinfo); /* for syncache_expand */ INP_WLOCK(inp); @@ -1501,6 +1518,7 @@ do_pass_establish(struct sge_iq *iq, con INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1526,6 +1544,7 @@ reset: send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } toep->tid = tid; @@ -1562,6 +1581,8 @@ reset: /* New connection inpcb is already locked by syncache_expand(). */ new_inp = sotoinpcb(so); INP_WLOCK_ASSERT(new_inp); + MPASS(so->so_vnet == lctx->vnet); + toep->vnet = lctx->vnet; /* * This is for the unlikely case where the syncache entry that we added @@ -1585,6 +1606,7 @@ reset: if (inp != NULL) INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); release_synqe(synqe); return (0); Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Sat Jan 14 04:20:42 2017 (r312115) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Sat Jan 14 04:24:49 2017 (r312116) @@ -307,7 +307,7 @@ release_offload_resources(struct toepcb t4_l2t_release(toep->l2te); if (tid >= 0) { - remove_tid(sc, tid); + remove_tid(sc, tid, toep->ce ? 2 : 1); release_tid(sc, tid, toep->ctrlq); } @@ -420,12 +420,12 @@ final_cpl_received(struct toepcb *toep) } void -insert_tid(struct adapter *sc, int tid, void *ctx) +insert_tid(struct adapter *sc, int tid, void *ctx, int ntids) { struct tid_info *t = &sc->tids; t->tid_tab[tid] = ctx; - atomic_add_int(&t->tids_in_use, 1); + atomic_add_int(&t->tids_in_use, ntids); } void * @@ -445,12 +445,12 @@ update_tid(struct adapter *sc, int tid, } void -remove_tid(struct adapter *sc, int tid) +remove_tid(struct adapter *sc, int tid, int ntids) { struct tid_info *t = &sc->tids; t->tid_tab[tid] = NULL; - atomic_subtract_int(&t->tids_in_use, 1); + atomic_subtract_int(&t->tids_in_use, ntids); } void @@ -799,74 +799,96 @@ update_clip_table(struct adapter *sc, st struct in6_addr *lip, tlip; struct clip_head stale; struct clip_entry *ce, *ce_temp; - int rc, gen = atomic_load_acq_int(&in6_ifaddr_gen); + struct vi_info *vi; + int rc, gen, i, j; + uintptr_t last_vnet; ASSERT_SYNCHRONIZED_OP(sc); IN6_IFADDR_RLOCK(&in6_ifa_tracker); mtx_lock(&td->clip_table_lock); + gen = atomic_load_acq_int(&in6_ifaddr_gen); if (gen == td->clip_gen) goto done; TAILQ_INIT(&stale); TAILQ_CONCAT(&stale, &td->clip_table, link); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { - lip = &ia->ia_addr.sin6_addr; + /* + * last_vnet optimizes the common cases where all if_vnet = NULL (no + * VIMAGE) or all if_vnet = vnet0. + */ + last_vnet = (uintptr_t)(-1); + for_each_port(sc, i) + for_each_vi(sc->port[i], j, vi) { + if (last_vnet == (uintptr_t)vi->ifp->if_vnet) + continue; - KASSERT(!IN6_IS_ADDR_MULTICAST(lip), - ("%s: mcast address in in6_ifaddr list", __func__)); + /* XXX: races with if_vmove */ + CURVNET_SET(vi->ifp->if_vnet); + TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { + lip = &ia->ia_addr.sin6_addr; + + KASSERT(!IN6_IS_ADDR_MULTICAST(lip), + ("%s: mcast address in in6_ifaddr list", __func__)); + + if (IN6_IS_ADDR_LOOPBACK(lip)) + continue; + if (IN6_IS_SCOPE_EMBED(lip)) { + /* Remove the embedded scope */ + tlip = *lip; + lip = &tlip; + in6_clearscope(lip); + } + /* + * XXX: how to weed out the link local address for the + * loopback interface? It's fe80::1 usually (always?). + */ + + /* + * If it's in the main list then we already know it's + * not stale. + */ + TAILQ_FOREACH(ce, &td->clip_table, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) + goto next; + } - if (IN6_IS_ADDR_LOOPBACK(lip)) - continue; - if (IN6_IS_SCOPE_EMBED(lip)) { - /* Remove the embedded scope */ - tlip = *lip; - lip = &tlip; - in6_clearscope(lip); - } - /* - * XXX: how to weed out the link local address for the loopback - * interface? It's fe80::1 usually (always?). - */ - - /* - * If it's in the main list then we already know it's not stale. - */ - TAILQ_FOREACH(ce, &td->clip_table, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) - goto next; - } + /* + * If it's in the stale list we should move it to the + * main list. + */ + TAILQ_FOREACH(ce, &stale, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { + TAILQ_REMOVE(&stale, ce, link); + TAILQ_INSERT_TAIL(&td->clip_table, ce, + link); + goto next; + } + } - /* - * If it's in the stale list we should move it to the main list. - */ - TAILQ_FOREACH(ce, &stale, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { - TAILQ_REMOVE(&stale, ce, link); + /* A new IP6 address; add it to the CLIP table */ + ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); + memcpy(&ce->lip, lip, sizeof(ce->lip)); + ce->refcount = 0; + rc = add_lip(sc, lip); + if (rc == 0) TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - goto next; - } - } + else { + char ip[INET6_ADDRSTRLEN]; - /* A new IP6 address; add it to the CLIP table */ - ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); - memcpy(&ce->lip, lip, sizeof(ce->lip)); - ce->refcount = 0; - rc = add_lip(sc, lip); - if (rc == 0) - TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - else { - char ip[INET6_ADDRSTRLEN]; - - inet_ntop(AF_INET6, &ce->lip, &ip[0], sizeof(ip)); - log(LOG_ERR, "%s: could not add %s (%d)\n", - __func__, ip, rc); - free(ce, M_CXGBE); - } + inet_ntop(AF_INET6, &ce->lip, &ip[0], + sizeof(ip)); + log(LOG_ERR, "%s: could not add %s (%d)\n", + __func__, ip, rc); + free(ce, M_CXGBE); + } next: - continue; + continue; + } + CURVNET_RESTORE(); + last_vnet = (uintptr_t)vi->ifp->if_vnet; } /* Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.h Sat Jan 14 04:20:42 2017 (r312115) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.h Sat Jan 14 04:24:49 2017 (r312116) @@ -141,6 +141,7 @@ struct toepcb { int refcount; struct tom_data *td; struct inpcb *inp; /* backpointer to host stack's PCB */ + struct vnet *vnet; struct vi_info *vi; /* virtual interface */ struct sge_wrq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; @@ -232,6 +233,7 @@ struct listen_ctx { struct stid_region stid_region; int flags; struct inpcb *inp; /* listening socket's inp */ + struct vnet *vnet; struct sge_wrq *ctrlq; struct sge_ofld_rxq *ofld_rxq; struct clip_entry *ce; @@ -306,10 +308,10 @@ void free_toepcb(struct toepcb *); void offload_socket(struct socket *, struct toepcb *); void undo_offload_socket(struct socket *); void final_cpl_received(struct toepcb *); -void insert_tid(struct adapter *, int, void *); +void insert_tid(struct adapter *, int, void *, int); void *lookup_tid(struct adapter *, int); void update_tid(struct adapter *, int, void *); -void remove_tid(struct adapter *, int); +void remove_tid(struct adapter *, int, int); void release_tid(struct adapter *, int, struct sge_wrq *); int find_best_mtu_idx(struct adapter *, struct in_conninfo *, int); u_long select_rcv_wnd(struct socket *); From owner-svn-src-all@freebsd.org Sat Jan 14 04:34:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9758CAF976; Sat, 14 Jan 2017 04:34:31 +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 757A9119E; Sat, 14 Jan 2017 04:34:31 +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 v0E4YUbd055989; Sat, 14 Jan 2017 04:34:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E4YUIT055980; Sat, 14 Jan 2017 04:34:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701140434.v0E4YUIT055980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Jan 2017 04:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312117 - stable/10/sys/dev/cxgbe/tom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:34:31 -0000 Author: np Date: Sat Jan 14 04:34:30 2017 New Revision: 312117 URL: https://svnweb.freebsd.org/changeset/base/312117 Log: MFC r311569, r311657, and r311949. r311569: Fix comment in t4_tom. No functional change. r311657: cxgbe/t4_tom: Fix tid accounting. An offloaded IPv6 connection uses 2 tids, not 1, in the hardware. r311949: cxgbe/tom: Add VIMAGE support to the TOE driver. Active Open: - Save the socket's vnet at the time of the active open (t4_connect) and switch to it when processing the reply (do_act_open_rpl or do_act_establish). Passive Open: - Save the listening socket's vnet in the driver's listen_ctx and switch to it when processing incoming SYNs for the socket. - Reject SYNs that arrive on an ifnet that's not in the same vnet as the listening socket. CLIP (Compressed Local IPv6) table: - Add only those IPv6 addresses to the CLIP that are in a vnet associated with one of the card's ifnets. Misc: - Set vnet from the toepcb when processing TCP state transitions. - The kernel sets the vnet when calling the driver's output routine so t4_push_frames runs in proper vnet context already. One exception is when incoming credits trigger tx within the driver's ithread. Set the vnet explicitly in do_fw4_ack for that case. Sponsored by: Chelsio Communications Modified: stable/10/sys/dev/cxgbe/tom/t4_connect.c stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_ddp.c stable/10/sys/dev/cxgbe/tom/t4_listen.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_connect.c Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_connect.c Sat Jan 14 04:34:30 2017 (r312117) @@ -107,7 +107,7 @@ free_atid(struct adapter *sc, int atid) } /* - * Active open failed. + * Active open succeeded. */ static int do_act_establish(struct sge_iq *iq, const struct rss_header *rss, @@ -126,9 +126,10 @@ do_act_establish(struct sge_iq *iq, cons CTR3(KTR_CXGBE, "%s: atid %u, tid %u", __func__, atid, tid); free_atid(sc, atid); + CURVNET_SET(toep->vnet); INP_WLOCK(inp); toep->tid = tid; - insert_tid(sc, tid, toep); + insert_tid(sc, tid, toep, inp->inp_vflag & INP_IPV6 ? 2 : 1); if (inp->inp_flags & INP_DROPPED) { /* socket closed by the kernel before hw told us it connected */ @@ -141,6 +142,7 @@ do_act_establish(struct sge_iq *iq, cons make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); done: INP_WUNLOCK(inp); + CURVNET_RESTORE(); return (0); } @@ -178,6 +180,7 @@ act_open_failure_cleanup(struct adapter free_atid(sc, atid); toep->tid = -1; + CURVNET_SET(toep->vnet); if (status != EAGAIN) INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); @@ -185,8 +188,12 @@ act_open_failure_cleanup(struct adapter final_cpl_received(toep); /* unlocks inp */ if (status != EAGAIN) INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); } +/* + * Active open failed. + */ static int do_act_open_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) @@ -357,6 +364,7 @@ t4_connect(struct toedev *tod, struct so if (wr == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); + toep->vnet = so->so_vnet; if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) set_tcpddp_ulp_mode(toep); else Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Jan 14 04:34:30 2017 (r312117) @@ -302,7 +302,6 @@ make_established(struct toepcb *toep, ui uint16_t tcpopt = be16toh(opt); struct flowc_tx_params ftxp; - CURVNET_SET(so->so_vnet); INP_WLOCK_ASSERT(inp); KASSERT(tp->t_state == TCPS_SYN_SENT || tp->t_state == TCPS_SYN_RECEIVED, @@ -353,7 +352,6 @@ make_established(struct toepcb *toep, ui send_flowc_wr(toep, &ftxp); soisconnected(so); - CURVNET_RESTORE(); } static int @@ -1107,6 +1105,7 @@ do_peer_close(struct sge_iq *iq, const s KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1150,6 +1149,7 @@ do_peer_close(struct sge_iq *iq, const s tcp_twstart(tp); INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); INP_WLOCK(inp); final_cpl_received(toep); @@ -1162,6 +1162,7 @@ do_peer_close(struct sge_iq *iq, const s done: INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1188,6 +1189,7 @@ do_close_con_rpl(struct sge_iq *iq, cons KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1207,6 +1209,7 @@ do_close_con_rpl(struct sge_iq *iq, cons release: INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); INP_WLOCK(inp); final_cpl_received(toep); /* no more CPLs expected */ @@ -1231,6 +1234,7 @@ release: done: INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1304,6 +1308,7 @@ do_abort_req(struct sge_iq *iq, const st } inp = toep->inp; + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); /* for tcp_close */ INP_WLOCK(inp); @@ -1339,6 +1344,7 @@ do_abort_req(struct sge_iq *iq, const st final_cpl_received(toep); done: INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); send_abort_rpl(sc, ofld_txq, tid, CPL_ABORT_NO_RST); return (0); } @@ -1456,18 +1462,21 @@ do_rx_data(struct sge_iq *iq, const stru SOCKBUF_UNLOCK(sb); INP_WUNLOCK(inp); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } /* receive buffer autosize */ - CURVNET_SET(so->so_vnet); + MPASS(toep->vnet == so->so_vnet); + CURVNET_SET(toep->vnet); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && @@ -1674,10 +1683,12 @@ do_fw4_ack(struct sge_iq *iq, const stru if (toep->flags & TPF_TX_SUSPENDED && toep->tx_credits >= toep->tx_total / 4) { toep->flags &= ~TPF_TX_SUSPENDED; + CURVNET_SET(toep->vnet); if (toep->ulp_mode == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, plen); else t4_push_frames(sc, toep, plen); + CURVNET_RESTORE(); } else if (plen > 0) { struct sockbuf *sb = &so->so_snd; int sbu; Modified: stable/10/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_ddp.c Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_ddp.c Sat Jan 14 04:34:30 2017 (r312117) @@ -392,6 +392,9 @@ handle_ddp_data(struct toepcb *toep, __b discourage_ddp(toep); /* receive buffer autosize */ + MPASS(toep->vnet == so->so_vnet); + CURVNET_SET(toep->vnet); + SOCKBUF_LOCK(sb); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && @@ -405,6 +408,7 @@ handle_ddp_data(struct toepcb *toep, __b else toep->rx_credits += newsize - hiwat; } + CURVNET_RESTORE(); KASSERT(toep->sb_cc >= sb->sb_cc, ("%s: sb %p has more data (%d) than last time (%d).", Modified: stable/10/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_listen.c Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_listen.c Sat Jan 14 04:34:30 2017 (r312117) @@ -220,6 +220,7 @@ alloc_lctx(struct adapter *sc, struct in TAILQ_INIT(&lctx->synq); lctx->inp = inp; + lctx->vnet = inp->inp_socket->so_vnet; in_pcbref(inp); return (lctx); @@ -825,14 +826,16 @@ done_with_synqe(struct adapter *sc, stru struct inpcb *inp = lctx->inp; struct vi_info *vi = synqe->syn->m_pkthdr.rcvif->if_softc; struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + int ntids; INP_WLOCK_ASSERT(inp); + ntids = inp->inp_vflag & INP_IPV6 ? 2 : 1; TAILQ_REMOVE(&lctx->synq, synqe, link); inp = release_lctx(sc, lctx); if (inp) INP_WUNLOCK(inp); - remove_tid(sc, synqe->tid); + remove_tid(sc, synqe->tid, ntids); release_tid(sc, synqe->tid, &sc->sge.ctrlq[vi->pi->port_id]); t4_l2t_release(e); release_synqe(synqe); /* removed from synq list */ @@ -1235,7 +1238,7 @@ do_pass_accept_req(struct sge_iq *iq, co struct l2t_entry *e = NULL; int rscale, mtu_idx, rx_credits, rxqid, ulp_mode; struct synq_entry *synqe = NULL; - int reject_reason, v; + int reject_reason, v, ntids; uint16_t vid; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); @@ -1253,6 +1256,8 @@ do_pass_accept_req(struct sge_iq *iq, co pi = sc->port[G_SYN_INTF(be16toh(cpl->l2info))]; + CURVNET_SET(lctx->vnet); + /* * Use the MAC index to lookup the associated VI. If this SYN * didn't match a perfect MAC filter, punt. @@ -1309,6 +1314,8 @@ found: */ if (!ifnet_has_ip6(ifp, &inc.inc6_laddr)) REJECT_PASS_ACCEPT(); + + ntids = 2; } else { /* Don't offload if the ifcap isn't enabled */ @@ -1321,8 +1328,17 @@ found: */ if (!ifnet_has_ip(ifp, inc.inc_laddr)) REJECT_PASS_ACCEPT(); + + ntids = 1; } + /* + * Don't offload if the ifnet that the SYN came in on is not in the same + * vnet as the listening socket. + */ + if (lctx->vnet != ifp->if_vnet) + REJECT_PASS_ACCEPT(); + e = get_l2te_for_nexthop(pi, ifp, &inc); if (e == NULL) REJECT_PASS_ACCEPT(); @@ -1362,7 +1378,6 @@ found: REJECT_PASS_ACCEPT(); } so = inp->inp_socket; - CURVNET_SET(so->so_vnet); mtu_idx = find_best_mtu_idx(sc, &inc, be16toh(cpl->tcpopt.mss)); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; @@ -1398,7 +1413,7 @@ found: synqe->rcv_bufsize = rx_credits; atomic_store_rel_ptr(&synqe->wr, (uintptr_t)wr); - insert_tid(sc, tid, synqe); + insert_tid(sc, tid, synqe, ntids); TAILQ_INSERT_TAIL(&lctx->synq, synqe, link); hold_synqe(synqe); /* hold for the duration it's in the synq */ hold_lctx(lctx); /* A synqe on the list has a ref on its lctx */ @@ -1409,7 +1424,6 @@ found: */ toe_syncache_add(&inc, &to, &th, inp, tod, synqe); INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */ - CURVNET_RESTORE(); /* * If we replied during syncache_add (synqe->wr has been consumed), @@ -1427,7 +1441,7 @@ found: if (m) m->m_pkthdr.rcvif = hw_ifp; - remove_tid(sc, synqe->tid); + remove_tid(sc, synqe->tid, ntids); free(wr, M_CXGBE); /* Yank the synqe out of the lctx synq. */ @@ -1464,10 +1478,12 @@ found: return (__LINE__); } INP_WUNLOCK(inp); + CURVNET_RESTORE(); release_synqe(synqe); /* extra hold */ return (0); reject: + CURVNET_RESTORE(); CTR4(KTR_CXGBE, "%s: stid %u, tid %u, REJECT (%d)", __func__, stid, tid, reject_reason); @@ -1539,6 +1555,7 @@ do_pass_establish(struct sge_iq *iq, con KASSERT(synqe->flags & TPF_SYNQE, ("%s: tid %u (ctx %p) not a synqe", __func__, tid, synqe)); + CURVNET_SET(lctx->vnet); INP_INFO_RLOCK(&V_tcbinfo); /* for syncache_expand */ INP_WLOCK(inp); @@ -1556,6 +1573,7 @@ do_pass_establish(struct sge_iq *iq, con INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1581,6 +1599,7 @@ reset: send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } toep->tid = tid; @@ -1617,6 +1636,8 @@ reset: /* New connection inpcb is already locked by syncache_expand(). */ new_inp = sotoinpcb(so); INP_WLOCK_ASSERT(new_inp); + MPASS(so->so_vnet == lctx->vnet); + toep->vnet = lctx->vnet; /* * This is for the unlikely case where the syncache entry that we added @@ -1640,6 +1661,7 @@ reset: if (inp != NULL) INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); release_synqe(synqe); return (0); Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.c Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.c Sat Jan 14 04:34:30 2017 (r312117) @@ -321,7 +321,7 @@ release_offload_resources(struct toepcb t4_l2t_release(toep->l2te); if (tid >= 0) { - remove_tid(sc, tid); + remove_tid(sc, tid, toep->ce ? 2 : 1); release_tid(sc, tid, toep->ctrlq); } @@ -432,12 +432,12 @@ final_cpl_received(struct toepcb *toep) } void -insert_tid(struct adapter *sc, int tid, void *ctx) +insert_tid(struct adapter *sc, int tid, void *ctx, int ntids) { struct tid_info *t = &sc->tids; t->tid_tab[tid] = ctx; - atomic_add_int(&t->tids_in_use, 1); + atomic_add_int(&t->tids_in_use, ntids); } void * @@ -457,12 +457,12 @@ update_tid(struct adapter *sc, int tid, } void -remove_tid(struct adapter *sc, int tid) +remove_tid(struct adapter *sc, int tid, int ntids) { struct tid_info *t = &sc->tids; t->tid_tab[tid] = NULL; - atomic_subtract_int(&t->tids_in_use, 1); + atomic_subtract_int(&t->tids_in_use, ntids); } void @@ -811,74 +811,96 @@ update_clip_table(struct adapter *sc, st struct in6_addr *lip, tlip; struct clip_head stale; struct clip_entry *ce, *ce_temp; - int rc, gen = atomic_load_acq_int(&in6_ifaddr_gen); + struct vi_info *vi; + int rc, gen, i, j; + uintptr_t last_vnet; ASSERT_SYNCHRONIZED_OP(sc); IN6_IFADDR_RLOCK(); mtx_lock(&td->clip_table_lock); + gen = atomic_load_acq_int(&in6_ifaddr_gen); if (gen == td->clip_gen) goto done; TAILQ_INIT(&stale); TAILQ_CONCAT(&stale, &td->clip_table, link); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { - lip = &ia->ia_addr.sin6_addr; + /* + * last_vnet optimizes the common cases where all if_vnet = NULL (no + * VIMAGE) or all if_vnet = vnet0. + */ + last_vnet = (uintptr_t)(-1); + for_each_port(sc, i) + for_each_vi(sc->port[i], j, vi) { + if (last_vnet == (uintptr_t)vi->ifp->if_vnet) + continue; - KASSERT(!IN6_IS_ADDR_MULTICAST(lip), - ("%s: mcast address in in6_ifaddr list", __func__)); + /* XXX: races with if_vmove */ + CURVNET_SET(vi->ifp->if_vnet); + TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { + lip = &ia->ia_addr.sin6_addr; + + KASSERT(!IN6_IS_ADDR_MULTICAST(lip), + ("%s: mcast address in in6_ifaddr list", __func__)); + + if (IN6_IS_ADDR_LOOPBACK(lip)) + continue; + if (IN6_IS_SCOPE_EMBED(lip)) { + /* Remove the embedded scope */ + tlip = *lip; + lip = &tlip; + in6_clearscope(lip); + } + /* + * XXX: how to weed out the link local address for the + * loopback interface? It's fe80::1 usually (always?). + */ + + /* + * If it's in the main list then we already know it's + * not stale. + */ + TAILQ_FOREACH(ce, &td->clip_table, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) + goto next; + } - if (IN6_IS_ADDR_LOOPBACK(lip)) - continue; - if (IN6_IS_SCOPE_EMBED(lip)) { - /* Remove the embedded scope */ - tlip = *lip; - lip = &tlip; - in6_clearscope(lip); - } - /* - * XXX: how to weed out the link local address for the loopback - * interface? It's fe80::1 usually (always?). - */ - - /* - * If it's in the main list then we already know it's not stale. - */ - TAILQ_FOREACH(ce, &td->clip_table, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) - goto next; - } + /* + * If it's in the stale list we should move it to the + * main list. + */ + TAILQ_FOREACH(ce, &stale, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { + TAILQ_REMOVE(&stale, ce, link); + TAILQ_INSERT_TAIL(&td->clip_table, ce, + link); + goto next; + } + } - /* - * If it's in the stale list we should move it to the main list. - */ - TAILQ_FOREACH(ce, &stale, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { - TAILQ_REMOVE(&stale, ce, link); + /* A new IP6 address; add it to the CLIP table */ + ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); + memcpy(&ce->lip, lip, sizeof(ce->lip)); + ce->refcount = 0; + rc = add_lip(sc, lip); + if (rc == 0) TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - goto next; - } - } + else { + char ip[INET6_ADDRSTRLEN]; - /* A new IP6 address; add it to the CLIP table */ - ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); - memcpy(&ce->lip, lip, sizeof(ce->lip)); - ce->refcount = 0; - rc = add_lip(sc, lip); - if (rc == 0) - TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - else { - char ip[INET6_ADDRSTRLEN]; - - inet_ntop(AF_INET6, &ce->lip, &ip[0], sizeof(ip)); - log(LOG_ERR, "%s: could not add %s (%d)\n", - __func__, ip, rc); - free(ce, M_CXGBE); - } + inet_ntop(AF_INET6, &ce->lip, &ip[0], + sizeof(ip)); + log(LOG_ERR, "%s: could not add %s (%d)\n", + __func__, ip, rc); + free(ce, M_CXGBE); + } next: - continue; + continue; + } + CURVNET_RESTORE(); + last_vnet = (uintptr_t)vi->ifp->if_vnet; } /* Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.h Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.h Sat Jan 14 04:34:30 2017 (r312117) @@ -123,6 +123,7 @@ struct toepcb { u_int flags; /* miscellaneous flags */ struct tom_data *td; struct inpcb *inp; /* backpointer to host stack's PCB */ + struct vnet *vnet; struct vi_info *vi; /* virtual interface */ struct sge_wrq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; @@ -199,6 +200,7 @@ struct listen_ctx { struct stid_region stid_region; int flags; struct inpcb *inp; /* listening socket's inp */ + struct vnet *vnet; struct sge_wrq *ctrlq; struct sge_ofld_rxq *ofld_rxq; struct clip_entry *ce; @@ -278,10 +280,10 @@ void free_toepcb(struct toepcb *); void offload_socket(struct socket *, struct toepcb *); void undo_offload_socket(struct socket *); void final_cpl_received(struct toepcb *); -void insert_tid(struct adapter *, int, void *); +void insert_tid(struct adapter *, int, void *, int); void *lookup_tid(struct adapter *, int); void update_tid(struct adapter *, int, void *); -void remove_tid(struct adapter *, int); +void remove_tid(struct adapter *, int, int); void release_tid(struct adapter *, int, struct sge_wrq *); int find_best_mtu_idx(struct adapter *, struct in_conninfo *, int); u_long select_rcv_wnd(struct socket *); From owner-svn-src-all@freebsd.org Sat Jan 14 05:02:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D46BCAF2EC; Sat, 14 Jan 2017 05:02:54 +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 46BA213E5; Sat, 14 Jan 2017 05:02:54 +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 v0E52r4f068114; Sat, 14 Jan 2017 05:02:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E52rED068113; Sat, 14 Jan 2017 05:02:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140502.v0E52rED068113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 05:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312118 - head/tests/sys/kern/execve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 05:02:54 -0000 Author: ngie Date: Sat Jan 14 05:02:53 2017 New Revision: 312118 URL: https://svnweb.freebsd.org/changeset/base/312118 Log: Fix -Wformat issue with zero-length format string passed to err(3) MFC after: 3 days Tested with: clang, gcc 4.2.1, gcc 4.9 Sponsored by: Dell EMC Isilon Modified: head/tests/sys/kern/execve/execve_helper.c Modified: head/tests/sys/kern/execve/execve_helper.c ============================================================================== --- head/tests/sys/kern/execve/execve_helper.c Sat Jan 14 04:34:30 2017 (r312117) +++ head/tests/sys/kern/execve/execve_helper.c Sat Jan 14 05:02:53 2017 (r312118) @@ -50,5 +50,5 @@ main(int argc, char **argv) } execve(argv[1], &argv[1], NULL); - err(1, ""); + err(1, "%s", ""); } From owner-svn-src-all@freebsd.org Sat Jan 14 05:06:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7931FCAF373; Sat, 14 Jan 2017 05:06:15 +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 537031625; Sat, 14 Jan 2017 05:06: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 v0E56Ef8068276; Sat, 14 Jan 2017 05:06:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E56EHT068275; Sat, 14 Jan 2017 05:06:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140506.v0E56EHT068275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 05:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312119 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 05:06:15 -0000 Author: ngie Date: Sat Jan 14 05:06:14 2017 New Revision: 312119 URL: https://svnweb.freebsd.org/changeset/base/312119 Log: encode_long, encode_timeval: mechanically replace `exp` with `exponent` This helps fix a -Wshadow issue with exp(3) with tests/sys/acct/acct_test, which include math.h, which in turn defines exp(3) MFC after: 2 weeks Tested with: clang, gcc 4.2.1, gcc 4.9 Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_acct.c Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Sat Jan 14 05:02:53 2017 (r312118) +++ head/sys/kern/kern_acct.c Sat Jan 14 05:06:14 2017 (r312119) @@ -469,8 +469,8 @@ static uint32_t encode_timeval(struct timeval tv) { int log2_s; - int val, exp; /* Unnormalized value and exponent */ - int norm_exp; /* Normalized exponent */ + int val, exponent; /* Unnormalized value and exponent */ + int norm_exponent; /* Normalized exponent */ int shift; /* @@ -481,7 +481,7 @@ encode_timeval(struct timeval tv) if (tv.tv_sec == 0) { if (tv.tv_usec == 0) return (0); - exp = 0; + exponent = 0; val = tv.tv_usec; } else { /* @@ -490,24 +490,24 @@ encode_timeval(struct timeval tv) */ log2_s = fls(tv.tv_sec) - 1; if (log2_s + LOG2_1M < CALC_BITS) { - exp = 0; + exponent = 0; val = 1000000 * tv.tv_sec + tv.tv_usec; } else { - exp = log2_s + LOG2_1M - CALC_BITS; + exponent = log2_s + LOG2_1M - CALC_BITS; val = (unsigned int)(((uint64_t)1000000 * tv.tv_sec + - tv.tv_usec) >> exp); + tv.tv_usec) >> exponent); } } /* Now normalize and pack the value into an IEEE-754 float. */ - norm_exp = fls(val) - 1; - shift = FLT_MANT_DIG - norm_exp - 1; + norm_exponent = fls(val) - 1; + shift = FLT_MANT_DIG - norm_exponent - 1; #ifdef ACCT_DEBUG printf("val=%d exp=%d shift=%d log2(val)=%d\n", - val, exp, shift, norm_exp); - printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exp, + val, exponent, shift, norm_exponent); + printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exponent + norm_exponent, ((shift > 0 ? (val << shift) : (val >> -shift)) & MANT_MASK)); #endif - return (((FLT_MAX_EXP - 1 + exp + norm_exp) << (FLT_MANT_DIG - 1)) | + return (((FLT_MAX_EXP - 1 + exponent + norm_exponent) << (FLT_MANT_DIG - 1)) | ((shift > 0 ? val << shift : val >> -shift) & MANT_MASK)); } @@ -518,7 +518,7 @@ encode_timeval(struct timeval tv) static uint32_t encode_long(long val) { - int norm_exp; /* Normalized exponent */ + int norm_exponent; /* Normalized exponent */ int shift; if (val == 0) @@ -529,15 +529,15 @@ encode_long(long val) val); val = LONG_MAX; } - norm_exp = fls(val) - 1; - shift = FLT_MANT_DIG - norm_exp - 1; + norm_exponent = fls(val) - 1; + shift = FLT_MANT_DIG - norm_exponent - 1; #ifdef ACCT_DEBUG printf("val=%d shift=%d log2(val)=%d\n", - val, shift, norm_exp); - printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exp, + val, shift, norm_exponent); + printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exponent, ((shift > 0 ? (val << shift) : (val >> -shift)) & MANT_MASK)); #endif - return (((FLT_MAX_EXP - 1 + norm_exp) << (FLT_MANT_DIG - 1)) | + return (((FLT_MAX_EXP - 1 + norm_exponent) << (FLT_MANT_DIG - 1)) | ((shift > 0 ? val << shift : val >> -shift) & MANT_MASK)); } From owner-svn-src-all@freebsd.org Sat Jan 14 05:18:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCEA2CAF6AC; Sat, 14 Jan 2017 05:18:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9574B1C95; Sat, 14 Jan 2017 05:18:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E5IIBv072226; Sat, 14 Jan 2017 05:18:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E5IIj6072225; Sat, 14 Jan 2017 05:18:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140518.v0E5IIj6072225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 05:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312120 - head/tests/sys/mac/bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 05:18:19 -0000 Author: ngie Date: Sat Jan 14 05:18:18 2017 New Revision: 312120 URL: https://svnweb.freebsd.org/changeset/base/312120 Log: Fix warnings - Staticize test_num - Promote i to size_t to deal with -Wsign-compare issues Tested with: clang, gcc, gcc49 MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/tests/sys/mac/bsdextended/ugidfw_test.c Modified: head/tests/sys/mac/bsdextended/ugidfw_test.c ============================================================================== --- head/tests/sys/mac/bsdextended/ugidfw_test.c Sat Jan 14 05:06:14 2017 (r312119) +++ head/tests/sys/mac/bsdextended/ugidfw_test.c Sat Jan 14 05:18:18 2017 (r312120) @@ -71,7 +71,7 @@ static const char *test_groups[] = { "bin", }; -int test_num; +static int test_num; /* * List of test strings that must go in (and come out) of libugidfw intact. @@ -149,7 +149,8 @@ test_libugidfw_strings(void) struct mac_bsdextended_rule rule; char errorstr[256]; char rulestr[256]; - int error, i; + size_t i; + int error; for (i = 0; i < nitems(test_users); i++, test_num++) { if (getpwnam(test_users[i]) == NULL) @@ -171,7 +172,7 @@ test_libugidfw_strings(void) error = bsde_parse_rule_string(test_strings[i], &rule, sizeof(errorstr), errorstr); if (error == -1) - printf("not ok %d # bsde_parse_rule_string: '%s' (%d) " + printf("not ok %d # bsde_parse_rule_string: '%s' (%zu) " "failed: %s\n", test_num, test_strings[i], i, errorstr); else printf("ok %d\n", test_num); From owner-svn-src-all@freebsd.org Sat Jan 14 05:24:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25E09CAF853; Sat, 14 Jan 2017 05:24:37 +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 DE05810AB; Sat, 14 Jan 2017 05:24:36 +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 v0E5Oa8i076170; Sat, 14 Jan 2017 05:24:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E5Oass076169; Sat, 14 Jan 2017 05:24:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140524.v0E5Oass076169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 05:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312121 - head/tests/sys/kern/execve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 05:24:37 -0000 Author: ngie Date: Sat Jan 14 05:24:35 2017 New Revision: 312121 URL: https://svnweb.freebsd.org/changeset/base/312121 Log: Follow up to r312118 State that execve failed instead of just printing out the program name and strerror(errno) via err(3). MFC after: 3 days X-MFC with: r312118 Sponsored by: Dell EMC Isilon Modified: head/tests/sys/kern/execve/execve_helper.c Modified: head/tests/sys/kern/execve/execve_helper.c ============================================================================== --- head/tests/sys/kern/execve/execve_helper.c Sat Jan 14 05:18:18 2017 (r312120) +++ head/tests/sys/kern/execve/execve_helper.c Sat Jan 14 05:24:35 2017 (r312121) @@ -50,5 +50,5 @@ main(int argc, char **argv) } execve(argv[1], &argv[1], NULL); - err(1, "%s", ""); + err(1, "execve failed"); } From owner-svn-src-all@freebsd.org Sat Jan 14 06:16:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20FB5CAF48A; Sat, 14 Jan 2017 06:16:59 +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 C49661749; Sat, 14 Jan 2017 06:16:58 +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 v0E6GwPH096108; Sat, 14 Jan 2017 06:16:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E6Gw4C096107; Sat, 14 Jan 2017 06:16:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140616.v0E6Gw4C096107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 06:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312122 - head/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 06:16:59 -0000 Author: ngie Date: Sat Jan 14 06:16:57 2017 New Revision: 312122 URL: https://svnweb.freebsd.org/changeset/base/312122 Log: Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind This should have been pruned in r305358 MFC after: 3 days Sponsored by: Dell EMC Isilon Deleted: head/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/ From owner-svn-src-all@freebsd.org Sat Jan 14 06:18:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5FBECAF517; Sat, 14 Jan 2017 06:18:55 +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 9DAA81906; Sat, 14 Jan 2017 06:18: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 v0E6IsuX096225; Sat, 14 Jan 2017 06:18:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E6Isj3096222; Sat, 14 Jan 2017 06:18:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140618.v0E6Isj3096222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 06:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312123 - in vendor/NetBSD/tests/dist: dev/clock_subr kernel kernel/arch kernel/arch/amd64 kernel/arch/i386 lib/libc/gen/exect lib/libpthread_dbg lib/librefuse net/if_tun net/if_vlan sy... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 06:18:56 -0000 Author: ngie Date: Sat Jan 14 06:18:54 2017 New Revision: 312123 URL: https://svnweb.freebsd.org/changeset/base/312123 Log: Add additional tests missed in previous merges Reminder: use cvs up -APd to pull new directories Added: vendor/NetBSD/tests/dist/dev/clock_subr/ vendor/NetBSD/tests/dist/dev/clock_subr/clock_subr_test_data_gen.sh (contents, props changed) vendor/NetBSD/tests/dist/dev/clock_subr/t_clock_subr.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/ vendor/NetBSD/tests/dist/kernel/arch/amd64/ vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_wait.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_wait3.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_wait4.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_wait6.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_waitid.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_waitpid.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/i386/ vendor/NetBSD/tests/dist/kernel/arch/i386/t_ptrace_wait.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/i386/t_ptrace_wait3.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/i386/t_ptrace_wait4.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/i386/t_ptrace_wait6.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/i386/t_ptrace_waitid.c (contents, props changed) vendor/NetBSD/tests/dist/kernel/arch/i386/t_ptrace_waitpid.c (contents, props changed) vendor/NetBSD/tests/dist/lib/libc/gen/exect/ vendor/NetBSD/tests/dist/lib/libc/gen/exect/t_exect.c (contents, props changed) vendor/NetBSD/tests/dist/lib/libpthread_dbg/ vendor/NetBSD/tests/dist/lib/libpthread_dbg/h_common.h (contents, props changed) vendor/NetBSD/tests/dist/lib/libpthread_dbg/t_dummy.c (contents, props changed) vendor/NetBSD/tests/dist/lib/libpthread_dbg/t_threads.c (contents, props changed) vendor/NetBSD/tests/dist/lib/librefuse/ vendor/NetBSD/tests/dist/lib/librefuse/t_refuse_opt.c (contents, props changed) vendor/NetBSD/tests/dist/net/if_tun/ vendor/NetBSD/tests/dist/net/if_tun/t_tun.sh (contents, props changed) vendor/NetBSD/tests/dist/net/if_vlan/ vendor/NetBSD/tests/dist/net/if_vlan/t_vlan.sh (contents, props changed) vendor/NetBSD/tests/dist/sys/uvm/ vendor/NetBSD/tests/dist/sys/uvm/t_uvm_physseg.c (contents, props changed) vendor/NetBSD/tests/dist/sys/uvm/t_uvm_physseg_load.c (contents, props changed) vendor/NetBSD/tests/dist/usr.bin/mixerctl/ vendor/NetBSD/tests/dist/usr.bin/mixerctl/t_mixerctl.sh (contents, props changed) vendor/NetBSD/tests/dist/usr.bin/uniq/ vendor/NetBSD/tests/dist/usr.bin/uniq/d_basic.in (contents, props changed) vendor/NetBSD/tests/dist/usr.bin/uniq/d_basic.out vendor/NetBSD/tests/dist/usr.bin/uniq/d_counts.out vendor/NetBSD/tests/dist/usr.bin/uniq/d_input.in (contents, props changed) vendor/NetBSD/tests/dist/usr.bin/uniq/d_show_duplicates.out vendor/NetBSD/tests/dist/usr.bin/uniq/d_show_uniques.out vendor/NetBSD/tests/dist/usr.bin/uniq/t_uniq.sh (contents, props changed) Modified: vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.c Added: vendor/NetBSD/tests/dist/dev/clock_subr/clock_subr_test_data_gen.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/tests/dist/dev/clock_subr/clock_subr_test_data_gen.sh Sat Jan 14 06:18:54 2017 (r312123) @@ -0,0 +1,25 @@ +#!/bin/ksh + +export TZ=Etc/Universal + +datesub() { + gdate "$@" '+ FILL(%_11s,%_4Y,%_m,%_d,%w,%_H,%_M,%_S), // %a %b %e %H:%M:%S %Z %Y' +} + +( + datesub -d '1970/01/01 00:00:00' + datesub -d '1981/04/12 12:00:03' + datesub -d '2011/07/21 09:57:00' + datesub -d @2147483647 + datesub -d @2147483648 + datesub -d '2063/04/05 00:00:00' + for year in `seq 1970 1 2030`; do + datesub -d "${year}/01/01 00:00:00" + datesub -d "${year}/07/01 00:00:00" + done + for year in `seq 2000 25 2600`; do + datesub -d "$((${year} - 1))/12/31 23:59:59" + datesub -d "$((${year} + 0))/01/01 00:00:00" + datesub -d "$((${year} + 1))/01/01 00:00:00" + done +)|sort -u Added: vendor/NetBSD/tests/dist/dev/clock_subr/t_clock_subr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/tests/dist/dev/clock_subr/t_clock_subr.c Sat Jan 14 06:18:54 2017 (r312123) @@ -0,0 +1,309 @@ +/* $NetBSD: t_clock_subr.c,v 1.3 2017/01/13 21:30:39 christos Exp $ */ + +/* + * Copyright (c) 2016 Jonathan A. Kollasch + * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 +__COPYRIGHT("@(#) Copyright (c) 2016\ + Jonathan A. Kollasch. All rights reserved."); +__RCSID("$NetBSD: t_clock_subr.c,v 1.3 2017/01/13 21:30:39 christos Exp $"); + +#include +#include + +#include +#include +#include + +#include + +#include "h_macros.h" + +#define FILL(ti,ye,mo,da,wd,ho,mi,se) \ +{ .time = (ti), .clock = { .dt_year = (ye), .dt_mon = (mo), .dt_day = (da), \ + .dt_wday = (wd), .dt_hour = (ho), .dt_min = (mi), .dt_sec = (se), } } + +static struct clock_test { + time_t time; + struct clock_ymdhms clock; +} const clock_tests[] = { + FILL( 0,1970, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 1970 + FILL( 15638400,1970, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 1970 + FILL( 31536000,1971, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 1971 + FILL( 47174400,1971, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 1971 + FILL( 63072000,1972, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 1972 + FILL( 78796800,1972, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 1972 + FILL( 94694400,1973, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 1973 + FILL( 110332800,1973, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 1973 + FILL( 126230400,1974, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 1974 + FILL( 141868800,1974, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 1974 + FILL( 157766400,1975, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 1975 + FILL( 173404800,1975, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 1975 + FILL( 189302400,1976, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 1976 + FILL( 205027200,1976, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 1976 + FILL( 220924800,1977, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 1977 + FILL( 236563200,1977, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 1977 + FILL( 252460800,1978, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 1978 + FILL( 268099200,1978, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 1978 + FILL( 283996800,1979, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 1979 + FILL( 299635200,1979, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 1979 + FILL( 315532800,1980, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 1980 + FILL( 331257600,1980, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 1980 + FILL( 347155200,1981, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 1981 + FILL( 355924803,1981, 4,12,0,12, 0, 3), // Sun Apr 12 12:00:03 UTC 1981 + FILL( 362793600,1981, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 1981 + FILL( 378691200,1982, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 1982 + FILL( 394329600,1982, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 1982 + FILL( 410227200,1983, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 1983 + FILL( 425865600,1983, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 1983 + FILL( 441763200,1984, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 1984 + FILL( 457488000,1984, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 1984 + FILL( 473385600,1985, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 1985 + FILL( 489024000,1985, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 1985 + FILL( 504921600,1986, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 1986 + FILL( 520560000,1986, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 1986 + FILL( 536457600,1987, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 1987 + FILL( 552096000,1987, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 1987 + FILL( 567993600,1988, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 1988 + FILL( 583718400,1988, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 1988 + FILL( 599616000,1989, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 1989 + FILL( 615254400,1989, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 1989 + FILL( 631152000,1990, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 1990 + FILL( 646790400,1990, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 1990 + FILL( 662688000,1991, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 1991 + FILL( 678326400,1991, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 1991 + FILL( 694224000,1992, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 1992 + FILL( 709948800,1992, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 1992 + FILL( 725846400,1993, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 1993 + FILL( 741484800,1993, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 1993 + FILL( 757382400,1994, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 1994 + FILL( 773020800,1994, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 1994 + FILL( 788918400,1995, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 1995 + FILL( 804556800,1995, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 1995 + FILL( 820454400,1996, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 1996 + FILL( 836179200,1996, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 1996 + FILL( 852076800,1997, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 1997 + FILL( 867715200,1997, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 1997 + FILL( 883612800,1998, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 1998 + FILL( 899251200,1998, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 1998 + FILL( 915148800,1999, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 1999 + FILL( 930787200,1999, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 1999 + FILL( 946684799,1999,12,31,5,23,59,59), // Fri Dec 31 23:59:59 UTC 1999 + FILL( 946684800,2000, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2000 + FILL( 962409600,2000, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 2000 + FILL( 978307200,2001, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2001 + FILL( 993945600,2001, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 2001 + FILL( 1009843200,2002, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2002 + FILL( 1025481600,2002, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 2002 + FILL( 1041379200,2003, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2003 + FILL( 1057017600,2003, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 2003 + FILL( 1072915200,2004, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2004 + FILL( 1088640000,2004, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 2004 + FILL( 1104537600,2005, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2005 + FILL( 1120176000,2005, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 2005 + FILL( 1136073600,2006, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2006 + FILL( 1151712000,2006, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 2006 + FILL( 1167609600,2007, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2007 + FILL( 1183248000,2007, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 2007 + FILL( 1199145600,2008, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2008 + FILL( 1214870400,2008, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 2008 + FILL( 1230768000,2009, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2009 + FILL( 1246406400,2009, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 2009 + FILL( 1262304000,2010, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2010 + FILL( 1277942400,2010, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 2010 + FILL( 1293840000,2011, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2011 + FILL( 1309478400,2011, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 2011 + FILL( 1311242220,2011, 7,21,4, 9,57, 0), // Thu Jul 21 09:57:00 UTC 2011 + FILL( 1325376000,2012, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2012 + FILL( 1341100800,2012, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 2012 + FILL( 1356998400,2013, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2013 + FILL( 1372636800,2013, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 2013 + FILL( 1388534400,2014, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2014 + FILL( 1404172800,2014, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 2014 + FILL( 1420070400,2015, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2015 + FILL( 1435708800,2015, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 2015 + FILL( 1451606400,2016, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2016 + FILL( 1467331200,2016, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 2016 + FILL( 1483228800,2017, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2017 + FILL( 1498867200,2017, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 2017 + FILL( 1514764800,2018, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2018 + FILL( 1530403200,2018, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 2018 + FILL( 1546300800,2019, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2019 + FILL( 1561939200,2019, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 2019 + FILL( 1577836800,2020, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2020 + FILL( 1593561600,2020, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 2020 + FILL( 1609459200,2021, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2021 + FILL( 1625097600,2021, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 2021 + FILL( 1640995200,2022, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2022 + FILL( 1656633600,2022, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 2022 + FILL( 1672531200,2023, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2023 + FILL( 1688169600,2023, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 2023 + FILL( 1704067200,2024, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2024 + FILL( 1719792000,2024, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 2024 + FILL( 1735689599,2024,12,31,2,23,59,59), // Tue Dec 31 23:59:59 UTC 2024 + FILL( 1735689600,2025, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2025 + FILL( 1751328000,2025, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 2025 + FILL( 1767225600,2026, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2026 + FILL( 1782864000,2026, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 2026 + FILL( 1798761600,2027, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2027 + FILL( 1814400000,2027, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 2027 + FILL( 1830297600,2028, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2028 + FILL( 1846022400,2028, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 2028 + FILL( 1861920000,2029, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2029 + FILL( 1877558400,2029, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 2029 + FILL( 1893456000,2030, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2030 + FILL( 1909094400,2030, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 2030 + FILL( 2147483647,2038, 1,19,2, 3,14, 7), // Tue Jan 19 03:14:07 UTC 2038 + FILL( 2147483648,2038, 1,19,2, 3,14, 8), // Tue Jan 19 03:14:08 UTC 2038 + FILL( 2524607999,2049,12,31,5,23,59,59), // Fri Dec 31 23:59:59 UTC 2049 + FILL( 2524608000,2050, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2050 + FILL( 2556144000,2051, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2051 + FILL( 2942956800,2063, 4, 5,4, 0, 0, 0), // Thu Apr 5 00:00:00 UTC 2063 + FILL( 3313526399,2074,12,31,1,23,59,59), // Mon Dec 31 23:59:59 UTC 2074 + FILL( 3313526400,2075, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2075 + FILL( 3345062400,2076, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2076 + FILL( 4102444799,2099,12,31,4,23,59,59), // Thu Dec 31 23:59:59 UTC 2099 + FILL( 4102444800,2100, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2100 + FILL( 4133980800,2101, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2101 + FILL( 4891363199,2124,12,31,0,23,59,59), // Sun Dec 31 23:59:59 UTC 2124 + FILL( 4891363200,2125, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2125 + FILL( 4922899200,2126, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2126 + FILL( 5680281599,2149,12,31,3,23,59,59), // Wed Dec 31 23:59:59 UTC 2149 + FILL( 5680281600,2150, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2150 + FILL( 5711817600,2151, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2151 + FILL( 6469199999,2174,12,31,6,23,59,59), // Sat Dec 31 23:59:59 UTC 2174 + FILL( 6469200000,2175, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2175 + FILL( 6500736000,2176, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2176 + FILL( 7258118399,2199,12,31,2,23,59,59), // Tue Dec 31 23:59:59 UTC 2199 + FILL( 7258118400,2200, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2200 + FILL( 7289654400,2201, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2201 + FILL( 8047036799,2224,12,31,5,23,59,59), // Fri Dec 31 23:59:59 UTC 2224 + FILL( 8047036800,2225, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2225 + FILL( 8078572800,2226, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2226 + FILL( 8835955199,2249,12,31,1,23,59,59), // Mon Dec 31 23:59:59 UTC 2249 + FILL( 8835955200,2250, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2250 + FILL( 8867491200,2251, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2251 + FILL( 9624873599,2274,12,31,4,23,59,59), // Thu Dec 31 23:59:59 UTC 2274 + FILL( 9624873600,2275, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2275 + FILL( 9656409600,2276, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2276 + FILL(10413791999,2299,12,31,0,23,59,59), // Sun Dec 31 23:59:59 UTC 2299 + FILL(10413792000,2300, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2300 + FILL(10445328000,2301, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2301 + FILL(11202710399,2324,12,31,3,23,59,59), // Wed Dec 31 23:59:59 UTC 2324 + FILL(11202710400,2325, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2325 + FILL(11234246400,2326, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2326 + FILL(11991628799,2349,12,31,6,23,59,59), // Sat Dec 31 23:59:59 UTC 2349 + FILL(11991628800,2350, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2350 + FILL(12023164800,2351, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2351 + FILL(12780547199,2374,12,31,2,23,59,59), // Tue Dec 31 23:59:59 UTC 2374 + FILL(12780547200,2375, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2375 + FILL(12812083200,2376, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2376 + FILL(13569465599,2399,12,31,5,23,59,59), // Fri Dec 31 23:59:59 UTC 2399 + FILL(13569465600,2400, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2400 + FILL(13601088000,2401, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2401 + FILL(14358470399,2424,12,31,2,23,59,59), // Tue Dec 31 23:59:59 UTC 2424 + FILL(14358470400,2425, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2425 + FILL(14390006400,2426, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2426 + FILL(15147388799,2449,12,31,5,23,59,59), // Fri Dec 31 23:59:59 UTC 2449 + FILL(15147388800,2450, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2450 + FILL(15178924800,2451, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2451 + FILL(15936307199,2474,12,31,1,23,59,59), // Mon Dec 31 23:59:59 UTC 2474 + FILL(15936307200,2475, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2475 + FILL(15967843200,2476, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2476 + FILL(16725225599,2499,12,31,4,23,59,59), // Thu Dec 31 23:59:59 UTC 2499 + FILL(16725225600,2500, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2500 + FILL(16756761600,2501, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2501 + FILL(17514143999,2524,12,31,0,23,59,59), // Sun Dec 31 23:59:59 UTC 2524 + FILL(17514144000,2525, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2525 + FILL(17545680000,2526, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2526 + FILL(18303062399,2549,12,31,3,23,59,59), // Wed Dec 31 23:59:59 UTC 2549 + FILL(18303062400,2550, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2550 + FILL(18334598400,2551, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2551 + FILL(19091980799,2574,12,31,6,23,59,59), // Sat Dec 31 23:59:59 UTC 2574 + FILL(19091980800,2575, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2575 + FILL(19123516800,2576, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2576 + FILL(19880899199,2599,12,31,2,23,59,59), // Tue Dec 31 23:59:59 UTC 2599 + FILL(19880899200,2600, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2600 + FILL(19912435200,2601, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2601 +}; +#undef FILL + +ATF_TC(ymdhms_to_secs); +ATF_TC_HEAD(ymdhms_to_secs, tc) +{ + + atf_tc_set_md_var(tc, "descr", "check clock_ymdhms_to_secs"); +} +ATF_TC_BODY(ymdhms_to_secs, tc) +{ + time_t secs; + size_t i; + + for (i = 0; i < __arraycount(clock_tests); i++) { + secs = clock_ymdhms_to_secs(__UNCONST(&clock_tests[i].clock)); + ATF_CHECK_EQ_MSG(clock_tests[i].time, secs, "%jd != %jd", + (intmax_t)clock_tests[i].time, (intmax_t)secs); + } +} + +ATF_TC(secs_to_ymdhms); +ATF_TC_HEAD(secs_to_ymdhms, tc) +{ + + atf_tc_set_md_var(tc, "descr", "check clock_secs_to_ymdhms"); +} +ATF_TC_BODY(secs_to_ymdhms, tc) +{ + struct clock_ymdhms ymdhms; + size_t i; + +#define CHECK_FIELD(f) \ + ATF_CHECK_EQ_MSG(ymdhms.dt_##f, clock_tests[i].clock.dt_##f, \ + "%jd != %jd for %jd", (intmax_t)ymdhms.dt_##f, \ + (intmax_t)clock_tests[i].clock.dt_##f, \ + (intmax_t)clock_tests[i].time) + + for (i = 0; i < __arraycount(clock_tests); i++) { + clock_secs_to_ymdhms(clock_tests[i].time, &ymdhms); + CHECK_FIELD(year); + CHECK_FIELD(mon); + CHECK_FIELD(day); + CHECK_FIELD(wday); + CHECK_FIELD(hour); + CHECK_FIELD(min); + CHECK_FIELD(sec); + } +#undef CHECK_FIELD +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, ymdhms_to_secs); + ATF_TP_ADD_TC(tp, secs_to_ymdhms); + + return atf_no_error(); +} Added: vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_wait.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_wait.c Sat Jan 14 06:18:54 2017 (r312123) @@ -0,0 +1,1388 @@ +/* $NetBSD: t_ptrace_wait.c,v 1.9 2017/01/13 21:30:41 christos Exp $ */ + +/*- + * Copyright (c) 2016 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.9 2017/01/13 21:30:41 christos Exp $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "h_macros.h" + +#include "../../t_ptrace_wait.h" + + +#if defined(HAVE_GPREGS) +ATF_TC(regs1); +ATF_TC_HEAD(regs1, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Call PT_GETREGS and iterate over General Purpose registers"); +} + +ATF_TC_BODY(regs1, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + struct reg r; + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + printf("Call GETREGS for the child process\n"); + ATF_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1); + + printf("RAX=%#" PRIxREGISTER "\n", r.regs[_REG_RAX]); + printf("RBX=%#" PRIxREGISTER "\n", r.regs[_REG_RBX]); + printf("RCX=%#" PRIxREGISTER "\n", r.regs[_REG_RCX]); + printf("RDX=%#" PRIxREGISTER "\n", r.regs[_REG_RDX]); + + printf("RDI=%#" PRIxREGISTER "\n", r.regs[_REG_RDI]); + printf("RSI=%#" PRIxREGISTER "\n", r.regs[_REG_RSI]); + + printf("GS=%#" PRIxREGISTER "\n", r.regs[_REG_GS]); + printf("FS=%#" PRIxREGISTER "\n", r.regs[_REG_FS]); + printf("ES=%#" PRIxREGISTER "\n", r.regs[_REG_ES]); + printf("DS=%#" PRIxREGISTER "\n", r.regs[_REG_DS]); + printf("CS=%#" PRIxREGISTER "\n", r.regs[_REG_CS]); + printf("SS=%#" PRIxREGISTER "\n", r.regs[_REG_SS]); + + printf("RSP=%#" PRIxREGISTER "\n", r.regs[_REG_RSP]); + printf("RIP=%#" PRIxREGISTER "\n", r.regs[_REG_RIP]); + + printf("RFLAGS=%#" PRIxREGISTER "\n", r.regs[_REG_RFLAGS]); + + printf("R8=%#" PRIxREGISTER "\n", r.regs[_REG_R8]); + printf("R9=%#" PRIxREGISTER "\n", r.regs[_REG_R9]); + printf("R10=%#" PRIxREGISTER "\n", r.regs[_REG_R10]); + printf("R11=%#" PRIxREGISTER "\n", r.regs[_REG_R11]); + printf("R12=%#" PRIxREGISTER "\n", r.regs[_REG_R12]); + printf("R13=%#" PRIxREGISTER "\n", r.regs[_REG_R13]); + printf("R14=%#" PRIxREGISTER "\n", r.regs[_REG_R14]); + printf("R15=%#" PRIxREGISTER "\n", r.regs[_REG_R15]); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} +#endif + +#if defined(__HAVE_PTRACE_WATCHPOINTS) +ATF_TC(watchpoint_count); +ATF_TC_HEAD(watchpoint_count, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Call PT_COUNT_WATCHPOINTS and assert four available watchpoints"); +} + +ATF_TC_BODY(watchpoint_count, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + int N; + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + printf("Call GETREGS for the child process\n"); + ATF_REQUIRE((N = ptrace(PT_COUNT_WATCHPOINTS, child, NULL, 0)) != -1); + printf("Reported %d watchpoints\n", N); + + ATF_REQUIRE_EQ_MSG(N, 4, "Expected 4 hw watchpoints - got %d", N); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} +#endif + +#if defined(__HAVE_PTRACE_WATCHPOINTS) +ATF_TC(watchpoint_read); +ATF_TC_HEAD(watchpoint_read, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Call PT_COUNT_WATCHPOINTS and assert four available watchpoints"); +} + +ATF_TC_BODY(watchpoint_read, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + int i, N; + struct ptrace_watchpoint pw; + int len = sizeof(pw); + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + printf("Call GETREGS for the child process\n"); + ATF_REQUIRE((N = ptrace(PT_COUNT_WATCHPOINTS, child, NULL, 0)) != -1); + + ATF_REQUIRE_EQ_MSG(N, 4, "Expected 4 hw watchpoints - got %d", N); + + for (i = 0; i < N; i++) { + printf("Before reading watchpoint %d\n", i); + pw.pw_index = i; + ATF_REQUIRE(ptrace(PT_READ_WATCHPOINT, child, &pw, len) != -1); + + printf("struct ptrace {\n"); + printf("\t.pw_index=%d\n", pw.pw_index); + printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); + printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); + printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); + printf("}\n"); + } + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} +#endif + +#if defined(__HAVE_PTRACE_WATCHPOINTS) +ATF_TC(watchpoint_write_unmodified); +ATF_TC_HEAD(watchpoint_write_unmodified, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Call PT_COUNT_WATCHPOINTS and assert functional write of " + "unmodified data"); +} + +ATF_TC_BODY(watchpoint_write_unmodified, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + int i, N; + struct ptrace_watchpoint pw; + int len = sizeof(pw); + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + printf("Call GETREGS for the child process\n"); + ATF_REQUIRE((N = ptrace(PT_COUNT_WATCHPOINTS, child, NULL, 0)) != -1); + + ATF_REQUIRE_EQ_MSG(N, 4, "Expected 4 hw watchpoints - got %d", N); + + for (i = 0; i < N; i++) { + printf("Before reading watchpoint %d\n", i); + pw.pw_index = i; + ATF_REQUIRE(ptrace(PT_READ_WATCHPOINT, child, &pw, len) != -1); + + printf("struct ptrace {\n"); + printf("\t.pw_index=%d\n", pw.pw_index); + printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); + printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); + printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); + printf("}\n"); + + printf("Before writing watchpoint %d (unmodified)\n", i); + ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) + != -1); + } + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} +#endif + +#if defined(__HAVE_PTRACE_WATCHPOINTS) +ATF_TC(watchpoint_trap_code0); +ATF_TC_HEAD(watchpoint_trap_code0, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Call PT_COUNT_WATCHPOINTS and test code trap with watchpoint 0"); +} + +ATF_TC_BODY(watchpoint_trap_code0, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + const int i = 0; + struct ptrace_watchpoint pw; + int len = sizeof(pw); + int watchme = 1234; + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("check_happy(%d)=%d\n", watchme, check_happy(watchme)); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + printf("Preparing code watchpoint trap %d\n", i); + + pw.pw_index = i; + pw.pw_lwpid = 0; + pw.pw_md.md_address = (void *)check_happy; + pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION; + pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; + + printf("struct ptrace {\n"); + printf("\t.pw_index=%d\n", pw.pw_index); + printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); + printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); + printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); + printf("}\n"); + + printf("Before writing watchpoint %d\n", i); + ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1); + + printf("Before resuming the child process where it left off " + "and without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, SIGTRAP); + + pw.pw_md.md_address = NULL; + printf("Before writing watchpoint %d (disable it)\n", i); + ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} +#endif + +#if defined(__HAVE_PTRACE_WATCHPOINTS) +ATF_TC(watchpoint_trap_code1); +ATF_TC_HEAD(watchpoint_trap_code1, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Call PT_COUNT_WATCHPOINTS and test code trap with watchpoint 1"); +} + +ATF_TC_BODY(watchpoint_trap_code1, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + const int i = 1; + struct ptrace_watchpoint pw; + int len = sizeof(pw); + int watchme = 1234; + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("check_happy(%d)=%d\n", watchme, check_happy(watchme)); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + printf("Preparing code watchpoint trap %d\n", i); + + pw.pw_index = i; + pw.pw_lwpid = 0; + pw.pw_md.md_address = (void *)check_happy; + pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION; + pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; + + printf("struct ptrace {\n"); + printf("\t.pw_index=%d\n", pw.pw_index); + printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); + printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); + printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); + printf("}\n"); + + printf("Before writing watchpoint %d\n", i); + ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1); + + printf("Before resuming the child process where it left off " + "and without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, SIGTRAP); + + pw.pw_md.md_address = NULL; + printf("Before writing watchpoint %d (disable it)\n", i); + ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} +#endif + +#if defined(__HAVE_PTRACE_WATCHPOINTS) +ATF_TC(watchpoint_trap_code2); +ATF_TC_HEAD(watchpoint_trap_code2, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Call PT_COUNT_WATCHPOINTS and test code trap with watchpoint 2"); +} + +ATF_TC_BODY(watchpoint_trap_code2, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + const int i = 2; + struct ptrace_watchpoint pw; + int len = sizeof(pw); + int watchme = 1234; + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("check_happy(%d)=%d\n", watchme, check_happy(watchme)); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + printf("Preparing code watchpoint trap %d\n", i); + + pw.pw_index = i; + pw.pw_lwpid = 0; + pw.pw_md.md_address = (void *)check_happy; + pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION; + pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; + + printf("struct ptrace {\n"); + printf("\t.pw_index=%d\n", pw.pw_index); + printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); + printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); + printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); + printf("}\n"); + + printf("Before writing watchpoint %d\n", i); + ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1); + + printf("Before resuming the child process where it left off " + "and without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, SIGTRAP); + + pw.pw_md.md_address = NULL; + printf("Before writing watchpoint %d (disable it)\n", i); + ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} +#endif + +#if defined(__HAVE_PTRACE_WATCHPOINTS) +ATF_TC(watchpoint_trap_code3); +ATF_TC_HEAD(watchpoint_trap_code3, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Call PT_COUNT_WATCHPOINTS and test code trap with watchpoint 3"); +} + +ATF_TC_BODY(watchpoint_trap_code3, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + const int i = 3; + struct ptrace_watchpoint pw; + int len = sizeof(pw); + int watchme = 1234; + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("check_happy(%d)=%d\n", watchme, check_happy(watchme)); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + printf("Preparing code watchpoint trap %d\n", i); + + pw.pw_index = i; + pw.pw_lwpid = 0; + pw.pw_md.md_address = (void *)check_happy; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 14 06:20:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 267B0CAF79C; Sat, 14 Jan 2017 06:20:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9F471B33; Sat, 14 Jan 2017 06:20:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E6KbU9098450; Sat, 14 Jan 2017 06:20:37 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E6Kada098447; Sat, 14 Jan 2017 06:20:36 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701140620.v0E6Kada098447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Jan 2017 06:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312124 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 06:20:38 -0000 Author: mjg Date: Sat Jan 14 06:20:36 2017 New Revision: 312124 URL: https://svnweb.freebsd.org/changeset/base/312124 Log: tmpfs: manage tm_pages_used with atomics Reviewed by: kib (previous version) Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Sat Jan 14 06:18:54 2017 (r312123) +++ head/sys/fs/tmpfs/tmpfs.h Sat Jan 14 06:20:36 2017 (r312124) @@ -312,12 +312,12 @@ struct tmpfs_mount { /* Maximum number of memory pages available for use by the file * system, set during mount time. This variable must never be * used directly as it may be bigger than the current amount of - * free memory; in the extreme case, it will hold the SIZE_MAX + * free memory; in the extreme case, it will hold the ULONG_MAX * value. */ - size_t tm_pages_max; + u_long tm_pages_max; /* Number of pages in use by the file system. */ - size_t tm_pages_used; + u_long tm_pages_used; /* Pointer to the node representing the root directory of this * file system. */ Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sat Jan 14 06:18:54 2017 (r312123) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sat Jan 14 06:20:36 2017 (r312124) @@ -129,7 +129,7 @@ tmpfs_pages_check_avail(struct tmpfs_mou if (tmpfs_mem_avail() < req_pages) return (0); - if (tmp->tm_pages_max != SIZE_MAX && + if (tmp->tm_pages_max != ULONG_MAX && tmp->tm_pages_max < req_pages + tmpfs_pages_used(tmp)) return (0); @@ -327,9 +327,7 @@ tmpfs_free_node(struct tmpfs_mount *tmp, case VREG: uobj = node->tn_reg.tn_aobj; if (uobj != NULL) { - TMPFS_LOCK(tmp); - tmp->tm_pages_used -= uobj->size; - TMPFS_UNLOCK(tmp); + atomic_subtract_long(&tmp->tm_pages_used, uobj->size); KASSERT((uobj->flags & OBJ_TMPFS) == 0, ("leaked OBJ_TMPFS node %p vm_obj %p", node, uobj)); vm_object_deallocate(uobj); @@ -1417,9 +1415,7 @@ retry: uobj->size = newpages; VM_OBJECT_WUNLOCK(uobj); - TMPFS_LOCK(tmp); - tmp->tm_pages_used += (newpages - oldpages); - TMPFS_UNLOCK(tmp); + atomic_add_long(&tmp->tm_pages_used, newpages - oldpages); node->tn_size = newsize; return (0); Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Sat Jan 14 06:18:54 2017 (r312123) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Sat Jan 14 06:20:36 2017 (r312124) @@ -397,7 +397,7 @@ tmpfs_statfs(struct mount *mp, struct st sbp->f_bsize = PAGE_SIZE; used = tmpfs_pages_used(tmp); - if (tmp->tm_pages_max != SIZE_MAX) + if (tmp->tm_pages_max != ULONG_MAX) sbp->f_blocks = tmp->tm_pages_max; else sbp->f_blocks = used + tmpfs_mem_avail(); From owner-svn-src-all@freebsd.org Sat Jan 14 09:56:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EC9BCAD890; Sat, 14 Jan 2017 09:56:02 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10B5C1536; Sat, 14 Jan 2017 09:56:01 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E9u1q1088365; Sat, 14 Jan 2017 09:56:01 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E9u1DU088364; Sat, 14 Jan 2017 09:56:01 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201701140956.v0E9u1DU088364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sat, 14 Jan 2017 09:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312153 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 09:56:02 -0000 Author: jah Date: Sat Jan 14 09:56:01 2017 New Revision: 312153 URL: https://svnweb.freebsd.org/changeset/base/312153 Log: For i386 temporary mappings, unpin the thread before releasing the cmap lock. Releasing the lock first may result in the thread being immediately rescheduled and bound to the same CPU, only to unpin itself upon resuming execution. Noted by: skra (in review for armv6 equivalent) MFC after: 1 week Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Jan 14 09:47:06 2017 (r312152) +++ head/sys/i386/i386/pmap.c Sat Jan 14 09:56:01 2017 (r312153) @@ -4216,8 +4216,8 @@ pmap_zero_page(vm_page_t m) invlcaddr(pc->pc_cmap_addr2); pagezero(pc->pc_cmap_addr2); *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* @@ -4244,8 +4244,8 @@ pmap_zero_page_area(vm_page_t m, int off else bzero(pc->pc_cmap_addr2 + off, size); *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* @@ -4275,8 +4275,8 @@ pmap_copy_page(vm_page_t src, vm_page_t bcopy(pc->pc_cmap_addr1, pc->pc_cmap_addr2, PAGE_SIZE); *cmap_pte1 = 0; *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } int unmapped_buf_allowed = 1; @@ -4323,8 +4323,8 @@ pmap_copy_pages(vm_page_t ma[], vm_offse } *cmap_pte1 = 0; *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* @@ -5310,8 +5310,8 @@ pmap_flush_page(vm_page_t m) if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL) mfence(); *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } else pmap_invalidate_cache(); } From owner-svn-src-all@freebsd.org Sat Jan 14 10:16:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19B9ECADD79; Sat, 14 Jan 2017 10:16:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF3D310C1; Sat, 14 Jan 2017 10:16:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAGbG1096797; Sat, 14 Jan 2017 10:16:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAGbmn096796; Sat, 14 Jan 2017 10:16:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141016.v0EAGbmn096796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312157 - stable/11/sys/dev/sfxge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:16:38 -0000 Author: arybchik Date: Sat Jan 14 10:16:36 2017 New Revision: 312157 URL: https://svnweb.freebsd.org/changeset/base/312157 Log: MFC r311877 sfxge(4): avoid unnecessary mbuf data prefetch Unnecessary prefetch just loads HW prefetcher and displaces other cache entries (which could be really useful). If we parse mbuf for TSO early and use firmware-assisted TSO, we do not expect mbuf data access when we compose firmware-assisted TSO (v1 or v2) option descriptors. If packet header needs to be linearized or finally FATSO cannot be used because of, for example, too big header, we do not care about a bit more performance degradation because of prefetch absence (it is better to optimize more common case). Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_tx.c Sat Jan 14 10:10:49 2017 (r312156) +++ stable/11/sys/dev/sfxge/sfxge_tx.c Sat Jan 14 10:16:36 2017 (r312157) @@ -363,8 +363,22 @@ static int sfxge_tx_queue_mbuf(struct sf KASSERT(!txq->blocked, ("txq->blocked")); +#if SFXGE_TX_PARSE_EARLY + /* + * If software TSO is used, we still need to copy packet header, + * even if we have already parsed it early before enqueue. + */ + if ((mbuf->m_pkthdr.csum_flags & CSUM_TSO) && + (txq->tso_fw_assisted == 0)) + prefetch_read_many(mbuf->m_data); +#else + /* + * Prefetch packet header since we need to parse it and extract + * IP ID, TCP sequence number and flags. + */ if (mbuf->m_pkthdr.csum_flags & CSUM_TSO) prefetch_read_many(mbuf->m_data); +#endif if (__predict_false(txq->init_state != SFXGE_TXQ_STARTED)) { rc = EINTR; From owner-svn-src-all@freebsd.org Sat Jan 14 10:17:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60C43CADE49; Sat, 14 Jan 2017 10:17:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 387C01329; Sat, 14 Jan 2017 10:17:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAHnwR097010; Sat, 14 Jan 2017 10:17:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAHnCN097008; Sat, 14 Jan 2017 10:17:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141017.v0EAHnCN097008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312158 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:17:50 -0000 Author: arybchik Date: Sat Jan 14 10:17:49 2017 New Revision: 312158 URL: https://svnweb.freebsd.org/changeset/base/312158 Log: MFC r311961 sfxge(4): do not ignore requested MAC stats update period Firmware version which takes PERIOD_MS parameter into account is required. Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.c stable/11/sys/dev/sfxge/common/efx_mcdi.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_mcdi.c Sat Jan 14 10:16:36 2017 (r312157) +++ stable/11/sys/dev/sfxge/common/efx_mcdi.c Sat Jan 14 10:17:49 2017 (r312158) @@ -1725,7 +1725,8 @@ static __checkReturn efx_rc_t efx_mcdi_mac_stats( __in efx_nic_t *enp, __in_opt efsys_mem_t *esmp, - __in efx_stats_action_t action) + __in efx_stats_action_t action, + __in uint16_t period_ms) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_MAC_STATS_IN_LEN, @@ -1750,7 +1751,7 @@ efx_mcdi_mac_stats( MAC_STATS_IN_PERIODIC_CHANGE, enable | events | disable, MAC_STATS_IN_PERIODIC_ENABLE, enable | events, MAC_STATS_IN_PERIODIC_NOEVENT, !events, - MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000 : 0); + MAC_STATS_IN_PERIOD_MS, (enable | events) ? period_ms : 0); if (esmp != NULL) { int bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t); @@ -1800,7 +1801,7 @@ efx_mcdi_mac_stats_clear( { efx_rc_t rc; - if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR)) != 0) + if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR, 0)) != 0) goto fail1; return (0); @@ -1823,7 +1824,7 @@ efx_mcdi_mac_stats_upload( * avoid having to pull the statistics buffer into the cache to * maintain cumulative statistics. */ - if ((rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_UPLOAD)) != 0) + if ((rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_UPLOAD, 0)) != 0) goto fail1; return (0); @@ -1838,7 +1839,7 @@ fail1: efx_mcdi_mac_stats_periodic( __in efx_nic_t *enp, __in efsys_mem_t *esmp, - __in uint16_t period, + __in uint16_t period_ms, __in boolean_t events) { efx_rc_t rc; @@ -1847,14 +1848,17 @@ efx_mcdi_mac_stats_periodic( * The MC DMAs aggregate statistics for our convenience, so we can * avoid having to pull the statistics buffer into the cache to * maintain cumulative statistics. - * Huntington uses a fixed 1sec period, so use that on Siena too. + * Huntington uses a fixed 1sec period. + * Medford uses a fixed 1sec period before v6.2.1.1033 firmware. */ - if (period == 0) - rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_DISABLE); + if (period_ms == 0) + rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_DISABLE, 0); else if (events) - rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_EVENTS); + rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_EVENTS, + period_ms); else - rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_NOEVENTS); + rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_NOEVENTS, + period_ms); if (rc != 0) goto fail1; Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_mcdi.h Sat Jan 14 10:16:36 2017 (r312157) +++ stable/11/sys/dev/sfxge/common/efx_mcdi.h Sat Jan 14 10:17:49 2017 (r312158) @@ -218,7 +218,7 @@ extern __checkReturn efx_rc_t efx_mcdi_mac_stats_periodic( __in efx_nic_t *enp, __in efsys_mem_t *esmp, - __in uint16_t period, + __in uint16_t period_ms, __in boolean_t events); From owner-svn-src-all@freebsd.org Sat Jan 14 10:19:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE108CADF25; Sat, 14 Jan 2017 10:19:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60550151B; Sat, 14 Jan 2017 10:19:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAJ3iv097122; Sat, 14 Jan 2017 10:19:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAJ3dR097120; Sat, 14 Jan 2017 10:19:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141019.v0EAJ3dR097120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312159 - stable/11/sys/dev/sfxge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:19:04 -0000 Author: arybchik Date: Sat Jan 14 10:19:03 2017 New Revision: 312159 URL: https://svnweb.freebsd.org/changeset/base/312159 Log: MFC r311962 sfxge(4): stats refresh in SW should depend on HW update period The period should be taken into account by the function which refreshes driver stats. Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/sfxge.h stable/11/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/11/sys/dev/sfxge/sfxge.h Sat Jan 14 10:17:49 2017 (r312158) +++ stable/11/sys/dev/sfxge/sfxge.h Sat Jan 14 10:19:03 2017 (r312159) @@ -159,6 +159,8 @@ enum sfxge_evq_state { #define SFXGE_EV_BATCH 16384 +#define SFXGE_STATS_UPDATE_PERIOD_MS 1000 + struct sfxge_evq { /* Structure members below are sorted by usage order */ struct sfxge_softc *sc; Modified: stable/11/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:17:49 2017 (r312158) +++ stable/11/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:19:03 2017 (r312159) @@ -51,6 +51,7 @@ sfxge_mac_stat_update(struct sfxge_softc struct sfxge_port *port = &sc->port; efsys_mem_t *esmp = &(port->mac_stats.dma_buf); clock_t now; + unsigned int min_ticks; unsigned int count; int rc; @@ -61,8 +62,10 @@ sfxge_mac_stat_update(struct sfxge_softc goto out; } + min_ticks = (unsigned int)hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000; + now = ticks; - if ((unsigned int)(now - port->mac_stats.update_time) < (unsigned int)hz) { + if ((unsigned int)(now - port->mac_stats.update_time) < min_ticks) { rc = 0; goto out; } @@ -510,9 +513,10 @@ sfxge_port_start(struct sfxge_softc *sc) sfxge_mac_filter_set_locked(sc); - /* Update MAC stats by DMA every second */ + /* Update MAC stats by DMA every period */ if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - 1000, B_FALSE)) != 0) + SFXGE_STATS_UPDATE_PERIOD_MS, + B_FALSE)) != 0) goto fail6; if ((rc = efx_mac_drain(enp, B_FALSE)) != 0) From owner-svn-src-all@freebsd.org Sat Jan 14 10:19:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4074DCA700B; Sat, 14 Jan 2017 10:19:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BD491754; Sat, 14 Jan 2017 10:19:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAJjZ5097320; Sat, 14 Jan 2017 10:19:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAJjnT097317; Sat, 14 Jan 2017 10:19:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141019.v0EAJjnT097317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312160 - in stable/11: share/man/man4 sys/dev/sfxge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:19:46 -0000 Author: arybchik Date: Sat Jan 14 10:19:44 2017 New Revision: 312160 URL: https://svnweb.freebsd.org/changeset/base/312160 Log: MFC r311977 sfxge(4): add tunable to configure MAC stats update period Sponsored by: Solarflare Communications, Inc. Modified: stable/11/share/man/man4/sfxge.4 stable/11/sys/dev/sfxge/sfxge.h stable/11/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/sfxge.4 ============================================================================== --- stable/11/share/man/man4/sfxge.4 Sat Jan 14 10:19:03 2017 (r312159) +++ stable/11/share/man/man4/sfxge.4 Sat Jan 14 10:19:44 2017 (r312160) @@ -158,6 +158,14 @@ The default for each port will be the va .Va hw.sfxge.mcdi_logging. The logging may also be enabled or disabled after the driver is loaded using the sysctl .Va dev.sfxge.%d.mcdi_logging. +.It Va hw.sfxge.stats_update_period_ms +Period in milliseconds to refresh interface statistics from hardware. +The accepted range is 0 to 65535, the default is 1000 (1 second). +Use zero value to disable periodic statistics update. +Supported on SFN8xxx series adapters with firmware v6.2.1.1033 and later and +SFN5xxx and SFN6xxx series adapters. +SFN7xxx series adapters and SFN8xxx series with earlier firmware use a +fixed 1000 milliseconds statistics update period. .El .Sh SUPPORT For general information and support, Modified: stable/11/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/11/sys/dev/sfxge/sfxge.h Sat Jan 14 10:19:03 2017 (r312159) +++ stable/11/sys/dev/sfxge/sfxge.h Sat Jan 14 10:19:44 2017 (r312160) @@ -248,6 +248,7 @@ struct sfxge_port { #endif struct sfxge_hw_stats phy_stats; struct sfxge_hw_stats mac_stats; + uint16_t stats_update_period_ms; efx_link_mode_t link_mode; uint8_t mcast_addrs[EFX_MAC_MULTICAST_LIST_MAX * EFX_MAC_ADDR_LEN]; Modified: stable/11/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:19:03 2017 (r312159) +++ stable/11/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:19:44 2017 (r312160) @@ -43,6 +43,15 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" +#define SFXGE_PARAM_STATS_UPDATE_PERIOD_MS \ + SFXGE_PARAM(stats_update_period_ms) +static int sfxge_stats_update_period_ms = SFXGE_STATS_UPDATE_PERIOD_MS; +TUNABLE_INT(SFXGE_PARAM_STATS_UPDATE_PERIOD_MS, + &sfxge_stats_update_period_ms); +SYSCTL_INT(_hw_sfxge, OID_AUTO, stats_update_period_ms, CTLFLAG_RDTUN, + &sfxge_stats_update_period_ms, 0, + "netstat interface statistics update period in milliseconds"); + static int sfxge_phy_cap_mask(struct sfxge_softc *, int, uint32_t *); static int @@ -62,7 +71,7 @@ sfxge_mac_stat_update(struct sfxge_softc goto out; } - min_ticks = (unsigned int)hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000; + min_ticks = (unsigned int)hz * port->stats_update_period_ms / 1000; now = ticks; if ((unsigned int)(now - port->mac_stats.update_time) < min_ticks) { @@ -515,7 +524,7 @@ sfxge_port_start(struct sfxge_softc *sc) /* Update MAC stats by DMA every period */ if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - SFXGE_STATS_UPDATE_PERIOD_MS, + port->stats_update_period_ms, B_FALSE)) != 0) goto fail6; @@ -673,6 +682,26 @@ sfxge_port_fini(struct sfxge_softc *sc) port->sc = NULL; } +static uint16_t +sfxge_port_stats_update_period_ms(struct sfxge_softc *sc) +{ + int period_ms = sfxge_stats_update_period_ms; + + if (period_ms < 0) { + device_printf(sc->dev, + "treat negative stats update period %d as 0 (disable)\n", + period_ms); + period_ms = 0; + } else if (period_ms > UINT16_MAX) { + device_printf(sc->dev, + "treat too big stats update period %d as %u\n", + period_ms, UINT16_MAX); + period_ms = UINT16_MAX; + } + + return period_ms; +} + int sfxge_port_init(struct sfxge_softc *sc) { @@ -721,6 +750,7 @@ sfxge_port_init(struct sfxge_softc *sc) M_SFXGE, M_WAITOK | M_ZERO); if ((rc = sfxge_dma_alloc(sc, EFX_MAC_STATS_SIZE, mac_stats_buf)) != 0) goto fail2; + port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc); sfxge_mac_stat_init(sc); port->init_state = SFXGE_PORT_INITIALIZED; From owner-svn-src-all@freebsd.org Sat Jan 14 10:20:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EEE1CA70C9; Sat, 14 Jan 2017 10:20:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21CD91949; Sat, 14 Jan 2017 10:20:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAKRmH097428; Sat, 14 Jan 2017 10:20:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAKRF6097426; Sat, 14 Jan 2017 10:20:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141020.v0EAKRF6097426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312161 - in stable/11: share/man/man4 sys/dev/sfxge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:20:28 -0000 Author: arybchik Date: Sat Jan 14 10:20:27 2017 New Revision: 312161 URL: https://svnweb.freebsd.org/changeset/base/312161 Log: MFC r311983 sfxge(4): add sysctl to change MAC stats update period The sysctl controls the period per interface. Sponsored by: Solarflare Communications, Inc. Modified: stable/11/share/man/man4/sfxge.4 stable/11/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/sfxge.4 ============================================================================== --- stable/11/share/man/man4/sfxge.4 Sat Jan 14 10:19:44 2017 (r312160) +++ stable/11/share/man/man4/sfxge.4 Sat Jan 14 10:20:27 2017 (r312161) @@ -166,6 +166,8 @@ Supported on SFN8xxx series adapters wit SFN5xxx and SFN6xxx series adapters. SFN7xxx series adapters and SFN8xxx series with earlier firmware use a fixed 1000 milliseconds statistics update period. +The period may also be changed after the driver is loaded using the sysctl +.Va dev.sfxge.%d.stats_update_period_ms . .El .Sh SUPPORT For general information and support, Modified: stable/11/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:19:44 2017 (r312160) +++ stable/11/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:20:27 2017 (r312161) @@ -702,6 +702,48 @@ sfxge_port_stats_update_period_ms(struct return period_ms; } +static int +sfxge_port_stats_update_period_ms_handler(SYSCTL_HANDLER_ARGS) +{ + struct sfxge_softc *sc; + struct sfxge_port *port; + unsigned int period_ms; + int error; + + sc = arg1; + port = &sc->port; + + if (req->newptr != NULL) { + error = SYSCTL_IN(req, &period_ms, sizeof(period_ms)); + if (error != 0) + return (error); + + if (period_ms > UINT16_MAX) + return (EINVAL); + + SFXGE_PORT_LOCK(port); + + if (port->stats_update_period_ms != period_ms) { + if (port->init_state == SFXGE_PORT_STARTED) + error = efx_mac_stats_periodic(sc->enp, + &port->mac_stats.dma_buf, + period_ms, B_FALSE); + if (error == 0) + port->stats_update_period_ms = period_ms; + } + + SFXGE_PORT_UNLOCK(port); + } else { + SFXGE_PORT_LOCK(port); + period_ms = port->stats_update_period_ms; + SFXGE_PORT_UNLOCK(port); + + error = SYSCTL_OUT(req, &period_ms, sizeof(period_ms)); + } + + return (error); +} + int sfxge_port_init(struct sfxge_softc *sc) { @@ -753,6 +795,11 @@ sfxge_port_init(struct sfxge_softc *sc) port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc); sfxge_mac_stat_init(sc); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "stats_update_period_ms", CTLTYPE_UINT|CTLFLAG_RW, sc, 0, + sfxge_port_stats_update_period_ms_handler, "IU", + "interface statistics refresh period"); + port->init_state = SFXGE_PORT_INITIALIZED; DBGPRINT(sc->dev, "success"); From owner-svn-src-all@freebsd.org Sat Jan 14 10:20:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3D95CA716B; Sat, 14 Jan 2017 10:20:39 +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 A2F6C19F1; Sat, 14 Jan 2017 10:20:39 +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 v0EAKc4C097483; Sat, 14 Jan 2017 10:20:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAKcrx097482; Sat, 14 Jan 2017 10:20:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701141020.v0EAKcrx097482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 10:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312162 - head/usr.sbin/inetd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:20:40 -0000 Author: ngie Date: Sat Jan 14 10:20:38 2017 New Revision: 312162 URL: https://svnweb.freebsd.org/changeset/base/312162 Log: Fix up r312105 - Only #include tcpd.h when LIBWRAP is true to avoid header include errors - Only define whichaf when LIBWRAP is true to avoid -Wunused warning and to avoid issues with structs being defined that should only be defined when tcpd.h is included. MFC after: 2 weeks X-MFC with: r312105 Pointyhat to: ngie Reported by: gcc tinderbox Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/inetd/inetd.c Modified: head/usr.sbin/inetd/inetd.c ============================================================================== --- head/usr.sbin/inetd/inetd.c Sat Jan 14 10:20:27 2017 (r312161) +++ head/usr.sbin/inetd/inetd.c Sat Jan 14 10:20:38 2017 (r312162) @@ -138,7 +138,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef LIBWRAP #include +#endif #include #include "inetd.h" @@ -307,6 +309,7 @@ getvalue(const char *arg, int *value, co return 0; /* success */ } +#ifdef LIBWRAP static sa_family_t whichaf(struct request_info *req) { @@ -322,6 +325,7 @@ whichaf(struct request_info *req) #endif return sa->sa_family; } +#endif int main(int argc, char **argv) From owner-svn-src-all@freebsd.org Sat Jan 14 10:23:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDFFDCA740A; Sat, 14 Jan 2017 10:23:06 +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 BA5BB1EFA; Sat, 14 Jan 2017 10:23:06 +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 v0EAN5JJ001351; Sat, 14 Jan 2017 10:23:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAN5HB001350; Sat, 14 Jan 2017 10:23:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701141023.v0EAN5HB001350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 10:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312163 - stable/11/tests/sys/acl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:23:07 -0000 Author: ngie Date: Sat Jan 14 10:23:05 2017 New Revision: 312163 URL: https://svnweb.freebsd.org/changeset/base/312163 Log: MFC r309464: Expect 01:main to fail Changes were made to ZFS in the past year with respect to how ACLs are handled, causing failures in this test. Mark it TODO so (hopefully) someone more knowledgeable (like mav or trasz) will fix the code or the test. PR: 212323 Modified: stable/11/tests/sys/acl/01.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/acl/01.sh ============================================================================== --- stable/11/tests/sys/acl/01.sh Sat Jan 14 10:20:38 2017 (r312162) +++ stable/11/tests/sys/acl/01.sh Sat Jan 14 10:23:05 2017 (r312163) @@ -81,7 +81,7 @@ perl $TESTDIR/run $TESTDIR/tools-nfs4-ps if [ $? -eq 0 ]; then echo "ok 3" else - echo "not ok 3" + echo "not ok 3 # TODO: fails due to ACL changes in ZFS; bug 212323" fi echo "ok 4" From owner-svn-src-all@freebsd.org Sat Jan 14 10:38:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0399FCA7876; Sat, 14 Jan 2017 10:38:41 +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 C82F91720; Sat, 14 Jan 2017 10:38: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 v0EAceON005626; Sat, 14 Jan 2017 10:38:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAcdBT005625; Sat, 14 Jan 2017 10:38:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701141038.v0EAcdBT005625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 10:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312164 - head/tests/sys/mac/bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:38:41 -0000 Author: ngie Date: Sat Jan 14 10:38:39 2017 New Revision: 312164 URL: https://svnweb.freebsd.org/changeset/base/312164 Log: Fix -Wformat issue Use %zu for printing out results from nitems, as it's size_t based MFC after: 1 week X-MFC with: r312120 Reported by: gcc (mips:mipsel tinderbox) Sponsored by: Dell EMC Isilon Modified: head/tests/sys/mac/bsdextended/ugidfw_test.c Modified: head/tests/sys/mac/bsdextended/ugidfw_test.c ============================================================================== --- head/tests/sys/mac/bsdextended/ugidfw_test.c Sat Jan 14 10:23:05 2017 (r312163) +++ head/tests/sys/mac/bsdextended/ugidfw_test.c Sat Jan 14 10:38:39 2017 (r312164) @@ -222,7 +222,7 @@ main(void) return (0); } - printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + + printf("1..%zu\n", nitems(test_users) + nitems(test_groups) + 3 * nitems(test_strings) + 2); test_libugidfw_strings(); From owner-svn-src-all@freebsd.org Sat Jan 14 10:39:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B62BCA78DB; Sat, 14 Jan 2017 10:39:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37BC018C6; Sat, 14 Jan 2017 10:39:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAd0xA005688; Sat, 14 Jan 2017 10:39:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAd0EH005687; Sat, 14 Jan 2017 10:39:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141039.v0EAd0EH005687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312165 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:39:01 -0000 Author: arybchik Date: Sat Jan 14 10:39:00 2017 New Revision: 312165 URL: https://svnweb.freebsd.org/changeset/base/312165 Log: MFC r311877 sfxge(4): avoid unnecessary mbuf data prefetch Unnecessary prefetch just loads HW prefetcher and displaces other cache entries (which could be really useful). If we parse mbuf for TSO early and use firmware-assisted TSO, we do not expect mbuf data access when we compose firmware-assisted TSO (v1 or v2) option descriptors. If packet header needs to be linearized or finally FATSO cannot be used because of, for example, too big header, we do not care about a bit more performance degradation because of prefetch absence (it is better to optimize more common case). Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Sat Jan 14 10:38:39 2017 (r312164) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Sat Jan 14 10:39:00 2017 (r312165) @@ -356,8 +356,22 @@ static int sfxge_tx_queue_mbuf(struct sf KASSERT(!txq->blocked, ("txq->blocked")); +#if SFXGE_TX_PARSE_EARLY + /* + * If software TSO is used, we still need to copy packet header, + * even if we have already parsed it early before enqueue. + */ + if ((mbuf->m_pkthdr.csum_flags & CSUM_TSO) && + (txq->tso_fw_assisted == 0)) + prefetch_read_many(mbuf->m_data); +#else + /* + * Prefetch packet header since we need to parse it and extract + * IP ID, TCP sequence number and flags. + */ if (mbuf->m_pkthdr.csum_flags & CSUM_TSO) prefetch_read_many(mbuf->m_data); +#endif if (__predict_false(txq->init_state != SFXGE_TXQ_STARTED)) { rc = EINTR; From owner-svn-src-all@freebsd.org Sat Jan 14 10:39:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F5DACA7975; Sat, 14 Jan 2017 10:39:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C9231A40; Sat, 14 Jan 2017 10:39:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAdgY3005769; Sat, 14 Jan 2017 10:39:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAdgZq005767; Sat, 14 Jan 2017 10:39:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141039.v0EAdgZq005767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312166 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:39:43 -0000 Author: arybchik Date: Sat Jan 14 10:39:42 2017 New Revision: 312166 URL: https://svnweb.freebsd.org/changeset/base/312166 Log: MFC r311961 sfxge(4): do not ignore requested MAC stats update period Firmware version which takes PERIOD_MS parameter into account is required. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c stable/10/sys/dev/sfxge/common/efx_mcdi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Sat Jan 14 10:39:00 2017 (r312165) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Sat Jan 14 10:39:42 2017 (r312166) @@ -1725,7 +1725,8 @@ static __checkReturn efx_rc_t efx_mcdi_mac_stats( __in efx_nic_t *enp, __in_opt efsys_mem_t *esmp, - __in efx_stats_action_t action) + __in efx_stats_action_t action, + __in uint16_t period_ms) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_MAC_STATS_IN_LEN, @@ -1750,7 +1751,7 @@ efx_mcdi_mac_stats( MAC_STATS_IN_PERIODIC_CHANGE, enable | events | disable, MAC_STATS_IN_PERIODIC_ENABLE, enable | events, MAC_STATS_IN_PERIODIC_NOEVENT, !events, - MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000 : 0); + MAC_STATS_IN_PERIOD_MS, (enable | events) ? period_ms : 0); if (esmp != NULL) { int bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t); @@ -1800,7 +1801,7 @@ efx_mcdi_mac_stats_clear( { efx_rc_t rc; - if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR)) != 0) + if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR, 0)) != 0) goto fail1; return (0); @@ -1823,7 +1824,7 @@ efx_mcdi_mac_stats_upload( * avoid having to pull the statistics buffer into the cache to * maintain cumulative statistics. */ - if ((rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_UPLOAD)) != 0) + if ((rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_UPLOAD, 0)) != 0) goto fail1; return (0); @@ -1838,7 +1839,7 @@ fail1: efx_mcdi_mac_stats_periodic( __in efx_nic_t *enp, __in efsys_mem_t *esmp, - __in uint16_t period, + __in uint16_t period_ms, __in boolean_t events) { efx_rc_t rc; @@ -1847,14 +1848,17 @@ efx_mcdi_mac_stats_periodic( * The MC DMAs aggregate statistics for our convenience, so we can * avoid having to pull the statistics buffer into the cache to * maintain cumulative statistics. - * Huntington uses a fixed 1sec period, so use that on Siena too. + * Huntington uses a fixed 1sec period. + * Medford uses a fixed 1sec period before v6.2.1.1033 firmware. */ - if (period == 0) - rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_DISABLE); + if (period_ms == 0) + rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_DISABLE, 0); else if (events) - rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_EVENTS); + rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_EVENTS, + period_ms); else - rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_NOEVENTS); + rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_NOEVENTS, + period_ms); if (rc != 0) goto fail1; Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.h Sat Jan 14 10:39:00 2017 (r312165) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.h Sat Jan 14 10:39:42 2017 (r312166) @@ -218,7 +218,7 @@ extern __checkReturn efx_rc_t efx_mcdi_mac_stats_periodic( __in efx_nic_t *enp, __in efsys_mem_t *esmp, - __in uint16_t period, + __in uint16_t period_ms, __in boolean_t events); From owner-svn-src-all@freebsd.org Sat Jan 14 10:50:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92864CA7DDA; Sat, 14 Jan 2017 10:50:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62092114C; Sat, 14 Jan 2017 10:50:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAojv2012191; Sat, 14 Jan 2017 10:50:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAoje9012188; Sat, 14 Jan 2017 10:50:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141050.v0EAoje9012188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312167 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:50:46 -0000 Author: arybchik Date: Sat Jan 14 10:50:45 2017 New Revision: 312167 URL: https://svnweb.freebsd.org/changeset/base/312167 Log: MFC r311962 sfxge(4): stats refresh in SW should depend on HW update period The period should be taken into account by the function which refreshes driver stats. Reviewed by: philip Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Sat Jan 14 10:39:42 2017 (r312166) +++ stable/10/sys/dev/sfxge/sfxge.c Sat Jan 14 10:50:45 2017 (r312167) @@ -94,14 +94,6 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_ring, &sfxge_tx_ring_entries, 0, "Maximum number of descriptors in a transmit ring"); -#define SFXGE_PARAM_STATS_UPDATE_PERIOD SFXGE_PARAM(stats_update_period) -static int sfxge_stats_update_period = SFXGE_CALLOUT_TICKS; -TUNABLE_INT(SFXGE_PARAM_STATS_UPDATE_PERIOD, - &sfxge_stats_update_period); -SYSCTL_INT(_hw_sfxge, OID_AUTO, stats_update_period, CTLFLAG_RDTUN, - &sfxge_stats_update_period, 0, - "netstat interface statistics update period in ticks"); - #define SFXGE_PARAM_RESTART_ATTEMPTS SFXGE_PARAM(restart_attempts) static int sfxge_restart_attempts = 3; TUNABLE_INT(SFXGE_PARAM_RESTART_ATTEMPTS, &sfxge_restart_attempts); @@ -558,7 +550,7 @@ sfxge_tick(void *arg) sfxge_port_update_stats(sc); sfxge_tx_update_stats(sc); - callout_reset(&sc->tick_callout, sfxge_stats_update_period, + callout_reset(&sc->tick_callout, hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000, sfxge_tick, sc); } @@ -623,7 +615,7 @@ sfxge_ifnet_init(struct ifnet *ifp, stru if ((rc = sfxge_port_ifmedia_init(sc)) != 0) goto fail; - callout_reset(&sc->tick_callout, sfxge_stats_update_period, + callout_reset(&sc->tick_callout, hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000, sfxge_tick, sc); return (0); Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Sat Jan 14 10:39:42 2017 (r312166) +++ stable/10/sys/dev/sfxge/sfxge.h Sat Jan 14 10:50:45 2017 (r312167) @@ -158,7 +158,7 @@ enum sfxge_evq_state { #define SFXGE_EV_BATCH 16384 -#define SFXGE_CALLOUT_TICKS 100 +#define SFXGE_STATS_UPDATE_PERIOD_MS 1000 struct sfxge_evq { /* Structure members below are sorted by usage order */ Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:39:42 2017 (r312166) +++ stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:50:45 2017 (r312167) @@ -51,6 +51,7 @@ sfxge_mac_stat_update(struct sfxge_softc struct sfxge_port *port = &sc->port; efsys_mem_t *esmp = &(port->mac_stats.dma_buf); clock_t now; + unsigned int min_ticks; unsigned int count; int rc; @@ -61,8 +62,10 @@ sfxge_mac_stat_update(struct sfxge_softc goto out; } + min_ticks = (unsigned int)hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000; + now = ticks; - if ((unsigned int)(now - port->mac_stats.update_time) < (unsigned int)hz) { + if ((unsigned int)(now - port->mac_stats.update_time) < min_ticks) { rc = 0; goto out; } @@ -483,9 +486,10 @@ sfxge_port_start(struct sfxge_softc *sc) sfxge_mac_filter_set_locked(sc); - /* Update MAC stats by DMA every second */ + /* Update MAC stats by DMA every period */ if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - 1000, B_FALSE)) != 0) + SFXGE_STATS_UPDATE_PERIOD_MS, + B_FALSE)) != 0) goto fail6; if ((rc = efx_mac_drain(enp, B_FALSE)) != 0) From owner-svn-src-all@freebsd.org Sat Jan 14 10:58:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3502FCAE04A; Sat, 14 Jan 2017 10:58:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E994E16AE; Sat, 14 Jan 2017 10:58:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAw9Ps014011; Sat, 14 Jan 2017 10:58:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAw825014006; Sat, 14 Jan 2017 10:58:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141058.v0EAw825014006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312168 - in stable/10: share/man/man4 sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:58:10 -0000 Author: arybchik Date: Sat Jan 14 10:58:08 2017 New Revision: 312168 URL: https://svnweb.freebsd.org/changeset/base/312168 Log: MFC r311977 sfxge(4): add tunable to configure MAC stats update period Sponsored by: Solarflare Communications, Inc. Modified: stable/10/share/man/man4/sfxge.4 stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Sat Jan 14 10:50:45 2017 (r312167) +++ stable/10/share/man/man4/sfxge.4 Sat Jan 14 10:58:08 2017 (r312168) @@ -158,6 +158,14 @@ port will be the value of .Va hw.sfxge.mcdi_logging. The logging may also be enabled or disabled after the driver is loaded using the sysctl .Va dev.sfxge.%d.mcdi_logging. +.It Va hw.sfxge.stats_update_period_ms +Period in milliseconds to refresh interface statistics from hardware. +The accepted range is 0 to 65535, the default is 1000 (1 second). +Use zero value to disable periodic statistics update. +Supported on SFN8xxx series adapters with firmware v6.2.1.1033 and later and +SFN5xxx and SFN6xxx series adapters. +SFN7xxx series adapters and SFN8xxx series with earlier firmware use a +fixed 1000 milliseconds statistics update period. .El .Sh SUPPORT For general information and support, Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Sat Jan 14 10:50:45 2017 (r312167) +++ stable/10/sys/dev/sfxge/sfxge.c Sat Jan 14 10:58:08 2017 (r312168) @@ -550,7 +550,8 @@ sfxge_tick(void *arg) sfxge_port_update_stats(sc); sfxge_tx_update_stats(sc); - callout_reset(&sc->tick_callout, hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000, + callout_reset(&sc->tick_callout, + hz * sc->port.stats_update_period_ms / 1000, sfxge_tick, sc); } @@ -615,7 +616,8 @@ sfxge_ifnet_init(struct ifnet *ifp, stru if ((rc = sfxge_port_ifmedia_init(sc)) != 0) goto fail; - callout_reset(&sc->tick_callout, hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000, + callout_reset(&sc->tick_callout, + hz * sc->port.stats_update_period_ms / 1000, sfxge_tick, sc); return (0); Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Sat Jan 14 10:50:45 2017 (r312167) +++ stable/10/sys/dev/sfxge/sfxge.h Sat Jan 14 10:58:08 2017 (r312168) @@ -247,6 +247,7 @@ struct sfxge_port { #endif struct sfxge_hw_stats phy_stats; struct sfxge_hw_stats mac_stats; + uint16_t stats_update_period_ms; efx_link_mode_t link_mode; uint8_t mcast_addrs[EFX_MAC_MULTICAST_LIST_MAX * EFX_MAC_ADDR_LEN]; Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:50:45 2017 (r312167) +++ stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:58:08 2017 (r312168) @@ -43,6 +43,15 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" +#define SFXGE_PARAM_STATS_UPDATE_PERIOD_MS \ + SFXGE_PARAM(stats_update_period_ms) +static int sfxge_stats_update_period_ms = SFXGE_STATS_UPDATE_PERIOD_MS; +TUNABLE_INT(SFXGE_PARAM_STATS_UPDATE_PERIOD_MS, + &sfxge_stats_update_period_ms); +SYSCTL_INT(_hw_sfxge, OID_AUTO, stats_update_period_ms, CTLFLAG_RDTUN, + &sfxge_stats_update_period_ms, 0, + "netstat interface statistics update period in milliseconds"); + static int sfxge_phy_cap_mask(struct sfxge_softc *, int, uint32_t *); static int @@ -62,7 +71,7 @@ sfxge_mac_stat_update(struct sfxge_softc goto out; } - min_ticks = (unsigned int)hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000; + min_ticks = (unsigned int)hz * port->stats_update_period_ms / 1000; now = ticks; if ((unsigned int)(now - port->mac_stats.update_time) < min_ticks) { @@ -488,7 +497,7 @@ sfxge_port_start(struct sfxge_softc *sc) /* Update MAC stats by DMA every period */ if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - SFXGE_STATS_UPDATE_PERIOD_MS, + port->stats_update_period_ms, B_FALSE)) != 0) goto fail6; @@ -646,6 +655,26 @@ sfxge_port_fini(struct sfxge_softc *sc) port->sc = NULL; } +static uint16_t +sfxge_port_stats_update_period_ms(struct sfxge_softc *sc) +{ + int period_ms = sfxge_stats_update_period_ms; + + if (period_ms < 0) { + device_printf(sc->dev, + "treat negative stats update period %d as 0 (disable)\n", + period_ms); + period_ms = 0; + } else if (period_ms > UINT16_MAX) { + device_printf(sc->dev, + "treat too big stats update period %d as %u\n", + period_ms, UINT16_MAX); + period_ms = UINT16_MAX; + } + + return period_ms; +} + int sfxge_port_init(struct sfxge_softc *sc) { @@ -694,6 +723,7 @@ sfxge_port_init(struct sfxge_softc *sc) M_SFXGE, M_WAITOK | M_ZERO); if ((rc = sfxge_dma_alloc(sc, EFX_MAC_STATS_SIZE, mac_stats_buf)) != 0) goto fail2; + port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc); sfxge_mac_stat_init(sc); port->init_state = SFXGE_PORT_INITIALIZED; From owner-svn-src-all@freebsd.org Sat Jan 14 10:59:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 115C2CAE115; Sat, 14 Jan 2017 10:59:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6586185B; Sat, 14 Jan 2017 10:59:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAxPvK014122; Sat, 14 Jan 2017 10:59:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAxPIX014120; Sat, 14 Jan 2017 10:59:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141059.v0EAxPIX014120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312169 - in stable/10: share/man/man4 sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:59:27 -0000 Author: arybchik Date: Sat Jan 14 10:59:25 2017 New Revision: 312169 URL: https://svnweb.freebsd.org/changeset/base/312169 Log: MFC r311983 sfxge(4): add sysctl to change MAC stats update period The sysctl controls the period per interface. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/share/man/man4/sfxge.4 stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Sat Jan 14 10:58:08 2017 (r312168) +++ stable/10/share/man/man4/sfxge.4 Sat Jan 14 10:59:25 2017 (r312169) @@ -166,6 +166,8 @@ Supported on SFN8xxx series adapters wit SFN5xxx and SFN6xxx series adapters. SFN7xxx series adapters and SFN8xxx series with earlier firmware use a fixed 1000 milliseconds statistics update period. +The period may also be changed after the driver is loaded using the sysctl +.Va dev.sfxge.%d.stats_update_period_ms . .El .Sh SUPPORT For general information and support, Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:58:08 2017 (r312168) +++ stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:59:25 2017 (r312169) @@ -675,6 +675,48 @@ sfxge_port_stats_update_period_ms(struct return period_ms; } +static int +sfxge_port_stats_update_period_ms_handler(SYSCTL_HANDLER_ARGS) +{ + struct sfxge_softc *sc; + struct sfxge_port *port; + unsigned int period_ms; + int error; + + sc = arg1; + port = &sc->port; + + if (req->newptr != NULL) { + error = SYSCTL_IN(req, &period_ms, sizeof(period_ms)); + if (error != 0) + return (error); + + if (period_ms > UINT16_MAX) + return (EINVAL); + + SFXGE_PORT_LOCK(port); + + if (port->stats_update_period_ms != period_ms) { + if (port->init_state == SFXGE_PORT_STARTED) + error = efx_mac_stats_periodic(sc->enp, + &port->mac_stats.dma_buf, + period_ms, B_FALSE); + if (error == 0) + port->stats_update_period_ms = period_ms; + } + + SFXGE_PORT_UNLOCK(port); + } else { + SFXGE_PORT_LOCK(port); + period_ms = port->stats_update_period_ms; + SFXGE_PORT_UNLOCK(port); + + error = SYSCTL_OUT(req, &period_ms, sizeof(period_ms)); + } + + return (error); +} + int sfxge_port_init(struct sfxge_softc *sc) { @@ -726,6 +768,11 @@ sfxge_port_init(struct sfxge_softc *sc) port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc); sfxge_mac_stat_init(sc); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "stats_update_period_ms", CTLTYPE_UINT|CTLFLAG_RW, sc, 0, + sfxge_port_stats_update_period_ms_handler, "IU", + "interface statistics refresh period"); + port->init_state = SFXGE_PORT_INITIALIZED; DBGPRINT(sc->dev, "success"); From owner-svn-src-all@freebsd.org Sat Jan 14 11:16:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56345CAE916; Sat, 14 Jan 2017 11:16:11 +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 27B831223; Sat, 14 Jan 2017 11:16:11 +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 v0EBGAQB021767; Sat, 14 Jan 2017 11:16:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EBGALe021766; Sat, 14 Jan 2017 11:16:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701141116.v0EBGALe021766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Jan 2017 11:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312170 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 11:16:11 -0000 Author: kib Date: Sat Jan 14 11:16:10 2017 New Revision: 312170 URL: https://svnweb.freebsd.org/changeset/base/312170 Log: MFC r311646: Define _POSIX_PRIORITY_SCHEDULING as 0, to account for the kernel option. Modified: stable/11/sys/sys/unistd.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/unistd.h ============================================================================== --- stable/11/sys/sys/unistd.h Sat Jan 14 10:59:25 2017 (r312169) +++ stable/11/sys/sys/unistd.h Sat Jan 14 11:16:10 2017 (r312170) @@ -65,7 +65,7 @@ #define _POSIX_MONOTONIC_CLOCK 200112L #define _POSIX_NO_TRUNC 1 #define _POSIX_PRIORITIZED_IO (-1) -#define _POSIX_PRIORITY_SCHEDULING 200112L +#define _POSIX_PRIORITY_SCHEDULING 0 #define _POSIX_RAW_SOCKETS 200112L #define _POSIX_REALTIME_SIGNALS 200112L #define _POSIX_SEMAPHORES 200112L From owner-svn-src-all@freebsd.org Sat Jan 14 11:27:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A9ACAEBEB; Sat, 14 Jan 2017 11:27: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 76E2017A0; Sat, 14 Jan 2017 11:27: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 v0EBRBOG026216; Sat, 14 Jan 2017 11:27:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EBRBKI026215; Sat, 14 Jan 2017 11:27:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701141127.v0EBRBKI026215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Jan 2017 11:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312171 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 11:27:12 -0000 Author: kib Date: Sat Jan 14 11:27:11 2017 New Revision: 312171 URL: https://svnweb.freebsd.org/changeset/base/312171 Log: MFC r311646: Define _POSIX_PRIORITY_SCHEDULING as 0, to account for the kernel option. Modified: stable/10/sys/sys/unistd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/unistd.h ============================================================================== --- stable/10/sys/sys/unistd.h Sat Jan 14 11:16:10 2017 (r312170) +++ stable/10/sys/sys/unistd.h Sat Jan 14 11:27:11 2017 (r312171) @@ -65,7 +65,7 @@ #define _POSIX_MONOTONIC_CLOCK 200112L #define _POSIX_NO_TRUNC 1 #define _POSIX_PRIORITIZED_IO (-1) -#define _POSIX_PRIORITY_SCHEDULING 200112L +#define _POSIX_PRIORITY_SCHEDULING 0 #define _POSIX_RAW_SOCKETS 200112L #define _POSIX_REALTIME_SIGNALS 200112L #define _POSIX_SEMAPHORES 200112L From owner-svn-src-all@freebsd.org Sat Jan 14 13:43:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49DEBCAF9C2; Sat, 14 Jan 2017 13:43:33 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3854B12E4; Sat, 14 Jan 2017 13:43:31 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 1bb024b7; Sat, 14 Jan 2017 14:43:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=MNue7/HkTKxDvLE5qfqaeYhXHNI=; b=PuG+8WuGUOPzRAMfk0CWWAh9Ptbf uF8DfvTX4fAkCD8HHXWditzb7QYknC1mEkEBGlfyQEvhvYuS64fS/NEE26Yr/3mX JAPqZg6wJ4qDtBdmnhz5DBq2gnH6dZuIfOxINLMUdM67IDA+G7i+ht0+A3lnDnr8 KpJEVvp5Fu3rKho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=kk2rMbewNcHXnqZNq+O0tKL4Y3GXsUGW/cAgVokJ+TLleJVUhT02wmBQ 0IfDZtgOKqIk6Ewafru81QkPrMhPVpaZFxZIxDEA2cOUHMWc9Tke/zstU0rjWPRS czNXmmkBnj9wGgCWYsr2YhPNj/OC5h+62OeGw7vWZrWkXy0XFcU= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 0029f9fd TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sat, 14 Jan 2017 14:43:28 +0100 (CET) Date: Sat, 14 Jan 2017 14:43:28 +0100 From: Emmanuel Vadot To: Zbigniew Bodek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311455 - head/sys/boot/fdt/dts/arm Message-Id: <20170114144328.1b9e0b3fdfe34b3ae1365798@bidouilliste.com> In-Reply-To: <201701051727.v05HRoup098984@repo.freebsd.org> References: <201701051727.v05HRoup098984@repo.freebsd.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 13:43:33 -0000 Hello zbb, On Thu, 5 Jan 2017 17:27:50 +0000 (UTC) Zbigniew Bodek wrote: > Author: zbb > Date: Thu Jan 5 17:27:50 2017 > New Revision: 311455 > URL: https://svnweb.freebsd.org/changeset/base/311455 > > Log: > Add DTS file for Armada 385 DB-AP board > > Armada38x is already supported in the tree. > This commit adds support for DB-AP board. > File was taken from Linux v4.8 and accustomed to FreeBSD > in minimal possible way. > > Submitted by: Bartosz Szczepanek > Obtained from: Semihalf > Sponsored by: Stormshield > Differential revision: https://reviews.freebsd.org/D7327 > > Added: > head/sys/boot/fdt/dts/arm/armada-385-db-ap.dts (contents, props changed) This file is already present in sys/gnu/dts (from an earlier version of Linux, 4.7-rcX). As I said in the review I'm not sure that we want multiple version of DTS in the tree. Could you use the upstream dts as base (include it in our DTS) and add the FreeBSD needed nodes in it like we do for Allwinner and BeagleBone ? Thanks. > Added: head/sys/boot/fdt/dts/arm/armada-385-db-ap.dts > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/boot/fdt/dts/arm/armada-385-db-ap.dts Thu Jan 5 17:27:50 2017 (r311455) > @@ -0,0 +1,271 @@ > +/* > + * Device Tree file for Marvell Armada 385 Access Point Development board > + * (DB-88F6820-AP) > + * > + * Copyright (C) 2014 Marvell > + * > + * Nadav Haklai > + * > + * This file is dual-licensed: you can use it either under the terms > + * of the GPL or the X11 license, at your option. Note that this dual > + * licensing only applies to this file, and not this project as a > + * whole. > + * > + * a) This file is licensed under the terms of the GNU General Public > + * License version 2. This program is licensed "as is" without > + * any warranty of any kind, whether express or implied. > + * > + * Or, alternatively, > + * > + * b) Permission is hereby granted, free of charge, to any person > + * obtaining a copy of this software and associated documentation > + * files (the "Software"), to deal in the Software without > + * restriction, including without limitation the rights to use, > + * copy, modify, merge, publish, distribute, sublicense, and/or > + * sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following > + * conditions: > + * > + * The above copyright notice and this permission notice shall be > + * included in all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES > + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT > + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, > + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR > + * OTHER DEALINGS IN THE SOFTWARE. > + * > + * $FreeBSD$ > + */ > + > +/dts-v1/; > +#include "armada-385.dtsi" > + > +#include > + > +/ { > + model = "Marvell Armada 385 Access Point Development Board"; > + compatible = "marvell,a385-db-ap", "marvell,armada385", "marvell,armada380"; > + > + chosen { > + stdout-path = "serial1"; > + }; > + > + memory { > + device_type = "memory"; > + reg = <0x00000000 0x80000000>; /* 2GB */ > + }; > + > + soc { > + ranges = ; > + > + internal-regs { > + i2c0: i2c@11000 { > + pinctrl-names = "default"; > + pinctrl-0 = <&i2c0_pins>; > + status = "okay"; > + > + /* > + * This bus is wired to two EEPROM > + * sockets, one of which holding the > + * board ID used by the bootloader. > + * Erasing this EEPROM's content will > + * brick the board. > + * Use this bus with caution. > + */ > + }; > + > + mdio@72004 { > + pinctrl-names = "default"; > + pinctrl-0 = <&mdio_pins>; > + > + phy0: ethernet-phy@1 { > + reg = <1>; > + }; > + > + phy1: ethernet-phy@4 { > + reg = <4>; > + }; > + > + phy2: ethernet-phy@6 { > + reg = <6>; > + }; > + }; > + > + /* UART0 is exposed through the JP8 connector */ > + uart0: serial@12000 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart0_pins>; > + status = "okay"; > + }; > + > + /* > + * UART1 is exposed through a FTDI chip > + * wired to the mini-USB connector > + */ > + uart1: serial@12100 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart1_pins>; > + status = "okay"; > + }; > + > + pinctrl@18000 { > + xhci0_vbus_pins: xhci0-vbus-pins { > + marvell,pins = "mpp44"; > + marvell,function = "gpio"; > + }; > + }; > + > + /* CON3 */ > + ethernet@30000 { > + status = "okay"; > + phy = <&phy2>; > + phy-mode = "sgmii"; > + buffer-manager = <&bm>; > + bm,pool-long = <1>; > + bm,pool-short = <3>; > + }; > + > + /* CON2 */ > + ethernet@34000 { > + status = "okay"; > + phy = <&phy1>; > + phy-mode = "sgmii"; > + buffer-manager = <&bm>; > + bm,pool-long = <2>; > + bm,pool-short = <3>; > + }; > + > + usb@58000 { > + status = "okay"; > + }; > + > + /* CON4 */ > + ethernet@70000 { > + pinctrl-names = "default"; > + > + /* > + * The Reference Clock 0 is used to > + * provide a clock to the PHY > + */ > + pinctrl-0 = <&ge0_rgmii_pins>, <&ref_clk0_pins>; > + status = "okay"; > + phy = <&phy0>; > + phy-mode = "rgmii-id"; > + buffer-manager = <&bm>; > + bm,pool-long = <0>; > + bm,pool-short = <3>; > + }; > + > + crypto@90000 { > + status = "okay"; > + }; > + > + crypto@92000 { > + status = "okay"; > + }; > + > + bm@c8000 { > + status = "okay"; > + }; > + > + nfc: flash@d0000 { > + status = "okay"; > + num-cs = <1>; > + nand-ecc-strength = <4>; > + nand-ecc-step-size = <512>; > + marvell,nand-keep-config; > + marvell,nand-enable-arbiter; > + nand-on-flash-bbt; > + > + partitions { > + compatible = "fixed-partitions"; > + #address-cells = <1>; > + #size-cells = <1>; > + > + partition@0 { > + label = "U-Boot"; > + reg = <0x00000000 0x00800000>; > + read-only; > + }; > + > + partition@800000 { > + label = "uImage"; > + reg = <0x00800000 0x00400000>; > + read-only; > + }; > + > + partition@c00000 { > + label = "Root"; > + reg = <0x00c00000 0x3f400000>; > + }; > + }; > + }; > + > + usb3@f0000 { > + status = "okay"; > + usb-phy = <&usb3_phy>; > + }; > + }; > + > + bm-bppi { > + status = "okay"; > + }; > + > + pcie-controller { > + status = "okay"; > + > + /* > + * The three PCIe units are accessible through > + * standard mini-PCIe slots on the board. > + */ > + pcie@1,0 { > + /* Port 0, Lane 0 */ > + status = "okay"; > + }; > + > + pcie@2,0 { > + /* Port 1, Lane 0 */ > + status = "okay"; > + }; > + > + pcie@3,0 { > + /* Port 2, Lane 0 */ > + status = "okay"; > + }; > + }; > + }; > + > + usb3_phy: usb3_phy { > + compatible = "usb-nop-xceiv"; > + vcc-supply = <®_xhci0_vbus>; > + }; > + > + reg_xhci0_vbus: xhci0-vbus { > + compatible = "regulator-fixed"; > + pinctrl-names = "default"; > + pinctrl-0 = <&xhci0_vbus_pins>; > + regulator-name = "xhci0-vbus"; > + regulator-min-microvolt = <5000000>; > + regulator-max-microvolt = <5000000>; > + enable-active-high; > + gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>; > + }; > +}; > + > +&spi1 { > + pinctrl-names = "default"; > + pinctrl-0 = <&spi1_pins>; > + status = "okay"; > + > + spi-flash@0 { > + #address-cells = <1>; > + #size-cells = <1>; > + compatible = "st,m25p128", "jedec,spi-nor"; > + reg = <0>; /* Chip select 0 */ > + spi-max-frequency = <54000000>; > + }; > +}; -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Sat Jan 14 15:37:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 857A3CAF9F9; Sat, 14 Jan 2017 15:37:55 +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 E86CD15F9; Sat, 14 Jan 2017 15:37:54 +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 v0EFbseI026618; Sat, 14 Jan 2017 15:37:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFbp4n026586; Sat, 14 Jan 2017 15:37:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141537.v0EFbp4n026586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312173 - in vendor/llvm/dist: . cmake/modules docs include/llvm/ADT include/llvm/Analysis include/llvm/CodeGen include/llvm/CodeGen/GlobalISel include/llvm/DebugInfo/CodeView include/l... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:37:55 -0000 Author: dim Date: Sat Jan 14 15:37:50 2017 New Revision: 312173 URL: https://svnweb.freebsd.org/changeset/base/312173 Log: Vendor import of llvm release_40 branch r292009: https://llvm.org/svn/llvm-project/llvm/branches/release_40@292009 Added: vendor/llvm/dist/cmake/modules/CheckLinkerFlag.cmake vendor/llvm/dist/include/llvm/Analysis/LoopAnalysisManager.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeDumper.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDatabase.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDatabaseVisitor.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDumperBase.h (contents, props changed) vendor/llvm/dist/include/llvm/Object/Decompressor.h (contents, props changed) vendor/llvm/dist/include/llvm/Transforms/Scalar/IVUsersPrinter.h (contents, props changed) vendor/llvm/dist/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h (contents, props changed) vendor/llvm/dist/include/llvm/Transforms/Scalar/LoopPassManager.h (contents, props changed) vendor/llvm/dist/include/llvm/XRay/ vendor/llvm/dist/include/llvm/XRay/Trace.h (contents, props changed) vendor/llvm/dist/include/llvm/XRay/XRayRecord.h (contents, props changed) vendor/llvm/dist/include/llvm/XRay/YAMLXRayRecord.h (contents, props changed) vendor/llvm/dist/lib/Analysis/LoopAnalysisManager.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/CVTypeDumper.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDatabase.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDatabaseVisitor.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp (contents, props changed) vendor/llvm/dist/lib/Object/Decompressor.cpp (contents, props changed) vendor/llvm/dist/lib/Transforms/Scalar/IVUsersPrinter.cpp (contents, props changed) vendor/llvm/dist/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp (contents, props changed) vendor/llvm/dist/lib/Transforms/Scalar/LoopPassManager.cpp (contents, props changed) vendor/llvm/dist/lib/XRay/ vendor/llvm/dist/lib/XRay/CMakeLists.txt (contents, props changed) vendor/llvm/dist/lib/XRay/Trace.cpp (contents, props changed) vendor/llvm/dist/test/Analysis/CostModel/X86/slm-arith-costs.ll vendor/llvm/dist/test/CodeGen/AMDGPU/constant-fold-imm-immreg.mir vendor/llvm/dist/test/CodeGen/AMDGPU/fadd-fma-fmul-combine.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fneg-combines.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fp16_to_fp32.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fp16_to_fp64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/select-fabs-fneg-extract-legacy.ll vendor/llvm/dist/test/CodeGen/AMDGPU/select-fabs-fneg-extract.ll vendor/llvm/dist/test/CodeGen/AMDGPU/select-opt.ll vendor/llvm/dist/test/CodeGen/AMDGPU/shrink-vop3-carry-out.mir vendor/llvm/dist/test/CodeGen/Mips/msa/immediates-bad.ll vendor/llvm/dist/test/CodeGen/Mips/msa/immediates.ll vendor/llvm/dist/test/CodeGen/Mips/msa/msa-nooddspreg.ll vendor/llvm/dist/test/CodeGen/PowerPC/change-no-infs.ll vendor/llvm/dist/test/CodeGen/X86/bypass-slow-division-32.ll vendor/llvm/dist/test/CodeGen/X86/bypass-slow-division-64.ll vendor/llvm/dist/test/CodeGen/X86/bypass-slow-division-tune.ll vendor/llvm/dist/test/CodeGen/X86/change-unsafe-fp-math.ll vendor/llvm/dist/test/CodeGen/X86/peephole.mir vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-avx512.ll vendor/llvm/dist/test/DebugInfo/Inputs/implicit-const-test.o (contents, props changed) vendor/llvm/dist/test/DebugInfo/dwarfdump-implicit-const.test vendor/llvm/dist/test/FileCheck/match-full-lines.txt (contents, props changed) vendor/llvm/dist/test/ObjectYAML/MachO/DWARF-debug_line.yaml vendor/llvm/dist/test/Transforms/LICM/opt-remarks-conditional-load.ll vendor/llvm/dist/test/Transforms/LICM/opt-remarks-intervening-store.ll vendor/llvm/dist/test/Transforms/LICM/opt-remarks.ll vendor/llvm/dist/test/Transforms/LoopVectorize/X86/mul_slm_16bit.ll vendor/llvm/dist/test/Transforms/LoopVectorize/pr31190.ll vendor/llvm/dist/test/Transforms/NewGVN/pr31594.ll vendor/llvm/dist/test/Transforms/PGOProfile/Inputs/multiple_hash_profile.proftext vendor/llvm/dist/test/Transforms/PGOProfile/multiple_hash_profile.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/X86/pr31599.ll vendor/llvm/dist/test/tools/llvm-config/booleans.test vendor/llvm/dist/test/tools/llvm-xray/X86/Inputs/elf64-objcopied-instrmap.bin (contents, props changed) vendor/llvm/dist/test/tools/llvm-xray/X86/Inputs/elf64-sample-o2.bin (contents, props changed) vendor/llvm/dist/test/tools/llvm-xray/X86/Inputs/naive-log-simple.xray (contents, props changed) vendor/llvm/dist/test/tools/llvm-xray/X86/Inputs/simple-instrmap.yaml vendor/llvm/dist/test/tools/llvm-xray/X86/Inputs/simple-xray-instrmap.yaml vendor/llvm/dist/test/tools/llvm-xray/X86/account-deduce-tail-call.yaml vendor/llvm/dist/test/tools/llvm-xray/X86/account-keep-going.yaml vendor/llvm/dist/test/tools/llvm-xray/X86/account-simple-case.yaml vendor/llvm/dist/test/tools/llvm-xray/X86/account-simple-sorting.yaml vendor/llvm/dist/test/tools/llvm-xray/X86/bad-instrmap-sizes.txt (contents, props changed) vendor/llvm/dist/test/tools/llvm-xray/X86/convert-roundtrip.yaml vendor/llvm/dist/test/tools/llvm-xray/X86/convert-to-yaml.txt (contents, props changed) vendor/llvm/dist/test/tools/llvm-xray/X86/convert-with-debug-syms.txt (contents, props changed) vendor/llvm/dist/test/tools/llvm-xray/X86/convert-with-standalone-instrmap.txt (contents, props changed) vendor/llvm/dist/test/tools/llvm-xray/X86/convert-with-yaml-instrmap.txt (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyBuiltinDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyBuiltinDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyClassDefinitionDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyClassDefinitionDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyCompilandDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyCompilandDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyEnumDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyEnumDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyExternalSymbolDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyExternalSymbolDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyFunctionDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyFunctionDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyTypeDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyTypeDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyTypedefDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyTypedefDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyVariableDumper.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/PrettyVariableDumper.h (contents, props changed) vendor/llvm/dist/tools/llvm-xray/func-id-helper.cc (contents, props changed) vendor/llvm/dist/tools/llvm-xray/func-id-helper.h (contents, props changed) vendor/llvm/dist/tools/llvm-xray/xray-account.cc (contents, props changed) vendor/llvm/dist/tools/llvm-xray/xray-account.h (contents, props changed) vendor/llvm/dist/tools/llvm-xray/xray-converter.cc (contents, props changed) vendor/llvm/dist/tools/llvm-xray/xray-converter.h (contents, props changed) vendor/llvm/dist/tools/llvm-xray/xray-record-yaml.h (contents, props changed) vendor/llvm/dist/unittests/Support/TarWriterTest.cpp (contents, props changed) vendor/llvm/dist/unittests/Transforms/Scalar/ vendor/llvm/dist/unittests/Transforms/Scalar/CMakeLists.txt (contents, props changed) vendor/llvm/dist/unittests/Transforms/Scalar/LoopPassManagerTest.cpp (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/ vendor/llvm/dist/utils/unittest/googlemock/LICENSE.txt (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/README.LLVM vendor/llvm/dist/utils/unittest/googlemock/include/ vendor/llvm/dist/utils/unittest/googlemock/include/gmock/ vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock-actions.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock-cardinalities.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock-generated-actions.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock-generated-function-mockers.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock-generated-matchers.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock-generated-nice-strict.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock-matchers.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock-more-actions.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock-more-matchers.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock-spec-builders.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/gmock.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/internal/ vendor/llvm/dist/utils/unittest/googlemock/include/gmock/internal/custom/ vendor/llvm/dist/utils/unittest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/internal/custom/gmock-matchers.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/internal/custom/gmock-port.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/include/gmock/internal/gmock-port.h (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/src/ vendor/llvm/dist/utils/unittest/googlemock/src/gmock-all.cc (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/src/gmock-cardinalities.cc (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/src/gmock-internal-utils.cc (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/src/gmock-matchers.cc (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/src/gmock-spec-builders.cc (contents, props changed) vendor/llvm/dist/utils/unittest/googlemock/src/gmock.cc (contents, props changed) Deleted: vendor/llvm/dist/include/llvm/Analysis/LoopPassManager.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDumper.h vendor/llvm/dist/lib/Analysis/LoopPassManager.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDumper.cpp vendor/llvm/dist/test/CodeGen/AMDGPU/fp16_to_fp.ll vendor/llvm/dist/test/CodeGen/X86/atom-bypass-slow-division-64.ll vendor/llvm/dist/test/CodeGen/X86/atom-bypass-slow-division.ll vendor/llvm/dist/test/CodeGen/X86/slow-div.ll vendor/llvm/dist/test/FileCheck/strict-whitespace-match-full-lines.txt vendor/llvm/dist/test/tools/llvm-xray/X86/bad-instrmap-sizes.bin vendor/llvm/dist/tools/llvm-pdbdump/BuiltinDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/BuiltinDumper.h vendor/llvm/dist/tools/llvm-pdbdump/ClassDefinitionDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/ClassDefinitionDumper.h vendor/llvm/dist/tools/llvm-pdbdump/CompilandDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/CompilandDumper.h vendor/llvm/dist/tools/llvm-pdbdump/EnumDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/EnumDumper.h vendor/llvm/dist/tools/llvm-pdbdump/ExternalSymbolDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/ExternalSymbolDumper.h vendor/llvm/dist/tools/llvm-pdbdump/FunctionDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/FunctionDumper.h vendor/llvm/dist/tools/llvm-pdbdump/TypeDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/TypeDumper.h vendor/llvm/dist/tools/llvm-pdbdump/TypedefDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/TypedefDumper.h vendor/llvm/dist/tools/llvm-pdbdump/VariableDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/VariableDumper.h vendor/llvm/dist/unittests/Analysis/LoopPassManagerTest.cpp Modified: vendor/llvm/dist/CMakeLists.txt vendor/llvm/dist/LICENSE.TXT vendor/llvm/dist/cmake/modules/AddLLVM.cmake vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake vendor/llvm/dist/docs/LangRef.rst vendor/llvm/dist/docs/ReleaseNotes.rst vendor/llvm/dist/include/llvm/ADT/PointerSumType.h vendor/llvm/dist/include/llvm/ADT/iterator.h vendor/llvm/dist/include/llvm/Analysis/AssumptionCache.h vendor/llvm/dist/include/llvm/Analysis/IVUsers.h vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h vendor/llvm/dist/include/llvm/Analysis/LoopAccessAnalysis.h vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h vendor/llvm/dist/include/llvm/CodeGen/DIE.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegBankSelect.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBank.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h vendor/llvm/dist/include/llvm/CodeGen/ISDOpcodes.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolDumper.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDie.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFFormValue.h vendor/llvm/dist/include/llvm/DebugInfo/MSF/StreamArray.h vendor/llvm/dist/include/llvm/IR/DIBuilder.h vendor/llvm/dist/include/llvm/IR/DebugInfoMetadata.h vendor/llvm/dist/include/llvm/IR/GlobalObject.h vendor/llvm/dist/include/llvm/IR/Intrinsics.td vendor/llvm/dist/include/llvm/IR/IntrinsicsAArch64.td vendor/llvm/dist/include/llvm/IR/IntrinsicsARM.td vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h vendor/llvm/dist/include/llvm/ObjectYAML/DWARFYAML.h vendor/llvm/dist/include/llvm/ObjectYAML/MachOYAML.h vendor/llvm/dist/include/llvm/Passes/PassBuilder.h vendor/llvm/dist/include/llvm/ProfileData/InstrProf.h vendor/llvm/dist/include/llvm/Support/CommandLine.h vendor/llvm/dist/include/llvm/Support/Dwarf.h vendor/llvm/dist/include/llvm/Support/FileOutputBuffer.h vendor/llvm/dist/include/llvm/Support/GenericDomTree.h vendor/llvm/dist/include/llvm/Target/TargetLowering.h vendor/llvm/dist/include/llvm/Target/TargetMachine.h vendor/llvm/dist/include/llvm/Target/TargetSelectionDAG.td vendor/llvm/dist/include/llvm/Target/TargetSubtargetInfo.h vendor/llvm/dist/include/llvm/Transforms/Scalar/IndVarSimplify.h vendor/llvm/dist/include/llvm/Transforms/Scalar/LICM.h vendor/llvm/dist/include/llvm/Transforms/Scalar/LoopDeletion.h vendor/llvm/dist/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h vendor/llvm/dist/include/llvm/Transforms/Scalar/LoopInstSimplify.h vendor/llvm/dist/include/llvm/Transforms/Scalar/LoopRotation.h vendor/llvm/dist/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h vendor/llvm/dist/include/llvm/Transforms/Scalar/LoopStrengthReduce.h vendor/llvm/dist/include/llvm/Transforms/Scalar/LoopUnrollPass.h vendor/llvm/dist/include/llvm/Transforms/Utils/LoopUtils.h vendor/llvm/dist/include/llvm/Transforms/Utils/UnrollLoop.h vendor/llvm/dist/include/llvm/Transforms/Vectorize/LoopVectorize.h vendor/llvm/dist/lib/Analysis/AssumptionCache.cpp vendor/llvm/dist/lib/Analysis/CMakeLists.txt vendor/llvm/dist/lib/Analysis/CostModel.cpp vendor/llvm/dist/lib/Analysis/IVUsers.cpp vendor/llvm/dist/lib/Analysis/InlineCost.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/LazyValueInfo.cpp vendor/llvm/dist/lib/Analysis/LoopAccessAnalysis.cpp vendor/llvm/dist/lib/Analysis/LoopInfo.cpp vendor/llvm/dist/lib/Analysis/LoopPass.cpp vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/CMakeLists.txt vendor/llvm/dist/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DIE.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfUnit.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/RegBankSelect.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/RegisterBank.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp vendor/llvm/dist/lib/CodeGen/MachineInstr.cpp vendor/llvm/dist/lib/CodeGen/PeepholeOptimizer.cpp vendor/llvm/dist/lib/CodeGen/ScheduleDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CMakeLists.txt vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolDumper.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFContext.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDie.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFFormValue.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFUnit.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp vendor/llvm/dist/lib/IR/AutoUpgrade.cpp vendor/llvm/dist/lib/IR/DIBuilder.cpp vendor/llvm/dist/lib/IR/Globals.cpp vendor/llvm/dist/lib/IR/LLVMContextImpl.h vendor/llvm/dist/lib/LTO/LTOBackend.cpp vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp vendor/llvm/dist/lib/Object/CMakeLists.txt vendor/llvm/dist/lib/ObjectYAML/DWARFYAML.cpp vendor/llvm/dist/lib/Passes/PassBuilder.cpp vendor/llvm/dist/lib/ProfileData/InstrProf.cpp vendor/llvm/dist/lib/Support/FileOutputBuffer.cpp vendor/llvm/dist/lib/Support/Host.cpp vendor/llvm/dist/lib/Support/TarWriter.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64GenRegisterBankInfo.def vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.td vendor/llvm/dist/lib/Target/AArch64/AArch64RegisterBankInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64TargetTransformInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64TargetTransformInfo.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h vendor/llvm/dist/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp vendor/llvm/dist/lib/Target/AMDGPU/EvergreenInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIFoldOperands.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.td vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIShrinkInstructions.cpp vendor/llvm/dist/lib/Target/AMDGPU/VOP1Instructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOP2Instructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOPCInstructions.td vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.h vendor/llvm/dist/lib/Target/ARM/ARMRegisterBankInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetTransformInfo.h vendor/llvm/dist/lib/Target/Lanai/LanaiTargetTransformInfo.h vendor/llvm/dist/lib/Target/Mips/MipsSEISelLowering.cpp vendor/llvm/dist/lib/Target/NVPTX/ManagedStringPool.h vendor/llvm/dist/lib/Target/NVPTX/NVPTXAsmPrinter.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXAsmPrinter.h vendor/llvm/dist/lib/Target/NVPTX/NVPTXISelLowering.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXInstrInfo.td vendor/llvm/dist/lib/Target/NVPTX/NVPTXSection.h vendor/llvm/dist/lib/Target/NVPTX/NVPTXTargetMachine.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXTargetObjectFile.h vendor/llvm/dist/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXTargetTransformInfo.h vendor/llvm/dist/lib/Target/PowerPC/PPCTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCTargetTransformInfo.h vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.cpp vendor/llvm/dist/lib/Target/TargetMachine.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyFastISel.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.h vendor/llvm/dist/lib/Target/X86/X86.td vendor/llvm/dist/lib/Target/X86/X86ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Target/X86/X86Subtarget.h vendor/llvm/dist/lib/Target/X86/X86TargetTransformInfo.cpp vendor/llvm/dist/lib/Target/X86/X86TargetTransformInfo.h vendor/llvm/dist/lib/Transforms/IPO/LowerTypeTests.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAddSub.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineInternal.h vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombinePHI.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineShifts.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/AddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/InstrProfiling.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/PGOInstrumentation.cpp vendor/llvm/dist/lib/Transforms/Scalar/CMakeLists.txt vendor/llvm/dist/lib/Transforms/Scalar/IndVarSimplify.cpp vendor/llvm/dist/lib/Transforms/Scalar/LICM.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopDeletion.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopDistribute.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopIdiomRecognize.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopInstSimplify.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopRotation.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopSimplifyCFG.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopSink.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopStrengthReduce.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopUnrollPass.cpp vendor/llvm/dist/lib/Transforms/Scalar/NewGVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/StructurizeCFG.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopUnroll.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopUnrollRuntime.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopUtils.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyLibCalls.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/lib/Transforms/Vectorize/SLPVectorizer.cpp vendor/llvm/dist/runtimes/CMakeLists.txt vendor/llvm/dist/test/Analysis/CostModel/AArch64/store.ll vendor/llvm/dist/test/Analysis/CostModel/X86/strided-load-i16.ll vendor/llvm/dist/test/Analysis/CostModel/X86/strided-load-i32.ll vendor/llvm/dist/test/Analysis/CostModel/X86/strided-load-i64.ll vendor/llvm/dist/test/Analysis/CostModel/X86/strided-load-i8.ll vendor/llvm/dist/test/Analysis/CostModel/X86/vshift-ashr-cost.ll vendor/llvm/dist/test/Analysis/CostModel/X86/vshift-lshr-cost.ll vendor/llvm/dist/test/Analysis/CostModel/X86/vshift-shl-cost.ll vendor/llvm/dist/test/Analysis/ScalarEvolution/max-trip-count.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-neon-copy.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-nvcast.ll vendor/llvm/dist/test/CodeGen/AArch64/bitreverse.ll vendor/llvm/dist/test/CodeGen/AArch64/rbit.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmul-2-combine-multi-use.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fp32_to_fp16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/insert_vector_elt.ll vendor/llvm/dist/test/CodeGen/AMDGPU/local-stack-slot-bug.ll vendor/llvm/dist/test/CodeGen/AMDGPU/mad-combine.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sext-in-reg.ll vendor/llvm/dist/test/CodeGen/AMDGPU/v_mac.ll vendor/llvm/dist/test/CodeGen/ARM/fp16-promote.ll vendor/llvm/dist/test/CodeGen/ARM/fpcmp_ueq.ll vendor/llvm/dist/test/CodeGen/ARM/vdup.ll vendor/llvm/dist/test/CodeGen/ARM/vpadd.ll vendor/llvm/dist/test/CodeGen/ARM/vtrn.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/extractelement.ll vendor/llvm/dist/test/CodeGen/NVPTX/fast-math.ll vendor/llvm/dist/test/CodeGen/PowerPC/variable_elem_vec_extracts.ll vendor/llvm/dist/test/CodeGen/WebAssembly/function-bitcasts.ll vendor/llvm/dist/test/CodeGen/X86/atomic-eflags-reuse.ll vendor/llvm/dist/test/CodeGen/X86/avx-cvt.ll vendor/llvm/dist/test/CodeGen/X86/avx-trunc.ll vendor/llvm/dist/test/CodeGen/X86/avx512-cvt.ll vendor/llvm/dist/test/CodeGen/X86/avx512-select.ll vendor/llvm/dist/test/CodeGen/X86/avx512-trunc.ll vendor/llvm/dist/test/CodeGen/X86/cmp.ll vendor/llvm/dist/test/CodeGen/X86/cpus.ll vendor/llvm/dist/test/CodeGen/X86/extractelement-index.ll vendor/llvm/dist/test/CodeGen/X86/extractelement-legalization-store-ordering.ll vendor/llvm/dist/test/CodeGen/X86/i64-mem-copy.ll vendor/llvm/dist/test/CodeGen/X86/implicit-null-checks.mir vendor/llvm/dist/test/CodeGen/X86/lzcnt-zext-cmp.ll vendor/llvm/dist/test/CodeGen/X86/slow-unaligned-mem.ll vendor/llvm/dist/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll vendor/llvm/dist/test/CodeGen/X86/vec_ins_extract-1.ll vendor/llvm/dist/test/CodeGen/X86/vec_insert-4.ll vendor/llvm/dist/test/CodeGen/X86/vec_insert-8.ll vendor/llvm/dist/test/CodeGen/X86/vec_int_to_fp.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-lshr-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-lshr-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-lshr-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-shl-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-shl-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-shl-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-combining-xop.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-variable-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-variable-256.ll vendor/llvm/dist/test/CodeGen/X86/x86-64-double-shifts-var.ll vendor/llvm/dist/test/DebugInfo/Generic/simplifycfg_sink_last_inst.ll vendor/llvm/dist/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_BE-relocations.s vendor/llvm/dist/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s vendor/llvm/dist/test/Instrumentation/AddressSanitizer/global_metadata_darwin.ll vendor/llvm/dist/test/MC/AMDGPU/vop_dpp.s vendor/llvm/dist/test/MC/AMDGPU/vop_sdwa.s vendor/llvm/dist/test/MC/ARM/directive-object_arch-2.s vendor/llvm/dist/test/MC/ARM/directive-object_arch.s vendor/llvm/dist/test/ObjectYAML/MachO/DWARF-debug_info.yaml vendor/llvm/dist/test/Other/loop-pass-ordering.ll vendor/llvm/dist/test/Other/new-pass-manager.ll vendor/llvm/dist/test/Other/pass-pipeline-parsing.ll vendor/llvm/dist/test/Transforms/GVN/assume-equal.ll vendor/llvm/dist/test/Transforms/GVN/invariant.group.ll vendor/llvm/dist/test/Transforms/InstCombine/fabs.ll vendor/llvm/dist/test/Transforms/InstCombine/fast-math.ll vendor/llvm/dist/test/Transforms/InstCombine/fdiv.ll vendor/llvm/dist/test/Transforms/InstCombine/pow-4.ll vendor/llvm/dist/test/Transforms/InstCombine/pow-sqrt.ll vendor/llvm/dist/test/Transforms/InstSimplify/floating-point-arithmetic.ll vendor/llvm/dist/test/Transforms/LICM/argmemonly-call.ll vendor/llvm/dist/test/Transforms/LICM/assume.ll vendor/llvm/dist/test/Transforms/LICM/atomics.ll vendor/llvm/dist/test/Transforms/LICM/basictest.ll vendor/llvm/dist/test/Transforms/LICM/constexpr.ll vendor/llvm/dist/test/Transforms/LICM/crash.ll vendor/llvm/dist/test/Transforms/LICM/debug-value.ll vendor/llvm/dist/test/Transforms/LICM/extra-copies.ll vendor/llvm/dist/test/Transforms/LICM/funclet.ll vendor/llvm/dist/test/Transforms/LICM/hoist-bitcast-load.ll vendor/llvm/dist/test/Transforms/LICM/hoist-deref-load.ll vendor/llvm/dist/test/Transforms/LICM/hoist-nounwind.ll vendor/llvm/dist/test/Transforms/LICM/hoist-round.ll vendor/llvm/dist/test/Transforms/LICM/hoisting.ll vendor/llvm/dist/test/Transforms/LICM/lcssa-ssa-promoter.ll vendor/llvm/dist/test/Transforms/LICM/no-preheader-test.ll vendor/llvm/dist/test/Transforms/LICM/preheader-safe.ll vendor/llvm/dist/test/Transforms/LICM/promote-order.ll vendor/llvm/dist/test/Transforms/LICM/promote-tls.ll vendor/llvm/dist/test/Transforms/LICM/scalar-promote-memmodel.ll vendor/llvm/dist/test/Transforms/LICM/scalar_promote-unwind.ll vendor/llvm/dist/test/Transforms/LICM/scalar_promote.ll vendor/llvm/dist/test/Transforms/LICM/speculate.ll vendor/llvm/dist/test/Transforms/LICM/volatile-alias.ll vendor/llvm/dist/test/Transforms/LoopSimplify/preserve-scev.ll vendor/llvm/dist/test/Transforms/LoopUnroll/peel-loop-pgo.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/Inputs/import-unsat.yaml vendor/llvm/dist/test/Transforms/LowerTypeTests/function.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/import-unsat.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/simple.ll vendor/llvm/dist/test/Transforms/NewGVN/assume-equal.ll vendor/llvm/dist/test/Transforms/NewGVN/invariant.group.ll vendor/llvm/dist/test/Transforms/PGOProfile/comdat_internal.ll vendor/llvm/dist/test/Transforms/PGOProfile/comdat_rename.ll vendor/llvm/dist/test/Transforms/PGOProfile/indirect_call_profile.ll vendor/llvm/dist/test/Transforms/StructurizeCFG/no-branch-to-entry.ll vendor/llvm/dist/tools/dsymutil/DwarfLinker.cpp vendor/llvm/dist/tools/llvm-config/BuildVariables.inc.in vendor/llvm/dist/tools/llvm-config/CMakeLists.txt vendor/llvm/dist/tools/llvm-config/llvm-config.cpp vendor/llvm/dist/tools/llvm-pdbdump/CMakeLists.txt vendor/llvm/dist/tools/llvm-pdbdump/LLVMOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/LLVMOutputStyle.h vendor/llvm/dist/tools/llvm-pdbdump/YAMLOutputStyle.h vendor/llvm/dist/tools/llvm-pdbdump/llvm-pdbdump.cpp vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/tools/llvm-xray/CMakeLists.txt vendor/llvm/dist/tools/llvm-xray/xray-extract.cc vendor/llvm/dist/tools/obj2yaml/dwarf2yaml.cpp vendor/llvm/dist/tools/opt/NewPMDriver.cpp vendor/llvm/dist/tools/yaml2obj/yaml2dwarf.cpp vendor/llvm/dist/tools/yaml2obj/yaml2macho.cpp vendor/llvm/dist/tools/yaml2obj/yaml2obj.h vendor/llvm/dist/unittests/Analysis/CMakeLists.txt vendor/llvm/dist/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp vendor/llvm/dist/unittests/IR/DominatorTreeTest.cpp vendor/llvm/dist/unittests/IR/IRBuilderTest.cpp vendor/llvm/dist/unittests/Support/CMakeLists.txt vendor/llvm/dist/unittests/Transforms/CMakeLists.txt vendor/llvm/dist/utils/release/build_llvm_package.bat vendor/llvm/dist/utils/unittest/CMakeLists.txt vendor/llvm/dist/utils/unittest/UnitTestMain/TestMain.cpp Modified: vendor/llvm/dist/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/CMakeLists.txt Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/CMakeLists.txt Sat Jan 14 15:37:50 2017 (r312173) @@ -29,7 +29,7 @@ if(NOT DEFINED LLVM_VERSION_PATCH) set(LLVM_VERSION_PATCH 0) endif() if(NOT DEFINED LLVM_VERSION_SUFFIX) - set(LLVM_VERSION_SUFFIX svn) + set(LLVM_VERSION_SUFFIX "") endif() if (POLICY CMP0048) Modified: vendor/llvm/dist/LICENSE.TXT ============================================================================== --- vendor/llvm/dist/LICENSE.TXT Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/LICENSE.TXT Sat Jan 14 15:37:50 2017 (r312173) @@ -4,7 +4,7 @@ LLVM Release License University of Illinois/NCSA Open Source License -Copyright (c) 2003-2016 University of Illinois at Urbana-Champaign. +Copyright (c) 2003-2017 University of Illinois at Urbana-Champaign. All rights reserved. Developed by: Modified: vendor/llvm/dist/cmake/modules/AddLLVM.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/AddLLVM.cmake Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/cmake/modules/AddLLVM.cmake Sat Jan 14 15:37:50 2017 (r312173) @@ -1007,6 +1007,7 @@ function(add_unittest test_suite test_na endif() include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include) + include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include) if (NOT LLVM_ENABLE_THREADS) list(APPEND LLVM_COMPILE_DEFINITIONS GTEST_HAS_PTHREAD=0) endif () Added: vendor/llvm/dist/cmake/modules/CheckLinkerFlag.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/cmake/modules/CheckLinkerFlag.cmake Sat Jan 14 15:37:50 2017 (r312173) @@ -0,0 +1,8 @@ +include(CheckCXXCompilerFlag) + +function(check_linker_flag flag out_var) + set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}") + check_cxx_compiler_flag("" ${out_var}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) +endfunction() Modified: vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake Sat Jan 14 15:37:50 2017 (r312173) @@ -597,6 +597,14 @@ if (UNIX AND append("-fcolor-diagnostics" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endif() +# lld doesn't print colored diagnostics when invoked from Ninja +if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja") + include(CheckLinkerFlag) + check_linker_flag("-Wl,-color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS) + append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,-color-diagnostics" + CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS) +endif() + # Add flags for add_dead_strip(). # FIXME: With MSVS, consider compiling with /Gy and linking with /OPT:REF? # But MinSizeRel seems to add that automatically, so maybe disable these Modified: vendor/llvm/dist/docs/LangRef.rst ============================================================================== --- vendor/llvm/dist/docs/LangRef.rst Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/docs/LangRef.rst Sat Jan 14 15:37:50 2017 (r312173) @@ -2169,8 +2169,9 @@ Fast-Math Flags LLVM IR floating-point binary ops (:ref:`fadd `, :ref:`fsub `, :ref:`fmul `, :ref:`fdiv `, -:ref:`frem `, :ref:`fcmp `) have the following flags that can -be set to enable otherwise unsafe floating point operations +:ref:`frem `, :ref:`fcmp `) and :ref:`call ` +instructions have the following flags that can be set to enable +otherwise unsafe floating point transformations. ``nnan`` No NaNs - Allow optimizations to assume the arguments and result are not Modified: vendor/llvm/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/llvm/dist/docs/ReleaseNotes.rst Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/docs/ReleaseNotes.rst Sat Jan 14 15:37:50 2017 (r312173) @@ -26,11 +26,6 @@ have questions or comments, the `LLVM De `_ is a good place to send them. -Note that if you are reading this file from a Subversion checkout or the main -LLVM web page, this document applies to the *next* release, not the current -one. To see the release notes for a specific release, please see the `releases -page `_. - Non-comprehensive list of changes in this release ================================================= * The C API functions LLVMAddFunctionAttr, LLVMGetFunctionAttr, @@ -57,6 +52,9 @@ Non-comprehensive list of changes in thi the previously used names should become descriptions and a short name in the style of a programming language identifier should be added. +* LLVM now handles invariant.group across different basic blocks, which makes + it possible to devirtualize virtual calls inside loops. + * ... next change ... .. NOTE Modified: vendor/llvm/dist/include/llvm/ADT/PointerSumType.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/PointerSumType.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/ADT/PointerSumType.h Sat Jan 14 15:37:50 2017 (r312173) @@ -94,7 +94,7 @@ public: return HelperT::template Lookup::TraitsT::getFromVoidPointer(getImpl()); } - operator bool() const { return Value & HelperT::PointerMask; } + explicit operator bool() const { return Value & HelperT::PointerMask; } bool operator==(const PointerSumType &R) const { return Value == R.Value; } bool operator!=(const PointerSumType &R) const { return Value != R.Value; } bool operator<(const PointerSumType &R) const { return Value < R.Value; } Modified: vendor/llvm/dist/include/llvm/ADT/iterator.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/iterator.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/ADT/iterator.h Sat Jan 14 15:37:50 2017 (r312173) @@ -33,6 +33,32 @@ namespace llvm { /// Another abstraction that this doesn't provide is implementing increment in /// terms of addition of one. These aren't equivalent for all iterator /// categories, and respecting that adds a lot of complexity for little gain. +/// +/// Classes wishing to use `iterator_facade_base` should implement the following +/// methods: +/// +/// Forward Iterators: +/// (All of the following methods) +/// - DerivedT &operator=(const DerivedT &R); +/// - bool operator==(const DerivedT &R) const; +/// - const T &operator*() const; +/// - T &operator*(); +/// - DerivedT &operator++(); +/// +/// Bidirectional Iterators: +/// (All methods of forward iterators, plus the following) +/// - DerivedT &operator--(); +/// +/// Random-access Iterators: +/// (All methods of bidirectional iterators excluding the following) +/// - DerivedT &operator++(); +/// - DerivedT &operator--(); +/// (and plus the following) +/// - bool operator<(const DerivedT &RHS) const; +/// - DifferenceTypeT operator-(const DerivedT &R) const; +/// - DerivedT &operator+=(DifferenceTypeT N); +/// - DerivedT &operator-=(DifferenceTypeT N); +/// template Modified: vendor/llvm/dist/include/llvm/Analysis/AssumptionCache.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/AssumptionCache.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/Analysis/AssumptionCache.h Sat Jan 14 15:37:50 2017 (r312173) @@ -46,6 +46,30 @@ class AssumptionCache { /// intrinsic. SmallVector AssumeHandles; + class AffectedValueCallbackVH final : public CallbackVH { + AssumptionCache *AC; + void deleted() override; + void allUsesReplacedWith(Value *) override; + + public: + using DMI = DenseMapInfo; + + AffectedValueCallbackVH(Value *V, AssumptionCache *AC = nullptr) + : CallbackVH(V), AC(AC) {} + }; + + friend AffectedValueCallbackVH; + + /// \brief A map of values about which an assumption might be providing + /// information to the relevant set of assumptions. + using AffectedValuesMap = + DenseMap, + AffectedValueCallbackVH::DMI>; + AffectedValuesMap AffectedValues; + + /// Get the vector of assumptions which affect a value from the cache. + SmallVector &getAffectedValues(Value *V); + /// \brief Flag tracking whether we have scanned the function yet. /// /// We want to be as lazy about this as possible, and so we scan the function @@ -66,11 +90,16 @@ public: /// not already be in the cache. void registerAssumption(CallInst *CI); + /// \brief Update the cache of values being affected by this assumption (i.e. + /// the values about which this assumption provides information). + void updateAffectedValues(CallInst *CI); + /// \brief Clear the cache of @llvm.assume intrinsics for a function. /// /// It will be re-scanned the next time it is requested. void clear() { AssumeHandles.clear(); + AffectedValues.clear(); Scanned = false; } @@ -87,6 +116,18 @@ public: scanFunction(); return AssumeHandles; } + + /// \brief Access the list of assumptions which affect this value. + MutableArrayRef assumptionsFor(const Value *V) { + if (!Scanned) + scanFunction(); + + auto AVI = AffectedValues.find_as(const_cast(V)); + if (AVI == AffectedValues.end()) + return MutableArrayRef(); + + return AVI->second; + } }; /// \brief A function analysis which provides an \c AssumptionCache. Modified: vendor/llvm/dist/include/llvm/Analysis/IVUsers.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/IVUsers.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/Analysis/IVUsers.h Sat Jan 14 15:37:50 2017 (r312173) @@ -15,8 +15,8 @@ #ifndef LLVM_ANALYSIS_IVUSERS_H #define LLVM_ANALYSIS_IVUSERS_H +#include "llvm/Analysis/LoopAnalysisManager.h" #include "llvm/Analysis/LoopPass.h" -#include "llvm/Analysis/LoopPassManager.h" #include "llvm/Analysis/ScalarEvolutionNormalization.h" #include "llvm/IR/ValueHandle.h" @@ -193,17 +193,10 @@ class IVUsersAnalysis : public AnalysisI public: typedef IVUsers Result; - IVUsers run(Loop &L, LoopAnalysisManager &AM); + IVUsers run(Loop &L, LoopAnalysisManager &AM, + LoopStandardAnalysisResults &AR); }; -/// Printer pass for the \c IVUsers for a loop. -class IVUsersPrinterPass : public PassInfoMixin { - raw_ostream &OS; - -public: - explicit IVUsersPrinterPass(raw_ostream &OS) : OS(OS) {} - PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); -}; } #endif Modified: vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h Sat Jan 14 15:37:50 2017 (r312173) @@ -148,7 +148,7 @@ public: /// /// This happens when an edge has been deleted. We leave the edge objects /// around but clear them. - operator bool() const; + explicit operator bool() const; /// Returnss the \c Kind of the edge. Kind getKind() const; Modified: vendor/llvm/dist/include/llvm/Analysis/LoopAccessAnalysis.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LoopAccessAnalysis.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/Analysis/LoopAccessAnalysis.h Sat Jan 14 15:37:50 2017 (r312173) @@ -20,7 +20,7 @@ #include "llvm/ADT/SetVector.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/AliasSetTracker.h" -#include "llvm/Analysis/LoopPassManager.h" +#include "llvm/Analysis/LoopAnalysisManager.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/ValueHandle.h" @@ -753,18 +753,8 @@ class LoopAccessAnalysis public: typedef LoopAccessInfo Result; - Result run(Loop &, LoopAnalysisManager &); - static StringRef name() { return "LoopAccessAnalysis"; } -}; - -/// \brief Printer pass for the \c LoopAccessInfo results. -class LoopAccessInfoPrinterPass - : public PassInfoMixin { - raw_ostream &OS; -public: - explicit LoopAccessInfoPrinterPass(raw_ostream &OS) : OS(OS) {} - PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM); + Result run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR); }; inline Instruction *MemoryDepChecker::Dependence::getSource( Added: vendor/llvm/dist/include/llvm/Analysis/LoopAnalysisManager.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/Analysis/LoopAnalysisManager.h Sat Jan 14 15:37:50 2017 (r312173) @@ -0,0 +1,155 @@ +//===- LoopAnalysisManager.h - Loop analysis management ---------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// \file +/// +/// This header provides classes for managing per-loop analyses. These are +/// typically used as part of a loop pass pipeline over the loop nests of +/// a function. +/// +/// Loop analyses are allowed to make some simplifying assumptions: +/// 1) Loops are, where possible, in simplified form. +/// 2) Loops are *always* in LCSSA form. +/// 3) A collection of analysis results are available: +/// - LoopInfo +/// - DominatorTree +/// - ScalarEvolution +/// - AAManager +/// +/// The primary mechanism to provide these invariants is the loop pass manager, +/// but they can also be manually provided in order to reason about a loop from +/// outside of a dedicated pass manager. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ANALYSIS_LOOPANALYSISMANAGER_H +#define LLVM_ANALYSIS_LOOPANALYSISMANAGER_H + +#include "llvm/ADT/PostOrderIterator.h" +#include "llvm/ADT/PriorityWorklist.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Analysis/BasicAliasAnalysis.h" +#include "llvm/Analysis/GlobalsModRef.h" +#include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/ScalarEvolution.h" +#include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h" +#include "llvm/Analysis/TargetLibraryInfo.h" +#include "llvm/Analysis/TargetTransformInfo.h" +#include "llvm/IR/Dominators.h" +#include "llvm/IR/PassManager.h" + +namespace llvm { + +/// The adaptor from a function pass to a loop pass computes these analyses and +/// makes them available to the loop passes "for free". Each loop pass is +/// expected expected to update these analyses if necessary to ensure they're +/// valid after it runs. +struct LoopStandardAnalysisResults { + AAResults &AA; + AssumptionCache &AC; + DominatorTree &DT; + LoopInfo &LI; + ScalarEvolution &SE; + TargetLibraryInfo &TLI; + TargetTransformInfo &TTI; +}; + +/// Extern template declaration for the analysis set for this IR unit. +extern template class AllAnalysesOn; + +extern template class AnalysisManager; +/// \brief The loop analysis manager. +/// +/// See the documentation for the AnalysisManager template for detail +/// documentation. This typedef serves as a convenient way to refer to this +/// construct in the adaptors and proxies used to integrate this into the larger +/// pass manager infrastructure. +typedef AnalysisManager + LoopAnalysisManager; + +/// A proxy from a \c LoopAnalysisManager to a \c Function. +typedef InnerAnalysisManagerProxy + LoopAnalysisManagerFunctionProxy; + +/// A specialized result for the \c LoopAnalysisManagerFunctionProxy which +/// retains a \c LoopInfo reference. +/// +/// This allows it to collect loop objects for which analysis results may be +/// cached in the \c LoopAnalysisManager. +template <> class LoopAnalysisManagerFunctionProxy::Result { +public: + explicit Result(LoopAnalysisManager &InnerAM, LoopInfo &LI) + : InnerAM(&InnerAM), LI(&LI) {} + Result(Result &&Arg) : InnerAM(std::move(Arg.InnerAM)), LI(Arg.LI) { + // We have to null out the analysis manager in the moved-from state + // because we are taking ownership of the responsibilty to clear the + // analysis state. + Arg.InnerAM = nullptr; + } + Result &operator=(Result &&RHS) { + InnerAM = RHS.InnerAM; + LI = RHS.LI; + // We have to null out the analysis manager in the moved-from state + // because we are taking ownership of the responsibilty to clear the + // analysis state. + RHS.InnerAM = nullptr; + return *this; + } + ~Result() { + // InnerAM is cleared in a moved from state where there is nothing to do. + if (!InnerAM) + return; + + // Clear out the analysis manager if we're being destroyed -- it means we + // didn't even see an invalidate call when we got invalidated. + InnerAM->clear(); + } + + /// Accessor for the analysis manager. + LoopAnalysisManager &getManager() { return *InnerAM; } + + /// Handler for invalidation of the proxy for a particular function. + /// + /// If the proxy, \c LoopInfo, and associated analyses are preserved, this + /// will merely forward the invalidation event to any cached loop analysis + /// results for loops within this function. + /// + /// If the necessary loop infrastructure is not preserved, this will forcibly + /// clear all of the cached analysis results that are keyed on the \c + /// LoopInfo for this function. + bool invalidate(Function &F, const PreservedAnalyses &PA, + FunctionAnalysisManager::Invalidator &Inv); + +private: + LoopAnalysisManager *InnerAM; + LoopInfo *LI; +}; + +/// Provide a specialized run method for the \c LoopAnalysisManagerFunctionProxy +/// so it can pass the \c LoopInfo to the result. +template <> +LoopAnalysisManagerFunctionProxy::Result +LoopAnalysisManagerFunctionProxy::run(Function &F, FunctionAnalysisManager &AM); + +// Ensure the \c LoopAnalysisManagerFunctionProxy is provided as an extern +// template. +extern template class InnerAnalysisManagerProxy; + +extern template class OuterAnalysisManagerProxy; +/// A proxy from a \c FunctionAnalysisManager to a \c Loop. +typedef OuterAnalysisManagerProxy + FunctionAnalysisManagerLoopProxy; + +/// Returns the minimum set of Analyses that all loop passes must preserve. +PreservedAnalyses getLoopPassPreservedAnalyses(); +} + +#endif // LLVM_ANALYSIS_LOOPANALYSISMANAGER_H Modified: vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h Sat Jan 14 15:37:50 2017 (r312173) @@ -853,17 +853,8 @@ public: void getAnalysisUsage(AnalysisUsage &AU) const override; }; -/// \brief Pass for printing a loop's contents as LLVM's text IR assembly. -class PrintLoopPass : public PassInfoMixin { - raw_ostream &OS; - std::string Banner; - -public: - PrintLoopPass(); - PrintLoopPass(raw_ostream &OS, const std::string &Banner = ""); - - PreservedAnalyses run(Loop &L, AnalysisManager &); -}; +/// Function to print a loop's contents as LLVM's text IR assembly. +void printLoop(Loop &L, raw_ostream &OS, const std::string &Banner = ""); } // End llvm namespace Modified: vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h Sat Jan 14 15:37:50 2017 (r312173) @@ -302,6 +302,10 @@ private: NonLocalPointerInfo() : Size(MemoryLocation::UnknownSize) {} }; + /// Cache storing single nonlocal def for the instruction. + /// It is set when nonlocal def would be found in function returning only + /// local dependencies. + DenseMap NonLocalDefsCache; /// This map stores the cached results of doing a pointer lookup at the /// bottom of a block. /// @@ -441,9 +445,9 @@ public: /// This analysis looks for other loads and stores with invariant.group /// metadata and the same pointer operand. Returns Unknown if it does not /// find anything, and Def if it can be assumed that 2 instructions load or - /// store the same value. - /// FIXME: This analysis works only on single block because of restrictions - /// at the call site. + /// store the same value and NonLocal which indicate that non-local Def was + /// found, which can be retrieved by calling getNonLocalPointerDependency + /// with the same queried instruction. MemDepResult getInvariantGroupPointerDependency(LoadInst *LI, BasicBlock *BB); /// Looks at a memory location for a load (specified by MemLocBase, Offs, and Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Sat Jan 14 15:37:50 2017 (r312173) @@ -55,6 +55,11 @@ struct MemIntrinsicInfo { // Same Id is set by the target for corresponding load/store intrinsics. unsigned short MatchingId; int NumMemRefs; + + /// This is the pointer that the intrinsic is loading from or storing to. + /// If this is non-null, then analysis/optimization passes can assume that + /// this intrinsic is functionally equivalent to a load/store from this + /// pointer. Value *PtrVal; }; @@ -518,11 +523,15 @@ public: unsigned getMaxInterleaveFactor(unsigned VF) const; /// \return The expected cost of arithmetic ops, such as mul, xor, fsub, etc. + /// \p Args is an optional argument which holds the instruction operands + /// values so the TTI can analyize those values searching for special + /// cases\optimizations based on those values. int getArithmeticInstrCost( unsigned Opcode, Type *Ty, OperandValueKind Opd1Info = OK_AnyValue, OperandValueKind Opd2Info = OK_AnyValue, OperandValueProperties Opd1PropInfo = OP_None, - OperandValueProperties Opd2PropInfo = OP_None) const; + OperandValueProperties Opd2PropInfo = OP_None, + ArrayRef Args = ArrayRef()) const; /// \return The cost of a shuffle instruction of kind Kind and of type Tp. /// The index and subtype parameters are used by the subvector insertion and @@ -763,7 +772,8 @@ public: getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind Opd1Info, OperandValueKind Opd2Info, OperandValueProperties Opd1PropInfo, - OperandValueProperties Opd2PropInfo) = 0; + OperandValueProperties Opd2PropInfo, + ArrayRef Args) = 0; virtual int getShuffleCost(ShuffleKind Kind, Type *Tp, int Index, Type *SubTp) = 0; virtual int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src) = 0; @@ -984,9 +994,10 @@ public: getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind Opd1Info, OperandValueKind Opd2Info, OperandValueProperties Opd1PropInfo, - OperandValueProperties Opd2PropInfo) override { + OperandValueProperties Opd2PropInfo, + ArrayRef Args) override { return Impl.getArithmeticInstrCost(Opcode, Ty, Opd1Info, Opd2Info, - Opd1PropInfo, Opd2PropInfo); + Opd1PropInfo, Opd2PropInfo, Args); } int getShuffleCost(ShuffleKind Kind, Type *Tp, int Index, Type *SubTp) override { Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Sat Jan 14 15:37:50 2017 (r312173) @@ -306,7 +306,8 @@ public: TTI::OperandValueKind Opd1Info, TTI::OperandValueKind Opd2Info, TTI::OperandValueProperties Opd1PropInfo, - TTI::OperandValueProperties Opd2PropInfo) { + TTI::OperandValueProperties Opd2PropInfo, + ArrayRef Args) { return 1; } @@ -427,6 +428,63 @@ public: return VF; } protected: + // Obtain the minimum required size to hold the value (without the sign) + // In case of a vector it returns the min required size for one element. + unsigned minRequiredElementSize(const Value* Val, bool &isSigned) { + if (isa(Val) || isa(Val)) { + const auto* VectorValue = cast(Val); + + // In case of a vector need to pick the max between the min + // required size for each element + auto *VT = cast(Val->getType()); + + // Assume unsigned elements + isSigned = false; + + // The max required size is the total vector width divided by num + // of elements in the vector + unsigned MaxRequiredSize = VT->getBitWidth() / VT->getNumElements(); + + unsigned MinRequiredSize = 0; + for(unsigned i = 0, e = VT->getNumElements(); i < e; ++i) { + if (auto* IntElement = + dyn_cast(VectorValue->getAggregateElement(i))) { + bool signedElement = IntElement->getValue().isNegative(); + // Get the element min required size. + unsigned ElementMinRequiredSize = + IntElement->getValue().getMinSignedBits() - 1; + // In case one element is signed then all the vector is signed. + isSigned |= signedElement; + // Save the max required bit size between all the elements. + MinRequiredSize = std::max(MinRequiredSize, ElementMinRequiredSize); + } + else { + // not an int constant element + return MaxRequiredSize; + } + } + return MinRequiredSize; + } + + if (const auto* CI = dyn_cast(Val)) { + isSigned = CI->getValue().isNegative(); + return CI->getValue().getMinSignedBits() - 1; + } + + if (const auto* Cast = dyn_cast(Val)) { + isSigned = true; + return Cast->getSrcTy()->getScalarSizeInBits() - 1; + } + + if (const auto* Cast = dyn_cast(Val)) { + isSigned = false; + return Cast->getSrcTy()->getScalarSizeInBits(); + } + + isSigned = false; + return Val->getType()->getScalarSizeInBits(); + } + bool isStridedAccess(const SCEV *Ptr) { return Ptr && isa(Ptr); } Modified: vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h Sat Jan 14 15:37:50 2017 (r312173) @@ -169,8 +169,12 @@ template class ArrayRef; /// Return true if we can prove that the specified FP value is either a NaN or /// never less than 0.0. - bool CannotBeOrderedLessThanZero(const Value *V, const TargetLibraryInfo *TLI, - unsigned Depth = 0); + /// If \p IncludeNeg0 is false, -0.0 is considered less than 0.0. + bool CannotBeOrderedLessThanZero(const Value *V, const TargetLibraryInfo *TLI); + + /// \returns true if we can prove that the specified FP value has a 0 sign + /// bit. + bool SignBitMustBeZero(const Value *V, const TargetLibraryInfo *TLI); /// If the specified value can be set by repeating the same byte in memory, /// return the i8 value that it is represented with. This is true for all i8 Modified: vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Sat Jan 14 15:37:50 2017 (r312173) @@ -308,7 +308,8 @@ public: TTI::OperandValueKind Opd1Info = TTI::OK_AnyValue, TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue, TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None, - TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None) { + TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None, + ArrayRef Args = ArrayRef()) { // Check if any of the operands are vector operands. const TargetLoweringBase *TLI = getTLI(); int ISD = TLI->InstructionOpcodeToISD(Opcode); Modified: vendor/llvm/dist/include/llvm/CodeGen/DIE.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/DIE.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/CodeGen/DIE.h Sat Jan 14 15:37:50 2017 (r312173) @@ -52,13 +52,20 @@ class DIEAbbrevData { /// Dwarf form code. dwarf::Form Form; + /// Dwarf attribute value for DW_FORM_implicit_const + int64_t Value; + public: - DIEAbbrevData(dwarf::Attribute A, dwarf::Form F) : Attribute(A), Form(F) {} + DIEAbbrevData(dwarf::Attribute A, dwarf::Form F) + : Attribute(A), Form(F), Value(0) {} + DIEAbbrevData(dwarf::Attribute A, int64_t V) + : Attribute(A), Form(dwarf::DW_FORM_implicit_const), Value(V) {} /// Accessors. /// @{ dwarf::Attribute getAttribute() const { return Attribute; } dwarf::Form getForm() const { return Form; } + int64_t getValue() const { return Value; } /// @} /// Used to gather unique data for the abbreviation folding set. @@ -102,6 +109,11 @@ public: Data.push_back(DIEAbbrevData(Attribute, Form)); } + /// Adds attribute with DW_FORM_implicit_const value + void AddImplicitConstAttribute(dwarf::Attribute Attribute, int64_t Value) { + Data.push_back(DIEAbbrevData(Attribute, Value)); + } + /// Used to gather unique data for the abbreviation folding set. void Profile(FoldingSetNodeID &ID) const; Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegBankSelect.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegBankSelect.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegBankSelect.h Sat Jan 14 15:37:50 2017 (r312173) @@ -76,6 +76,7 @@ class MachineBlockFrequencyInfo; class MachineRegisterInfo; class TargetPassConfig; class TargetRegisterInfo; +class raw_ostream; /// This pass implements the reg bank selector pass used in the GlobalISel /// pipeline. At the end of this pass, all register operands have been assigned @@ -450,6 +451,18 @@ private: bool operator>(const MappingCost &Cost) const { return *this != Cost && Cost < *this; } + + /// Print this on dbgs() stream. + void dump() const; + + /// Print this on \p OS; + void print(raw_ostream &OS) const; + + /// Overload the stream operator for easy debug printing. + friend raw_ostream &operator<<(raw_ostream &OS, const MappingCost &Cost) { + Cost.print(OS); + return OS; + } }; /// Interface to the target lowering info related @@ -626,6 +639,7 @@ public: /// \endcode bool runOnMachineFunction(MachineFunction &MF) override; }; + } // End namespace llvm. #endif Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBank.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBank.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBank.h Sat Jan 14 15:37:50 2017 (r312173) @@ -41,11 +41,8 @@ private: friend RegisterBankInfo; public: - /// The default constructor will leave the object in - /// an invalid state. I.e. isValid() == false. - /// The fields must be updated to fix that and only - /// RegisterBankInfo instances are allowed to do that - RegisterBank(); + RegisterBank(unsigned ID, const char *Name, unsigned Size, + const uint32_t *ContainedRegClasses); /// Get the identifier of this register bank. unsigned getID() const { return ID; } Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h Sat Jan 14 15:37:50 2017 (r312173) @@ -384,10 +384,6 @@ protected: /// Create a RegisterBankInfo that can accomodate up to \p NumRegBanks /// RegisterBank instances. - /// - /// \note For the verify method to succeed all the \p NumRegBanks - /// must be initialized by createRegisterBank and updated with - /// addRegBankCoverage RegisterBank. RegisterBankInfo(RegisterBank **RegBanks, unsigned NumRegBanks); /// This constructor is meaningless. @@ -400,31 +396,6 @@ protected: llvm_unreachable("This constructor should not be executed"); } - /// Create a new register bank with the given parameter and add it - /// to RegBanks. - /// \pre \p ID must not already be used. - /// \pre \p ID < NumRegBanks. - void createRegisterBank(unsigned ID, const char *Name); - - /// Add \p RCId to the set of register class that the register bank, - /// identified \p ID, covers. - /// This method transitively adds all the sub classes and the subreg-classes - /// of \p RCId to the set of covered register classes. - /// It also adjusts the size of the register bank to reflect the maximal - /// size of a value that can be hold into that register bank. - /// - /// \note This method does *not* add the super classes of \p RCId. - /// The rationale is if \p ID covers the registers of \p RCId, that - /// does not necessarily mean that \p ID covers the set of registers - /// of RCId's superclasses. - /// This method does *not* add the superreg classes as well for consistents. - /// The expected use is to add the coverage top-down with respect to the - /// register hierarchy. - /// - /// \todo TableGen should just generate the BitSet vector for us. - void addRegBankCoverage(unsigned ID, unsigned RCId, - const TargetRegisterInfo &TRI); - /// Get the register bank identified by \p ID. RegisterBank &getRegBank(unsigned ID) { assert(ID < getNumRegBanks() && "Accessing an unknown register bank"); Modified: vendor/llvm/dist/include/llvm/CodeGen/ISDOpcodes.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/ISDOpcodes.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/CodeGen/ISDOpcodes.h Sat Jan 14 15:37:50 2017 (r312173) @@ -503,19 +503,6 @@ namespace ISD { /// address spaces. ADDRSPACECAST, - /// CONVERT_RNDSAT - This operator is used to support various conversions - /// between various types (float, signed, unsigned and vectors of those - /// types) with rounding and saturation. NOTE: Avoid using this operator as - /// most target don't support it and the operator might be removed in the - /// future. It takes the following arguments: - /// 0) value - /// 1) dest type (type to convert to) - /// 2) src type (type to convert from) - /// 3) rounding imm - /// 4) saturation imm - /// 5) ISD::CvtCode indicating the type of conversion to do - CONVERT_RNDSAT, - /// FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions /// and truncation for half-precision (16 bit) floating numbers. These nodes /// form a semi-softened interface for dealing with f16 (as an i16), which @@ -927,21 +914,6 @@ namespace ISD { /// SETCC_INVALID if it is not possible to represent the resultant comparison. CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, bool isInteger); - //===--------------------------------------------------------------------===// - /// This enum defines the various converts CONVERT_RNDSAT supports. - enum CvtCode { - CVT_FF, /// Float from Float - CVT_FS, /// Float from Signed - CVT_FU, /// Float from Unsigned - CVT_SF, /// Signed from Float - CVT_UF, /// Unsigned from Float - CVT_SS, /// Signed from Signed - CVT_SU, /// Signed from Unsigned - CVT_US, /// Unsigned from Signed - CVT_UU, /// Unsigned from Unsigned - CVT_INVALID /// Marker - Invalid opcode - }; - } // end llvm::ISD namespace } // end llvm namespace Modified: vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h Sat Jan 14 15:37:50 2017 (r312173) @@ -626,12 +626,6 @@ public: SDValue getCondCode(ISD::CondCode Cond); - /// Returns the ConvertRndSat Note: Avoid using this node because it may - /// disappear in the future and most targets don't support it. - SDValue getConvertRndSat(EVT VT, const SDLoc &dl, SDValue Val, SDValue DTy, - SDValue STy, SDValue Rnd, SDValue Sat, - ISD::CvtCode Code); - /// Return an ISD::VECTOR_SHUFFLE node. The number of elements in VT, /// which must be a vector type, must match the number of mask elements /// NumElts. An integer mask element equal to -1 is treated as undefined. Modified: vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h Sat Jan 14 15:37:50 2017 (r312173) @@ -1860,26 +1860,6 @@ public: } }; -/// NOTE: avoid using this node as this may disappear in the -/// future and most targets don't support it. -class CvtRndSatSDNode : public SDNode { - ISD::CvtCode CvtCode; - - friend class SelectionDAG; - - explicit CvtRndSatSDNode(EVT VT, unsigned Order, const DebugLoc &dl, - ISD::CvtCode Code) - : SDNode(ISD::CONVERT_RNDSAT, Order, dl, getSDVTList(VT)), CvtCode(Code) { - } - -public: - ISD::CvtCode getCvtCode() const { return CvtCode; } - - static bool classof(const SDNode *N) { - return N->getOpcode() == ISD::CONVERT_RNDSAT; - } -}; - /// This class is used to represent EVT's, which are used /// to parameterize some operations. class VTSDNode : public SDNode { @@ -2041,7 +2021,7 @@ public: friend class SelectionDAG; MaskedStoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, - bool isTrunc, bool isCompressing, EVT MemVT, + bool isTrunc, bool isCompressing, EVT MemVT, MachineMemOperand *MMO) : MaskedLoadStoreSDNode(ISD::MSTORE, Order, dl, VTs, MemVT, MMO) { StoreSDNodeBits.IsTruncating = isTrunc; @@ -2054,8 +2034,8 @@ public: bool isTruncatingStore() const { return StoreSDNodeBits.IsTruncating; } /// Returns true if the op does a compression to the vector before storing. - /// The node contiguously stores the active elements (integers or floats) - /// in src (those with their respective bit set in writemask k) to unaligned + /// The node contiguously stores the active elements (integers or floats) + /// in src (those with their respective bit set in writemask k) to unaligned /// memory at base_addr. bool isCompressingStore() const { return StoreSDNodeBits.IsCompressing; } Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeDumper.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeDumper.h Sat Jan 14 15:37:50 2017 (r312173) @@ -0,0 +1,56 @@ +//===-- CVTypeDumper.h - CodeView type info dumper --------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_DEBUGINFO_CODEVIEW_CVTYPEDUMPER_H +#define LLVM_DEBUGINFO_CODEVIEW_CVTYPEDUMPER_H + +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/StringSet.h" +#include "llvm/DebugInfo/CodeView/TypeDatabase.h" +#include "llvm/DebugInfo/CodeView/TypeIndex.h" +#include "llvm/DebugInfo/CodeView/TypeRecord.h" +#include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h" +#include "llvm/Support/ScopedPrinter.h" + +namespace llvm { + +namespace codeview { + +/// Dumper for CodeView type streams found in COFF object files and PDB files. +class CVTypeDumper { +public: + explicit CVTypeDumper(TypeDatabase &TypeDB) : TypeDB(TypeDB) {} + + /// Dumps one type record. Returns false if there was a type parsing error, + /// and true otherwise. This should be called in order, since the dumper + /// maintains state about previous records which are necessary for cross + /// type references. + Error dump(const CVType &Record, TypeVisitorCallbacks &Dumper); + + /// Dumps the type records in Types. Returns false if there was a type stream + /// parse error, and true otherwise. + Error dump(const CVTypeArray &Types, TypeVisitorCallbacks &Dumper); + + /// Dumps the type records in Data. Returns false if there was a type stream + /// parse error, and true otherwise. Use this method instead of the + /// CVTypeArray overload when type records are laid out contiguously in + /// memory. + Error dump(ArrayRef Data, TypeVisitorCallbacks &Dumper); + + static void printTypeIndex(ScopedPrinter &Printer, StringRef FieldName, + TypeIndex TI, TypeDatabase &DB); + +private: + TypeDatabase &TypeDB; +}; + +} // end namespace codeview +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_CODEVIEW_TYPEDUMPER_H Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolDumper.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolDumper.h Sat Jan 14 12:55:32 2017 (r312172) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolDumper.h Sat Jan 14 15:37:50 2017 (r312173) @@ -20,15 +20,15 @@ namespace llvm { class ScopedPrinter; namespace codeview { -class CVTypeDumper; +class TypeDatabase; /// Dumper for CodeView symbol streams found in COFF object files and PDB files. class CVSymbolDumper { public: - CVSymbolDumper(ScopedPrinter &W, CVTypeDumper &CVTD, + CVSymbolDumper(ScopedPrinter &W, TypeDatabase &TypeDB, std::unique_ptr ObjDelegate, bool PrintRecordBytes) - : W(W), CVTD(CVTD), ObjDelegate(std::move(ObjDelegate)), + : W(W), TypeDB(TypeDB), ObjDelegate(std::move(ObjDelegate)), PrintRecordBytes(PrintRecordBytes) {} /// Dumps one type record. Returns false if there was a type parsing error, @@ -43,7 +43,7 @@ public: private: ScopedPrinter &W; - CVTypeDumper &CVTD; + TypeDatabase &TypeDB; std::unique_ptr ObjDelegate; bool PrintRecordBytes; Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDatabase.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDatabase.h Sat Jan 14 15:37:50 2017 (r312173) @@ -0,0 +1,55 @@ +//===- TypeDatabase.h - A collection of CodeView type records ---*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_DEBUGINFO_CODEVIEW_TYPEDATABASE_H +#define LLVM_DEBUGINFO_CODEVIEW_TYPEDATABASE_H + +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 14 15:37:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB83CCAFA00; Sat, 14 Jan 2017 15:37:59 +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 7163B15FB; Sat, 14 Jan 2017 15:37:59 +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 v0EFbwuS026665; Sat, 14 Jan 2017 15:37:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFbwnp026664; Sat, 14 Jan 2017 15:37:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141537.v0EFbwnp026664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312174 - vendor/llvm/llvm-release_40-r292009 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:37:59 -0000 Author: dim Date: Sat Jan 14 15:37:58 2017 New Revision: 312174 URL: https://svnweb.freebsd.org/changeset/base/312174 Log: Tag llvm release_40 branch r292009. Added: vendor/llvm/llvm-release_40-r292009/ - copied from r312173, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Sat Jan 14 15:38:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF407CAFACD; Sat, 14 Jan 2017 15:38:40 +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 A509B18E3; Sat, 14 Jan 2017 15:38:40 +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 v0EFcdaF026780; Sat, 14 Jan 2017 15:38:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFcdqS026779; Sat, 14 Jan 2017 15:38:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141538.v0EFcdqS026779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312176 - vendor/clang/clang-release_40-r292009 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:38:41 -0000 Author: dim Date: Sat Jan 14 15:38:39 2017 New Revision: 312176 URL: https://svnweb.freebsd.org/changeset/base/312176 Log: Tag clang release_40 branch r292009. Added: vendor/clang/clang-release_40-r292009/ - copied from r312175, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Sat Jan 14 15:38:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 183B3CAFAC8; Sat, 14 Jan 2017 15:38:37 +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 B260B18E1; Sat, 14 Jan 2017 15:38:36 +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 v0EFcakp026733; Sat, 14 Jan 2017 15:38:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFcZ3X026728; Sat, 14 Jan 2017 15:38:35 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141538.v0EFcZ3X026728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312175 - in vendor/clang/dist: . bindings/python/clang bindings/python/tests/cindex docs include/clang-c include/clang/AST include/clang/Basic include/clang/Driver include/clang/Index ... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:38:37 -0000 Author: dim Date: Sat Jan 14 15:38:35 2017 New Revision: 312175 URL: https://svnweb.freebsd.org/changeset/base/312175 Log: Vendor import of clang release_40 branch r292009: https://llvm.org/svn/llvm-project/cfe/branches/release_40@292009 Added: vendor/clang/dist/test/CXX/basic/basic.start/basic.start.init/p2.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCXX/pr31054.cpp (contents, props changed) vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/ vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/ vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/ vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crt1.o (contents, props changed) vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crti.o (contents, props changed) vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crtn.o (contents, props changed) vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/ vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/aarch64-suse-linux/ vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/aarch64-suse-linux/4.8/ vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/aarch64-suse-linux/4.8/crtbegin.o (contents, props changed) vendor/clang/dist/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/aarch64-suse-linux/4.8/crtend.o (contents, props changed) vendor/clang/dist/test/Driver/disable-llvm.c (contents, props changed) vendor/clang/dist/test/Modules/Inputs/FooFramework.framework/ vendor/clang/dist/test/Modules/Inputs/FooFramework.framework/Modules/ vendor/clang/dist/test/Modules/Inputs/FooFramework.framework/Modules/module.modulemap vendor/clang/dist/test/Modules/Inputs/FooFramework.framework/PrivateHeaders/ vendor/clang/dist/test/Modules/Inputs/FooFramework.framework/PrivateHeaders/Bar.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/FooFramework.framework/PrivateHeaders/Baz_Private.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/FooFramework.framework/PrivateHeaders/Foo.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/FooFramework.framework/PrivateHeaders/FooUmbrella.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/PR31469/ vendor/clang/dist/test/Modules/Inputs/PR31469/empty.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/PR31469/module.modulemap vendor/clang/dist/test/Modules/Inputs/PR31469/textual.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/PR31469/textual_file_shadow.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/import-textual/ vendor/clang/dist/test/Modules/Inputs/import-textual/M/ vendor/clang/dist/test/Modules/Inputs/import-textual/M/A/ vendor/clang/dist/test/Modules/Inputs/import-textual/M/A/A.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/import-textual/M/B/ vendor/clang/dist/test/Modules/Inputs/import-textual/M/B/B.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/import-textual/M/module.modulemap vendor/clang/dist/test/Modules/Inputs/import-textual/M/someheader.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/import-textual/M2/ vendor/clang/dist/test/Modules/Inputs/import-textual/M2/A/ vendor/clang/dist/test/Modules/Inputs/import-textual/M2/A/A.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/import-textual/M2/B/ vendor/clang/dist/test/Modules/Inputs/import-textual/M2/B/B.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/import-textual/M2/module.modulemap vendor/clang/dist/test/Modules/Inputs/import-textual/M2/someheader.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/c++/v1/cstddef vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/c++/v1/type_traits vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/sys/ vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/sys/_types/ vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/sys/_types/_ptrdiff_t.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/sys/_types/_types.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/module-impl-with-link/ vendor/clang/dist/test/Modules/Inputs/module-impl-with-link/foo.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/module-impl-with-link/module.modulemap vendor/clang/dist/test/Modules/builtin-import.mm vendor/clang/dist/test/Modules/import-textual-noguard.mm vendor/clang/dist/test/Modules/import-textual.mm vendor/clang/dist/test/Modules/module-impl-with-link.c (contents, props changed) vendor/clang/dist/test/Modules/pr31469.cpp (contents, props changed) vendor/clang/dist/test/Modules/textual-hdr-in-umbrella-hdr.m vendor/clang/dist/test/OpenMP/nvptx_parallel_codegen.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_parallel_for_is_device_ptr_ast_print.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_parallel_for_is_device_ptr_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_parallel_for_simd_is_device_ptr_ast_print.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_parallel_for_simd_is_device_ptr_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_aligned_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_ast_print.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_collapse_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_defaultmap_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_depend_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_device_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_dist_schedule_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_if_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_is_device_ptr_ast_print.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_is_device_ptr_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_map_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_misc_messages.c (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_nowait_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_num_teams_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_private_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_safelen_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_shared_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_simdlen_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_thread_limit_messages.cpp (contents, props changed) vendor/clang/dist/test/PCH/uses-seh.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/diagnose_if-ext.cpp (contents, props changed) Modified: vendor/clang/dist/CMakeLists.txt vendor/clang/dist/bindings/python/clang/cindex.py vendor/clang/dist/bindings/python/tests/cindex/test_translation_unit.py vendor/clang/dist/docs/AttributeReference.rst vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/docs/UsersManual.rst vendor/clang/dist/include/clang-c/Index.h vendor/clang/dist/include/clang/AST/Decl.h vendor/clang/dist/include/clang/AST/DeclTemplate.h vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h vendor/clang/dist/include/clang/AST/StmtOpenMP.h vendor/clang/dist/include/clang/AST/TypeLoc.h vendor/clang/dist/include/clang/Basic/AttrDocs.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/OpenMPKinds.def vendor/clang/dist/include/clang/Basic/StmtNodes.td vendor/clang/dist/include/clang/Driver/CLCompatOptions.td vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Index/IndexSymbol.h vendor/clang/dist/include/clang/Lex/HeaderSearch.h vendor/clang/dist/include/clang/Lex/ModuleMap.h vendor/clang/dist/include/clang/Parse/Parser.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Serialization/ASTBitCodes.h vendor/clang/dist/lib/AST/ASTImporter.cpp vendor/clang/dist/lib/AST/Decl.cpp vendor/clang/dist/lib/AST/DeclTemplate.cpp vendor/clang/dist/lib/AST/Expr.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/StmtOpenMP.cpp vendor/clang/dist/lib/AST/StmtPrinter.cpp vendor/clang/dist/lib/AST/StmtProfile.cpp vendor/clang/dist/lib/Analysis/BodyFarm.cpp vendor/clang/dist/lib/Analysis/CFG.cpp vendor/clang/dist/lib/Analysis/ReachableCode.cpp vendor/clang/dist/lib/Basic/OpenMPKinds.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/Basic/Version.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGDecl.cpp vendor/clang/dist/lib/CodeGen/CGDeclCXX.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.h vendor/clang/dist/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntimeNVPTX.h vendor/clang/dist/lib/CodeGen/CGStmt.cpp vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp vendor/clang/dist/lib/Driver/ToolChains.cpp vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Format/ContinuationIndenter.cpp vendor/clang/dist/lib/Frontend/InitPreprocessor.cpp vendor/clang/dist/lib/Headers/altivec.h vendor/clang/dist/lib/Index/IndexDecl.cpp vendor/clang/dist/lib/Index/IndexSymbol.cpp vendor/clang/dist/lib/Index/IndexTypeSourceInfo.cpp vendor/clang/dist/lib/Index/IndexingContext.cpp vendor/clang/dist/lib/Index/IndexingContext.h vendor/clang/dist/lib/Lex/HeaderSearch.cpp vendor/clang/dist/lib/Lex/ModuleMap.cpp vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp vendor/clang/dist/lib/Parse/ParseExpr.cpp vendor/clang/dist/lib/Parse/ParseExprCXX.cpp vendor/clang/dist/lib/Parse/ParseOpenMP.cpp vendor/clang/dist/lib/Parse/Parser.cpp vendor/clang/dist/lib/Sema/AnalysisBasedWarnings.cpp vendor/clang/dist/lib/Sema/SemaCoroutine.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclObjC.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/lib/Sema/SemaOpenMP.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Sema/SemaTemplate.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Sema/TreeTransform.h vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTReaderDecl.cpp vendor/clang/dist/lib/Serialization/ASTReaderStmt.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/Serialization/ASTWriterDecl.cpp vendor/clang/dist/lib/Serialization/ASTWriterStmt.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngine.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/SValBuilder.cpp vendor/clang/dist/test/Analysis/initializer.cpp vendor/clang/dist/test/Analysis/pointer-to-member.cpp vendor/clang/dist/test/Analysis/properties.m vendor/clang/dist/test/CXX/drs/dr0xx.cpp vendor/clang/dist/test/CXX/drs/dr12xx.cpp vendor/clang/dist/test/CXX/drs/dr13xx.cpp vendor/clang/dist/test/CXX/drs/dr14xx.cpp vendor/clang/dist/test/CXX/drs/dr15xx.cpp vendor/clang/dist/test/CXX/drs/dr16xx.cpp vendor/clang/dist/test/CXX/drs/dr18xx.cpp vendor/clang/dist/test/CXX/drs/dr2xx.cpp vendor/clang/dist/test/CXX/drs/dr5xx.cpp vendor/clang/dist/test/CXX/drs/dr6xx.cpp vendor/clang/dist/test/CodeGen/always_inline.c vendor/clang/dist/test/CodeGen/arm_acle.c vendor/clang/dist/test/CodeGen/builtins-arm.c vendor/clang/dist/test/CodeGen/builtins-arm64.c vendor/clang/dist/test/CodeGen/builtins-ppc-p9vector.c vendor/clang/dist/test/CodeGen/integer-overflow.c vendor/clang/dist/test/CodeGenCXX/cxx11-thread-local.cpp vendor/clang/dist/test/CodeGenCXX/dllexport.cpp vendor/clang/dist/test/CodeGenCXX/funcsig.cpp vendor/clang/dist/test/CodeGenCXX/global-array-destruction.cpp vendor/clang/dist/test/Driver/cl-options.c vendor/clang/dist/test/Driver/linux-ld.c vendor/clang/dist/test/Driver/x86-march.c vendor/clang/dist/test/Frontend/x86-target-cpu.c vendor/clang/dist/test/Index/Core/designated-inits.c vendor/clang/dist/test/Index/Core/index-source.cpp vendor/clang/dist/test/Index/Core/index-source.m vendor/clang/dist/test/Index/Core/index-subkinds.m vendor/clang/dist/test/Index/Core/index-with-module.m vendor/clang/dist/test/Index/index-templates.cpp vendor/clang/dist/test/Misc/ast-dump-decl.cpp vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/c++/v1/math.h vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/c++/v1/module.modulemap vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/c++/v1/stddef.h vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/module.modulemap vendor/clang/dist/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/stddef.h vendor/clang/dist/test/Modules/cxx-templates.cpp vendor/clang/dist/test/OpenMP/nesting_of_regions.cpp vendor/clang/dist/test/OpenMP/target_teams_distribute_collapse_messages.cpp vendor/clang/dist/test/OpenMP/threadprivate_codegen.cpp vendor/clang/dist/test/Preprocessor/predefined-arch-macros.c vendor/clang/dist/test/Profile/gcc-flag-compatibility.c vendor/clang/dist/test/Sema/atomic-ops.c vendor/clang/dist/test/Sema/warn-unreachable.c vendor/clang/dist/test/SemaCXX/coroutines.cpp vendor/clang/dist/test/SemaCXX/cxx0x-class.cpp vendor/clang/dist/test/SemaCXX/cxx1y-variable-templates_top_level.cpp vendor/clang/dist/test/SemaCXX/uninitialized.cpp vendor/clang/dist/test/SemaCXX/warn-shadow-in-lambdas.cpp vendor/clang/dist/test/SemaCXX/warn-shadow.cpp vendor/clang/dist/test/SemaTemplate/deduction.cpp vendor/clang/dist/test/SemaTemplate/temp_arg_template.cpp vendor/clang/dist/test/SemaTemplate/temp_arg_template_cxx1z.cpp vendor/clang/dist/tools/clang-fuzzer/ClangFuzzer.cpp vendor/clang/dist/tools/libclang/CIndex.cpp vendor/clang/dist/tools/libclang/CXCursor.cpp vendor/clang/dist/unittests/AST/SourceLocationTest.cpp vendor/clang/dist/unittests/Format/FormatTest.cpp vendor/clang/dist/www/cxx_dr_status.html vendor/clang/dist/www/cxx_status.html vendor/clang/dist/www/index.html vendor/clang/dist/www/make_cxx_dr_status Modified: vendor/clang/dist/CMakeLists.txt ============================================================================== --- vendor/clang/dist/CMakeLists.txt Sat Jan 14 15:37:58 2017 (r312174) +++ vendor/clang/dist/CMakeLists.txt Sat Jan 14 15:38:35 2017 (r312175) @@ -16,7 +16,8 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR "--libdir" "--includedir" "--prefix" - "--src-root") + "--src-root" + "--cmakedir") execute_process( COMMAND ${CONFIG_COMMAND} RESULT_VARIABLE HAD_ERROR @@ -41,6 +42,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR list(GET CONFIG_OUTPUT 3 INCLUDE_DIR) list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT) list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR) + list(GET CONFIG_OUTPUT 6 LLVM_CMAKE_PATH) if(NOT MSVC_IDE) set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS} @@ -58,7 +60,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) - set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake") if(EXISTS ${LLVMCONFIG_FILE}) list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") Modified: vendor/clang/dist/bindings/python/clang/cindex.py ============================================================================== --- vendor/clang/dist/bindings/python/clang/cindex.py Sat Jan 14 15:37:58 2017 (r312174) +++ vendor/clang/dist/bindings/python/clang/cindex.py Sat Jan 14 15:38:35 2017 (r312175) @@ -64,7 +64,6 @@ call is efficient. from ctypes import * import collections -import sys import clang.enumerations @@ -74,33 +73,6 @@ import clang.enumerations # this by marshalling object arguments as void**. c_object_p = POINTER(c_void_p) -if sys.version_info[0] > 2: -# Python 3 strings are unicode, translate them to/from utf8 for C-interop -# Python 3 replaces xrange with range, we want xrange behaviour - xrange = range - - class c_string_p(c_char_p): - def __init__(self, p=None): - if type(p) == str: - p = p.encode("utf8") - super(c_char_p, self).__init__(p) - - def __str__(self): - return str(self.value) - - @property - def value(self): - if super(c_char_p, self).value is None: - return None - return super(c_char_p, self).value.decode("utf8") - - @classmethod - def from_param(cls, param): - return cls(param) -else: - c_string_p = c_char_p - - callbacks = {} ### Exception Classes ### @@ -175,7 +147,7 @@ class CachedProperty(object): class _CXString(Structure): """Helper for transforming CXString results.""" - _fields_ = [("spelling", c_string_p), ("free", c_int)] + _fields_ = [("spelling", c_char_p), ("free", c_int)] def __del__(self): conf.lib.clang_disposeString(self) @@ -357,7 +329,7 @@ class Diagnostic(object): @property def spelling(self): - return str(conf.lib.clang_getDiagnosticSpelling(self)) + return conf.lib.clang_getDiagnosticSpelling(self) @property def ranges(self): @@ -386,8 +358,8 @@ class Diagnostic(object): def __getitem__(self, key): range = SourceRange() - value = str(conf.lib.clang_getDiagnosticFixIt(self.diag, key, - byref(range))) + value = conf.lib.clang_getDiagnosticFixIt(self.diag, key, + byref(range)) if len(value) == 0: raise IndexError @@ -420,12 +392,12 @@ class Diagnostic(object): @property def category_name(self): """The string name of the category for this diagnostic.""" - return str(conf.lib.clang_getDiagnosticCategoryText(self)) + return conf.lib.clang_getDiagnosticCategoryText(self) @property def option(self): """The command-line option that enables this diagnostic.""" - return str(conf.lib.clang_getDiagnosticOption(self, None)) + return conf.lib.clang_getDiagnosticOption(self, None) @property def disable_option(self): @@ -433,7 +405,7 @@ class Diagnostic(object): disable = _CXString() conf.lib.clang_getDiagnosticOption(self, byref(disable)) - return str(conf.lib.clang_getCString(disable)) + return conf.lib.clang_getCString(disable) def format(self, options=None): """ @@ -582,8 +554,8 @@ class BaseEnumeration(object): if value >= len(self.__class__._kinds): self.__class__._kinds += [None] * (value - len(self.__class__._kinds) + 1) if self.__class__._kinds[value] is not None: - raise ValueError('{0} value {1} already loaded'.format( - str(self.__class__), value)) + raise ValueError,'{0} value {1} already loaded'.format( + str(self.__class__), value) self.value = value self.__class__._kinds[value] = self self.__class__._name_map = None @@ -600,12 +572,12 @@ class BaseEnumeration(object): for key, value in self.__class__.__dict__.items(): if isinstance(value, self.__class__): self._name_map[value] = key - return str(self._name_map[self]) + return self._name_map[self] @classmethod def from_id(cls, id): if id >= len(cls._kinds) or cls._kinds[id] is None: - raise ValueError('Unknown template argument kind %d' % id) + raise ValueError,'Unknown template argument kind %d' % id return cls._kinds[id] def __repr__(self): @@ -624,7 +596,7 @@ class CursorKind(BaseEnumeration): @staticmethod def get_all_kinds(): """Return all CursorKind enumeration instances.""" - return [x for x in CursorKind._kinds if x] + return filter(None, CursorKind._kinds) def is_declaration(self): """Test if this is a declaration kind.""" @@ -1457,9 +1429,9 @@ class Cursor(Structure): def spelling(self): """Return the spelling of the entity pointed at by the cursor.""" if not hasattr(self, '_spelling'): - self._spelling = str(conf.lib.clang_getCursorSpelling(self)) + self._spelling = conf.lib.clang_getCursorSpelling(self) - return str(self._spelling) + return self._spelling @property def displayname(self): @@ -1471,7 +1443,7 @@ class Cursor(Structure): arguments of a class template specialization. """ if not hasattr(self, '_displayname'): - self._displayname = str(conf.lib.clang_getCursorDisplayName(self)) + self._displayname = conf.lib.clang_getCursorDisplayName(self) return self._displayname @@ -1479,7 +1451,7 @@ class Cursor(Structure): def mangled_name(self): """Return the mangled name for the entity referenced by this cursor.""" if not hasattr(self, '_mangled_name'): - self._mangled_name = str(conf.lib.clang_Cursor_getMangling(self)) + self._mangled_name = conf.lib.clang_Cursor_getMangling(self) return self._mangled_name @@ -1618,7 +1590,7 @@ class Cursor(Structure): self._objc_type_encoding = \ conf.lib.clang_getDeclObjCTypeEncoding(self) - return str(self._objc_type_encoding) + return self._objc_type_encoding @property def hash(self): @@ -1665,23 +1637,17 @@ class Cursor(Structure): @property def brief_comment(self): """Returns the brief comment text associated with that Cursor""" - r = conf.lib.clang_Cursor_getBriefCommentText(self) - if not r: - return None - return str(r) + return conf.lib.clang_Cursor_getBriefCommentText(self) @property def raw_comment(self): """Returns the raw comment text associated with that Cursor""" - r = conf.lib.clang_Cursor_getRawCommentText(self) - if not r: - return None - return str(r) + return conf.lib.clang_Cursor_getRawCommentText(self) def get_arguments(self): """Return an iterator for accessing the arguments of this cursor.""" num_args = conf.lib.clang_Cursor_getNumArguments(self) - for i in xrange(0, num_args): + for i in range(0, num_args): yield conf.lib.clang_Cursor_getArgument(self, i) def get_num_template_arguments(self): @@ -1811,7 +1777,7 @@ class StorageClass(object): if value >= len(StorageClass._kinds): StorageClass._kinds += [None] * (value - len(StorageClass._kinds) + 1) if StorageClass._kinds[value] is not None: - raise ValueError('StorageClass already loaded') + raise ValueError,'StorageClass already loaded' self.value = value StorageClass._kinds[value] = self StorageClass._name_map = None @@ -1832,7 +1798,7 @@ class StorageClass(object): @staticmethod def from_id(id): if id >= len(StorageClass._kinds) or not StorageClass._kinds[id]: - raise ValueError('Unknown storage class %d' % id) + raise ValueError,'Unknown storage class %d' % id return StorageClass._kinds[id] def __repr__(self): @@ -1885,7 +1851,7 @@ class TypeKind(BaseEnumeration): @property def spelling(self): """Retrieve the spelling of this TypeKind.""" - return str(conf.lib.clang_getTypeKindSpelling(self.value)) + return conf.lib.clang_getTypeKindSpelling(self.value) def __repr__(self): return 'TypeKind.%s' % (self.name,) @@ -2161,7 +2127,7 @@ class Type(Structure): """ Retrieve the offset of a field in the record. """ - return conf.lib.clang_Type_getOffsetOf(self, fieldname) + return conf.lib.clang_Type_getOffsetOf(self, c_char_p(fieldname)) def get_ref_qualifier(self): """ @@ -2188,7 +2154,7 @@ class Type(Structure): @property def spelling(self): """Retrieve the spelling of this Type.""" - return str(conf.lib.clang_getTypeSpelling(self)) + return conf.lib.clang_getTypeSpelling(self) def __eq__(self, other): if type(other) != type(self): @@ -2220,7 +2186,7 @@ class ClangObject(object): class _CXUnsavedFile(Structure): """Helper for passing unsaved file arguments.""" - _fields_ = [("name", c_string_p), ("contents", c_string_p), ('length', c_ulong)] + _fields_ = [("name", c_char_p), ("contents", c_char_p), ('length', c_ulong)] # Functions calls through the python interface are rather slow. Fortunately, # for most symboles, we do not need to perform a function call. Their spelling @@ -2266,7 +2232,7 @@ class CompletionChunk: self.__kindNumberCache = -1 def __repr__(self): - return "{'" + str(self.spelling) + "', " + str(self.kind) + "}" + return "{'" + self.spelling + "', " + str(self.kind) + "}" @CachedProperty def spelling(self): @@ -2575,9 +2541,7 @@ class TranslationUnit(ClangObject): args_array = None if len(args) > 0: - args_array = (c_string_p * len(args))() - for i,a in enumerate(args): - args_array[i] = c_string_p(a) + args_array = (c_char_p * len(args))(* args) unsaved_array = None if len(unsaved_files) > 0: @@ -2586,8 +2550,8 @@ class TranslationUnit(ClangObject): if hasattr(contents, "read"): contents = contents.read() - unsaved_array[i].name = c_string_p(name) - unsaved_array[i].contents = c_string_p(contents) + unsaved_array[i].name = name + unsaved_array[i].contents = contents unsaved_array[i].length = len(contents) ptr = conf.lib.clang_parseTranslationUnit(index, filename, args_array, @@ -2642,7 +2606,7 @@ class TranslationUnit(ClangObject): @property def spelling(self): """Get the original translation unit source file name.""" - return str(conf.lib.clang_getTranslationUnitSpelling(self)) + return conf.lib.clang_getTranslationUnitSpelling(self) def get_includes(self): """ @@ -2765,9 +2729,9 @@ class TranslationUnit(ClangObject): # FIXME: It would be great to support an efficient version # of this, one day. value = value.read() - print(value) + print value if not isinstance(value, str): - raise TypeError('Unexpected unsaved file contents.') + raise TypeError,'Unexpected unsaved file contents.' unsaved_files_array[i].name = name unsaved_files_array[i].contents = value unsaved_files_array[i].length = len(value) @@ -2829,11 +2793,11 @@ class TranslationUnit(ClangObject): # FIXME: It would be great to support an efficient version # of this, one day. value = value.read() - print(value) + print value if not isinstance(value, str): - raise TypeError('Unexpected unsaved file contents.') - unsaved_files_array[i].name = c_string_p(name) - unsaved_files_array[i].contents = c_string_p(value) + raise TypeError,'Unexpected unsaved file contents.' + unsaved_files_array[i].name = name + unsaved_files_array[i].contents = value unsaved_files_array[i].length = len(value) ptr = conf.lib.clang_codeCompleteAt(self, path, line, column, unsaved_files_array, len(unsaved_files), options) @@ -2868,7 +2832,7 @@ class File(ClangObject): @property def name(self): """Return the complete file and path name of the file.""" - return str(conf.lib.clang_getCString(conf.lib.clang_getFileName(self))) + return conf.lib.clang_getCString(conf.lib.clang_getFileName(self)) @property def time(self): @@ -2876,7 +2840,7 @@ class File(ClangObject): return conf.lib.clang_getFileTime(self) def __str__(self): - return str(self.name) + return self.name def __repr__(self): return "" % (self.name) @@ -2945,12 +2909,12 @@ class CompileCommand(object): @property def directory(self): """Get the working directory for this CompileCommand""" - return str(conf.lib.clang_CompileCommand_getDirectory(self.cmd)) + return conf.lib.clang_CompileCommand_getDirectory(self.cmd) @property def filename(self): """Get the working filename for this CompileCommand""" - return str(conf.lib.clang_CompileCommand_getFilename(self.cmd)) + return conf.lib.clang_CompileCommand_getFilename(self.cmd) @property def arguments(self): @@ -2962,7 +2926,7 @@ class CompileCommand(object): """ length = conf.lib.clang_CompileCommand_getNumArgs(self.cmd) for i in xrange(length): - yield str(conf.lib.clang_CompileCommand_getArg(self.cmd, i)) + yield conf.lib.clang_CompileCommand_getArg(self.cmd, i) class CompileCommands(object): """ @@ -3056,7 +3020,7 @@ class Token(Structure): This is the textual representation of the token in source. """ - return str(conf.lib.clang_getTokenSpelling(self._tu, self)) + return conf.lib.clang_getTokenSpelling(self._tu, self) @property def kind(self): @@ -3099,7 +3063,7 @@ functionList = [ [c_object_p]), ("clang_CompilationDatabase_fromDirectory", - [c_string_p, POINTER(c_uint)], + [c_char_p, POINTER(c_uint)], c_object_p, CompilationDatabase.from_result), @@ -3109,7 +3073,7 @@ functionList = [ CompileCommands.from_result), ("clang_CompilationDatabase_getCompileCommands", - [c_object_p, c_string_p], + [c_object_p, c_char_p], c_object_p, CompileCommands.from_result), @@ -3144,7 +3108,7 @@ functionList = [ c_uint), ("clang_codeCompleteAt", - [TranslationUnit, c_string_p, c_int, c_int, c_void_p, c_int, c_int], + [TranslationUnit, c_char_p, c_int, c_int, c_void_p, c_int, c_int], POINTER(CCRStructure)), ("clang_codeCompleteGetDiagnostic", @@ -3160,7 +3124,7 @@ functionList = [ c_object_p), ("clang_createTranslationUnit", - [Index, c_string_p], + [Index, c_char_p], c_object_p), ("clang_CXXConstructor_isConvertingConstructor", @@ -3310,7 +3274,7 @@ functionList = [ ("clang_getCString", [_CXString], - c_string_p), + c_char_p), ("clang_getCursor", [TranslationUnit, SourceLocation], @@ -3457,7 +3421,7 @@ functionList = [ Type.from_result), ("clang_getFile", - [TranslationUnit, c_string_p], + [TranslationUnit, c_char_p], c_object_p), ("clang_getFileName", @@ -3586,7 +3550,7 @@ functionList = [ ("clang_getTUResourceUsageName", [c_uint], - c_string_p), + c_char_p), ("clang_getTypeDeclaration", [Type], @@ -3681,7 +3645,7 @@ functionList = [ bool), ("clang_parseTranslationUnit", - [Index, c_string_p, c_void_p, c_int, c_void_p, c_int, c_int], + [Index, c_char_p, c_void_p, c_int, c_void_p, c_int, c_int], c_object_p), ("clang_reparseTranslationUnit", @@ -3689,7 +3653,7 @@ functionList = [ c_int), ("clang_saveTranslationUnit", - [TranslationUnit, c_string_p, c_uint], + [TranslationUnit, c_char_p, c_uint], c_int), ("clang_tokenize", @@ -3761,7 +3725,7 @@ functionList = [ Type.from_result), ("clang_Type_getOffsetOf", - [Type, c_string_p], + [Type, c_char_p], c_longlong), ("clang_Type_getSizeOf", @@ -3820,8 +3784,7 @@ def register_functions(lib, ignore_error def register(item): return register_function(lib, item, ignore_errors) - for f in functionList: - register(f) + map(register, functionList) class Config: library_path = None Modified: vendor/clang/dist/bindings/python/tests/cindex/test_translation_unit.py ============================================================================== --- vendor/clang/dist/bindings/python/tests/cindex/test_translation_unit.py Sat Jan 14 15:37:58 2017 (r312174) +++ vendor/clang/dist/bindings/python/tests/cindex/test_translation_unit.py Sat Jan 14 15:38:35 2017 (r312175) @@ -59,13 +59,9 @@ int SOME_DEFINE; assert spellings[-1] == 'y' def test_unsaved_files_2(): - try: - from StringIO import StringIO - except: - from io import StringIO - + import StringIO tu = TranslationUnit.from_source('fake.c', unsaved_files = [ - ('fake.c', StringIO('int x;'))]) + ('fake.c', StringIO.StringIO('int x;'))]) spellings = [c.spelling for c in tu.cursor.get_children()] assert spellings[-1] == 'x' Modified: vendor/clang/dist/docs/AttributeReference.rst ============================================================================== --- vendor/clang/dist/docs/AttributeReference.rst Sat Jan 14 15:37:58 2017 (r312174) +++ vendor/clang/dist/docs/AttributeReference.rst Sat Jan 14 15:38:35 2017 (r312175) @@ -1,13 +1,3118 @@ .. ------------------------------------------------------------------- NOTE: This file is automatically generated by running clang-tblgen - -gen-attr-docs. Do not edit this file by hand!! The contents for - this file are automatically generated by a server-side process. - - Please do not commit this file. The file exists for local testing - purposes only. + -gen-attr-docs. Do not edit this file by hand!! ------------------------------------------------------------------- =================== Attributes in Clang -=================== \ No newline at end of file +=================== +.. contents:: + :local: + +Introduction +============ + +This page lists the attributes currently supported by Clang. + +Function Attributes +=================== + + +interrupt +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang supports the GNU style ``__attribute__((interrupt("TYPE")))`` attribute on +ARM targets. This attribute may be attached to a function definition and +instructs the backend to generate appropriate function entry/exit code so that +it can be used directly as an interrupt service routine. + +The parameter passed to the interrupt attribute is optional, but if +provided it must be a string literal with one of the following values: "IRQ", +"FIQ", "SWI", "ABORT", "UNDEF". + +The semantics are as follows: + +- If the function is AAPCS, Clang instructs the backend to realign the stack to + 8 bytes on entry. This is a general requirement of the AAPCS at public + interfaces, but may not hold when an exception is taken. Doing this allows + other AAPCS functions to be called. +- If the CPU is M-class this is all that needs to be done since the architecture + itself is designed in such a way that functions obeying the normal AAPCS ABI + constraints are valid exception handlers. +- If the CPU is not M-class, the prologue and epilogue are modified to save all + non-banked registers that are used, so that upon return the user-mode state + will not be corrupted. Note that to avoid unnecessary overhead, only + general-purpose (integer) registers are saved in this way. If VFP operations + are needed, that state must be saved manually. + + Specifically, interrupt kinds other than "FIQ" will save all core registers + except "lr" and "sp". "FIQ" interrupts will save r0-r7. +- If the CPU is not M-class, the return instruction is changed to one of the + canonical sequences permitted by the architecture for exception return. Where + possible the function itself will make the necessary "lr" adjustments so that + the "preferred return address" is selected. + + Unfortunately the compiler is unable to make this guarantee for an "UNDEF" + handler, where the offset from "lr" to the preferred return address depends on + the execution state of the code which generated the exception. In this case + a sequence equivalent to "movs pc, lr" will be used. + + +abi_tag (gnu::abi_tag) +---------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``abi_tag`` attribute can be applied to a function, variable, class or +inline namespace declaration to modify the mangled name of the entity. It gives +the ability to distinguish between different versions of the same entity but +with different ABI versions supported. For example, a newer version of a class +could have a different set of data members and thus have a different size. Using +the ``abi_tag`` attribute, it is possible to have different mangled names for +a global variable of the class type. Therefor, the old code could keep using +the old manged name and the new code will use the new mangled name with tags. + + +acquire_capability (acquire_shared_capability, clang::acquire_capability, clang::acquire_shared_capability) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Marks a function as acquiring a capability. + + +alloc_size (gnu::alloc_size) +---------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``alloc_size`` attribute can be placed on functions that return pointers in +order to hint to the compiler how many bytes of memory will be available at the +returned poiner. ``alloc_size`` takes one or two arguments. + +- ``alloc_size(N)`` implies that argument number N equals the number of + available bytes at the returned pointer. +- ``alloc_size(N, M)`` implies that the product of argument number N and + argument number M equals the number of available bytes at the returned + pointer. + +Argument numbers are 1-based. + +An example of how to use ``alloc_size`` + +.. code-block:: c + + void *my_malloc(int a) __attribute__((alloc_size(1))); + void *my_calloc(int a, int b) __attribute__((alloc_size(1, 2))); + + int main() { + void *const p = my_malloc(100); + assert(__builtin_object_size(p, 0) == 100); + void *const a = my_calloc(20, 5); + assert(__builtin_object_size(a, 0) == 100); + } + +.. Note:: This attribute works differently in clang than it does in GCC. + Specifically, clang will only trace ``const`` pointers (as above); we give up + on pointers that are not marked as ``const``. In the vast majority of cases, + this is unimportant, because LLVM has support for the ``alloc_size`` + attribute. However, this may cause mildly unintuitive behavior when used with + other attributes, such as ``enable_if``. + + +interrupt +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang supports the GNU style ``__attribute__((interrupt))`` attribute on +x86/x86-64 targets.The compiler generates function entry and exit sequences +suitable for use in an interrupt handler when this attribute is present. +The 'IRET' instruction, instead of the 'RET' instruction, is used to return +from interrupt or exception handlers. All registers, except for the EFLAGS +register which is restored by the 'IRET' instruction, are preserved by the +compiler. + +Any interruptible-without-stack-switch code must be compiled with +-mno-red-zone since interrupt handlers can and will, because of the +hardware design, touch the red zone. + +1. interrupt handler must be declared with a mandatory pointer argument: + + .. code-block:: c + + struct interrupt_frame + { + uword_t ip; + uword_t cs; + uword_t flags; + uword_t sp; + uword_t ss; + }; + + __attribute__ ((interrupt)) + void f (struct interrupt_frame *frame) { + ... + } + +2. exception handler: + + The exception handler is very similar to the interrupt handler with + a different mandatory function signature: + + .. code-block:: c + + __attribute__ ((interrupt)) + void f (struct interrupt_frame *frame, uword_t error_code) { + ... + } + + and compiler pops 'ERROR_CODE' off stack before the 'IRET' instruction. + + The exception handler should only be used for exceptions which push an + error code and all other exceptions must use the interrupt handler. + The system will crash if the wrong handler is used. + + +assert_capability (assert_shared_capability, clang::assert_capability, clang::assert_shared_capability) +------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Marks a function that dynamically tests whether a capability is held, and halts +the program if it is not held. + + +assume_aligned (gnu::assume_aligned) +------------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Use ``__attribute__((assume_aligned([,]))`` on a function +declaration to specify that the return value of the function (which must be a +pointer type) has the specified offset, in bytes, from an address with the +specified alignment. The offset is taken to be zero if omitted. + +.. code-block:: c++ + + // The returned pointer value has 32-byte alignment. + void *a() __attribute__((assume_aligned (32))); + + // The returned pointer value is 4 bytes greater than an address having + // 32-byte alignment. + void *b() __attribute__((assume_aligned (32, 4))); + +Note that this attribute provides information to the compiler regarding a +condition that the code already ensures is true. It does not cause the compiler +to enforce the provided alignment assumption. + + +availability +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +The ``availability`` attribute can be placed on declarations to describe the +lifecycle of that declaration relative to operating system versions. Consider +the function declaration for a hypothetical function ``f``: + +.. code-block:: c++ + + void f(void) __attribute__((availability(macos,introduced=10.4,deprecated=10.6,obsoleted=10.7))); + +The availability attribute states that ``f`` was introduced in Mac OS X 10.4, +deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This information +is used by Clang to determine when it is safe to use ``f``: for example, if +Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()`` +succeeds. If Clang is instructed to compile code for Mac OS X 10.6, the call +succeeds but Clang emits a warning specifying that the function is deprecated. +Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call +fails because ``f()`` is no longer available. + +The availability attribute is a comma-separated list starting with the +platform name and then including clauses specifying important milestones in the +declaration's lifetime (in any order) along with additional information. Those +clauses can be: + +introduced=\ *version* + The first version in which this declaration was introduced. + +deprecated=\ *version* + The first version in which this declaration was deprecated, meaning that + users should migrate away from this API. + +obsoleted=\ *version* + The first version in which this declaration was obsoleted, meaning that it + was removed completely and can no longer be used. + +unavailable + This declaration is never available on this platform. + +message=\ *string-literal* + Additional message text that Clang will provide when emitting a warning or + error about use of a deprecated or obsoleted declaration. Useful to direct + users to replacement APIs. + +replacement=\ *string-literal* + Additional message text that Clang will use to provide Fix-It when emitting + a warning about use of a deprecated declaration. The Fix-It will replace + the deprecated declaration with the new declaration specified. + +Multiple availability attributes can be placed on a declaration, which may +correspond to different platforms. Only the availability attribute with the +platform corresponding to the target platform will be used; any others will be +ignored. If no availability attribute specifies availability for the current +target platform, the availability attributes are ignored. Supported platforms +are: + +``ios`` + Apple's iOS operating system. The minimum deployment target is specified by + the ``-mios-version-min=*version*`` or ``-miphoneos-version-min=*version*`` + command-line arguments. + +``macos`` + Apple's Mac OS X operating system. The minimum deployment target is + specified by the ``-mmacosx-version-min=*version*`` command-line argument. + ``macosx`` is supported for backward-compatibility reasons, but it is + deprecated. + +``tvos`` + Apple's tvOS operating system. The minimum deployment target is specified by + the ``-mtvos-version-min=*version*`` command-line argument. + +``watchos`` + Apple's watchOS operating system. The minimum deployment target is specified by + the ``-mwatchos-version-min=*version*`` command-line argument. + +A declaration can typically be used even when deploying back to a platform +version prior to when the declaration was introduced. When this happens, the +declaration is `weakly linked +`_, +as if the ``weak_import`` attribute were added to the declaration. A +weakly-linked declaration may or may not be present a run-time, and a program +can determine whether the declaration is present by checking whether the +address of that declaration is non-NULL. + +The flag ``strict`` disallows using API when deploying back to a +platform version prior to when the declaration was introduced. An +attempt to use such API before its introduction causes a hard error. +Weakly-linking is almost always a better API choice, since it allows +users to query availability at runtime. + +If there are multiple declarations of the same entity, the availability +attributes must either match on a per-platform basis or later +declarations must not have availability attributes for that +platform. For example: + +.. code-block:: c + + void g(void) __attribute__((availability(macos,introduced=10.4))); + void g(void) __attribute__((availability(macos,introduced=10.4))); // okay, matches + void g(void) __attribute__((availability(ios,introduced=4.0))); // okay, adds a new platform + void g(void); // okay, inherits both macos and ios availability from above. + void g(void) __attribute__((availability(macos,introduced=10.5))); // error: mismatch + +When one method overrides another, the overriding method can be more widely available than the overridden method, e.g.,: + +.. code-block:: objc + + @interface A + - (id)method __attribute__((availability(macos,introduced=10.4))); + - (id)method2 __attribute__((availability(macos,introduced=10.4))); + @end + + @interface B : A + - (id)method __attribute__((availability(macos,introduced=10.3))); // okay: method moved into base class later + - (id)method __attribute__((availability(macos,introduced=10.5))); // error: this method was available via the base class in 10.4 + @end + + +_Noreturn +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","","","X", "" + +A function declared as ``_Noreturn`` shall not return to its caller. The +compiler will generate a diagnostic for a function declared as ``_Noreturn`` +that appears to be capable of returning to its caller. + + +noreturn +-------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","X","","", "" + +A function declared as ``[[noreturn]]`` shall not return to its caller. The +compiler will generate a diagnostic for a function declared as ``[[noreturn]]`` +that appears to be capable of returning to its caller. + + +carries_dependency +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``carries_dependency`` attribute specifies dependency propagation into and +out of functions. + +When specified on a function or Objective-C method, the ``carries_dependency`` +attribute means that the return value carries a dependency out of the function, +so that the implementation need not constrain ordering upon return from that +function. Implementations of the function and its caller may choose to preserve +dependencies instead of emitting memory ordering instructions such as fences. + +Note, this attribute does not change the meaning of the program, but may result +in generation of more efficient code. + + +convergent (clang::convergent) +------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``convergent`` attribute can be placed on a function declaration. It is +translated into the LLVM ``convergent`` attribute, which indicates that the call +instructions of a function with this attribute cannot be made control-dependent +on any additional values. + +In languages designed for SPMD/SIMT programming model, e.g. OpenCL or CUDA, +the call instructions of a function with this attribute must be executed by +all work items or threads in a work group or sub group. + +This attribute is different from ``noduplicate`` because it allows duplicating +function calls if it can be proved that the duplicated function calls are +not made control-dependent on any additional values, e.g., unrolling a loop +executed by all work items. + +Sample usage: +.. code-block:: c + + void convfunc(void) __attribute__((convergent)); + // Setting it as a C++11 attribute is also valid in a C++ program. + // void convfunc(void) [[clang::convergent]]; + + +deprecated (gnu::deprecated) +---------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","X","", "" + +The ``deprecated`` attribute can be applied to a function, a variable, or a +type. This is useful when identifying functions, variables, or types that are +expected to be removed in a future version of a program. + +Consider the function declaration for a hypothetical function ``f``: + +.. code-block:: c++ + + void f(void) __attribute__((deprecated("message", "replacement"))); + +When spelled as `__attribute__((deprecated))`, the deprecated attribute can have +two optional string arguments. The first one is the message to display when +emitting the warning; the second one enables the compiler to provide a Fix-It +to replace the deprecated name with a new name. Otherwise, when spelled as +`[[gnu::deprecated]] or [[deprecated]]`, the attribute can have one optional +string argument which is the message to display when emitting the warning. + + +diagnose_if +----------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +The ``diagnose_if`` attribute can be placed on function declarations to emit +warnings or errors at compile-time if calls to the attributed function meet +certain user-defined criteria. For example: + +.. code-block:: c + void abs(int a) + __attribute__((diagnose_if(a >= 0, "Redundant abs call", "warning"))); + void must_abs(int a) + __attribute__((diagnose_if(a >= 0, "Redundant abs call", "error"))); + + int val = abs(1); // warning: Redundant abs call + int val2 = must_abs(1); // error: Redundant abs call + int val3 = abs(val); + int val4 = must_abs(val); // Because run-time checks are not emitted for + // diagnose_if attributes, this executes without + // issue. + + +``diagnose_if`` is closely related to ``enable_if``, with a few key differences: + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 14 15:38:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 634CDCAFB4D; Sat, 14 Jan 2017 15:38:53 +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 1E91419F1; Sat, 14 Jan 2017 15:38:53 +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 v0EFcqBP026870; Sat, 14 Jan 2017 15:38:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFcmsY026830; Sat, 14 Jan 2017 15:38:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141538.v0EFcmsY026830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312177 - in vendor/compiler-rt/dist: cmake cmake/Modules lib/asan lib/asan/tests lib/builtins/arm lib/msan/tests lib/sancov lib/sanitizer_common lib/sanitizer_common/tests lib/scudo li... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:38:53 -0000 Author: dim Date: Sat Jan 14 15:38:48 2017 New Revision: 312177 URL: https://svnweb.freebsd.org/changeset/base/312177 Log: Vendor import of compiler-rt release_40 branch r292009: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_40@292009 Added: vendor/compiler-rt/dist/lib/sancov/ vendor/compiler-rt/dist/lib/scudo/scudo_crc32.cpp (contents, props changed) vendor/compiler-rt/dist/lib/scudo/scudo_crc32.h (contents, props changed) vendor/compiler-rt/dist/test/tsan/Darwin/ignore-noninstrumented.mm Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake vendor/compiler-rt/dist/cmake/Modules/CompilerRTDarwinUtils.cmake vendor/compiler-rt/dist/cmake/Modules/CompilerRTLink.cmake vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake vendor/compiler-rt/dist/cmake/config-ix.cmake vendor/compiler-rt/dist/lib/asan/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/asan_activation.cc vendor/compiler-rt/dist/lib/asan/asan_activation_flags.inc vendor/compiler-rt/dist/lib/asan/asan_allocator.cc vendor/compiler-rt/dist/lib/asan/asan_flags.cc vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/builtins/arm/adddf3vfp.S vendor/compiler-rt/dist/lib/builtins/arm/addsf3vfp.S vendor/compiler-rt/dist/lib/builtins/arm/comparesf2.S vendor/compiler-rt/dist/lib/builtins/arm/divdf3vfp.S vendor/compiler-rt/dist/lib/builtins/arm/divsf3vfp.S vendor/compiler-rt/dist/lib/builtins/arm/eqdf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/eqsf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/extendsfdf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/fixdfsivfp.S vendor/compiler-rt/dist/lib/builtins/arm/fixsfsivfp.S vendor/compiler-rt/dist/lib/builtins/arm/fixunsdfsivfp.S vendor/compiler-rt/dist/lib/builtins/arm/fixunssfsivfp.S vendor/compiler-rt/dist/lib/builtins/arm/floatsidfvfp.S vendor/compiler-rt/dist/lib/builtins/arm/floatsisfvfp.S vendor/compiler-rt/dist/lib/builtins/arm/floatunssidfvfp.S vendor/compiler-rt/dist/lib/builtins/arm/floatunssisfvfp.S vendor/compiler-rt/dist/lib/builtins/arm/gedf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/gesf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/gtdf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/gtsf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/ledf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/lesf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/ltdf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/ltsf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/muldf3vfp.S vendor/compiler-rt/dist/lib/builtins/arm/mulsf3vfp.S vendor/compiler-rt/dist/lib/builtins/arm/nedf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/negdf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/negsf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/nesf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/subdf3vfp.S vendor/compiler-rt/dist/lib/builtins/arm/subsf3vfp.S vendor/compiler-rt/dist/lib/builtins/arm/truncdfsf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/unorddf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/unordsf2vfp.S vendor/compiler-rt/dist/lib/msan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_libignore.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_libignore.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_quarantine.h vendor/compiler-rt/dist/lib/sanitizer_common/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/scudo/CMakeLists.txt vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp vendor/compiler-rt/dist/lib/scudo/scudo_utils.cpp vendor/compiler-rt/dist/lib/scudo/scudo_utils.h vendor/compiler-rt/dist/lib/stats/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/rtl/tsan_flags.inc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interceptors.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interceptors.h vendor/compiler-rt/dist/lib/tsan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt vendor/compiler-rt/dist/lib/xray/xray_AArch64.cc vendor/compiler-rt/dist/test/asan/TestCases/Linux/thread_local_quarantine_size_kb.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/start-deactivated.cc vendor/compiler-rt/dist/test/asan/lit.cfg vendor/compiler-rt/dist/test/profile/Linux/comdat_rename.test vendor/compiler-rt/dist/test/profile/lit.cfg vendor/compiler-rt/dist/test/xray/TestCases/Linux/patching-unpatching.cc Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Sat Jan 14 15:38:48 2017 (r312177) @@ -94,7 +94,7 @@ endfunction() # OS # SOURCES # CFLAGS -# LINKFLAGS +# LINK_FLAGS # DEFS # LINK_LIBS (only for shared library) # OBJECT_LIBS @@ -107,7 +107,7 @@ function(add_compiler_rt_runtime name ty cmake_parse_arguments(LIB "" "PARENT_TARGET" - "OS;ARCHS;SOURCES;CFLAGS;LINKFLAGS;DEFS;LINK_LIBS;OBJECT_LIBS" + "OS;ARCHS;SOURCES;CFLAGS;LINK_FLAGS;DEFS;LINK_LIBS;OBJECT_LIBS" ${ARGN}) set(libnames) if(APPLE) @@ -116,7 +116,7 @@ function(add_compiler_rt_runtime name ty set(libname "${name}_${os}") else() set(libname "${name}_${os}_dynamic") - set(extra_linkflags_${libname} ${DARWIN_${os}_LINKFLAGS} ${LIB_LINKFLAGS}) + set(extra_link_flags_${libname} ${DARWIN_${os}_LINK_FLAGS} ${LIB_LINK_FLAGS}) endif() list_intersect(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) if(LIB_ARCHS_${libname}) @@ -139,7 +139,7 @@ function(add_compiler_rt_runtime name ty else() set(libname "${name}-dynamic-${arch}") set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) - set(extra_linkflags_${libname} ${TARGET_${arch}_LINKFLAGS} ${LIB_LINKFLAGS}) + set(extra_link_flags_${libname} ${TARGET_${arch}_LINK_FLAGS} ${LIB_LINK_FLAGS}) if(WIN32) set(output_name_${libname} ${name}_dynamic-${arch}${COMPILER_RT_OS_SUFFIX}) else() @@ -188,7 +188,7 @@ function(add_compiler_rt_runtime name ty add_library(${libname} ${type} ${sources_${libname}}) set_target_compile_flags(${libname} ${extra_cflags_${libname}}) - set_target_link_flags(${libname} ${extra_linkflags_${libname}}) + set_target_link_flags(${libname} ${extra_link_flags_${libname}}) set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS ${LIB_DEFS}) set_target_output_directories(${libname} ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) @@ -243,7 +243,7 @@ endfunction() # when cross compiling, COMPILER_RT_TEST_COMPILER_CFLAGS help # in compilation and linking of unittests. string(REPLACE " " ";" COMPILER_RT_UNITTEST_CFLAGS "${COMPILER_RT_TEST_COMPILER_CFLAGS}") -set(COMPILER_RT_UNITTEST_LINKFLAGS ${COMPILER_RT_UNITTEST_CFLAGS}) +set(COMPILER_RT_UNITTEST_LINK_FLAGS ${COMPILER_RT_UNITTEST_CFLAGS}) # Unittests support. set(COMPILER_RT_GTEST_PATH ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest) Modified: vendor/compiler-rt/dist/cmake/Modules/CompilerRTDarwinUtils.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/CompilerRTDarwinUtils.cmake Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/cmake/Modules/CompilerRTDarwinUtils.cmake Sat Jan 14 15:38:48 2017 (r312177) @@ -66,7 +66,7 @@ function(darwin_test_archs os valid_arch file(WRITE ${SIMPLE_C} "#include \nint main() { printf(__FILE__); return 0; }\n") set(os_linker_flags) - foreach(flag ${DARWIN_${os}_LINKFLAGS}) + foreach(flag ${DARWIN_${os}_LINK_FLAGS}) set(os_linker_flags "${os_linker_flags} ${flag}") endforeach() endif() Modified: vendor/compiler-rt/dist/cmake/Modules/CompilerRTLink.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/CompilerRTLink.cmake Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/cmake/Modules/CompilerRTLink.cmake Sat Jan 14 15:38:48 2017 (r312177) @@ -1,16 +1,16 @@ # Link a shared library with COMPILER_RT_TEST_COMPILER. # clang_link_shared( # OBJECTS -# LINKFLAGS +# LINK_FLAGS # DEPS ) macro(clang_link_shared so_file) - cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINKFLAGS;DEPS" ${ARGN}) + cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINK_FLAGS;DEPS" ${ARGN}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SOURCE_DEPS clang) endif() add_custom_command( OUTPUT ${so_file} COMMAND ${COMPILER_RT_TEST_COMPILER} -o "${so_file}" -shared - ${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS} + ${SOURCE_LINK_FLAGS} ${SOURCE_OBJECTS} DEPENDS ${SOURCE_DEPS}) endmacro() Modified: vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake Sat Jan 14 15:38:48 2017 (r312177) @@ -126,7 +126,7 @@ endfunction() # If successful, saves target flags for this architecture. macro(test_target_arch arch def) set(TARGET_${arch}_CFLAGS ${ARGN}) - set(TARGET_${arch}_LINKFLAGS ${ARGN}) + set(TARGET_${arch}_LINK_FLAGS ${ARGN}) set(argstring "") foreach(arg ${ARGN}) set(argstring "${argstring} ${arg}") @@ -219,8 +219,18 @@ macro(load_llvm_config) set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") # Make use of LLVM CMake modules. - file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE) - set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + # --cmakedir is supported since llvm r291218 (4.0 release) + execute_process( + COMMAND ${LLVM_CONFIG_PATH} --cmakedir + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE CONFIG_OUTPUT) + if(NOT HAD_ERROR) + string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH) + else() + file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE) + set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + endif() + list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") # Get some LLVM variables from LLVMConfig. include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake") Modified: vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake Sat Jan 14 15:38:48 2017 (r312177) @@ -48,13 +48,13 @@ endmacro() # This function is only used on Darwin, where undefined symbols must be specified # in the linker invocation. -function(add_weak_symbols libname linkflags) +function(add_weak_symbols libname link_flags) file(STRINGS "${COMPILER_RT_SOURCE_DIR}/lib/${libname}/weak_symbols.txt" WEAK_SYMBOLS) - set(local_linkflags ${${linkflags}}) + set(local_link_flags ${${link_flags}}) foreach(SYMBOL ${WEAK_SYMBOLS}) - set(local_linkflags ${local_linkflags} -Wl,-U,${SYMBOL}) + set(local_link_flags ${local_link_flags} -Wl,-U,${SYMBOL}) endforeach() - set(${linkflags} ${local_linkflags} PARENT_SCOPE) + set(${link_flags} ${local_link_flags} PARENT_SCOPE) endfunction() macro(add_sanitizer_rt_version_list name) Modified: vendor/compiler-rt/dist/cmake/config-ix.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/config-ix.cmake Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/cmake/config-ix.cmake Sat Jan 14 15:38:48 2017 (r312177) @@ -29,6 +29,7 @@ check_cxx_compiler_flag(-std=c++11 check_cxx_compiler_flag(-ftls-model=initial-exec COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC) check_cxx_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG) check_cxx_compiler_flag("-Werror -msse3" COMPILER_RT_HAS_MSSE3_FLAG) +check_cxx_compiler_flag("-Werror -msse4.2" COMPILER_RT_HAS_MSSE4_2_FLAG) check_cxx_compiler_flag(--sysroot=. COMPILER_RT_HAS_SYSROOT_FLAG) if(NOT WIN32 AND NOT CYGWIN) @@ -241,26 +242,26 @@ if(APPLE) set(CMAKE_OSX_DEPLOYMENT_TARGET "") set(DARWIN_COMMON_CFLAGS -stdlib=libc++) - set(DARWIN_COMMON_LINKFLAGS + set(DARWIN_COMMON_LINK_FLAGS -stdlib=libc++ -lc++ -lc++abi) check_linker_flag("-fapplication-extension" COMPILER_RT_HAS_APP_EXTENSION) if(COMPILER_RT_HAS_APP_EXTENSION) - list(APPEND DARWIN_COMMON_LINKFLAGS "-fapplication-extension") + list(APPEND DARWIN_COMMON_LINK_FLAGS "-fapplication-extension") endif() set(DARWIN_osx_CFLAGS ${DARWIN_COMMON_CFLAGS} -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) - set(DARWIN_osx_LINKFLAGS - ${DARWIN_COMMON_LINKFLAGS} + set(DARWIN_osx_LINK_FLAGS + ${DARWIN_COMMON_LINK_FLAGS} -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) if(DARWIN_osx_SYSROOT) list(APPEND DARWIN_osx_CFLAGS -isysroot ${DARWIN_osx_SYSROOT}) - list(APPEND DARWIN_osx_LINKFLAGS -isysroot ${DARWIN_osx_SYSROOT}) + list(APPEND DARWIN_osx_LINK_FLAGS -isysroot ${DARWIN_osx_SYSROOT}) endif() # Figure out which arches to use for each OS @@ -283,8 +284,8 @@ if(APPLE) ${DARWIN_COMMON_CFLAGS} ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} -isysroot ${DARWIN_${platform}sim_SYSROOT}) - set(DARWIN_${platform}sim_LINKFLAGS - ${DARWIN_COMMON_LINKFLAGS} + set(DARWIN_${platform}sim_LINK_FLAGS + ${DARWIN_COMMON_LINK_FLAGS} ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} -isysroot ${DARWIN_${platform}sim_SYSROOT}) @@ -311,8 +312,8 @@ if(APPLE) ${DARWIN_COMMON_CFLAGS} ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} -isysroot ${DARWIN_${platform}_SYSROOT}) - set(DARWIN_${platform}_LINKFLAGS - ${DARWIN_COMMON_LINKFLAGS} + set(DARWIN_${platform}_LINK_FLAGS + ${DARWIN_COMMON_LINK_FLAGS} ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} -isysroot ${DARWIN_${platform}_SYSROOT}) Modified: vendor/compiler-rt/dist/lib/asan/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/asan/CMakeLists.txt Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/asan/CMakeLists.txt Sat Jan 14 15:38:48 2017 (r312177) @@ -106,9 +106,9 @@ endif() add_compiler_rt_component(asan) if(APPLE) - add_weak_symbols("asan" WEAK_SYMBOL_LINKFLAGS) - add_weak_symbols("ubsan" WEAK_SYMBOL_LINKFLAGS) - add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINKFLAGS) + add_weak_symbols("asan" WEAK_SYMBOL_LINK_FLAGS) + add_weak_symbols("ubsan" WEAK_SYMBOL_LINK_FLAGS) + add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS) add_compiler_rt_runtime(clang_rt.asan SHARED @@ -121,7 +121,7 @@ if(APPLE) RTLSanCommon RTUbsan CFLAGS ${ASAN_DYNAMIC_CFLAGS} - LINKFLAGS ${WEAK_SYMBOL_LINKFLAGS} + LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS} DEFS ${ASAN_DYNAMIC_DEFINITIONS} PARENT_TARGET asan) else() @@ -188,7 +188,7 @@ else() RTAsan_dynamic_version_script_dummy RTUbsan_cxx CFLAGS ${ASAN_DYNAMIC_CFLAGS} - LINKFLAGS ${ASAN_DYNAMIC_LINK_FLAGS} + LINK_FLAGS ${ASAN_DYNAMIC_LINK_FLAGS} ${VERSION_SCRIPT_FLAG} LINK_LIBS ${ASAN_DYNAMIC_LIBS} DEFS ${ASAN_DYNAMIC_DEFINITIONS} Modified: vendor/compiler-rt/dist/lib/asan/asan_activation.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_activation.cc Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/asan/asan_activation.cc Sat Jan 14 15:38:48 2017 (r312177) @@ -77,12 +77,13 @@ static struct AsanDeactivatedFlags { void Print() { Report( - "quarantine_size_mb %d, max_redzone %d, poison_heap %d, " - "malloc_context_size %d, alloc_dealloc_mismatch %d, " - "allocator_may_return_null %d, coverage %d, coverage_dir %s, " - "allocator_release_to_os_interval_ms %d\n", - allocator_options.quarantine_size_mb, allocator_options.max_redzone, - poison_heap, malloc_context_size, + "quarantine_size_mb %d, thread_local_quarantine_size_kb %d, " + "max_redzone %d, poison_heap %d, malloc_context_size %d, " + "alloc_dealloc_mismatch %d, allocator_may_return_null %d, coverage %d, " + "coverage_dir %s, allocator_release_to_os_interval_ms %d\n", + allocator_options.quarantine_size_mb, + allocator_options.thread_local_quarantine_size_kb, + allocator_options.max_redzone, poison_heap, malloc_context_size, allocator_options.alloc_dealloc_mismatch, allocator_options.may_return_null, coverage, coverage_dir, allocator_options.release_to_os_interval_ms); @@ -109,6 +110,7 @@ void AsanDeactivate() { AllocatorOptions disabled = asan_deactivated_flags.allocator_options; disabled.quarantine_size_mb = 0; + disabled.thread_local_quarantine_size_kb = 0; disabled.min_redzone = 16; // Redzone must be at least 16 bytes long. disabled.max_redzone = 16; disabled.alloc_dealloc_mismatch = false; Modified: vendor/compiler-rt/dist/lib/asan/asan_activation_flags.inc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_activation_flags.inc Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/asan/asan_activation_flags.inc Sat Jan 14 15:38:48 2017 (r312177) @@ -24,6 +24,7 @@ ASAN_ACTIVATION_FLAG(int, redzone) ASAN_ACTIVATION_FLAG(int, max_redzone) ASAN_ACTIVATION_FLAG(int, quarantine_size_mb) +ASAN_ACTIVATION_FLAG(int, thread_local_quarantine_size_kb) ASAN_ACTIVATION_FLAG(bool, alloc_dealloc_mismatch) ASAN_ACTIVATION_FLAG(bool, poison_heap) Modified: vendor/compiler-rt/dist/lib/asan/asan_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_allocator.cc Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/asan/asan_allocator.cc Sat Jan 14 15:38:48 2017 (r312177) @@ -269,24 +269,24 @@ struct Allocator { } void RePoisonChunk(uptr chunk) { - // This could a user-facing chunk (with redzones), or some internal + // This could be a user-facing chunk (with redzones), or some internal // housekeeping chunk, like TransferBatch. Start by assuming the former. AsanChunk *ac = GetAsanChunk((void *)chunk); uptr allocated_size = allocator.GetActuallyAllocatedSize((void *)ac); uptr beg = ac->Beg(); uptr end = ac->Beg() + ac->UsedSize(true); uptr chunk_end = chunk + allocated_size; - if (chunk < beg && beg < end && end <= chunk_end) { - // Looks like a valid AsanChunk. Or maybe not. Be conservative and only - // poison the redzones. + if (chunk < beg && beg < end && end <= chunk_end && + ac->chunk_state == CHUNK_ALLOCATED) { + // Looks like a valid AsanChunk in use, poison redzones only. PoisonShadow(chunk, beg - chunk, kAsanHeapLeftRedzoneMagic); uptr end_aligned_down = RoundDownTo(end, SHADOW_GRANULARITY); FastPoisonShadowPartialRightRedzone( end_aligned_down, end - end_aligned_down, chunk_end - end_aligned_down, kAsanHeapLeftRedzoneMagic); } else { - // This can not be an AsanChunk. Poison everything. It may be reused as - // AsanChunk later. + // This is either not an AsanChunk or freed or quarantined AsanChunk. + // In either case, poison everything. PoisonShadow(chunk, allocated_size, kAsanHeapLeftRedzoneMagic); } } Modified: vendor/compiler-rt/dist/lib/asan/asan_flags.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_flags.cc Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/asan/asan_flags.cc Sat Jan 14 15:38:48 2017 (r312177) @@ -169,6 +169,11 @@ void InitializeFlags() { (ASAN_LOW_MEMORY) ? 1 << 6 : FIRST_32_SECOND_64(1 << 8, 1 << 10); f->thread_local_quarantine_size_kb = kDefaultThreadLocalQuarantineSizeKb; } + if (f->thread_local_quarantine_size_kb == 0 && f->quarantine_size_mb > 0) { + Report("%s: thread_local_quarantine_size_kb can be set to 0 only when " + "quarantine_size_mb is set to 0\n", SanitizerToolName); + Die(); + } if (!f->replace_str && common_flags()->intercept_strlen) { Report("WARNING: strlen interceptor is enabled even though replace_str=0. " "Use intercept_strlen=0 to disable it."); Modified: vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt Sat Jan 14 15:38:48 2017 (r312177) @@ -36,8 +36,8 @@ append_list_if(COMPILER_RT_HAS_WVARIADIC # This will ensure the target linker is used # during cross compilation -set(ASAN_UNITTEST_COMMON_LINKFLAGS - ${COMPILER_RT_UNITTEST_LINKFLAGS}) +set(ASAN_UNITTEST_COMMON_LINK_FLAGS + ${COMPILER_RT_UNITTEST_LINK_FLAGS}) # -gline-tables-only must be enough for ASan, so use it if possible. if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang") @@ -48,7 +48,7 @@ endif() if(MSVC) list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -gcodeview) endif() -list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS -g) +list(APPEND ASAN_UNITTEST_COMMON_LINK_FLAGS -g) # Use -D instead of definitions to please custom compile command. list(APPEND ASAN_UNITTEST_COMMON_CFLAGS @@ -58,12 +58,12 @@ list(APPEND ASAN_UNITTEST_COMMON_CFLAGS if(APPLE) list(APPEND ASAN_UNITTEST_COMMON_CFLAGS ${DARWIN_osx_CFLAGS}) - list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS ${DARWIN_osx_LINKFLAGS}) + list(APPEND ASAN_UNITTEST_COMMON_LINK_FLAGS ${DARWIN_osx_LINK_FLAGS}) - add_weak_symbols("asan" WEAK_SYMBOL_LINKFLAGS) - add_weak_symbols("ubsan" WEAK_SYMBOL_LINKFLAGS) - add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINKFLAGS) - list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS ${WEAK_SYMBOL_LINKFLAGS}) + add_weak_symbols("asan" WEAK_SYMBOL_LINK_FLAGS) + add_weak_symbols("ubsan" WEAK_SYMBOL_LINK_FLAGS) + add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS) + list(APPEND ASAN_UNITTEST_COMMON_LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS}) endif() if(MSVC) @@ -82,41 +82,41 @@ if(CAN_TARGET_x86_64 OR CAN_TARGET_i386) endif() if(NOT MSVC) - list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS --driver-mode=g++) + list(APPEND ASAN_UNITTEST_COMMON_LINK_FLAGS --driver-mode=g++) endif() # x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests. if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE") - list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS "-lc++") + list(APPEND ASAN_UNITTEST_COMMON_LINK_FLAGS "-lc++") endif() # Unit tests on Mac depend on Foundation. if(APPLE) - list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS -framework Foundation) + list(APPEND ASAN_UNITTEST_COMMON_LINK_FLAGS -framework Foundation) endif() if(ANDROID) - list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS -pie) + list(APPEND ASAN_UNITTEST_COMMON_LINK_FLAGS -pie) endif() -set(ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS - ${ASAN_UNITTEST_COMMON_LINKFLAGS}) -list(APPEND ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS -fsanitize=address) +set(ASAN_UNITTEST_INSTRUMENTED_LINK_FLAGS + ${ASAN_UNITTEST_COMMON_LINK_FLAGS}) +list(APPEND ASAN_UNITTEST_INSTRUMENTED_LINK_FLAGS -fsanitize=address) -set(ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINKFLAGS - ${ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS} +set(ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINK_FLAGS + ${ASAN_UNITTEST_INSTRUMENTED_LINK_FLAGS} -shared-libasan) set(ASAN_UNITTEST_INSTRUMENTED_LIBS) # NDK r10 requires -latomic almost always. append_list_if(ANDROID atomic ASAN_UNITTEST_INSTRUMENTED_LIBS) -set(ASAN_UNITTEST_NOINST_LINKFLAGS ${ASAN_UNITTEST_COMMON_LINKFLAGS}) +set(ASAN_UNITTEST_NOINST_LINK_FLAGS ${ASAN_UNITTEST_COMMON_LINK_FLAGS}) if(NOT APPLE) - append_list_if(COMPILER_RT_HAS_LIBM -lm ASAN_UNITTEST_NOINST_LINKFLAGS) - append_list_if(COMPILER_RT_HAS_LIBDL -ldl ASAN_UNITTEST_NOINST_LINKFLAGS) - append_list_if(COMPILER_RT_HAS_LIBRT -lrt ASAN_UNITTEST_NOINST_LINKFLAGS) - append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread ASAN_UNITTEST_NOINST_LINKFLAGS) - append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINKFLAGS) + append_list_if(COMPILER_RT_HAS_LIBM -lm ASAN_UNITTEST_NOINST_LINK_FLAGS) + append_list_if(COMPILER_RT_HAS_LIBDL -ldl ASAN_UNITTEST_NOINST_LINK_FLAGS) + append_list_if(COMPILER_RT_HAS_LIBRT -lrt ASAN_UNITTEST_NOINST_LINK_FLAGS) + append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread ASAN_UNITTEST_NOINST_LINK_FLAGS) + append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINK_FLAGS) endif() # TODO(eugenis): move all -l flags above to _LIBS? @@ -148,7 +148,7 @@ endmacro() # Link ASan unit test for a given architecture from a set # of objects in with given linker flags. macro(add_asan_test test_suite test_name arch kind) - cmake_parse_arguments(TEST "WITH_TEST_RUNTIME" "" "OBJECTS;LINKFLAGS;SUBDIR" ${ARGN}) + cmake_parse_arguments(TEST "WITH_TEST_RUNTIME" "" "OBJECTS;LINK_FLAGS;SUBDIR" ${ARGN}) get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS) set(TEST_DEPS ${TEST_OBJECTS}) if(NOT COMPILER_RT_STANDALONE_BUILD) @@ -172,7 +172,7 @@ macro(add_asan_test test_suite test_name SUBDIR ${TEST_SUBDIR} OBJECTS ${TEST_OBJECTS} DEPS ${TEST_DEPS} - LINK_FLAGS ${TEST_LINKFLAGS} + LINK_FLAGS ${TEST_LINK_FLAGS} ${TARGET_LINK_FLAGS}) endmacro() @@ -237,8 +237,8 @@ macro(add_asan_tests_for_arch_and_kind a endforeach() # Clang links the static CRT by default. Override that to use the dynamic # CRT. - set(ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINKFLAGS - ${ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINKFLAGS} + set(ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINK_FLAGS + ${ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINK_FLAGS} -Wl,-nodefaultlib:libcmt,-defaultlib:msvcrt,-defaultlib:oldnames) else() set(ASAN_INST_DYNAMIC_TEST_OBJECTS ${ASAN_INST_TEST_OBJECTS}) @@ -256,7 +256,7 @@ macro(add_asan_tests_for_arch_and_kind a add_asan_test(AsanUnitTests "Asan-${arch}${kind}-Test" ${arch} ${kind} SUBDIR "default" OBJECTS ${ASAN_INST_TEST_OBJECTS} - LINKFLAGS ${ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS}) + LINK_FLAGS ${ASAN_UNITTEST_INSTRUMENTED_LINK_FLAGS}) if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME) # Create the 'dynamic' folder where ASAN tests are produced. if(CMAKE_CONFIGURATION_TYPES) @@ -270,7 +270,7 @@ macro(add_asan_tests_for_arch_and_kind a add_asan_test(AsanDynamicUnitTests "Asan-${arch}${kind}-Dynamic-Test" ${arch} ${kind} SUBDIR "dynamic" OBJECTS ${ASAN_INST_DYNAMIC_TEST_OBJECTS} - LINKFLAGS ${ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINKFLAGS}) + LINK_FLAGS ${ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINK_FLAGS}) endif() # Add static ASan runtime that will be linked with uninstrumented tests. @@ -307,7 +307,7 @@ macro(add_asan_tests_for_arch_and_kind a add_asan_test(AsanUnitTests "Asan-${arch}${kind}-Noinst-Test" ${arch} ${kind} SUBDIR "default" OBJECTS ${ASAN_NOINST_TEST_OBJECTS} - LINKFLAGS ${ASAN_UNITTEST_NOINST_LINKFLAGS} + LINK_FLAGS ${ASAN_UNITTEST_NOINST_LINK_FLAGS} WITH_TEST_RUNTIME) # Benchmarks. @@ -319,7 +319,7 @@ macro(add_asan_tests_for_arch_and_kind a add_asan_test(AsanBenchmarks "Asan-${arch}${kind}-Benchmark" ${arch} ${kind} SUBDIR "default" OBJECTS ${ASAN_BENCHMARKS_OBJECTS} - LINKFLAGS ${ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS}) + LINK_FLAGS ${ASAN_UNITTEST_INSTRUMENTED_LINK_FLAGS}) endmacro() if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT ANDROID) @@ -347,7 +347,7 @@ if(ANDROID) ${COMPILER_RT_GTEST_SOURCE} ${ASAN_NOINST_TEST_SOURCES}) set_target_compile_flags(AsanNoinstTest ${ASAN_UNITTEST_COMMON_CFLAGS}) - set_target_link_flags(AsanNoinstTest ${ASAN_UNITTEST_NOINST_LINKFLAGS}) + set_target_link_flags(AsanNoinstTest ${ASAN_UNITTEST_NOINST_LINK_FLAGS}) target_link_libraries(AsanNoinstTest ${ASAN_UNITTEST_NOINST_LIBS}) # Test with ASan instrumentation. Link with ASan dynamic runtime. @@ -355,7 +355,7 @@ if(ANDROID) ${COMPILER_RT_GTEST_SOURCE} ${ASAN_INST_TEST_SOURCES}) set_target_compile_flags(AsanTest ${ASAN_UNITTEST_INSTRUMENTED_CFLAGS}) - set_target_link_flags(AsanTest ${ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS}) + set_target_link_flags(AsanTest ${ASAN_UNITTEST_INSTRUMENTED_LINK_FLAGS}) target_link_libraries(AsanTest ${ASAN_UNITTEST_INSTRUMENTED_LIBS}) # Setup correct output directory and link flags. Modified: vendor/compiler-rt/dist/lib/builtins/arm/adddf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/adddf3vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/adddf3vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -18,10 +18,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__adddf3vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vadd.f64 d0, d0, d1 +#else vmov d6, r0, r1 // move first param from r0/r1 pair into d6 vmov d7, r2, r3 // move second param from r2/r3 pair into d7 vadd.f64 d6, d6, d7 vmov r0, r1, d6 // move result back to r0/r1 pair +#endif bx lr END_COMPILERRT_FUNCTION(__adddf3vfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/addsf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/addsf3vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/addsf3vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -18,10 +18,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__addsf3vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vadd.f32 s0, s0, s1 +#else vmov s14, r0 // move first param from r0 into float register vmov s15, r1 // move second param from r1 into float register vadd.f32 s14, s14, s15 vmov r0, s14 // move result back to r0 +#endif bx lr END_COMPILERRT_FUNCTION(__addsf3vfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/comparesf2.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/comparesf2.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/comparesf2.S Sat Jan 14 15:38:48 2017 (r312177) @@ -43,8 +43,14 @@ .thumb #endif -.p2align 2 +@ int __eqsf2(float a, float b) + + .p2align 2 DEFINE_COMPILERRT_FUNCTION(__eqsf2) +#if defined(COMPILER_RT_ARMHF_TARGET) + vmov r0, s0 + vmov r1, s1 +#endif // Make copies of a and b with the sign bit shifted off the top. These will // be used to detect zeros and NaNs. #if __ARM_ARCH_ISA_THUMB == 1 @@ -166,16 +172,23 @@ LOCAL_LABEL(CHECK_NAN): JMP(lr) #endif END_COMPILERRT_FUNCTION(__eqsf2) + DEFINE_COMPILERRT_FUNCTION_ALIAS(__lesf2, __eqsf2) DEFINE_COMPILERRT_FUNCTION_ALIAS(__ltsf2, __eqsf2) DEFINE_COMPILERRT_FUNCTION_ALIAS(__nesf2, __eqsf2) -.p2align 2 +@ int __gtsf2(float a, float b) + + .p2align 2 DEFINE_COMPILERRT_FUNCTION(__gtsf2) // Identical to the preceding except in that we return -1 for NaN values. // Given that the two paths share so much code, one might be tempted to // unify them; however, the extra code needed to do so makes the code size // to performance tradeoff very hard to justify for such small functions. +#if defined(COMPILER_RT_ARMHF_TARGET) + vmov r0, s0 + vmov r1, s1 +#endif #if __ARM_ARCH_ISA_THUMB == 1 push {r6, lr} lsls r2, r0, #1 @@ -215,6 +228,8 @@ LOCAL_LABEL(CHECK_NAN_2): 6: pop {r6, pc} #else + mov r2, r0, lsl #1 + mov r3, r1, lsl #1 orrs r12, r2, r3, lsr #1 it ne eorsne r12, r0, r1 @@ -233,10 +248,17 @@ LOCAL_LABEL(CHECK_NAN_2): JMP(lr) #endif END_COMPILERRT_FUNCTION(__gtsf2) + DEFINE_COMPILERRT_FUNCTION_ALIAS(__gesf2, __gtsf2) -.p2align 2 +@ int __unordsf2(float a, float b) + + .p2align 2 DEFINE_COMPILERRT_FUNCTION(__unordsf2) +#if defined(COMPILER_RT_ARMHF_TARGET) + vmov r0, s0 + vmov r1, s1 +#endif // Return 1 for NaN values, 0 otherwise. lsls r2, r0, #1 lsls r3, r1, #1 @@ -260,7 +282,15 @@ DEFINE_COMPILERRT_FUNCTION(__unordsf2) JMP(lr) END_COMPILERRT_FUNCTION(__unordsf2) +#if defined(COMPILER_RT_ARMHF_TARGET) +DEFINE_COMPILERRT_FUNCTION(__aeabi_fcmpum): + vmov s0, r0 + vmov s1, r1 + b SYMBOL_NAME(__unordsf2) +END_COMPILERRT_FUNCTION(__aeabi_fcmpum) +#else DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_fcmpun, __unordsf2) +#endif NO_EXEC_STACK_DIRECTIVE Modified: vendor/compiler-rt/dist/lib/builtins/arm/divdf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/divdf3vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/divdf3vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -18,10 +18,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__divdf3vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vdiv.f64 d0, d0, d1 +#else vmov d6, r0, r1 // move first param from r0/r1 pair into d6 vmov d7, r2, r3 // move second param from r2/r3 pair into d7 - vdiv.f64 d5, d6, d7 + vdiv.f64 d5, d6, d7 vmov r0, r1, d5 // move result back to r0/r1 pair +#endif bx lr END_COMPILERRT_FUNCTION(__divdf3vfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/divsf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/divsf3vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/divsf3vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -18,10 +18,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__divsf3vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vdiv.f32 s0, s0, s1 +#else vmov s14, r0 // move first param from r0 into float register vmov s15, r1 // move second param from r1 into float register vdiv.f32 s13, s14, s15 vmov r0, s13 // move result back to r0 +#endif bx lr END_COMPILERRT_FUNCTION(__divsf3vfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/eqdf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/eqdf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/eqdf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__eqdf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcmp.f64 d0, d1 +#else vmov d6, r0, r1 // load r0/r1 pair in double register vmov d7, r2, r3 // load r2/r3 pair in double register vcmp.f64 d6, d7 +#endif vmrs apsr_nzcv, fpscr moveq r0, #1 // set result register to 1 if equal movne r0, #0 Modified: vendor/compiler-rt/dist/lib/builtins/arm/eqsf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/eqsf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/eqsf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__eqsf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcmp.f32 s0, s1 +#else vmov s14, r0 // move from GPR 0 to float register vmov s15, r1 // move from GPR 1 to float register vcmp.f32 s14, s15 +#endif vmrs apsr_nzcv, fpscr moveq r0, #1 // set result register to 1 if equal movne r0, #0 Modified: vendor/compiler-rt/dist/lib/builtins/arm/extendsfdf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/extendsfdf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/extendsfdf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__extendsfdf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcvt.f64.f32 d0, s0 +#else vmov s15, r0 // load float register from R0 vcvt.f64.f32 d7, s15 // convert single to double vmov r0, r1, d7 // return result in r0/r1 pair +#endif bx lr END_COMPILERRT_FUNCTION(__extendsfdf2vfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/fixdfsivfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/fixdfsivfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/fixdfsivfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__fixdfsivfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcvt.s32.f64 s0, d0 + vmov r0, s0 +#else vmov d7, r0, r1 // load double register from R0/R1 vcvt.s32.f64 s15, d7 // convert double to 32-bit int into s15 vmov r0, s15 // move s15 to result register +#endif bx lr END_COMPILERRT_FUNCTION(__fixdfsivfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/fixsfsivfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/fixsfsivfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/fixsfsivfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__fixsfsivfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcvt.s32.f32 s0, s0 + vmov r0, s0 +#else vmov s15, r0 // load float register from R0 vcvt.s32.f32 s15, s15 // convert single to 32-bit int into s15 vmov r0, s15 // move s15 to result register +#endif bx lr END_COMPILERRT_FUNCTION(__fixsfsivfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/fixunsdfsivfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/fixunsdfsivfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/fixunsdfsivfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -20,9 +20,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__fixunsdfsivfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcvt.u32.f64 s0, d0 + vmov r0, s0 +#else vmov d7, r0, r1 // load double register from R0/R1 vcvt.u32.f64 s15, d7 // convert double to 32-bit int into s15 vmov r0, s15 // move s15 to result register +#endif bx lr END_COMPILERRT_FUNCTION(__fixunsdfsivfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/fixunssfsivfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/fixunssfsivfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/fixunssfsivfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -20,9 +20,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__fixunssfsivfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcvt.u32.f32 s0, s0 + vmov r0, s0 +#else vmov s15, r0 // load float register from R0 vcvt.u32.f32 s15, s15 // convert single to 32-bit unsigned into s15 vmov r0, s15 // move s15 to result register +#endif bx lr END_COMPILERRT_FUNCTION(__fixunssfsivfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/floatsidfvfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/floatsidfvfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/floatsidfvfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__floatsidfvfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vmov s0, r0 + vcvt.f64.s32 d0, s0 +#else vmov s15, r0 // move int to float register s15 vcvt.f64.s32 d7, s15 // convert 32-bit int in s15 to double in d7 vmov r0, r1, d7 // move d7 to result register pair r0/r1 +#endif bx lr END_COMPILERRT_FUNCTION(__floatsidfvfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/floatsisfvfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/floatsisfvfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/floatsisfvfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__floatsisfvfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vmov s0, r0 + vcvt.f32.s32 s0, s0 +#else vmov s15, r0 // move int to float register s15 vcvt.f32.s32 s15, s15 // convert 32-bit int in s15 to float in s15 vmov r0, s15 // move s15 to result register +#endif bx lr END_COMPILERRT_FUNCTION(__floatsisfvfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/floatunssidfvfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/floatunssidfvfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/floatunssidfvfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__floatunssidfvfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vmov s0, r0 + vcvt.f64.u32 d0, s0 +#else vmov s15, r0 // move int to float register s15 vcvt.f64.u32 d7, s15 // convert 32-bit int in s15 to double in d7 vmov r0, r1, d7 // move d7 to result register pair r0/r1 +#endif bx lr END_COMPILERRT_FUNCTION(__floatunssidfvfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/floatunssisfvfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/floatunssisfvfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/floatunssisfvfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__floatunssisfvfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vmov s0, r0 + vcvt.f32.u32 s0, s0 +#else vmov s15, r0 // move int to float register s15 vcvt.f32.u32 s15, s15 // convert 32-bit int in s15 to float in s15 vmov r0, s15 // move s15 to result register +#endif bx lr END_COMPILERRT_FUNCTION(__floatunssisfvfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/gedf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/gedf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/gedf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__gedf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcmp.f64 d0, d1 +#else vmov d6, r0, r1 // load r0/r1 pair in double register vmov d7, r2, r3 // load r2/r3 pair in double register vcmp.f64 d6, d7 +#endif vmrs apsr_nzcv, fpscr movge r0, #1 // set result register to 1 if greater than or equal movlt r0, #0 Modified: vendor/compiler-rt/dist/lib/builtins/arm/gesf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/gesf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/gesf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__gesf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcmp.f32 s0, s1 +#else vmov s14, r0 // move from GPR 0 to float register vmov s15, r1 // move from GPR 1 to float register vcmp.f32 s14, s15 +#endif vmrs apsr_nzcv, fpscr movge r0, #1 // set result register to 1 if greater than or equal movlt r0, #0 Modified: vendor/compiler-rt/dist/lib/builtins/arm/gtdf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/gtdf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/gtdf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__gtdf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcmp.f64 d0, d1 +#else vmov d6, r0, r1 // load r0/r1 pair in double register vmov d7, r2, r3 // load r2/r3 pair in double register vcmp.f64 d6, d7 +#endif vmrs apsr_nzcv, fpscr movgt r0, #1 // set result register to 1 if equal movle r0, #0 Modified: vendor/compiler-rt/dist/lib/builtins/arm/gtsf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/gtsf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/gtsf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__gtsf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcmp.f32 s0, s1 +#else vmov s14, r0 // move from GPR 0 to float register vmov s15, r1 // move from GPR 1 to float register vcmp.f32 s14, s15 +#endif vmrs apsr_nzcv, fpscr movgt r0, #1 // set result register to 1 if equal movle r0, #0 Modified: vendor/compiler-rt/dist/lib/builtins/arm/ledf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/ledf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/ledf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__ledf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcmp.f64 d0, d1 +#else vmov d6, r0, r1 // load r0/r1 pair in double register vmov d7, r2, r3 // load r2/r3 pair in double register vcmp.f64 d6, d7 +#endif vmrs apsr_nzcv, fpscr movls r0, #1 // set result register to 1 if equal movhi r0, #0 Modified: vendor/compiler-rt/dist/lib/builtins/arm/lesf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/lesf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/lesf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__lesf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcmp.f32 s0, s1 +#else vmov s14, r0 // move from GPR 0 to float register vmov s15, r1 // move from GPR 1 to float register vcmp.f32 s14, s15 +#endif vmrs apsr_nzcv, fpscr movls r0, #1 // set result register to 1 if equal movhi r0, #0 Modified: vendor/compiler-rt/dist/lib/builtins/arm/ltdf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/ltdf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/ltdf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__ltdf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcmp.f64 d0, d1 +#else vmov d6, r0, r1 // load r0/r1 pair in double register vmov d7, r2, r3 // load r2/r3 pair in double register vcmp.f64 d6, d7 +#endif vmrs apsr_nzcv, fpscr movmi r0, #1 // set result register to 1 if equal movpl r0, #0 Modified: vendor/compiler-rt/dist/lib/builtins/arm/ltsf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/ltsf2vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/ltsf2vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -19,9 +19,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__ltsf2vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vcmp.f32 s0, s1 +#else vmov s14, r0 // move from GPR 0 to float register vmov s15, r1 // move from GPR 1 to float register vcmp.f32 s14, s15 +#endif vmrs apsr_nzcv, fpscr movmi r0, #1 // set result register to 1 if equal movpl r0, #0 Modified: vendor/compiler-rt/dist/lib/builtins/arm/muldf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/muldf3vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/muldf3vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -18,10 +18,14 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__muldf3vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vmul.f64 d0, d0, d1 +#else vmov d6, r0, r1 // move first param from r0/r1 pair into d6 vmov d7, r2, r3 // move second param from r2/r3 pair into d7 - vmul.f64 d6, d6, d7 + vmul.f64 d6, d6, d7 vmov r0, r1, d6 // move result back to r0/r1 pair +#endif bx lr END_COMPILERRT_FUNCTION(__muldf3vfp) Modified: vendor/compiler-rt/dist/lib/builtins/arm/mulsf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/mulsf3vfp.S Sat Jan 14 15:38:39 2017 (r312176) +++ vendor/compiler-rt/dist/lib/builtins/arm/mulsf3vfp.S Sat Jan 14 15:38:48 2017 (r312177) @@ -18,9 +18,13 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__mulsf3vfp) +#if defined(COMPILER_RT_ARMHF_TARGET) + vmul.f32 s0, s0, s1 +#else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 14 15:38:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4976CAFB66; Sat, 14 Jan 2017 15:38:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58C861A49; Sat, 14 Jan 2017 15:38:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EFcuwu026920; Sat, 14 Jan 2017 15:38:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFcujj026919; Sat, 14 Jan 2017 15:38:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141538.v0EFcujj026919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312178 - vendor/compiler-rt/compiler-rt-release_40-r292009 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:38:57 -0000 Author: dim Date: Sat Jan 14 15:38:56 2017 New Revision: 312178 URL: https://svnweb.freebsd.org/changeset/base/312178 Log: Tag compiler-rt release_40 branch r292009. Added: vendor/compiler-rt/compiler-rt-release_40-r292009/ - copied from r312177, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Sat Jan 14 15:39:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F422CAFC07; Sat, 14 Jan 2017 15:39:17 +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 0ADB81C68; Sat, 14 Jan 2017 15:39:16 +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 v0EFdG5H027107; Sat, 14 Jan 2017 15:39:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFdEKU026985; Sat, 14 Jan 2017 15:39:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141539.v0EFdEKU026985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312179 - in vendor/libc++/dist: . cmake/Modules include include/experimental src test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char test/std/stri... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:39:17 -0000 Author: dim Date: Sat Jan 14 15:39:13 2017 New Revision: 312179 URL: https://svnweb.freebsd.org/changeset/base/312179 Log: Vendor import of libc++ release_40 branch r292009: https://llvm.org/svn/llvm-project/libcxx/branches/release_40@292009 Modified: vendor/libc++/dist/CMakeLists.txt vendor/libc++/dist/cmake/Modules/HandleOutOfTreeLLVM.cmake vendor/libc++/dist/include/__config vendor/libc++/dist/include/__mutex_base vendor/libc++/dist/include/__string vendor/libc++/dist/include/__threading_support vendor/libc++/dist/include/experimental/string_view vendor/libc++/dist/include/ios vendor/libc++/dist/include/memory vendor/libc++/dist/include/mutex vendor/libc++/dist/src/chrono.cpp vendor/libc++/dist/src/new.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign2.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/compare.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/find.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/length.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign2.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/compare.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/find.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/length.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign2.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/compare.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/find.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/length.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign2.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/compare.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/length.pass.cpp vendor/libc++/dist/test/std/thread/futures/futures.shared_future/dtor.pass.cpp vendor/libc++/dist/test/std/thread/futures/futures.unique_future/dtor.pass.cpp Modified: vendor/libc++/dist/CMakeLists.txt ============================================================================== --- vendor/libc++/dist/CMakeLists.txt Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/CMakeLists.txt Sat Jan 14 15:39:13 2017 (r312179) @@ -24,7 +24,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR project(libcxx CXX C) set(PACKAGE_NAME libcxx) - set(PACKAGE_VERSION 4.0.0svn) + set(PACKAGE_VERSION 4.0.0) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") Modified: vendor/libc++/dist/cmake/Modules/HandleOutOfTreeLLVM.cmake ============================================================================== --- vendor/libc++/dist/cmake/Modules/HandleOutOfTreeLLVM.cmake Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/cmake/Modules/HandleOutOfTreeLLVM.cmake Sat Jan 14 15:39:13 2017 (r312179) @@ -38,7 +38,18 @@ macro(find_llvm_parts) set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include") set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree") set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") - set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + + # --cmakedir is supported since llvm r291218 (4.0 release) + execute_process( + COMMAND ${LLVM_CONFIG_PATH} --cmakedir + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE CONFIG_OUTPUT) + if(NOT HAD_ERROR) + string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH) + else() + set(LLVM_CMAKE_PATH + "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + endif() else() set(LLVM_FOUND OFF) message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: " Modified: vendor/libc++/dist/include/__config ============================================================================== --- vendor/libc++/dist/include/__config Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/include/__config Sat Jan 14 15:39:13 2017 (r312179) @@ -396,6 +396,15 @@ namespace std { #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow"))) #endif +// A constexpr version of __builtin_memcmp was added in clang 4.0 +#if __has_builtin(__builtin_memcmp) +# ifdef __apple_build_version__ +// No shipping version of Apple's clang has constexpr __builtin_memcmp +# elif __clang_major__ > 3 +# define _LIBCPP_BUILTIN_MEMCMP_ISCONSTEXPR +# endif +#endif + #elif defined(_LIBCPP_COMPILER_GCC) #define _ALIGNAS(x) __attribute__((__aligned__(x))) @@ -763,7 +772,7 @@ template struct __static_asse #define _NOALIAS #endif -#if __has_extension(cxx_explicit_conversions) || defined(__IBMCPP__) || \ +#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || \ (!defined(_LIBCPP_CXX03_LANG) && defined(__GNUC__)) // All supported GCC versions # define _LIBCPP_EXPLICIT explicit #else Modified: vendor/libc++/dist/include/__mutex_base ============================================================================== --- vendor/libc++/dist/include/__mutex_base Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/include/__mutex_base Sat Jan 14 15:39:13 2017 (r312179) @@ -410,8 +410,8 @@ condition_variable::wait_for(unique_lock typedef time_point > __sys_tpf; typedef time_point __sys_tpi; __sys_tpf _Max = __sys_tpi::max(); - system_clock::time_point __s_now = system_clock::now(); steady_clock::time_point __c_now = steady_clock::now(); + system_clock::time_point __s_now = system_clock::now(); if (_Max - __d > __s_now) __do_timed_wait(__lk, __s_now + __ceil(__d)); else Modified: vendor/libc++/dist/include/__string ============================================================================== --- vendor/libc++/dist/include/__string Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/include/__string Sat Jan 14 15:39:13 2017 (r312179) @@ -26,13 +26,14 @@ struct char_traits typedef streampos pos_type; typedef mbstate_t state_type; - static void assign(char_type& c1, const char_type& c2) noexcept; + static constexpr void assign(char_type& c1, const char_type& c2) noexcept; static constexpr bool eq(char_type c1, char_type c2) noexcept; static constexpr bool lt(char_type c1, char_type c2) noexcept; - static int compare(const char_type* s1, const char_type* s2, size_t n); - static size_t length(const char_type* s); - static const char_type* find(const char_type* s, size_t n, const char_type& a); + static constexpr int compare(const char_type* s1, const char_type* s2, size_t n); + static constexpr size_t length(const char_type* s); + static constexpr const char_type* + find(const char_type* s, size_t n, const char_type& a); static char_type* move(char_type* s1, const char_type* s2, size_t n); static char_type* copy(char_type* s1, const char_type* s2, size_t n); static char_type* assign(char_type* s, size_t n, char_type a); @@ -77,18 +78,19 @@ struct _LIBCPP_TEMPLATE_VIS char_traits typedef streampos pos_type; typedef mbstate_t state_type; - static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT - {__c1 = __c2;} + static inline void _LIBCPP_CONSTEXPR_AFTER_CXX14 + assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;} static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 == __c2;} static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 < __c2;} - static int compare(const char_type* __s1, const char_type* __s2, size_t __n); - _LIBCPP_INLINE_VISIBILITY - static size_t length(const char_type* __s); - _LIBCPP_INLINE_VISIBILITY - static const char_type* find(const char_type* __s, size_t __n, const char_type& __a); + static _LIBCPP_CONSTEXPR_AFTER_CXX14 + int compare(const char_type* __s1, const char_type* __s2, size_t __n); + _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14 + size_t length(const char_type* __s); + _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14 + const char_type* find(const char_type* __s, size_t __n, const char_type& __a); static char_type* move(char_type* __s1, const char_type* __s2, size_t __n); _LIBCPP_INLINE_VISIBILITY static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n); @@ -108,7 +110,7 @@ struct _LIBCPP_TEMPLATE_VIS char_traits }; template -int +_LIBCPP_CONSTEXPR_AFTER_CXX14 int char_traits<_CharT>::compare(const char_type* __s1, const char_type* __s2, size_t __n) { for (; __n; --__n, ++__s1, ++__s2) @@ -123,7 +125,7 @@ char_traits<_CharT>::compare(const char_ template inline -size_t +_LIBCPP_CONSTEXPR_AFTER_CXX14 size_t char_traits<_CharT>::length(const char_type* __s) { size_t __len = 0; @@ -134,7 +136,7 @@ char_traits<_CharT>::length(const char_t template inline -const _CharT* +_LIBCPP_CONSTEXPR_AFTER_CXX14 const _CharT* char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a) { for (; __n; --__n) @@ -200,18 +202,19 @@ struct _LIBCPP_TEMPLATE_VIS char_traits< typedef streampos pos_type; typedef mbstate_t state_type; - static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT - {__c1 = __c2;} + static inline _LIBCPP_CONSTEXPR_AFTER_CXX14 + void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;} static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 == __c2;} static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {return (unsigned char)__c1 < (unsigned char)__c2;} - static inline int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT - {return __n == 0 ? 0 : memcmp(__s1, __s2, __n);} - static inline size_t length(const char_type* __s) _NOEXCEPT {return strlen(__s);} - static inline const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT - {return __n == 0 ? NULL : (const char_type*) memchr(__s, to_int_type(__a), __n);} + static _LIBCPP_CONSTEXPR_AFTER_CXX14 + int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT; + static inline size_t _LIBCPP_CONSTEXPR_AFTER_CXX14 + length(const char_type* __s) _NOEXCEPT {return __builtin_strlen(__s);} + static _LIBCPP_CONSTEXPR_AFTER_CXX14 + const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {return __n == 0 ? __s1 : (char_type*) memmove(__s1, __s2, __n);} static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT @@ -234,6 +237,48 @@ struct _LIBCPP_TEMPLATE_VIS char_traits< {return int_type(EOF);} }; +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 +int +char_traits::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT +{ + if (__n == 0) + return 0; +#ifdef _LIBCPP_BUILTIN_MEMCMP_ISCONSTEXPR + return __builtin_memcmp(__s1, __s2, __n); +#elif _LIBCPP_STD_VER <= 14 + return memcmp(__s1, __s2, __n); +#else + for (; __n; --__n, ++__s1, ++__s2) + { + if (lt(*__s1, *__s2)) + return -1; + if (lt(*__s2, *__s1)) + return 1; + } + return 0; +#endif +} + +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 +const char* +char_traits::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT +{ + if (__n == 0) + return NULL; +#if _LIBCPP_STD_VER <= 14 + return (const char_type*) memchr(__s, to_int_type(__a), __n); +#else + for (; __n; --__n) + { + if (eq(*__s, __a)) + return __s; + ++__s; + } + return NULL; +#endif +} + + // char_traits template <> @@ -245,19 +290,19 @@ struct _LIBCPP_TEMPLATE_VIS char_traits< typedef streampos pos_type; typedef mbstate_t state_type; - static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT - {__c1 = __c2;} + static inline _LIBCPP_CONSTEXPR_AFTER_CXX14 + void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;} static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 == __c2;} static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 < __c2;} - static inline int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT - {return __n == 0 ? 0 : wmemcmp(__s1, __s2, __n);} - static inline size_t length(const char_type* __s) _NOEXCEPT - {return wcslen(__s);} - static inline const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT - {return __n == 0 ? NULL : (const char_type*)wmemchr(__s, __a, __n);} + static _LIBCPP_CONSTEXPR_AFTER_CXX14 + int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT; + static _LIBCPP_CONSTEXPR_AFTER_CXX14 + size_t length(const char_type* __s) _NOEXCEPT; + static _LIBCPP_CONSTEXPR_AFTER_CXX14 + const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {return __n == 0 ? __s1 : (char_type*)wmemmove(__s1, __s2, __n);} static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT @@ -280,6 +325,66 @@ struct _LIBCPP_TEMPLATE_VIS char_traits< {return int_type(WEOF);} }; +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 +int +char_traits::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT +{ + if (__n == 0) + return 0; +#if __has_builtin(__builtin_wmemcmp) + return __builtin_wmemcmp(__s1, __s2, __n); +#elif _LIBCPP_STD_VER <= 14 + return wmemcmp(__s1, __s2, __n); +#else + for (; __n; --__n, ++__s1, ++__s2) + { + if (lt(*__s1, *__s2)) + return -1; + if (lt(*__s2, *__s1)) + return 1; + } + return 0; +#endif +} + +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 +size_t +char_traits::length(const char_type* __s) _NOEXCEPT +{ +#if __has_builtin(__builtin_wcslen) + return __builtin_wcslen(__s); +#elif _LIBCPP_STD_VER <= 14 + return wcslen(__s); +#else + size_t __len = 0; + for (; !eq(*__s, char_type(0)); ++__s) + ++__len; + return __len; +#endif +} + +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 +const wchar_t* +char_traits::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT +{ + if (__n == 0) + return NULL; +#if __has_builtin(__builtin_wmemchr) + return __builtin_wmemchr(__s, __a, __n); +#elif _LIBCPP_STD_VER <= 14 + return wmemchr(__s, __a, __n); +#else + for (; __n; --__n) + { + if (eq(*__s, __a)) + return __s; + ++__s; + } + return NULL; +#endif +} + + #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS template <> @@ -291,19 +396,19 @@ struct _LIBCPP_TEMPLATE_VIS char_traits< typedef u16streampos pos_type; typedef mbstate_t state_type; - static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT - {__c1 = __c2;} + static inline _LIBCPP_CONSTEXPR_AFTER_CXX14 + void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;} static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 == __c2;} static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 < __c2;} - _LIBCPP_INLINE_VISIBILITY - static int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - static size_t length(const char_type* __s) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14 + int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14 + size_t length(const char_type* __s) _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14 + const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY @@ -323,7 +428,7 @@ struct _LIBCPP_TEMPLATE_VIS char_traits< {return int_type(0xFFFF);} }; -inline +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 int char_traits::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { @@ -337,7 +442,7 @@ char_traits::compare(const cha return 0; } -inline +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 size_t char_traits::length(const char_type* __s) _NOEXCEPT { @@ -347,7 +452,7 @@ char_traits::length(const char return __len; } -inline +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 const char16_t* char_traits::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { @@ -410,19 +515,19 @@ struct _LIBCPP_TEMPLATE_VIS char_traits< typedef u32streampos pos_type; typedef mbstate_t state_type; - static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT - {__c1 = __c2;} + static inline _LIBCPP_CONSTEXPR_AFTER_CXX14 + void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;} static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 == __c2;} static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 < __c2;} - _LIBCPP_INLINE_VISIBILITY - static int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - static size_t length(const char_type* __s) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14 + int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14 + size_t length(const char_type* __s) _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14 + const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY @@ -442,7 +547,7 @@ struct _LIBCPP_TEMPLATE_VIS char_traits< {return int_type(0xFFFFFFFF);} }; -inline +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 int char_traits::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { @@ -456,7 +561,7 @@ char_traits::compare(const cha return 0; } -inline +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 size_t char_traits::length(const char_type* __s) _NOEXCEPT { @@ -466,7 +571,7 @@ char_traits::length(const char return __len; } -inline +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 const char32_t* char_traits::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { Modified: vendor/libc++/dist/include/__threading_support ============================================================================== --- vendor/libc++/dist/include/__threading_support Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/include/__threading_support Sat Jan 14 15:39:13 2017 (r312179) @@ -385,7 +385,7 @@ int __libcpp_recursive_mutex_unlock(__li int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m) { - static_cast(__m); + DeleteCriticalSection(__m); return 0; } Modified: vendor/libc++/dist/include/experimental/string_view ============================================================================== --- vendor/libc++/dist/include/experimental/string_view Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/include/experimental/string_view Sat Jan 14 15:39:13 2017 (r312179) @@ -340,12 +340,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS // [string.view.ops], string operations: template _LIBCPP_INLINE_VISIBILITY - // Clang's extended C++11 explict conversions don't work with - // string_view in C++03. -#ifndef _LIBCPP_CXX03_LANG - _LIBCPP_EXPLICIT -#endif - operator basic_string<_CharT, _Traits, _Allocator>() const + _LIBCPP_EXPLICIT operator basic_string<_CharT, _Traits, _Allocator>() const { return basic_string<_CharT, _Traits, _Allocator>( begin(), end()); } template > Modified: vendor/libc++/dist/include/ios ============================================================================== --- vendor/libc++/dist/include/ios Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/include/ios Sat Jan 14 15:39:13 2017 (r312179) @@ -572,6 +572,13 @@ ios_base::exceptions(iostate __iostate) clear(__rdstate_); } +#if defined(_LIBCPP_CXX03_LANG) +struct _LIBCPP_TYPE_VIS __cxx03_bool { + typedef void (__cxx03_bool::*__bool_type)(); + void __true_value() {} +}; +#endif + template class _LIBCPP_TEMPLATE_VIS basic_ios : public ios_base @@ -585,8 +592,15 @@ public: typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; +#if defined(_LIBCPP_CXX03_LANG) + _LIBCPP_ALWAYS_INLINE + operator __cxx03_bool::__bool_type() const { + return !fail() ? &__cxx03_bool::__true_value : nullptr; + } +#else _LIBCPP_ALWAYS_INLINE _LIBCPP_EXPLICIT operator bool() const {return !fail();} +#endif _LIBCPP_ALWAYS_INLINE bool operator!() const {return fail();} _LIBCPP_ALWAYS_INLINE iostate rdstate() const {return ios_base::rdstate();} Modified: vendor/libc++/dist/include/memory ============================================================================== --- vendor/libc++/dist/include/memory Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/include/memory Sat Jan 14 15:39:13 2017 (r312179) @@ -3884,6 +3884,7 @@ class _LIBCPP_TEMPLATE_VIS shared_ptr { public: typedef _Tp element_type; + #if _LIBCPP_STD_VER > 14 typedef weak_ptr<_Tp> weak_type; #endif @@ -3914,17 +3915,17 @@ public: template _LIBCPP_INLINE_VISIBILITY shared_ptr(const shared_ptr<_Yp>& __r, - typename enable_if::value, __nat>::type = __nat()) + typename enable_if::value, __nat>::type = __nat()) _NOEXCEPT; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr&& __r) _NOEXCEPT; template _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr<_Yp>&& __r, - typename enable_if::value, __nat>::type = __nat()) + typename enable_if::value, __nat>::type = __nat()) _NOEXCEPT; #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template explicit shared_ptr(const weak_ptr<_Yp>& __r, - typename enable_if::value, __nat>::type= __nat()); + typename enable_if::value, __nat>::type= __nat()); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template shared_ptr(auto_ptr<_Yp>&& __r, @@ -4316,7 +4317,7 @@ template template inline shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r, - typename enable_if::value, __nat>::type) + typename enable_if::value, __nat>::type) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) @@ -4341,7 +4342,7 @@ template template inline shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r, - typename enable_if::value, __nat>::type) + typename enable_if::value, __nat>::type) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) @@ -4639,7 +4640,7 @@ template inline typename enable_if < - is_convertible<_Yp*, _Tp*>::value, + is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value, shared_ptr<_Tp>& >::type shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT @@ -4664,7 +4665,7 @@ template inline typename enable_if < - is_convertible<_Yp*, _Tp*>::value, + is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value, shared_ptr<_Tp>& >::type shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r) @@ -4679,7 +4680,7 @@ inline typename enable_if < !is_array<_Yp>::value && - is_convertible<_Yp*, _Tp*>::value, + is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value, shared_ptr<_Tp> >::type& shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r) @@ -4694,7 +4695,8 @@ inline typename enable_if < !is_array<_Yp>::value && - is_convertible::pointer, _Tp*>::value, + is_convertible::pointer, + typename shared_ptr<_Tp>::element_type*>::value, shared_ptr<_Tp>& >::type shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r) @@ -4711,7 +4713,7 @@ inline _LIBCPP_INLINE_VISIBILITY typename enable_if < !is_array<_Yp>::value && - is_convertible<_Yp*, _Tp*>::value, + is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value, shared_ptr<_Tp>& >::type shared_ptr<_Tp>::operator=(auto_ptr<_Yp> __r) @@ -4726,7 +4728,8 @@ inline _LIBCPP_INLINE_VISIBILITY typename enable_if < !is_array<_Yp>::value && - is_convertible::pointer, _Tp*>::value, + is_convertible::pointer, + typename shared_ptr<_Tp>::element_type*>::value, shared_ptr<_Tp>& >::type shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp> __r) @@ -4759,7 +4762,7 @@ template inline typename enable_if < - is_convertible<_Yp*, _Tp*>::value, + is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value, void >::type shared_ptr<_Tp>::reset(_Yp* __p) @@ -4772,7 +4775,7 @@ template inline typename enable_if < - is_convertible<_Yp*, _Tp*>::value, + is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value, void >::type shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d) @@ -4785,7 +4788,7 @@ template::value, + is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value, void >::type shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d, _Alloc __a) @@ -5350,7 +5353,7 @@ weak_ptr<_Tp>::reset() _NOEXCEPT template template shared_ptr<_Tp>::shared_ptr(const weak_ptr<_Yp>& __r, - typename enable_if::value, __nat>::type) + typename enable_if::value, __nat>::type) : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_) { Modified: vendor/libc++/dist/include/mutex ============================================================================== --- vendor/libc++/dist/include/mutex Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/include/mutex Sat Jan 14 15:39:13 2017 (r312179) @@ -559,6 +559,7 @@ public: #endif template +inline _LIBCPP_INLINE_VISIBILITY void __call_once_proxy(void* __vp) { Modified: vendor/libc++/dist/src/chrono.cpp ============================================================================== --- vendor/libc++/dist/src/chrono.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/src/chrono.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -42,7 +42,7 @@ #include #endif #else -#if !defined(CLOCK_REALTIME) +#if !defined(CLOCK_REALTIME) || !defined(_LIBCXX_USE_CLOCK_GETTIME) #include // for gettimeofday and timeval #endif // !defined(CLOCK_REALTIME) #endif // defined(_LIBCPP_WIN32API) Modified: vendor/libc++/dist/src/new.cpp ============================================================================== --- vendor/libc++/dist/src/new.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/src/new.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -198,7 +198,11 @@ void operator delete(void* ptr, std::align_val_t) _NOEXCEPT { if (ptr) +#if defined(_LIBCPP_MSVCRT) + ::_aligned_free(ptr); +#else ::free(ptr); +#endif } _LIBCPP_WEAK Modified: vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign2.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign2.pass.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign2.pass.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -11,14 +11,30 @@ // template<> struct char_traits -// static void assign(char_type& c1, const char_type& c2); +// static constexpr void assign(char_type& c1, const char_type& c2); // constexpr in C++17 +// constexpr in C++17 #include #include +#include "test_macros.h" + +#if TEST_STD_VER > 14 +constexpr bool test_constexpr() +{ + char c = '1'; + std::char_traits::assign(c, 'a'); + return c == 'a'; +} +#endif + int main() { char c = '\0'; std::char_traits::assign(c, 'a'); assert(c == 'a'); + +#if TEST_STD_VER > 14 + static_assert(test_constexpr(), "" ); +#endif } Modified: vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/compare.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/compare.pass.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/compare.pass.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -12,10 +12,22 @@ // template<> struct char_traits // static int compare(const char_type* s1, const char_type* s2, size_t n); +// constexpr in C++17 #include #include +#include "test_macros.h" + +#if TEST_STD_VER > 14 +constexpr bool test_constexpr() +{ + return std::char_traits::compare("123", "223", 3) < 0 + && std::char_traits::compare("223", "123", 3) > 0 + && std::char_traits::compare("123", "123", 3) == 0; +} +#endif + int main() { assert(std::char_traits::compare("", "", 0) == 0); @@ -38,4 +50,8 @@ int main() assert(std::char_traits::compare("223", "123", 3) > 0); assert(std::char_traits::compare("133", "123", 3) > 0); assert(std::char_traits::compare("124", "123", 3) > 0); + +#if TEST_STD_VER > 14 + static_assert(test_constexpr(), "" ); +#endif } Modified: vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/find.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/find.pass.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/find.pass.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -12,10 +12,24 @@ // template<> struct char_traits // static const char_type* find(const char_type* s, size_t n, const char_type& a); +// constexpr in C++17 #include #include +#include "test_macros.h" + +#if TEST_STD_VER > 14 +constexpr bool test_constexpr() +{ + constexpr const char *p = "123"; + return std::char_traits::find(p, 3, '1') == p + && std::char_traits::find(p, 3, '2') == p + 1 + && std::char_traits::find(p, 3, '3') == p + 2 + && std::char_traits::find(p, 3, '4') == nullptr; +} +#endif + int main() { char s1[] = {1, 2, 3}; @@ -25,4 +39,8 @@ int main() assert(std::char_traits::find(s1, 3, char(4)) == 0); assert(std::char_traits::find(s1, 3, char(0)) == 0); assert(std::char_traits::find(NULL, 0, char(0)) == 0); + +#if TEST_STD_VER > 14 + static_assert(test_constexpr(), "" ); +#endif } Modified: vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/length.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/length.pass.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/length.pass.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -12,10 +12,22 @@ // template<> struct char_traits // static size_t length(const char_type* s); +// constexpr in C++17 #include #include +#include "test_macros.h" + +#if TEST_STD_VER > 14 +constexpr bool test_constexpr() +{ + return std::char_traits::length("") == 0 + && std::char_traits::length("abcd") == 4; +} +#endif + + int main() { assert(std::char_traits::length("") == 0); @@ -23,4 +35,8 @@ int main() assert(std::char_traits::length("aa") == 2); assert(std::char_traits::length("aaa") == 3); assert(std::char_traits::length("aaaa") == 4); + +#if TEST_STD_VER > 14 + static_assert(test_constexpr(), "" ); +#endif } Modified: vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign2.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign2.pass.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign2.pass.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -12,12 +12,22 @@ // template<> struct char_traits // static void assign(char_type& c1, const char_type& c2); +// constexpr in C++17 #include #include #include "test_macros.h" +#if TEST_STD_VER > 14 +constexpr bool test_constexpr() +{ + char16_t c = u'1'; + std::char_traits::assign(c, u'a'); + return c == u'a'; +} +#endif + int main() { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS @@ -26,5 +36,9 @@ int main() std::char_traits::assign(c, u'a'); assert(c == u'a'); #endif + +#if TEST_STD_VER > 14 + static_assert(test_constexpr(), "" ); +#endif #endif // _LIBCPP_HAS_NO_UNICODE_CHARS } Modified: vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/compare.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/compare.pass.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/compare.pass.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -12,12 +12,23 @@ // template<> struct char_traits // static int compare(const char_type* s1, const char_type* s2, size_t n); +// constexpr in C++17 #include #include #include "test_macros.h" +#if TEST_STD_VER > 14 +constexpr bool test_constexpr() +{ + return std::char_traits::compare(u"123", u"223", 3) < 0 + && std::char_traits::compare(u"223", u"123", 3) > 0 + && std::char_traits::compare(u"123", u"123", 3) == 0; +} +#endif + + int main() { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS @@ -43,5 +54,9 @@ int main() assert(std::char_traits::compare(u"133", u"123", 3) > 0); assert(std::char_traits::compare(u"124", u"123", 3) > 0); #endif + +#if TEST_STD_VER > 14 + static_assert(test_constexpr(), "" ); +#endif #endif // _LIBCPP_HAS_NO_UNICODE_CHARS } Modified: vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/find.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/find.pass.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/find.pass.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -12,10 +12,24 @@ // template<> struct char_traits // static const char_type* find(const char_type* s, size_t n, const char_type& a); +// constexpr in C++17 #include #include +#include "test_macros.h" + +#if TEST_STD_VER > 14 +constexpr bool test_constexpr() +{ + constexpr const char16_t *p = u"123"; + return std::char_traits::find(p, 3, u'1') == p + && std::char_traits::find(p, 3, u'2') == p + 1 + && std::char_traits::find(p, 3, u'3') == p + 2 + && std::char_traits::find(p, 3, u'4') == nullptr; +} +#endif + int main() { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS @@ -26,5 +40,9 @@ int main() assert(std::char_traits::find(s1, 3, char16_t(4)) == 0); assert(std::char_traits::find(s1, 3, char16_t(0)) == 0); assert(std::char_traits::find(NULL, 0, char16_t(0)) == 0); + +#if TEST_STD_VER > 14 + static_assert(test_constexpr(), "" ); +#endif #endif // _LIBCPP_HAS_NO_UNICODE_CHARS } Modified: vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/length.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/length.pass.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/length.pass.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -12,12 +12,21 @@ // template<> struct char_traits // static size_t length(const char_type* s); +// constexpr in C++17 #include #include #include "test_macros.h" +#if TEST_STD_VER > 14 +constexpr bool test_constexpr() +{ + return std::char_traits::length(u"") == 0 + && std::char_traits::length(u"abcd") == 4; +} +#endif + int main() { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS @@ -28,5 +37,9 @@ int main() assert(std::char_traits::length(u"aaa") == 3); assert(std::char_traits::length(u"aaaa") == 4); #endif + +#if TEST_STD_VER > 14 + static_assert(test_constexpr(), "" ); +#endif #endif // _LIBCPP_HAS_NO_UNICODE_CHARS } Modified: vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign2.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign2.pass.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign2.pass.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -12,12 +12,22 @@ // template<> struct char_traits // static void assign(char_type& c1, const char_type& c2); +// constexpr in C++17 #include #include #include "test_macros.h" +#if TEST_STD_VER > 14 +constexpr bool test_constexpr() +{ + char32_t c = U'1'; + std::char_traits::assign(c, U'a'); + return c == U'a'; +} +#endif + int main() { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS @@ -26,5 +36,9 @@ int main() std::char_traits::assign(c, U'a'); assert(c == U'a'); #endif + +#if TEST_STD_VER > 14 + static_assert(test_constexpr(), "" ); +#endif #endif // _LIBCPP_HAS_NO_UNICODE_CHARS } Modified: vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/compare.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/compare.pass.cpp Sat Jan 14 15:38:56 2017 (r312178) +++ vendor/libc++/dist/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/compare.pass.cpp Sat Jan 14 15:39:13 2017 (r312179) @@ -12,12 +12,22 @@ // template<> struct char_traits // static int compare(const char_type* s1, const char_type* s2, size_t n); +// constexpr in C++17 #include #include #include "test_macros.h" +#if TEST_STD_VER > 14 +constexpr bool test_constexpr() +{ + return std::char_traits::compare(U"123", U"223", 3) < 0 + && std::char_traits::compare(U"223", U"123", 3) > 0 + && std::char_traits::compare(U"123", U"123", 3) == 0; +} +#endif + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 14 15:39:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48472CAFC2C; Sat, 14 Jan 2017 15:39:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFA191CC1; Sat, 14 Jan 2017 15:39:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EFdJAD027226; Sat, 14 Jan 2017 15:39:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFdJEN027225; Sat, 14 Jan 2017 15:39:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141539.v0EFdJEN027225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312180 - vendor/libc++/libc++-release_40-r292009 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:39:20 -0000 Author: dim Date: Sat Jan 14 15:39:18 2017 New Revision: 312180 URL: https://svnweb.freebsd.org/changeset/base/312180 Log: Tag libc++ release_40 branch r292009. Added: vendor/libc++/libc++-release_40-r292009/ - copied from r312179, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Sat Jan 14 15:39:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A765CAFCB9; Sat, 14 Jan 2017 15:39:29 +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 BBD001DCB; Sat, 14 Jan 2017 15:39:28 +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 v0EFdRXG027295; Sat, 14 Jan 2017 15:39:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFdPdV027274; Sat, 14 Jan 2017 15:39:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141539.v0EFdPdV027274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312181 - in vendor/lld/dist: . COFF ELF test/COFF test/COFF/Inputs test/ELF test/ELF/Inputs test/ELF/invalid test/ELF/linkerscript test/ELF/lto X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:39:29 -0000 Author: dim Date: Sat Jan 14 15:39:25 2017 New Revision: 312181 URL: https://svnweb.freebsd.org/changeset/base/312181 Log: Vendor import of lld release_40 branch r292009: https://llvm.org/svn/llvm-project/lld/branches/release_40@292009 Added: vendor/lld/dist/test/COFF/Inputs/pdb1.yaml vendor/lld/dist/test/COFF/Inputs/pdb2.yaml vendor/lld/dist/test/ELF/Inputs/relocation-copy-relro.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/unknown-reloc.s (contents, props changed) vendor/lld/dist/test/ELF/incompatible-section-types2.s (contents, props changed) vendor/lld/dist/test/ELF/merge-section-types.s (contents, props changed) vendor/lld/dist/test/ELF/relocation-copy-relro.s (contents, props changed) vendor/lld/dist/test/ELF/relocation-none-i686.test vendor/lld/dist/test/ELF/unknown-reloc.s (contents, props changed) vendor/lld/dist/test/ELF/version-script-anonymous-local.s (contents, props changed) Deleted: vendor/lld/dist/test/COFF/dumppdb.test Modified: vendor/lld/dist/CMakeLists.txt vendor/lld/dist/COFF/PDB.cpp vendor/lld/dist/ELF/Driver.cpp vendor/lld/dist/ELF/Error.cpp vendor/lld/dist/ELF/Error.h vendor/lld/dist/ELF/InputFiles.cpp vendor/lld/dist/ELF/InputSection.cpp vendor/lld/dist/ELF/InputSection.h vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/OutputSections.cpp vendor/lld/dist/ELF/OutputSections.h vendor/lld/dist/ELF/Relocations.cpp vendor/lld/dist/ELF/SymbolTable.cpp vendor/lld/dist/ELF/Symbols.cpp vendor/lld/dist/ELF/Symbols.h vendor/lld/dist/ELF/SyntheticSections.cpp vendor/lld/dist/ELF/Target.cpp vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/test/COFF/pdb.test vendor/lld/dist/test/ELF/Inputs/copy-rel-pie.s vendor/lld/dist/test/ELF/aarch64-condb-reloc.s vendor/lld/dist/test/ELF/aarch64-gnu-ifunc-plt.s vendor/lld/dist/test/ELF/aarch64-tstbr14-reloc.s vendor/lld/dist/test/ELF/amdgpu-relocs.s vendor/lld/dist/test/ELF/arm-abs32-dyn.s vendor/lld/dist/test/ELF/arm-exidx-shared.s vendor/lld/dist/test/ELF/arm-fpic-got.s vendor/lld/dist/test/ELF/arm-gnu-ifunc-plt.s vendor/lld/dist/test/ELF/arm-pie-relative.s vendor/lld/dist/test/ELF/arm-plt-reloc.s vendor/lld/dist/test/ELF/arm-thumb-interwork-shared.s vendor/lld/dist/test/ELF/arm-thumb-plt-reloc.s vendor/lld/dist/test/ELF/arm-tls-norelax-gd-ie.s vendor/lld/dist/test/ELF/arm-tls-norelax-gd-le.s vendor/lld/dist/test/ELF/arm-tls-norelax-ie-le.s vendor/lld/dist/test/ELF/arm-tls-norelax-ld-le.s vendor/lld/dist/test/ELF/basic-mips.s vendor/lld/dist/test/ELF/basic.s vendor/lld/dist/test/ELF/basic64be.s vendor/lld/dist/test/ELF/combrelocs.s vendor/lld/dist/test/ELF/copy-rel-pie.s vendor/lld/dist/test/ELF/dynamic-reloc-index.s vendor/lld/dist/test/ELF/dynamic-reloc.s vendor/lld/dist/test/ELF/format-binary.test vendor/lld/dist/test/ELF/gnu-ifunc-plt-i386.s vendor/lld/dist/test/ELF/gnu-ifunc-plt.s vendor/lld/dist/test/ELF/gnu-ifunc-shared.s vendor/lld/dist/test/ELF/got-aarch64.s vendor/lld/dist/test/ELF/got-plt-header.s vendor/lld/dist/test/ELF/gotpc-relax-nopic.s vendor/lld/dist/test/ELF/i386-merge.s vendor/lld/dist/test/ELF/incompatible-section-types.s vendor/lld/dist/test/ELF/invalid/invalid-relocation-x64.s vendor/lld/dist/test/ELF/linkerscript/orphan.s vendor/lld/dist/test/ELF/linkerscript/repsection-symbol.s vendor/lld/dist/test/ELF/linkerscript/sort-non-script.s vendor/lld/dist/test/ELF/lto/undefined-puts.ll vendor/lld/dist/test/ELF/lto/visibility.ll vendor/lld/dist/test/ELF/mips-26.s vendor/lld/dist/test/ELF/mips-32.s vendor/lld/dist/test/ELF/mips-64-disp.s vendor/lld/dist/test/ELF/mips-64-got.s vendor/lld/dist/test/ELF/mips-64.s vendor/lld/dist/test/ELF/mips-dynamic.s vendor/lld/dist/test/ELF/mips-got-and-copy.s vendor/lld/dist/test/ELF/mips-got-extsym.s vendor/lld/dist/test/ELF/mips-got-hilo.s vendor/lld/dist/test/ELF/mips-got-redundant.s vendor/lld/dist/test/ELF/mips-got-relocs.s vendor/lld/dist/test/ELF/mips-got-weak.s vendor/lld/dist/test/ELF/mips-got16.s vendor/lld/dist/test/ELF/mips-gp-ext.s vendor/lld/dist/test/ELF/mips-gp-lowest.s vendor/lld/dist/test/ELF/mips-hilo-gp-disp.s vendor/lld/dist/test/ELF/mips-hilo.s vendor/lld/dist/test/ELF/mips-options.s vendor/lld/dist/test/ELF/mips-pc-relocs.s vendor/lld/dist/test/ELF/mips-plt-r6.s vendor/lld/dist/test/ELF/mips-tls-64.s vendor/lld/dist/test/ELF/mips-tls-static-64.s vendor/lld/dist/test/ELF/mips-tls-static.s vendor/lld/dist/test/ELF/mips-tls.s vendor/lld/dist/test/ELF/mips-xgot-order.s vendor/lld/dist/test/ELF/plt-aarch64.s vendor/lld/dist/test/ELF/plt-i686.s vendor/lld/dist/test/ELF/plt.s vendor/lld/dist/test/ELF/ppc64-relocs.s vendor/lld/dist/test/ELF/ppc64-shared-rel-toc.s vendor/lld/dist/test/ELF/ppc64-toc-restore.s vendor/lld/dist/test/ELF/rel-offset.s vendor/lld/dist/test/ELF/relative-dynamic-reloc-pie.s vendor/lld/dist/test/ELF/relative-dynamic-reloc-ppc64.s vendor/lld/dist/test/ELF/relative-dynamic-reloc.s vendor/lld/dist/test/ELF/relocation-copy-flags.s vendor/lld/dist/test/ELF/relocation-i686.s vendor/lld/dist/test/ELF/relocation-non-alloc.s vendor/lld/dist/test/ELF/relocation.s vendor/lld/dist/test/ELF/section-layout.s vendor/lld/dist/test/ELF/section-name.s vendor/lld/dist/test/ELF/sort-norosegment.s vendor/lld/dist/test/ELF/startstop.s vendor/lld/dist/test/ELF/synthetic-got.s vendor/lld/dist/test/ELF/tls-dynamic-i686.s vendor/lld/dist/test/ELF/tls-dynamic.s vendor/lld/dist/test/ELF/tls-offset.s vendor/lld/dist/test/ELF/undef-with-plt-addr.s vendor/lld/dist/test/ELF/undefined-versioned-symbol.s vendor/lld/dist/test/ELF/x86-64-tls-gd-local.s Modified: vendor/lld/dist/CMakeLists.txt ============================================================================== --- vendor/lld/dist/CMakeLists.txt Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/CMakeLists.txt Sat Jan 14 15:39:25 2017 (r312181) @@ -12,6 +12,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRE endif() execute_process(COMMAND "${LLVM_CONFIG_PATH}" "--obj-root" "--includedir" + "--cmakedir" RESULT_VARIABLE HAD_ERROR OUTPUT_VARIABLE LLVM_CONFIG_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -23,12 +24,12 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRE list(GET LLVM_CONFIG_OUTPUT 0 OBJ_ROOT) list(GET LLVM_CONFIG_OUTPUT 1 MAIN_INCLUDE_DIR) + list(GET LLVM_CONFIG_OUTPUT 2 LLVM_CMAKE_PATH) set(LLVM_OBJ_ROOT ${OBJ_ROOT} CACHE PATH "path to LLVM build tree") set(LLVM_MAIN_INCLUDE_DIR ${MAIN_INCLUDE_DIR} CACHE PATH "path to llvm/include") file(TO_CMAKE_PATH ${LLVM_OBJ_ROOT} LLVM_BINARY_DIR) - set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") if(NOT EXISTS "${LLVM_CMAKE_PATH}/LLVMConfig.cmake") message(FATAL_ERROR "LLVMConfig.cmake not found") Modified: vendor/lld/dist/COFF/PDB.cpp ============================================================================== --- vendor/lld/dist/COFF/PDB.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/COFF/PDB.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -14,8 +14,12 @@ #include "SymbolTable.h" #include "Symbols.h" #include "llvm/DebugInfo/CodeView/CVDebugRecord.h" +#include "llvm/DebugInfo/CodeView/CVTypeDumper.h" #include "llvm/DebugInfo/CodeView/SymbolDumper.h" -#include "llvm/DebugInfo/CodeView/TypeDumper.h" +#include "llvm/DebugInfo/CodeView/TypeDatabase.h" +#include "llvm/DebugInfo/CodeView/TypeDumpVisitor.h" +#include "llvm/DebugInfo/CodeView/TypeStreamMerger.h" +#include "llvm/DebugInfo/CodeView/TypeTableBuilder.h" #include "llvm/DebugInfo/MSF/ByteStream.h" #include "llvm/DebugInfo/MSF/MSFBuilder.h" #include "llvm/DebugInfo/MSF/MSFCommon.h" @@ -61,44 +65,75 @@ static SectionChunk *findByName(std::vec return nullptr; } -static ArrayRef getDebugT(ObjectFile *File) { - SectionChunk *Sec = findByName(File->getDebugChunks(), ".debug$T"); +static ArrayRef getDebugSection(ObjectFile *File, StringRef SecName) { + SectionChunk *Sec = findByName(File->getDebugChunks(), SecName); if (!Sec) return {}; // First 4 bytes are section magic. ArrayRef Data = Sec->getContents(); if (Data.size() < 4) - fatal(".debug$T too short"); + fatal(SecName + " too short"); if (read32le(Data.data()) != COFF::DEBUG_SECTION_MAGIC) - fatal(".debug$T has an invalid magic"); + fatal(SecName + " has an invalid magic"); return Data.slice(4); } +// Merge .debug$T sections and returns it. +static std::vector mergeDebugT(SymbolTable *Symtab) { + ScopedPrinter W(outs()); + + // Visit all .debug$T sections to add them to Builder. + codeview::TypeTableBuilder Builder(BAlloc); + for (ObjectFile *File : Symtab->ObjectFiles) { + ArrayRef Data = getDebugSection(File, ".debug$T"); + if (Data.empty()) + continue; + + msf::ByteStream Stream(Data); + codeview::CVTypeArray Types; + msf::StreamReader Reader(Stream); + if (auto EC = Reader.readArray(Types, Reader.getLength())) + fatal(EC, "Reader::readArray failed"); + if (!codeview::mergeTypeStreams(Builder, Types)) + fatal("codeview::mergeTypeStreams failed"); + } + + // Construct section contents. + std::vector V; + Builder.ForEachRecord([&](TypeIndex TI, ArrayRef Rec) { + V.insert(V.end(), Rec.begin(), Rec.end()); + }); + return V; +} + static void dumpDebugT(ScopedPrinter &W, ObjectFile *File) { - ArrayRef Data = getDebugT(File); + ListScope LS(W, "DebugT"); + ArrayRef Data = getDebugSection(File, ".debug$T"); if (Data.empty()) return; - msf::ByteStream Stream(Data); - CVTypeDumper TypeDumper(&W, false); - if (auto EC = TypeDumper.dump(Data)) + TypeDatabase TDB; + TypeDumpVisitor TDV(TDB, &W, false); + CVTypeDumper TypeDumper(TDB); + if (auto EC = TypeDumper.dump(Data, TDV)) fatal(EC, "CVTypeDumper::dump failed"); } static void dumpDebugS(ScopedPrinter &W, ObjectFile *File) { - SectionChunk *Sec = findByName(File->getDebugChunks(), ".debug$S"); - if (!Sec) + ListScope LS(W, "DebugS"); + ArrayRef Data = getDebugSection(File, ".debug$S"); + if (Data.empty()) return; - msf::ByteStream Stream(Sec->getContents()); + msf::ByteStream Stream(Data); CVSymbolArray Symbols; msf::StreamReader Reader(Stream); if (auto EC = Reader.readArray(Symbols, Reader.getLength())) fatal(EC, "StreamReader.readArray failed"); - CVTypeDumper TypeDumper(&W, false); - CVSymbolDumper SymbolDumper(W, TypeDumper, nullptr, false); + TypeDatabase TDB; + CVSymbolDumper SymbolDumper(W, TDB, nullptr, false); if (auto EC = SymbolDumper.dump(Symbols)) fatal(EC, "CVSymbolDumper::dump failed"); } @@ -113,21 +148,15 @@ static void dumpCodeView(SymbolTable *Sy } } -static void addTypeInfo(SymbolTable *Symtab, - pdb::TpiStreamBuilder &TpiBuilder) { - for (ObjectFile *File : Symtab->ObjectFiles) { - ArrayRef Data = getDebugT(File); - if (Data.empty()) - continue; - - msf::ByteStream Stream(Data); - codeview::CVTypeArray Records; - msf::StreamReader Reader(Stream); - if (auto EC = Reader.readArray(Records, Reader.getLength())) - fatal(EC, "Reader.readArray failed"); - for (const codeview::CVType &Rec : Records) - TpiBuilder.addTypeRecord(Rec); - } +static void addTypeInfo(pdb::TpiStreamBuilder &TpiBuilder, + ArrayRef Data) { + msf::ByteStream Stream(Data); + codeview::CVTypeArray Records; + msf::StreamReader Reader(Stream); + if (auto EC = Reader.readArray(Records, Reader.getLength())) + fatal(EC, "Reader.readArray failed"); + for (const codeview::CVType &Rec : Records) + TpiBuilder.addTypeRecord(Rec); } // Creates a PDB file. @@ -162,8 +191,11 @@ void coff::createPDB(StringRef Path, Sym // Add an empty TPI stream. auto &TpiBuilder = Builder.getTpiBuilder(); TpiBuilder.setVersionHeader(pdb::PdbTpiV80); - if (Config->DebugPdb) - addTypeInfo(Symtab, TpiBuilder); + std::vector TpiData; + if (Config->DebugPdb) { + TpiData = mergeDebugT(Symtab); + addTypeInfo(TpiBuilder, TpiData); + } // Add an empty IPI stream. auto &IpiBuilder = Builder.getIpiBuilder(); Modified: vendor/lld/dist/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist/ELF/Driver.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/Driver.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -24,6 +24,7 @@ #include "lld/Driver/Driver.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringSwitch.h" +#include "llvm/Object/Decompressor.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Path.h" #include "llvm/Support/TarWriter.h" @@ -815,7 +816,7 @@ template void LinkerDriver: [](InputSectionBase *S) { if (!S->Live) return; - if (S->isCompressed()) + if (Decompressor::isCompressedELFSection(S->Flags, S->Name)) S->uncompress(); if (auto *MS = dyn_cast>(S)) MS->splitIntoPieces(); Modified: vendor/lld/dist/ELF/Error.cpp ============================================================================== --- vendor/lld/dist/ELF/Error.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/Error.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -103,4 +103,8 @@ void elf::fatal(std::error_code EC, cons fatal(Prefix + ": " + EC.message()); } +void elf::fatal(Error &E, const Twine &Prefix) { + fatal(Prefix + ": " + llvm::toString(std::move(E))); +} + } // namespace lld Modified: vendor/lld/dist/ELF/Error.h ============================================================================== --- vendor/lld/dist/ELF/Error.h Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/Error.h Sat Jan 14 15:39:25 2017 (r312181) @@ -44,6 +44,7 @@ void error(std::error_code EC, const Twi LLVM_ATTRIBUTE_NORETURN void exitLld(int Val); LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg); LLVM_ATTRIBUTE_NORETURN void fatal(std::error_code EC, const Twine &Prefix); +LLVM_ATTRIBUTE_NORETURN void fatal(Error &E, const Twine &Prefix); // check() functions are convenient functions to strip errors // from error-or-value objects. @@ -55,11 +56,7 @@ template T check(ErrorOr E) template T check(Expected E) { if (!E) - handleAllErrors(std::move(E.takeError()), - [](llvm::ErrorInfoBase &EIB) -> Error { - fatal(EIB.message()); - return Error::success(); - }); + fatal(llvm::toString(E.takeError())); return std::move(*E); } Modified: vendor/lld/dist/ELF/InputFiles.cpp ============================================================================== --- vendor/lld/dist/ELF/InputFiles.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/InputFiles.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -857,8 +857,8 @@ template void BinaryFile::p StringRef EndName = Saver.save(Twine(Filename) + "_end"); StringRef SizeName = Saver.save(Twine(Filename) + "_size"); - auto *Section = - make>(SHF_ALLOC, SHT_PROGBITS, 8, Data, ".data"); + auto *Section = make>(SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, + 8, Data, ".data"); Sections.push_back(Section); elf::Symtab::X->addRegular(StartName, STV_DEFAULT, STT_OBJECT, 0, 0, Modified: vendor/lld/dist/ELF/InputSection.cpp ============================================================================== --- vendor/lld/dist/ELF/InputSection.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/InputSection.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -19,6 +19,7 @@ #include "SyntheticSections.h" #include "Target.h" #include "Thunks.h" +#include "llvm/Object/Decompressor.h" #include "llvm/Support/Compression.h" #include "llvm/Support/Endian.h" #include @@ -35,7 +36,10 @@ using namespace lld::elf; // Returns a string to construct an error message. template std::string lld::toString(const InputSectionBase *Sec) { - return (Sec->getFile()->getName() + ":(" + Sec->Name + ")").str(); + // File can be absent if section is synthetic. + std::string FileName = + Sec->getFile() ? Sec->getFile()->getName() : ""; + return (FileName + ":(" + Sec->Name + ")").str(); } template @@ -102,11 +106,6 @@ template size_t InputSectio return Data.size(); } -// Returns a string for an error message. -template static std::string getName(SectionT *Sec) { - return (Sec->getFile()->getName() + ":(" + Sec->Name + ")").str(); -} - template typename ELFT::uint InputSectionBase::getOffset(uintX_t Offset) const { switch (kind()) { @@ -128,71 +127,23 @@ typename ELFT::uint InputSectionBase bool InputSectionBase::isCompressed() const { - return (Flags & SHF_COMPRESSED) || Name.startswith(".zdebug"); -} - -// Returns compressed data and its size when uncompressed. -template -std::pair, uint64_t> -InputSectionBase::getElfCompressedData(ArrayRef Data) { - // Compressed section with Elf_Chdr is the ELF standard. - if (Data.size() < sizeof(Elf_Chdr)) - fatal(toString(this) + ": corrupted compressed section"); - auto *Hdr = reinterpret_cast(Data.data()); - if (Hdr->ch_type != ELFCOMPRESS_ZLIB) - fatal(toString(this) + ": unsupported compression type"); - return {Data.slice(sizeof(*Hdr)), Hdr->ch_size}; -} - -// Returns compressed data and its size when uncompressed. -template -std::pair, uint64_t> -InputSectionBase::getRawCompressedData(ArrayRef Data) { - // Compressed sections without Elf_Chdr header contain this header - // instead. This is a GNU extension. - struct ZlibHeader { - char Magic[4]; // Should be "ZLIB" - char Size[8]; // Uncompressed size in big-endian - }; - - if (Data.size() < sizeof(ZlibHeader)) - fatal(toString(this) + ": corrupted compressed section"); - auto *Hdr = reinterpret_cast(Data.data()); - if (memcmp(Hdr->Magic, "ZLIB", 4)) - fatal(toString(this) + ": broken ZLIB-compressed section"); - return {Data.slice(sizeof(*Hdr)), read64be(Hdr->Size)}; -} - // Uncompress section contents. Note that this function is called // from parallel_for_each, so it must be thread-safe. template void InputSectionBase::uncompress() { - if (!zlib::isAvailable()) - fatal(toString(this) + - ": build lld with zlib to enable compressed sections support"); - - // This section is compressed. Here we decompress it. Ideally, all - // compressed sections have SHF_COMPRESSED bit and their contents - // start with headers of Elf_Chdr type. However, sections whose - // names start with ".zdebug_" don't have the bit and contains a raw - // ZLIB-compressed data (which is a bad thing because section names - // shouldn't be significant in ELF.) We need to be able to read both. - ArrayRef Buf; // Compressed data - size_t Size; // Uncompressed size - if (Flags & SHF_COMPRESSED) - std::tie(Buf, Size) = getElfCompressedData(Data); - else - std::tie(Buf, Size) = getRawCompressedData(Data); + Decompressor Decompressor = check(Decompressor::create( + Name, toStringRef(Data), ELFT::TargetEndianness == llvm::support::little, + ELFT::Is64Bits)); - // Uncompress Buf. + size_t Size = Decompressor.getDecompressedSize(); char *OutputBuf; { static std::mutex Mu; std::lock_guard Lock(Mu); OutputBuf = BAlloc.Allocate(Size); } - if (zlib::uncompress(toStringRef(Buf), OutputBuf, Size) != zlib::StatusOK) - fatal(toString(this) + ": error while uncompressing section"); + + if (Error E = Decompressor.decompress({OutputBuf, Size})) + fatal(E, toString(this)); Data = ArrayRef((uint8_t *)OutputBuf, Size); } Modified: vendor/lld/dist/ELF/InputSection.h ============================================================================== --- vendor/lld/dist/ELF/InputSection.h Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/InputSection.h Sat Jan 14 15:39:25 2017 (r312181) @@ -138,22 +138,12 @@ public: // section. uintX_t getOffset(uintX_t Offset) const; - // ELF supports ZLIB-compressed section. - // Returns true if the section is compressed. - bool isCompressed() const; void uncompress(); // Returns a source location string. Used to construct an error message. std::string getLocation(uintX_t Offset); void relocate(uint8_t *Buf, uint8_t *BufEnd); - -private: - std::pair, uint64_t> - getElfCompressedData(ArrayRef Data); - - std::pair, uint64_t> - getRawCompressedData(ArrayRef Data); }; // SectionPiece represents a piece of splittable section contents. Modified: vendor/lld/dist/ELF/LinkerScript.cpp ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/LinkerScript.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -1014,6 +1014,7 @@ private: void readAnonymousDeclaration(); void readVersionDeclaration(StringRef VerStr); std::vector readSymbols(); + void readLocals(); ScriptConfiguration &Opt = *ScriptConfig; bool IsUnderSysroot; @@ -1861,17 +1862,22 @@ void ScriptParser::readAnonymousDeclarat if (consume("global:") || peek() != "local:") Config->VersionScriptGlobals = readSymbols(); - // Next, read local symbols. - if (consume("local:")) { - if (consume("*")) { + readLocals(); + expect("}"); + expect(";"); +} + +void ScriptParser::readLocals() { + if (!consume("local:")) + return; + std::vector Locals = readSymbols(); + for (SymbolVersion V : Locals) { + if (V.Name == "*") { Config->DefaultSymbolVersion = VER_NDX_LOCAL; - expect(";"); - } else { - setError("local symbol list for anonymous version is not supported"); + continue; } + Config->VersionScriptLocals.push_back(V); } - expect("}"); - expect(";"); } // Reads a list of symbols, e.g. "VerStr { global: foo; bar; local: *; };". @@ -1885,16 +1891,7 @@ void ScriptParser::readVersionDeclaratio if (consume("global:") || peek() != "local:") Config->VersionDefinitions.back().Globals = readSymbols(); - // Read local symbols. - if (consume("local:")) { - if (consume("*")) { - Config->DefaultSymbolVersion = VER_NDX_LOCAL; - expect(";"); - } else { - for (SymbolVersion V : readSymbols()) - Config->VersionScriptLocals.push_back(V); - } - } + readLocals(); expect("}"); // Each version may have a parent version. For example, "Ver2" Modified: vendor/lld/dist/ELF/OutputSections.cpp ============================================================================== --- vendor/lld/dist/ELF/OutputSections.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/OutputSections.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -636,7 +636,12 @@ OutputSectionFactory::create(const if (getIncompatibleFlags(Sec->Flags) != getIncompatibleFlags(C->Flags)) error("Section has flags incompatible with others with the same name " + toString(C)); - if (Sec->Type != C->Type) + // Convert notbits to progbits if they are mixed. This happens is some + // linker scripts. + if (Sec->Type == SHT_NOBITS && C->Type == SHT_PROGBITS) + Sec->Type = SHT_PROGBITS; + if (Sec->Type != C->Type && + !(Sec->Type == SHT_PROGBITS && C->Type == SHT_NOBITS)) error("Section has different type from others with the same name " + toString(C)); Sec->Flags |= Flags; Modified: vendor/lld/dist/ELF/OutputSections.h ============================================================================== --- vendor/lld/dist/ELF/OutputSections.h Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/OutputSections.h Sat Jan 14 15:39:25 2017 (r312181) @@ -206,6 +206,7 @@ template struct Out { static uint8_t First; static EhOutputSection *EhFrame; static OutputSection *Bss; + static OutputSection *BssRelRo; static OutputSectionBase *Opd; static uint8_t *OpdBuf; static PhdrEntry *TlsPhdr; @@ -252,6 +253,7 @@ template uint64_t getHeader template uint8_t Out::First; template EhOutputSection *Out::EhFrame; template OutputSection *Out::Bss; +template OutputSection *Out::BssRelRo; template OutputSectionBase *Out::Opd; template uint8_t *Out::OpdBuf; template PhdrEntry *Out::TlsPhdr; Modified: vendor/lld/dist/ELF/Relocations.cpp ============================================================================== --- vendor/lld/dist/ELF/Relocations.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/Relocations.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -399,7 +399,21 @@ template static uint32_t ge return 1 << TrailingZeros; } -// Reserve space in .bss for copy relocation. +template static bool isReadOnly(SharedSymbol *SS) { + typedef typename ELFT::uint uintX_t; + typedef typename ELFT::Phdr Elf_Phdr; + + // Determine if the symbol is read-only by scanning the DSO's program headers. + uintX_t Value = SS->Sym.st_value; + for (const Elf_Phdr &Phdr : check(SS->file()->getObj().program_headers())) + if ((Phdr.p_type == ELF::PT_LOAD || Phdr.p_type == ELF::PT_GNU_RELRO) && + !(Phdr.p_flags & ELF::PF_W) && Value >= Phdr.p_vaddr && + Value < Phdr.p_vaddr + Phdr.p_memsz) + return true; + return false; +} + +// Reserve space in .bss or .bss.rel.ro for copy relocation. template static void addCopyRelSymbol(SharedSymbol *SS) { typedef typename ELFT::uint uintX_t; typedef typename ELFT::Sym Elf_Sym; @@ -409,10 +423,16 @@ template static void addCop if (SymSize == 0) fatal("cannot create a copy relocation for symbol " + toString(*SS)); + // See if this symbol is in a read-only segment. If so, preserve the symbol's + // memory protection by reserving space in the .bss.rel.ro section. + bool IsReadOnly = isReadOnly(SS); + OutputSection *CopySec = + IsReadOnly ? Out::BssRelRo : Out::Bss; + uintX_t Alignment = getAlignment(SS); - uintX_t Off = alignTo(Out::Bss->Size, Alignment); - Out::Bss->Size = Off + SymSize; - Out::Bss->updateAlignment(Alignment); + uintX_t Off = alignTo(CopySec->Size, Alignment); + CopySec->Size = Off + SymSize; + CopySec->updateAlignment(Alignment); uintX_t Shndx = SS->Sym.st_shndx; uintX_t Value = SS->Sym.st_value; // Look through the DSO's dynamic symbol table for aliases and create a @@ -425,12 +445,12 @@ template static void addCop Symtab::X->find(check(S.getName(SS->file()->getStringTable())))); if (!Alias) continue; - Alias->OffsetInBss = Off; + Alias->CopyIsInBssRelRo = IsReadOnly; + Alias->CopyOffset = Off; Alias->NeedsCopyOrPltAddr = true; Alias->symbol()->IsUsedInRegularObj = true; } - In::RelaDyn->addReloc( - {Target->CopyRel, Out::Bss, SS->OffsetInBss, false, SS, 0}); + In::RelaDyn->addReloc({Target->CopyRel, CopySec, Off, false, SS, 0}); } template Modified: vendor/lld/dist/ELF/SymbolTable.cpp ============================================================================== --- vendor/lld/dist/ELF/SymbolTable.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/SymbolTable.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -605,19 +605,16 @@ SymbolTable::findAllByVersion(Symb // If there's only one anonymous version definition in a version // script file, the script does not actually define any symbol version, -// but just specifies symbols visibilities. We assume that the script was -// in the form of { global: foo; bar; local *; }. So, local is default. -// In this function, we make specified symbols global. +// but just specifies symbols visibilities. template void SymbolTable::handleAnonymousVersion() { - for (SymbolVersion &Ver : Config->VersionScriptGlobals) { - if (Ver.HasWildcard) { - for (SymbolBody *B : findAllByVersion(Ver)) - B->symbol()->VersionId = VER_NDX_GLOBAL; - continue; - } - for (SymbolBody *B : findByVersion(Ver)) - B->symbol()->VersionId = VER_NDX_GLOBAL; - } + for (SymbolVersion &Ver : Config->VersionScriptGlobals) + assignExactVersion(Ver, VER_NDX_GLOBAL, "global"); + for (SymbolVersion &Ver : Config->VersionScriptGlobals) + assignWildcardVersion(Ver, VER_NDX_GLOBAL); + for (SymbolVersion &Ver : Config->VersionScriptLocals) + assignExactVersion(Ver, VER_NDX_LOCAL, "local"); + for (SymbolVersion &Ver : Config->VersionScriptLocals) + assignWildcardVersion(Ver, VER_NDX_LOCAL); } // Set symbol versions to symbols. This function handles patterns @@ -673,10 +670,7 @@ template void SymbolTablebody()->parseSymbolVersion(); // Handle edge cases first. - if (!Config->VersionScriptGlobals.empty()) { - handleAnonymousVersion(); - return; - } + handleAnonymousVersion(); if (Config->VersionDefinitions.empty()) return; @@ -687,8 +681,6 @@ template void SymbolTableVersionScriptLocals) - assignExactVersion(Ver, VER_NDX_LOCAL, "local"); for (VersionDefinition &V : Config->VersionDefinitions) for (SymbolVersion &Ver : V.Globals) assignExactVersion(Ver, V.Id, V.Name); @@ -697,8 +689,6 @@ template void SymbolTableVersionScriptLocals) - assignWildcardVersion(Ver, VER_NDX_LOCAL); for (VersionDefinition &V : llvm::reverse(Config->VersionDefinitions)) for (SymbolVersion &Ver : V.Globals) assignWildcardVersion(Ver, V.Id); Modified: vendor/lld/dist/ELF/Symbols.cpp ============================================================================== --- vendor/lld/dist/ELF/Symbols.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/Symbols.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -81,7 +81,7 @@ static typename ELFT::uint getSymVA(cons return 0; if (SS.isFunc()) return Body.getPltVA(); - return Out::Bss->Addr + SS.OffsetInBss; + return SS.getBssSectionForCopy()->Addr + SS.CopyOffset; } case SymbolBody::UndefinedKind: return 0; @@ -97,7 +97,8 @@ SymbolBody::SymbolBody(Kind K, StringRef uint8_t Type) : SymbolKind(K), NeedsCopyOrPltAddr(false), IsLocal(IsLocal), IsInGlobalMipsGot(false), Is32BitMipsGot(false), IsInIplt(false), - IsInIgot(false), Type(Type), StOther(StOther), Name(Name) {} + IsInIgot(false), CopyIsInBssRelRo(false), Type(Type), StOther(StOther), + Name(Name) {} // Returns true if a symbol can be replaced at load-time by a symbol // with the same name defined in other ELF executable or DSO. @@ -245,6 +246,12 @@ Undefined::Undefined(StringRefZ Na this->File = File; } +template +OutputSection *SharedSymbol::getBssSectionForCopy() const { + assert(needsCopy()); + return CopyIsInBssRelRo ? Out::BssRelRo : Out::Bss; +} + DefinedCommon::DefinedCommon(StringRef Name, uint64_t Size, uint64_t Alignment, uint8_t StOther, uint8_t Type, InputFile *File) : Defined(SymbolBody::DefinedCommonKind, Name, /*IsLocal=*/false, StOther, @@ -287,10 +294,22 @@ InputFile *LazyObject::fetch() { return createObjectFile(MBRef); } -bool Symbol::includeInDynsym() const { +uint8_t Symbol::computeBinding() const { + if (Config->Relocatable) + return Binding; if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED) + return STB_LOCAL; + if (VersionId == VER_NDX_LOCAL && !body()->isUndefined()) + return STB_LOCAL; + if (Config->NoGnuUnique && Binding == STB_GNU_UNIQUE) + return STB_GLOBAL; + return Binding; +} + +bool Symbol::includeInDynsym() const { + if (computeBinding() == STB_LOCAL) return false; - return (ExportDynamic && VersionId != VER_NDX_LOCAL) || body()->isShared() || + return ExportDynamic || body()->isShared() || (body()->isUndefined() && Config->Shared); } @@ -366,6 +385,11 @@ template class elf::Undefined; template class elf::Undefined; template class elf::Undefined; +template class elf::SharedSymbol; +template class elf::SharedSymbol; +template class elf::SharedSymbol; +template class elf::SharedSymbol; + template class elf::DefinedRegular; template class elf::DefinedRegular; template class elf::DefinedRegular; Modified: vendor/lld/dist/ELF/Symbols.h ============================================================================== --- vendor/lld/dist/ELF/Symbols.h Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/Symbols.h Sat Jan 14 15:39:25 2017 (r312181) @@ -123,6 +123,11 @@ public: // True if this symbol is in the Igot sub-section of the .got.plt or .got. unsigned IsInIgot : 1; + // True if this is a shared symbol in a read-only segment which requires a + // copy relocation. This causes space for the symbol to be allocated in the + // .bss.rel.ro section. + unsigned CopyIsInBssRelRo : 1; + // The following fields have the same meaning as the ELF symbol attributes. uint8_t Type; // symbol type uint8_t StOther; // st_other field value @@ -282,13 +287,15 @@ public: // This field is a pointer to the symbol's version definition. const Elf_Verdef *Verdef; - // OffsetInBss is significant only when needsCopy() is true. - uintX_t OffsetInBss = 0; + // CopyOffset is significant only when needsCopy() is true. + uintX_t CopyOffset = 0; // If non-null the symbol has a Thunk that may be used as an alternative // destination for callers of this Symbol. Thunk *ThunkData = nullptr; bool needsCopy() const { return this->NeedsCopyOrPltAddr && !this->isFunc(); } + + OutputSection *getBssSectionForCopy() const; }; // This class represents a symbol defined in an archive file. It is @@ -413,6 +420,7 @@ struct Symbol { unsigned InVersionScript : 1; bool includeInDynsym() const; + uint8_t computeBinding() const; bool isWeak() const { return Binding == llvm::ELF::STB_WEAK; } // This field is used to store the Symbol's SymbolBody. This instantiation of Modified: vendor/lld/dist/ELF/SyntheticSections.cpp ============================================================================== --- vendor/lld/dist/ELF/SyntheticSections.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/SyntheticSections.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -1060,18 +1060,6 @@ static bool sortMipsSymbols(const Symbol return L->GotIndex < R->GotIndex; } -static uint8_t getSymbolBinding(SymbolBody *Body) { - Symbol *S = Body->symbol(); - if (Config->Relocatable) - return S->Binding; - uint8_t Visibility = S->Visibility; - if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED) - return STB_LOCAL; - if (Config->NoGnuUnique && S->Binding == STB_GNU_UNIQUE) - return STB_GLOBAL; - return S->Binding; -} - template void SymbolTableSection::finalize() { this->OutSec->Link = this->Link = StrTabSec.OutSec->SectionIndex; this->OutSec->Info = this->Info = NumLocals + 1; @@ -1085,11 +1073,12 @@ template void SymbolTableSe } if (!StrTabSec.isDynamic()) { - std::stable_sort(Symbols.begin(), Symbols.end(), - [](const SymbolTableEntry &L, const SymbolTableEntry &R) { - return getSymbolBinding(L.Symbol) == STB_LOCAL && - getSymbolBinding(R.Symbol) != STB_LOCAL; - }); + std::stable_sort( + Symbols.begin(), Symbols.end(), + [](const SymbolTableEntry &L, const SymbolTableEntry &R) { + return L.Symbol->symbol()->computeBinding() == STB_LOCAL && + R.Symbol->symbol()->computeBinding() != STB_LOCAL; + }); return; } if (In::GnuHashTab) @@ -1159,7 +1148,7 @@ void SymbolTableSection::writeGlob uint8_t Type = Body->Type; uintX_t Size = Body->getSize(); - ESym->setBindingAndType(getSymbolBinding(Body), Type); + ESym->setBindingAndType(Body->symbol()->computeBinding(), Type); ESym->st_size = Size; ESym->st_name = StrOff; ESym->setVisibility(Body->symbol()->Visibility); @@ -1201,10 +1190,12 @@ SymbolTableSection::getOutputSecti } case SymbolBody::DefinedCommonKind: return In::Common->OutSec; - case SymbolBody::SharedKind: - if (cast>(Sym)->needsCopy()) - return Out::Bss; + case SymbolBody::SharedKind: { + auto &SS = cast>(*Sym); + if (SS.needsCopy()) + return SS.getBssSectionForCopy(); break; + } case SymbolBody::UndefinedKind: case SymbolBody::LazyArchiveKind: case SymbolBody::LazyObjectKind: Modified: vendor/lld/dist/ELF/Target.cpp ============================================================================== --- vendor/lld/dist/ELF/Target.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/Target.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -356,7 +356,9 @@ X86TargetInfo::X86TargetInfo() { RelExpr X86TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const { switch (Type) { - default: + case R_386_16: + case R_386_32: + case R_386_TLS_LDO_32: return R_ABS; case R_386_TLS_GD: return R_TLSGD; @@ -381,6 +383,12 @@ RelExpr X86TargetInfo::getRelExpr(uint32 return R_TLS; case R_386_TLS_LE_32: return R_NEG_TLS; + case R_386_NONE: + return R_HINT; + default: + error("do not know how to handle relocation '" + toString(Type) + "' (" + + Twine(Type) + ")"); + return R_HINT; } } @@ -623,7 +631,11 @@ template RelExpr X86_64TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const { switch (Type) { - default: + case R_X86_64_32: + case R_X86_64_32S: + case R_X86_64_64: + case R_X86_64_DTPOFF32: + case R_X86_64_DTPOFF64: return R_ABS; case R_X86_64_TPOFF32: return R_TLS; @@ -649,6 +661,10 @@ RelExpr X86_64TargetInfo::getRelEx return R_GOT_PC; case R_X86_64_NONE: return R_HINT; + default: + error("do not know how to handle relocation '" + toString(Type) + "' (" + + Twine(Type) + ")"); + return R_HINT; } } @@ -870,7 +886,7 @@ void X86_64TargetInfo::relocateOne write64le(Loc, Val); break; default: - error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + llvm_unreachable("unexpected relocation"); } } Modified: vendor/lld/dist/ELF/Writer.cpp ============================================================================== --- vendor/lld/dist/ELF/Writer.cpp Sat Jan 14 15:39:18 2017 (r312180) +++ vendor/lld/dist/ELF/Writer.cpp Sat Jan 14 15:39:25 2017 (r312181) @@ -250,6 +250,8 @@ template void Writer: // Create singleton output sections. Out::Bss = make>(".bss", SHT_NOBITS, SHF_ALLOC | SHF_WRITE); + Out::BssRelRo = make>(".bss.rel.ro", SHT_NOBITS, + SHF_ALLOC | SHF_WRITE); In::DynStrTab = make>(".dynstr", true); In::Dynamic = make>(); Out::EhFrame = make>(); @@ -498,6 +500,8 @@ template bool elf::isRelroS return true; if (In::MipsGot && Sec == In::MipsGot->OutSec) return true; + if (Sec == Out::BssRelRo) + return true; StringRef S = Sec->getName(); return S == ".data.rel.ro" || S == ".ctors" || S == ".dtors" || S == ".jcr" || S == ".eh_frame" || S == ".openbsd.randomdata"; @@ -557,30 +561,38 @@ static bool compareSectionsNonScript(con // If we got here we know that both A and B are in the same PT_LOAD. - // The TLS initialization block needs to be a single contiguous block in a R/W - // PT_LOAD, so stick TLS sections directly before R/W sections. The TLS NOBITS - // sections are placed here as they don't take up virtual address space in the - // PT_LOAD. bool AIsTls = A->Flags & SHF_TLS; bool BIsTls = B->Flags & SHF_TLS; - if (AIsTls != BIsTls) - return AIsTls; - - // The next requirement we have is to put nobits sections last. The - // reason is that the only thing the dynamic linker will see about - // them is a p_memsz that is larger than p_filesz. Seeing that it - // zeros the end of the PT_LOAD, so that has to correspond to the - // nobits sections. bool AIsNoBits = A->Type == SHT_NOBITS; bool BIsNoBits = B->Type == SHT_NOBITS; - if (AIsNoBits != BIsNoBits) - return BIsNoBits; - // We place RelRo section before plain r/w ones. + // The first requirement we have is to put (non-TLS) nobits sections last. The + // reason is that the only thing the dynamic linker will see about them is a + // p_memsz that is larger than p_filesz. Seeing that it zeros the end of the + // PT_LOAD, so that has to correspond to the nobits sections. + bool AIsNonTlsNoBits = AIsNoBits && !AIsTls; + bool BIsNonTlsNoBits = BIsNoBits && !BIsTls; + if (AIsNonTlsNoBits != BIsNonTlsNoBits) + return BIsNonTlsNoBits; + + // We place nobits RelRo sections before plain r/w ones, and non-nobits RelRo + // sections after r/w ones, so that the RelRo sections are contiguous. bool AIsRelRo = isRelroSection(A); bool BIsRelRo = isRelroSection(B); if (AIsRelRo != BIsRelRo) - return AIsRelRo; + return AIsNonTlsNoBits ? AIsRelRo : BIsRelRo; + + // The TLS initialization block needs to be a single contiguous block in a R/W + // PT_LOAD, so stick TLS sections directly before the other RelRo R/W + // sections. The TLS NOBITS sections are placed here as they don't take up + // virtual address space in the PT_LOAD. + if (AIsTls != BIsTls) + return AIsTls; + + // Within the TLS initialization block, the non-nobits sections need to appear + // first. + if (AIsNoBits != BIsNoBits) + return BIsNoBits; // Some architectures have additional ordering restrictions for sections // within the same PT_LOAD. @@ -1071,6 +1083,8 @@ template void Writer: template void Writer::addPredefinedSections() { if (Out::Bss->Size > 0) OutputSections.push_back(Out::Bss); + if (Out::BssRelRo->Size > 0) + OutputSections.push_back(Out::BssRelRo); auto OS = dyn_cast_or_null>(findSection(".ARM.exidx")); if (OS && !OS->Sections.empty() && !Config->Relocatable) @@ -1272,8 +1286,9 @@ void Writer::addPtArmExid(std::vec Phdrs.push_back(ARMExidx); } -// The first section of each PT_LOAD and the first section after PT_GNU_RELRO -// have to be page aligned so that the dynamic linker can set the permissions. +// The first section of each PT_LOAD, the first section in PT_GNU_RELRO and the +// first section after PT_GNU_RELRO have to be page aligned so that the dynamic +// linker can set the permissions. template void Writer::fixSectionAlignments() { for (const PhdrEntry &P : Phdrs) if (P.p_type == PT_LOAD && P.First) @@ -1282,6 +1297,8 @@ template void Writer: for (const PhdrEntry &P : Phdrs) { if (P.p_type != PT_GNU_RELRO) continue; + if (P.First) + P.First->PageAlign = true; // Find the first section after PT_GNU_RELRO. If it is in a PT_LOAD we // have to align it to a page. auto End = OutputSections.end(); @@ -1635,10 +1652,12 @@ static void unlinkAsync(StringRef Path) // Path as a new file. If we do that in a different thread, the new // thread can remove the new file. SmallString<128> TempPath; - if (auto EC = sys::fs::createUniqueFile(Path + "tmp%%%%%%%%", TempPath)) - fatal(EC, "createUniqueFile failed"); - if (auto EC = sys::fs::rename(Path, TempPath)) - fatal(EC, "rename failed"); + if (sys::fs::createUniqueFile(Path + "tmp%%%%%%%%", TempPath)) + return; + if (sys::fs::rename(Path, TempPath)) { + sys::fs::remove(TempPath); + return; + } // Remove TempPath in background. std::thread([=] { ::remove(TempPath.str().str().c_str()); }).detach(); Added: vendor/lld/dist/test/COFF/Inputs/pdb1.yaml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/COFF/Inputs/pdb1.yaml Sat Jan 14 15:39:25 2017 (r312181) @@ -0,0 +1,172 @@ +--- !COFF +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ ] +sections: + - Name: .drectve + Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ] + Alignment: 1 + SectionData: 2020202F44454641554C544C49423A224C4942434D5422202F44454641554C544C49423A224F4C444E414D45532220 + - Name: '.debug$S' + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] + Alignment: 1 + SectionData: 04000000F1000000580000001A00011100000000443A5C625C72657434322D6D61696E2E6F626A003A003C1100600000D00013000000F259000013000000F25900004D6963726F736F667420285229204F7074696D697A696E6720436F6D70696C657200F10000004E0000002A0047110000000000000000000000000E000000040000000900000005100000000000000000006D61696E001C001210280000000000000000000000000000000000000000000042110002004F110000F20000002000000000000000000000000E0000000000000001000000140000000000000002000080F400000018000000010000001001C538722F63570DF6705DDE06FE96E5D10000F30000001300000000643A5C625C72657434322D6D61696E2E630000F10000000800000006004C110E100000 + Relocations: + - VirtualAddress: 140 + SymbolName: main + Type: IMAGE_REL_AMD64_SECREL + - VirtualAddress: 144 + SymbolName: main + Type: IMAGE_REL_AMD64_SECTION + - VirtualAddress: 196 + SymbolName: main + Type: IMAGE_REL_AMD64_SECREL + - VirtualAddress: 200 + SymbolName: main + Type: IMAGE_REL_AMD64_SECTION + - Name: '.debug$T' + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] + Alignment: 1 + SectionData: 0400000006000112000000000E0008107400000000000000001000000A000210011000000C0001000A00011201000000000000000E0008107400000000000000031000001200011600000000041000006D61696E00F3F2F10E0001160000000001100000666F6F000E00051600000000443A5C6200F3F2F12200051600000000433A5C767331345C56435C42494E5C616D6436345C636C2E6578650002010516000000002D5A37202D63202D4D54202D49433A5C767331345C56435C494E434C554445202D49433A5C767331345C56435C41544C4D46435C494E434C554445202D4922433A5C50726F6772616D2046696C65732028783836295C57696E646F7773204B6974735C31305C696E636C7564655C31302E302E31303135302E305C7563727422202D4922433A5C50726F6772616D2046696C65732028783836295C57696E646F7773204B6974735C4E4554465853444B5C342E365C696E636C7564655C756D22202D4922433A5C50726F6772616D2046696C65732028783836295C57696E646F7773204B6974735C382E315C696E636C7564655C73686172656422000A0004160100000009100000820005160A100000202D4922433A5C50726F6772616D2046696C65732028783836295C57696E646F7773204B6974735C382E315C696E636C7564655C 756D22202D4922433A5C50726F6772616D2046696C65732028783836295C57696E646F7773204B6974735C382E315C696E636C7564655C77696E727422202D5443202D5800F3F2F1160005160000000072657434322D6D61696E2E6300F3F2F11600051600000000443A5C625C76633134302E70646200F11A000316050007100000081000000C1000000D1000000B100000F2F1 + - Name: '.text$mn' + Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] + Alignment: 16 + SectionData: 4883EC28E8000000004883C428C3 + Relocations: + - VirtualAddress: 5 + SymbolName: foo + Type: IMAGE_REL_AMD64_REL32 + - Name: .xdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + Alignment: 4 + SectionData: '0104010004420000' + - Name: .pdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + Alignment: 4 + SectionData: '000000000E00000000000000' + Relocations: + - VirtualAddress: 0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 14 15:39:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA54ECAFCD7; Sat, 14 Jan 2017 15:39:31 +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 92B4D1E1C; Sat, 14 Jan 2017 15:39:31 +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 v0EFdUTr027343; Sat, 14 Jan 2017 15:39:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFdU08027342; Sat, 14 Jan 2017 15:39:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141539.v0EFdU08027342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312182 - vendor/lld/lld-release_40-r292009 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:39:32 -0000 Author: dim Date: Sat Jan 14 15:39:30 2017 New Revision: 312182 URL: https://svnweb.freebsd.org/changeset/base/312182 Log: Tag lld release_40 branch r292009. Added: vendor/lld/lld-release_40-r292009/ - copied from r312181, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Sat Jan 14 15:39:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B81DCAFDA1; Sat, 14 Jan 2017 15:39:52 +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 14FB8104E; Sat, 14 Jan 2017 15:39:52 +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 v0EFdpss027462; Sat, 14 Jan 2017 15:39:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFdpqR027461; Sat, 14 Jan 2017 15:39:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141539.v0EFdpqR027461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:39:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312184 - vendor/lldb/lldb-release_40-r292009 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:39:52 -0000 Author: dim Date: Sat Jan 14 15:39:51 2017 New Revision: 312184 URL: https://svnweb.freebsd.org/changeset/base/312184 Log: Tag lldb release_40 branch r292009. Added: vendor/lldb/lldb-release_40-r292009/ - copied from r312183, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Sat Jan 14 15:39:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AAA7CAFD86; Sat, 14 Jan 2017 15:39:49 +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 531D5100B; Sat, 14 Jan 2017 15:39:49 +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 v0EFdmSR027415; Sat, 14 Jan 2017 15:39:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFdkRh027395; Sat, 14 Jan 2017 15:39:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701141539.v0EFdkRh027395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Jan 2017 15:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312183 - in vendor/lldb/dist: . cmake/modules include/lldb/Core include/lldb/Symbol packages/Python/lldbsuite/test packages/Python/lldbsuite/test/lang/c/register_variables packages/Pyt... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:39:49 -0000 Author: dim Date: Sat Jan 14 15:39:46 2017 New Revision: 312183 URL: https://svnweb.freebsd.org/changeset/base/312183 Log: Vendor import of lldb release_40 branch r292009: https://llvm.org/svn/llvm-project/lldb/branches/release_40@292009 Added: vendor/lldb/dist/packages/Python/lldbsuite/test/lldbdwarf.py (contents, props changed) vendor/lldb/dist/unittests/Core/ErrorTest.cpp (contents, props changed) vendor/lldb/dist/unittests/Symbol/TestType.cpp (contents, props changed) Modified: vendor/lldb/dist/CMakeLists.txt vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake vendor/lldb/dist/include/lldb/Core/Error.h vendor/lldb/dist/include/lldb/Symbol/Type.h vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py vendor/lldb/dist/scripts/Xcode/build-llvm.py vendor/lldb/dist/source/Core/Module.cpp vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp vendor/lldb/dist/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp vendor/lldb/dist/source/Symbol/ClangASTContext.cpp vendor/lldb/dist/source/Symbol/Type.cpp vendor/lldb/dist/source/Symbol/TypeList.cpp vendor/lldb/dist/source/Symbol/TypeMap.cpp vendor/lldb/dist/tools/lldb-server/CMakeLists.txt vendor/lldb/dist/unittests/Core/CMakeLists.txt vendor/lldb/dist/unittests/Symbol/CMakeLists.txt Modified: vendor/lldb/dist/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/CMakeLists.txt Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/CMakeLists.txt Sat Jan 14 15:39:46 2017 (r312183) @@ -28,7 +28,7 @@ if (NOT LLDB_DISABLE_PYTHON) # Don't set -m when building the framework. set(FINISH_EXTRA_ARGS "-m") endif() - set(LLDB_WRAP_PYTHON ${LLDB_PYTHON_TARGET_DIR}/LLDBWrapPython.cpp) + set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp) add_subdirectory(scripts) endif () Modified: vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake ============================================================================== --- vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake Sat Jan 14 15:39:46 2017 (r312183) @@ -21,7 +21,8 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR "--libdir" "--includedir" "--prefix" - "--src-root") + "--src-root" + "--cmakedir") execute_process( COMMAND ${CONFIG_COMMAND} RESULT_VARIABLE HAD_ERROR @@ -47,6 +48,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR list(GET CONFIG_OUTPUT 3 INCLUDE_DIR) list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT) list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR) + list(GET CONFIG_OUTPUT 6 LLVM_CMAKE_PATH) if(NOT MSVC_IDE) set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS} @@ -65,7 +67,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) - set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake") if(EXISTS ${LLVMCONFIG_FILE}) list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") Modified: vendor/lldb/dist/include/lldb/Core/Error.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/Error.h Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/include/lldb/Core/Error.h Sat Jan 14 15:39:46 2017 (r312183) @@ -12,6 +12,7 @@ #if defined(__cplusplus) #include "llvm/Support/DataTypes.h" +#include "llvm/Support/FormatVariadic.h" #include #include @@ -300,5 +301,15 @@ protected: } // namespace lldb_private +namespace llvm { +template <> struct format_provider { + static void format(const lldb_private::Error &error, llvm::raw_ostream &OS, + llvm::StringRef Options) { + llvm::format_provider::format(error.AsCString(), OS, + Options); + } +}; +} + #endif // #if defined(__cplusplus) #endif // #ifndef __DCError_h__ Modified: vendor/lldb/dist/include/lldb/Symbol/Type.h ============================================================================== --- vendor/lldb/dist/include/lldb/Symbol/Type.h Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/include/lldb/Symbol/Type.h Sat Jan 14 15:39:46 2017 (r312183) @@ -201,8 +201,9 @@ public: // From a fully qualified typename, split the type into the type basename // and the remaining type scope (namespaces/classes). - static bool GetTypeScopeAndBasename(const char *&name_cstr, - std::string &scope, std::string &basename, + static bool GetTypeScopeAndBasename(const llvm::StringRef& name, + llvm::StringRef &scope, + llvm::StringRef &basename, lldb::TypeClass &type_class); void SetEncodingType(Type *encoding_type) { m_encoding_type = encoding_type; } Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py Sat Jan 14 15:39:46 2017 (r312183) @@ -101,6 +101,8 @@ class RegisterVariableTestCase(TestBase) @expectedFailureAll(compiler="clang", compiler_version=['<', '3.5']) @expectedFailureAll(compiler="gcc", compiler_version=[ '>=', '4.8.2'], archs=["i386"]) + @expectedFailureAll(compiler="gcc", compiler_version=[ + '<', '4.9'], archs=["x86_64"]) def test_and_run_command(self): """Test expressions on register values.""" Added: vendor/lldb/dist/packages/Python/lldbsuite/test/lldbdwarf.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lldbdwarf.py Sat Jan 14 15:39:46 2017 (r312183) @@ -0,0 +1,256 @@ +""" This module implement Dwarf expression opcode parser. """ + +import lldb + +# DWARF Expression operators. +DW_OP_addr = 0x03 +DW_OP_deref = 0x06 +DW_OP_const1u = 0x08 +DW_OP_const1s = 0x09 +DW_OP_const2u = 0x0A +DW_OP_const2s = 0x0B +DW_OP_const4u = 0x0C +DW_OP_const4s = 0x0D +DW_OP_const8u = 0x0E +DW_OP_const8s = 0x0F +DW_OP_constu = 0x10 +DW_OP_consts = 0x11 +DW_OP_dup = 0x12 +DW_OP_drop = 0x13 +DW_OP_over = 0x14 +DW_OP_pick = 0x15 +DW_OP_swap = 0x16 +DW_OP_rot = 0x17 +DW_OP_xderef = 0x18 +DW_OP_abs = 0x19 +DW_OP_and = 0x1A +DW_OP_div = 0x1B +DW_OP_minus = 0x1C +DW_OP_mod = 0x1D +DW_OP_mul = 0x1E +DW_OP_neg = 0x1F +DW_OP_not = 0x20 +DW_OP_or = 0x21 +DW_OP_plus = 0x22 +DW_OP_plus_uconst = 0x23 +DW_OP_shl = 0x24 +DW_OP_shr = 0x25 +DW_OP_shra = 0x26 +DW_OP_xor = 0x27 +DW_OP_skip = 0x2F +DW_OP_bra = 0x28 +DW_OP_eq = 0x29 +DW_OP_ge = 0x2A +DW_OP_gt = 0x2B +DW_OP_le = 0x2C +DW_OP_lt = 0x2D +DW_OP_ne = 0x2E +DW_OP_lit0 = 0x30 +DW_OP_lit1 = 0x31 +DW_OP_lit2 = 0x32 +DW_OP_lit3 = 0x33 +DW_OP_lit4 = 0x34 +DW_OP_lit5 = 0x35 +DW_OP_lit6 = 0x36 +DW_OP_lit7 = 0x37 +DW_OP_lit8 = 0x38 +DW_OP_lit9 = 0x39 +DW_OP_lit10 = 0x3A +DW_OP_lit11 = 0x3B +DW_OP_lit12 = 0x3C +DW_OP_lit13 = 0x3D +DW_OP_lit14 = 0x3E +DW_OP_lit15 = 0x3F +DW_OP_lit16 = 0x40 +DW_OP_lit17 = 0x41 +DW_OP_lit18 = 0x42 +DW_OP_lit19 = 0x43 +DW_OP_lit20 = 0x44 +DW_OP_lit21 = 0x45 +DW_OP_lit22 = 0x46 +DW_OP_lit23 = 0x47 +DW_OP_lit24 = 0x48 +DW_OP_lit25 = 0x49 +DW_OP_lit26 = 0x4A +DW_OP_lit27 = 0x4B +DW_OP_lit28 = 0x4C +DW_OP_lit29 = 0x4D +DW_OP_lit30 = 0x4E +DW_OP_lit31 = 0x4F +DW_OP_reg0 = 0x50 +DW_OP_reg1 = 0x51 +DW_OP_reg2 = 0x52 +DW_OP_reg3 = 0x53 +DW_OP_reg4 = 0x54 +DW_OP_reg5 = 0x55 +DW_OP_reg6 = 0x56 +DW_OP_reg7 = 0x57 +DW_OP_reg8 = 0x58 +DW_OP_reg9 = 0x59 +DW_OP_reg10 = 0x5A +DW_OP_reg11 = 0x5B +DW_OP_reg12 = 0x5C +DW_OP_reg13 = 0x5D +DW_OP_reg14 = 0x5E +DW_OP_reg15 = 0x5F +DW_OP_reg16 = 0x60 +DW_OP_reg17 = 0x61 +DW_OP_reg18 = 0x62 +DW_OP_reg19 = 0x63 +DW_OP_reg20 = 0x64 +DW_OP_reg21 = 0x65 +DW_OP_reg22 = 0x66 +DW_OP_reg23 = 0x67 +DW_OP_reg24 = 0x68 +DW_OP_reg25 = 0x69 +DW_OP_reg26 = 0x6A +DW_OP_reg27 = 0x6B +DW_OP_reg28 = 0x6C +DW_OP_reg29 = 0x6D +DW_OP_reg30 = 0x6E +DW_OP_reg31 = 0x6F +DW_OP_breg0 = 0x70 +DW_OP_breg1 = 0x71 +DW_OP_breg2 = 0x72 +DW_OP_breg3 = 0x73 +DW_OP_breg4 = 0x74 +DW_OP_breg5 = 0x75 +DW_OP_breg6 = 0x76 +DW_OP_breg7 = 0x77 +DW_OP_breg8 = 0x78 +DW_OP_breg9 = 0x79 +DW_OP_breg10 = 0x7A +DW_OP_breg11 = 0x7B +DW_OP_breg12 = 0x7C +DW_OP_breg13 = 0x7D +DW_OP_breg14 = 0x7E +DW_OP_breg15 = 0x7F +DW_OP_breg16 = 0x80 +DW_OP_breg17 = 0x81 +DW_OP_breg18 = 0x82 +DW_OP_breg19 = 0x83 +DW_OP_breg20 = 0x84 +DW_OP_breg21 = 0x85 +DW_OP_breg22 = 0x86 +DW_OP_breg23 = 0x87 +DW_OP_breg24 = 0x88 +DW_OP_breg25 = 0x89 +DW_OP_breg26 = 0x8A +DW_OP_breg27 = 0x8B +DW_OP_breg28 = 0x8C +DW_OP_breg29 = 0x8D +DW_OP_breg30 = 0x8E +DW_OP_breg31 = 0x8F +DW_OP_regx = 0x90 +DW_OP_fbreg = 0x91 +DW_OP_bregx = 0x92 +DW_OP_piece = 0x93 +DW_OP_deref_size = 0x94 +DW_OP_xderef_size = 0x95 +DW_OP_nop = 0x96 +DW_OP_push_object_address = 0x97 +DW_OP_call2 = 0x98 +DW_OP_call4 = 0x99 +DW_OP_call_ref = 0x9A +DW_OP_form_tls_address = 0x9B +DW_OP_call_frame_cfa = 0x9C +DW_OP_bit_piece = 0x9D +DW_OP_implicit_value = 0x9E +DW_OP_stack_value = 0x9F +DW_OP_lo_user = 0xE0 +DW_OP_GNU_push_tls_address = 0xE0 +DW_OP_APPLE_uninit = 0xF0 +DW_OP_hi_user = 0xFF + + +class DwarfOpcodeParser(object): + + def updateRegInfoBitsize(self, reg_info, byte_order): + """ Update the regInfo bit size. """ + + # Evaluate Dwarf Expression + expr_result = self.evaluateDwarfExpression(reg_info["dynamic_size_dwarf_expr_bytes"], + byte_order) + + if expr_result == 0: + reg_info["bitsize"] = 32 + elif expr_result == 1: + reg_info["bitsize"] = 64 + + + def evaluateDwarfExpression(self, dwarf_opcode, byte_order): + """Evaluate Dwarf Expression. """ + + dwarf_opcode = [dwarf_opcode[i:i+2] for i in range(0,len(dwarf_opcode),2)] + dwarf_data = [] + for index in range(len(dwarf_opcode)): + + if index < len(dwarf_opcode): + val = int(dwarf_opcode[index], 16) + else: + break + + if val == DW_OP_regx: + # Read register number + self.assertTrue(len(dwarf_opcode) > (index + 1)) + reg_no = int(dwarf_opcode.pop(index + 1), 16) + + self.reset_test_sequence() + # Read register value + self.test_sequence.add_log_lines( + ["read packet: $p{0:x}#00".format(reg_no), + {"direction": "send", "regex": r"^\$([0-9a-fA-F]+)#", + "capture": {1: "p_response"}}],True) + + Context = self.expect_gdbremote_sequence() + self.assertIsNotNone(Context) + p_response = Context.get("p_response") + self.assertIsNotNone(p_response) + + if byte_order == lldb.eByteOrderLittle: + # In case of little endian + # first decode the HEX ASCII bytes and then reverse it + # to get actual value of SR register + p_response = "".join(reversed([p_response[i:i+2] for i in range(0, + len(p_response),2)])) + # Push register value + dwarf_data.append(int(p_response,16)) + + elif val == DW_OP_lit1: + # Push literal 1 + dwarf_data.append(1) + + elif val == DW_OP_lit26: + # Push literal 26 + dwarf_data.append(26) + + elif val == DW_OP_shl: + # left shift and push the result back + self.assertTrue(len(dwarf_data) > 1) + shift_amount = dwarf_data.pop() + val_to_shift = dwarf_data.pop() + result = val_to_shift << shift_amount + dwarf_data.append(result) + + elif val == DW_OP_shr: + # Right shift and push the result back + self.assertTrue(len(dwarf_data) > 1) + shift_amount = dwarf_data.pop() + val_to_shift = dwarf_data.pop() + result = val_to_shift >> shift_amount + dwarf_data.append(result) + + elif val == DW_OP_and: + # And of topmost 2 elements and push the result back + first_ele = dwarf_data.pop() + second_ele = dwarf_data.pop() + result = first_ele & second_ele + dwarf_data.append(result) + + else: + self.assertTrue(False and "Unprocess Dwarf Opcode") + + self.assertTrue(len(dwarf_data) == 1) + expr_result = dwarf_data.pop() + return expr_result + Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py Sat Jan 14 15:39:46 2017 (r312183) @@ -20,10 +20,11 @@ import platform import signal from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * +from lldbsuite.test.lldbdwarf import * from lldbsuite.test import lldbutil -class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase): +class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase, DwarfOpcodeParser): mydir = TestBase.compute_mydir(__file__) @@ -541,6 +542,10 @@ class LldbGdbServerTestCase(gdbremote_te self.assertIsNotNone(reg_infos) self.assertTrue(len(reg_infos) > 0) + inferior_exe_path = os.path.abspath("a.out") + Target = self.dbg.CreateTarget(inferior_exe_path) + byte_order = Target.GetByteOrder() + # Read value for each register. reg_index = 0 for reg_info in reg_infos: @@ -565,6 +570,9 @@ class LldbGdbServerTestCase(gdbremote_te # Verify the response length. p_response = context.get("p_response") self.assertIsNotNone(p_response) + + if "dynamic_size_dwarf_expr_bytes" in reg_info: + self.updateRegInfoBitsize(reg_info, byte_order) self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8) # Increment loop Modified: vendor/lldb/dist/scripts/Xcode/build-llvm.py ============================================================================== --- vendor/lldb/dist/scripts/Xcode/build-llvm.py Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/scripts/Xcode/build-llvm.py Sat Jan 14 15:39:46 2017 (r312183) @@ -22,12 +22,12 @@ def LLVM_HASH_INCLUDES_DIFFS(): def LLVM_REF(): - llvm_ref = "master" + llvm_ref = "release_40" return llvm_ref def CLANG_REF(): - clang_ref = "master" + clang_ref = "release_40" return clang_ref # For use with Xcode-style builds Modified: vendor/lldb/dist/source/Core/Module.cpp ============================================================================== --- vendor/lldb/dist/source/Core/Module.cpp Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/source/Core/Module.cpp Sat Jan 14 15:39:46 2017 (r312183) @@ -995,8 +995,8 @@ size_t Module::FindTypes( TypeList &types) { size_t num_matches = 0; const char *type_name_cstr = name.GetCString(); - std::string type_scope; - std::string type_basename; + llvm::StringRef type_scope; + llvm::StringRef type_basename; const bool append = true; TypeClass type_class = eTypeClassAny; TypeMap typesmap; @@ -1006,13 +1006,9 @@ size_t Module::FindTypes( // from the root namespace and implies and exact match. The typenames we // get back from clang do not start with "::" so we need to strip this off // in order to get the qualified names to match + exact_match = type_scope.consume_front("::"); - if (type_scope.size() >= 2 && type_scope[0] == ':' && - type_scope[1] == ':') { - type_scope.erase(0, 2); - exact_match = true; - } - ConstString type_basename_const_str(type_basename.c_str()); + ConstString type_basename_const_str(type_basename); if (FindTypes_Impl(sc, type_basename_const_str, nullptr, append, max_matches, searched_symbol_files, typesmap)) { typesmap.RemoveMismatchedTypes(type_scope, type_basename, type_class, Modified: vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp Sat Jan 14 15:39:46 2017 (r312183) @@ -346,8 +346,7 @@ bool ASTResultSynthesizer::SynthesizeBod ExprResult address_of_expr = m_sema->CreateBuiltinUnaryOp(SourceLocation(), UO_AddrOf, last_expr); if (address_of_expr.get()) - m_sema->AddInitializerToDecl(result_decl, address_of_expr.get(), true, - false); + m_sema->AddInitializerToDecl(result_decl, address_of_expr.get(), true); else return false; } else { @@ -359,7 +358,7 @@ bool ASTResultSynthesizer::SynthesizeBod if (!result_decl) return false; - m_sema->AddInitializerToDecl(result_decl, last_expr, true, false); + m_sema->AddInitializerToDecl(result_decl, last_expr, true); } DC->addDecl(result_decl); Modified: vendor/lldb/dist/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp Sat Jan 14 15:39:46 2017 (r312183) @@ -206,7 +206,8 @@ CreateStackTrace(ValueObjectSP o, StructuredData::Array *trace = new StructuredData::Array(); ValueObjectSP trace_value_object = o->GetValueForExpressionPath(trace_item_name.c_str()); - for (int j = 0; j < 8; j++) { + size_t count = trace_value_object->GetNumChildren(); + for (size_t j = 0; j < count; j++) { addr_t trace_addr = trace_value_object->GetChildAtIndex(j, true)->GetValueAsUnsigned(0); if (trace_addr == 0) Modified: vendor/lldb/dist/source/Symbol/ClangASTContext.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/ClangASTContext.cpp Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/source/Symbol/ClangASTContext.cpp Sat Jan 14 15:39:46 2017 (r312183) @@ -1528,8 +1528,7 @@ ClassTemplateDecl *ClangASTContext::Crea *ast, decl_ctx, // What decl context do we use here? TU? The actual decl // context? - SourceLocation(), decl_name, template_param_list, template_cxx_decl, - nullptr); + SourceLocation(), decl_name, template_param_list, template_cxx_decl); if (class_template_decl) { if (access_type != eAccessNone) Modified: vendor/lldb/dist/source/Symbol/Type.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/Type.cpp Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/source/Symbol/Type.cpp Sat Jan 14 15:39:46 2017 (r312183) @@ -620,50 +620,59 @@ ConstString Type::GetQualifiedName() { return GetForwardCompilerType().GetConstTypeName(); } -bool Type::GetTypeScopeAndBasename(const char *&name_cstr, std::string &scope, - std::string &basename, +bool Type::GetTypeScopeAndBasename(const llvm::StringRef& name, + llvm::StringRef &scope, + llvm::StringRef &basename, TypeClass &type_class) { - // Protect against null c string. - type_class = eTypeClassAny; - if (name_cstr && name_cstr[0]) { - llvm::StringRef name_strref(name_cstr); - if (name_strref.startswith("struct ")) { - name_cstr += 7; - type_class = eTypeClassStruct; - } else if (name_strref.startswith("class ")) { - name_cstr += 6; - type_class = eTypeClassClass; - } else if (name_strref.startswith("union ")) { - name_cstr += 6; - type_class = eTypeClassUnion; - } else if (name_strref.startswith("enum ")) { - name_cstr += 5; - type_class = eTypeClassEnumeration; - } else if (name_strref.startswith("typedef ")) { - name_cstr += 8; - type_class = eTypeClassTypedef; - } - const char *basename_cstr = name_cstr; - const char *namespace_separator = ::strstr(basename_cstr, "::"); - if (namespace_separator) { - const char *template_arg_char = ::strchr(basename_cstr, '<'); - while (namespace_separator != nullptr) { - if (template_arg_char && - namespace_separator > template_arg_char) // but namespace'd template - // arguments are still good - // to go - break; - basename_cstr = namespace_separator + 2; - namespace_separator = strstr(basename_cstr, "::"); - } - if (basename_cstr > name_cstr) { - scope.assign(name_cstr, basename_cstr - name_cstr); - basename.assign(basename_cstr); - return true; + if (name.empty()) + return false; + + basename = name; + if (basename.consume_front("struct ")) + type_class = eTypeClassStruct; + else if (basename.consume_front("class ")) + type_class = eTypeClassClass; + else if (basename.consume_front("union ")) + type_class = eTypeClassUnion; + else if (basename.consume_front("enum ")) + type_class = eTypeClassEnumeration; + else if (basename.consume_front("typedef ")) + type_class = eTypeClassTypedef; + + size_t namespace_separator = basename.find("::"); + if (namespace_separator == llvm::StringRef::npos) + return false; + + size_t template_begin = basename.find('<'); + while (namespace_separator != llvm::StringRef::npos) { + if (template_begin != llvm::StringRef::npos && + namespace_separator > template_begin) { + size_t template_depth = 1; + llvm::StringRef template_arg = + basename.drop_front(template_begin + 1); + while (template_depth > 0 && !template_arg.empty()) { + if (template_arg.front() == '<') + template_depth++; + else if (template_arg.front() == '>') + template_depth--; + template_arg = template_arg.drop_front(1); } + if (template_depth != 0) + return false; // We have an invalid type name. Bail out. + if (template_arg.empty()) + break; // The template ends at the end of the full name. + basename = template_arg; + } else { + basename = basename.drop_front(namespace_separator + 2); } + template_begin = basename.find('<'); + namespace_separator = basename.find("::"); + } + if (basename.size() < name.size()) { + scope = name.take_front(name.size() - basename.size()); + return true; } return false; } Modified: vendor/lldb/dist/source/Symbol/TypeList.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/TypeList.cpp Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/source/Symbol/TypeList.cpp Sat Jan 14 15:39:46 2017 (r312183) @@ -108,13 +108,13 @@ void TypeList::Dump(Stream *s, bool show void TypeList::RemoveMismatchedTypes(const char *qualified_typename, bool exact_match) { - std::string type_scope; - std::string type_basename; + llvm::StringRef type_scope; + llvm::StringRef type_basename; TypeClass type_class = eTypeClassAny; if (!Type::GetTypeScopeAndBasename(qualified_typename, type_scope, type_basename, type_class)) { type_basename = qualified_typename; - type_scope.clear(); + type_scope = ""; } return RemoveMismatchedTypes(type_scope, type_basename, type_class, exact_match); @@ -145,8 +145,8 @@ void TypeList::RemoveMismatchedTypes(con ConstString match_type_name_const_str(the_type->GetQualifiedName()); if (match_type_name_const_str) { const char *match_type_name = match_type_name_const_str.GetCString(); - std::string match_type_scope; - std::string match_type_basename; + llvm::StringRef match_type_scope; + llvm::StringRef match_type_basename; if (Type::GetTypeScopeAndBasename(match_type_name, match_type_scope, match_type_basename, match_type_class)) { Modified: vendor/lldb/dist/source/Symbol/TypeMap.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/TypeMap.cpp Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/source/Symbol/TypeMap.cpp Sat Jan 14 15:39:46 2017 (r312183) @@ -152,13 +152,13 @@ void TypeMap::Dump(Stream *s, bool show_ void TypeMap::RemoveMismatchedTypes(const char *qualified_typename, bool exact_match) { - std::string type_scope; - std::string type_basename; + llvm::StringRef type_scope; + llvm::StringRef type_basename; TypeClass type_class = eTypeClassAny; if (!Type::GetTypeScopeAndBasename(qualified_typename, type_scope, type_basename, type_class)) { type_basename = qualified_typename; - type_scope.clear(); + type_scope = ""; } return RemoveMismatchedTypes(type_scope, type_basename, type_class, exact_match); @@ -189,8 +189,8 @@ void TypeMap::RemoveMismatchedTypes(cons ConstString match_type_name_const_str(the_type->GetQualifiedName()); if (match_type_name_const_str) { const char *match_type_name = match_type_name_const_str.GetCString(); - std::string match_type_scope; - std::string match_type_basename; + llvm::StringRef match_type_scope; + llvm::StringRef match_type_basename; if (Type::GetTypeScopeAndBasename(match_type_name, match_type_scope, match_type_basename, match_type_class)) { Modified: vendor/lldb/dist/tools/lldb-server/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/tools/lldb-server/CMakeLists.txt Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/tools/lldb-server/CMakeLists.txt Sat Jan 14 15:39:46 2017 (r312183) @@ -183,7 +183,13 @@ else() target_link_libraries(lldb-server ${LLDB_USED_LIBS}) target_link_libraries(lldb-server ${CLANG_USED_LIBS}) endif() -llvm_config(lldb-server ${LLVM_LINK_COMPONENTS}) +if(NOT LLVM_LINK_LLVM_DYLIB) + # This is necessary in !LLVM_LINK_LLVM_DYLIB as LLDB's libs do not track their + # dependencies properly. It is conditional because in a LLVM_LINK_LLVM_DYLIB + # build it would introduce duplicate symbols (add_lldb_tool links to libLLVM, + # and this would add the individual .a files as well). + llvm_config(lldb-server ${LLVM_LINK_COMPONENTS}) +endif() target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS}) Modified: vendor/lldb/dist/unittests/Core/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/unittests/Core/CMakeLists.txt Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/unittests/Core/CMakeLists.txt Sat Jan 14 15:39:46 2017 (r312183) @@ -2,6 +2,7 @@ add_lldb_unittest(LLDBCoreTests ArchSpecTest.cpp BroadcasterTest.cpp DataExtractorTest.cpp + ErrorTest.cpp ListenerTest.cpp ScalarTest.cpp StructuredDataTest.cpp Added: vendor/lldb/dist/unittests/Core/ErrorTest.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/unittests/Core/ErrorTest.cpp Sat Jan 14 15:39:46 2017 (r312183) @@ -0,0 +1,19 @@ +//===-- ErrorTest.cpp -------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "gtest/gtest.h" +#include "lldb/Core/Error.h" + +using namespace lldb_private; + +TEST(ErrorTest, Formatv) { + EXPECT_EQ("", llvm::formatv("{0}", Error()).str()); + EXPECT_EQ("Hello Error", llvm::formatv("{0}", Error("Hello Error")).str()); + EXPECT_EQ("Hello", llvm::formatv("{0:5}", Error("Hello Error")).str()); +} Modified: vendor/lldb/dist/unittests/Symbol/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/unittests/Symbol/CMakeLists.txt Sat Jan 14 15:39:30 2017 (r312182) +++ vendor/lldb/dist/unittests/Symbol/CMakeLists.txt Sat Jan 14 15:39:46 2017 (r312183) @@ -1,3 +1,4 @@ add_lldb_unittest(SymbolTests TestClangASTContext.cpp + TestType.cpp ) Added: vendor/lldb/dist/unittests/Symbol/TestType.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/unittests/Symbol/TestType.cpp Sat Jan 14 15:39:46 2017 (r312183) @@ -0,0 +1,51 @@ +//===-- TestType.cpp --------------------------------------------*- C++ -*-===// +// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "gtest/gtest.h" + +#include "lldb/Symbol/Type.h" + +using namespace lldb; +using namespace lldb_private; + +namespace { +void TestGetTypeScopeAndBasenameHelper(const char *full_type, + bool expected_is_scoped, + const char *expected_scope, + const char *expected_name) { + llvm::StringRef scope, name; + lldb::TypeClass type_class; + bool is_scoped = + Type::GetTypeScopeAndBasename(full_type, scope, name, type_class); + EXPECT_EQ(is_scoped, expected_is_scoped); + if (expected_is_scoped) { + EXPECT_EQ(scope, expected_scope); + EXPECT_EQ(name, expected_name); + } +} +}; + +TEST(Type, GetTypeScopeAndBasename) { + TestGetTypeScopeAndBasenameHelper("int", false, "", ""); + TestGetTypeScopeAndBasenameHelper("std::string", true, "std::", "string"); + TestGetTypeScopeAndBasenameHelper("std::set", true, "std::", "set"); + TestGetTypeScopeAndBasenameHelper("std::set>", true, + "std::", "set>"); + TestGetTypeScopeAndBasenameHelper("std::string::iterator", true, + "std::string::", "iterator"); + TestGetTypeScopeAndBasenameHelper("std::set::iterator", true, + "std::set::", "iterator"); + TestGetTypeScopeAndBasenameHelper( + "std::set>::iterator", true, + "std::set>::", "iterator"); + TestGetTypeScopeAndBasenameHelper( + "std::set>::iterator", true, + "std::set>::", "iterator"); +} From owner-svn-src-all@freebsd.org Sat Jan 14 15:43:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEAC1CAD373; Sat, 14 Jan 2017 15:43:05 +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 9D9931D16; Sat, 14 Jan 2017 15:43:05 +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 v0EFh4gT031527; Sat, 14 Jan 2017 15:43:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFh46U031526; Sat, 14 Jan 2017 15:43:04 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701141543.v0EFh46U031526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Jan 2017 15:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312185 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:43:05 -0000 Author: np Date: Sat Jan 14 15:43:04 2017 New Revision: 312185 URL: https://svnweb.freebsd.org/changeset/base/312185 Log: MFC r311831 and r311832. r311831: cxgbe(4): The wraparound logic in start_wrq_wr() should not get involved in work requests that end at the end of the descriptor ring, even though the pidx wraps around to 0. r311832: cxgbe(4): Enable automatic cidx flush for all control queues. Modified: stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Sat Jan 14 15:39:51 2017 (r312184) +++ stable/11/sys/dev/cxgbe/t4_sge.c Sat Jan 14 15:43:04 2017 (r312185) @@ -2289,7 +2289,7 @@ slowpath: w = &eq->desc[eq->pidx]; IDXINCR(eq->pidx, ndesc, eq->sidx); - if (__predict_false(eq->pidx < ndesc - 1)) { + if (__predict_false(cookie->pidx + ndesc > eq->sidx)) { w = &wrq->ss[0]; wrq->ss_pidx = cookie->pidx; wrq->ss_len = len16 * 16; @@ -3296,12 +3296,13 @@ ctrl_eq_alloc(struct adapter *sc, struct c.cmpliqid_eqid = htonl(V_FW_EQ_CTRL_CMD_CMPLIQID(eq->iqid)); c.physeqid_pkd = htobe32(0); c.fetchszm_to_iqid = - htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | + htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | V_FW_EQ_CTRL_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) | + V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) | V_FW_EQ_CTRL_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); From owner-svn-src-all@freebsd.org Sat Jan 14 15:43:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39DDCCAD403; Sat, 14 Jan 2017 15:43:33 +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 E489A1E3D; Sat, 14 Jan 2017 15:43:32 +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 v0EFhWxQ031590; Sat, 14 Jan 2017 15:43:32 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFhWuA031589; Sat, 14 Jan 2017 15:43:32 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701141543.v0EFhWuA031589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Jan 2017 15:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312186 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:43:33 -0000 Author: np Date: Sat Jan 14 15:43:31 2017 New Revision: 312186 URL: https://svnweb.freebsd.org/changeset/base/312186 Log: MFC r311831 and r311832. r311831: cxgbe(4): The wraparound logic in start_wrq_wr() should not get involved in work requests that end at the end of the descriptor ring, even though the pidx wraps around to 0. r311832: cxgbe(4): Enable automatic cidx flush for all control queues. Modified: stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Sat Jan 14 15:43:04 2017 (r312185) +++ stable/10/sys/dev/cxgbe/t4_sge.c Sat Jan 14 15:43:31 2017 (r312186) @@ -2289,7 +2289,7 @@ slowpath: w = &eq->desc[eq->pidx]; IDXINCR(eq->pidx, ndesc, eq->sidx); - if (__predict_false(eq->pidx < ndesc - 1)) { + if (__predict_false(cookie->pidx + ndesc > eq->sidx)) { w = &wrq->ss[0]; wrq->ss_pidx = cookie->pidx; wrq->ss_len = len16 * 16; @@ -3296,12 +3296,13 @@ ctrl_eq_alloc(struct adapter *sc, struct c.cmpliqid_eqid = htonl(V_FW_EQ_CTRL_CMD_CMPLIQID(eq->iqid)); c.physeqid_pkd = htobe32(0); c.fetchszm_to_iqid = - htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | + htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | V_FW_EQ_CTRL_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) | + V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) | V_FW_EQ_CTRL_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); From owner-svn-src-all@freebsd.org Sat Jan 14 15:52:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDA5BCAD8EC; Sat, 14 Jan 2017 15:52:57 +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 8CF58163E; Sat, 14 Jan 2017 15:52:57 +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 v0EFqurp035524; Sat, 14 Jan 2017 15:52:56 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFquPd035523; Sat, 14 Jan 2017 15:52:56 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701141552.v0EFquPd035523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Jan 2017 15:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312187 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:52:57 -0000 Author: np Date: Sat Jan 14 15:52:56 2017 New Revision: 312187 URL: https://svnweb.freebsd.org/changeset/base/312187 Log: MFC r311848: cxgbe(4): Attach to the 2x25 debug card. This is for internal use only. Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sat Jan 14 15:43:31 2017 (r312186) +++ stable/11/sys/dev/cxgbe/t4_main.c Sat Jan 14 15:52:56 2017 (r312187) @@ -623,6 +623,7 @@ struct { #endif }, t6_pciids[] = { {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ + {0x6400, "Chelsio T6225-DBG"}, /* 2 x 10/25G, debug */ {0x6401, "Chelsio T6225-CR"}, /* 2 x 10/25G */ {0x6402, "Chelsio T6225-SO-CR"}, /* 2 x 10/25G, nomem */ {0x6407, "Chelsio T62100-LP-CR"}, /* 2 x 40/50/100G */ From owner-svn-src-all@freebsd.org Sat Jan 14 15:53:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4A6ECAD914; Sat, 14 Jan 2017 15:53:00 +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 8034A1641; Sat, 14 Jan 2017 15:53: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 v0EFqxn9035572; Sat, 14 Jan 2017 15:52:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFqxED035570; Sat, 14 Jan 2017 15:52:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701141552.v0EFqxED035570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Jan 2017 15:52:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312188 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:53:00 -0000 Author: np Date: Sat Jan 14 15:52:59 2017 New Revision: 312188 URL: https://svnweb.freebsd.org/changeset/base/312188 Log: MFC r311848: cxgbe(4): Attach to the 2x25 debug card. This is for internal use only. Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Sat Jan 14 15:52:56 2017 (r312187) +++ stable/10/sys/dev/cxgbe/t4_main.c Sat Jan 14 15:52:59 2017 (r312188) @@ -611,6 +611,7 @@ struct { #endif }, t6_pciids[] = { {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ + {0x6400, "Chelsio T6225-DBG"}, /* 2 x 10/25G, debug */ {0x6401, "Chelsio T6225-CR"}, /* 2 x 10/25G */ {0x6402, "Chelsio T6225-SO-CR"}, /* 2 x 10/25G, nomem */ {0x6407, "Chelsio T62100-LP-CR"}, /* 2 x 40/50/100G */ From owner-svn-src-all@freebsd.org Sat Jan 14 16:58:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75A67CAF91A; Sat, 14 Jan 2017 16:58:50 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 450DA158B; Sat, 14 Jan 2017 16:58:50 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EGwnfC060522; Sat, 14 Jan 2017 16:58:49 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EGwnpf060521; Sat, 14 Jan 2017 16:58:49 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201701141658.v0EGwnpf060521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Sat, 14 Jan 2017 16:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r312189 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 16:58:50 -0000 Author: matthew (ports committer) Date: Sat Jan 14 16:58:49 2017 New Revision: 312189 URL: https://svnweb.freebsd.org/changeset/base/312189 Log: Take in the commit bits for the following 8 people: brian gber gleb ivoras rdivacky trhodes vanhu zont All of these have not been active for at least 18 months and agree that they aren't likely to resume FreeBSD work soon, so have aquiesced to giving up their commit bits. We haven't had the Grim Reaper working for base commit bits for some time, so we've a backlog of bits to take in. More to come. Approved by: core (implicit) Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sat Jan 14 15:52:59 2017 (r312188) +++ svnadmin/conf/access Sat Jan 14 16:58:49 2017 (r312189) @@ -46,7 +46,6 @@ benl benno bms br -brian freebsd-committers@Awfulhak.org brooks brueffer bryanv @@ -91,11 +90,9 @@ gad gallatin ganbold gavin -gber ghelmer gibbs gjb -gleb glebius gnn gonzo @@ -109,7 +106,6 @@ hselasky ian imp ivadasz -ivoras iwasaki jah jamie @@ -196,7 +192,6 @@ pstef qingli raj ray -rdivacky remko rmacklem rmh @@ -237,7 +232,6 @@ thompsa tijl torek trasz -trhodes trociny truckman tsoome @@ -247,7 +241,6 @@ ume ups ups_old@stups.com uqs vangyzen -vanhu venkat versus whu @@ -258,4 +251,3 @@ wollman yongari zbb zec -zont From owner-svn-src-all@freebsd.org Sat Jan 14 18:04:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DE87CAF25D; Sat, 14 Jan 2017 18:04:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 087351DC2; Sat, 14 Jan 2017 18:04:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EI4Dwg089683; Sat, 14 Jan 2017 18:04:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EI4CS8089680; Sat, 14 Jan 2017 18:04:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701141804.v0EI4CS8089680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Jan 2017 18:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312190 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 18:04:14 -0000 Author: mav Date: Sat Jan 14 18:04:12 2017 New Revision: 312190 URL: https://svnweb.freebsd.org/changeset/base/312190 Log: Decouple iSCSI connection limits from defaults. If initiator does not negotiate some parameter, it expects one to get default value, not some unknown remote hardware limit. On the side side, if some parameter is negotiated, its default value from RFC should not be used for anything. Modified: head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Sat Jan 14 16:58:49 2017 (r312189) +++ head/usr.sbin/ctld/ctld.c Sat Jan 14 18:04:12 2017 (r312190) @@ -1582,6 +1582,7 @@ connection_new(struct portal *portal, in * Default values, from RFC 3720, section 12. */ conn->conn_max_recv_data_segment_length = 8192; + conn->conn_max_send_data_segment_length = 8192; conn->conn_max_burst_length = 262144; conn->conn_first_burst_length = 65536; conn->conn_immediate_data = true; Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Sat Jan 14 16:58:49 2017 (r312189) +++ head/usr.sbin/ctld/ctld.h Sat Jan 14 18:04:12 2017 (r312190) @@ -48,8 +48,6 @@ #define MAX_LUNS 1024 #define MAX_NAME_LEN 223 #define MAX_DATA_SEGMENT_LENGTH (128 * 1024) -#define MAX_BURST_LENGTH 16776192 -#define FIRST_BURST_LENGTH (128 * 1024) #define SOCKBUF_SIZE 1048576 struct auth { @@ -242,6 +240,10 @@ struct connection { struct sockaddr_storage conn_initiator_sa; uint32_t conn_cmdsn; uint32_t conn_statsn; + int conn_max_recv_data_segment_limit; + int conn_max_send_data_segment_limit; + int conn_max_burst_limit; + int conn_first_burst_limit; int conn_max_recv_data_segment_length; int conn_max_send_data_segment_length; int conn_max_burst_length; Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Sat Jan 14 16:58:49 2017 (r312189) +++ head/usr.sbin/ctld/login.c Sat Jan 14 18:04:12 2017 (r312190) @@ -557,13 +557,15 @@ login_negotiate_key(struct pdu *request, * our MaxRecvDataSegmentLength is not influenced by the * initiator in any way. */ - if ((int)tmp > conn->conn_max_send_data_segment_length) { - log_debugx("capping max_send_data_segment_length " + if ((int)tmp > conn->conn_max_send_data_segment_limit) { + log_debugx("capping MaxRecvDataSegmentLength " "from %zd to %d", tmp, - conn->conn_max_send_data_segment_length); - tmp = conn->conn_max_send_data_segment_length; + conn->conn_max_send_data_segment_limit); + tmp = conn->conn_max_send_data_segment_limit; } conn->conn_max_send_data_segment_length = tmp; + conn->conn_max_recv_data_segment_length = + conn->conn_max_recv_data_segment_limit; keys_add_int(response_keys, name, conn->conn_max_recv_data_segment_length); } else if (strcmp(name, "MaxBurstLength") == 0) { @@ -572,10 +574,10 @@ login_negotiate_key(struct pdu *request, login_send_error(request, 0x02, 0x00); log_errx(1, "received invalid MaxBurstLength"); } - if ((int)tmp > conn->conn_max_burst_length) { + if ((int)tmp > conn->conn_max_burst_limit) { log_debugx("capping MaxBurstLength from %zd to %d", - tmp, conn->conn_max_burst_length); - tmp = conn->conn_max_burst_length; + tmp, conn->conn_max_burst_limit); + tmp = conn->conn_max_burst_limit; } conn->conn_max_burst_length = tmp; keys_add_int(response_keys, name, tmp); @@ -585,10 +587,10 @@ login_negotiate_key(struct pdu *request, login_send_error(request, 0x02, 0x00); log_errx(1, "received invalid FirstBurstLength"); } - if ((int)tmp > conn->conn_first_burst_length) { + if ((int)tmp > conn->conn_first_burst_limit) { log_debugx("capping FirstBurstLength from %zd to %d", - tmp, conn->conn_first_burst_length); - tmp = conn->conn_first_burst_length; + tmp, conn->conn_first_burst_limit); + tmp = conn->conn_first_burst_limit; } conn->conn_first_burst_length = tmp; keys_add_int(response_keys, name, tmp); @@ -694,25 +696,42 @@ login_negotiate(struct connection *conn, * offload, it depends on hardware capabilities. */ assert(conn->conn_target != NULL); + conn->conn_max_recv_data_segment_limit = (1 << 24) - 1; + conn->conn_max_send_data_segment_limit = (1 << 24) - 1; + conn->conn_max_burst_limit = (1 << 24) - 1; + conn->conn_first_burst_limit = (1 << 24) - 1; kernel_limits(conn->conn_portal->p_portal_group->pg_offload, - &conn->conn_max_recv_data_segment_length, - &conn->conn_max_send_data_segment_length, - &conn->conn_max_burst_length, - &conn->conn_first_burst_length); + &conn->conn_max_recv_data_segment_limit, + &conn->conn_max_send_data_segment_limit, + &conn->conn_max_burst_limit, + &conn->conn_first_burst_limit); /* We expect legal, usable values at this point. */ - assert(conn->conn_max_recv_data_segment_length >= 512); - assert(conn->conn_max_recv_data_segment_length < (1 << 24)); - assert(conn->conn_max_burst_length >= 512); - assert(conn->conn_max_burst_length < (1 << 24)); - assert(conn->conn_first_burst_length >= 512); - assert(conn->conn_first_burst_length < (1 << 24)); - assert(conn->conn_first_burst_length <= - conn->conn_max_burst_length); + assert(conn->conn_max_recv_data_segment_limit >= 512); + assert(conn->conn_max_recv_data_segment_limit < (1 << 24)); + assert(conn->conn_max_send_data_segment_limit >= 512); + assert(conn->conn_max_send_data_segment_limit < (1 << 24)); + assert(conn->conn_max_burst_limit >= 512); + assert(conn->conn_max_burst_limit < (1 << 24)); + assert(conn->conn_first_burst_limit >= 512); + assert(conn->conn_first_burst_limit < (1 << 24)); + assert(conn->conn_first_burst_limit <= + conn->conn_max_burst_limit); + + /* + * Limit default send length in case it won't be negotiated. + * We can't do it for other limits, since they may affect both + * sender and receiver operation, and we must obey defaults. + */ + if (conn->conn_max_send_data_segment_limit < + conn->conn_max_send_data_segment_length) { + conn->conn_max_send_data_segment_limit = + conn->conn_max_send_data_segment_length; + } } else { - conn->conn_max_recv_data_segment_length = + conn->conn_max_recv_data_segment_limit = MAX_DATA_SEGMENT_LENGTH; - conn->conn_max_send_data_segment_length = + conn->conn_max_send_data_segment_limit = MAX_DATA_SEGMENT_LENGTH; } From owner-svn-src-all@freebsd.org Sat Jan 14 19:35:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CAD7CAFDC6; Sat, 14 Jan 2017 19:35:37 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B4681AFC; Sat, 14 Jan 2017 19:35:37 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EJZabh026286; Sat, 14 Jan 2017 19:35:36 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EJZaew026285; Sat, 14 Jan 2017 19:35:36 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201701141935.v0EJZaew026285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sat, 14 Jan 2017 19:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312191 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 19:35:37 -0000 Author: jah Date: Sat Jan 14 19:35:36 2017 New Revision: 312191 URL: https://svnweb.freebsd.org/changeset/base/312191 Log: Add comment explaining relative order of sched_unpin() and mtx_unlock(). Suggested by: alc MFC after: 1 week Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Jan 14 18:04:12 2017 (r312190) +++ head/sys/i386/i386/pmap.c Sat Jan 14 19:35:36 2017 (r312191) @@ -4216,6 +4216,12 @@ pmap_zero_page(vm_page_t m) invlcaddr(pc->pc_cmap_addr2); pagezero(pc->pc_cmap_addr2); *cmap_pte2 = 0; + + /* + * Unpin the thread before releasing the lock. Otherwise the thread + * could be rescheduled while still bound to the current CPU, only + * to unpin itself immediately upon resuming execution. + */ sched_unpin(); mtx_unlock(&pc->pc_cmap_lock); } From owner-svn-src-all@freebsd.org Sat Jan 14 19:58:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD29ECAE47C; Sat, 14 Jan 2017 19:58:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A2A618B4; Sat, 14 Jan 2017 19:58:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EJwp5v034963; Sat, 14 Jan 2017 19:58:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EJwpql034962; Sat, 14 Jan 2017 19:58:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701141958.v0EJwpql034962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Jan 2017 19:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312192 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 19:58:52 -0000 Author: mav Date: Sat Jan 14 19:58:51 2017 New Revision: 312192 URL: https://svnweb.freebsd.org/changeset/base/312192 Log: Fix wrong way assignment in r312190. Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Sat Jan 14 19:35:36 2017 (r312191) +++ head/usr.sbin/ctld/login.c Sat Jan 14 19:58:51 2017 (r312192) @@ -725,8 +725,8 @@ login_negotiate(struct connection *conn, */ if (conn->conn_max_send_data_segment_limit < conn->conn_max_send_data_segment_length) { - conn->conn_max_send_data_segment_limit = - conn->conn_max_send_data_segment_length; + conn->conn_max_send_data_segment_length = + conn->conn_max_send_data_segment_limit; } } else { conn->conn_max_recv_data_segment_limit = From owner-svn-src-all@freebsd.org Sat Jan 14 20:29:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BE8BCAF014; Sat, 14 Jan 2017 20:29:27 +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 5E88118FA; Sat, 14 Jan 2017 20:29:27 +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 v0EKTQbj047126; Sat, 14 Jan 2017 20:29:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EKTQ2f047122; Sat, 14 Jan 2017 20:29:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701142029.v0EKTQ2f047122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 20:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312194 - in head/tests/sys: fs kern kqueue mac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 20:29:27 -0000 Author: ngie Date: Sat Jan 14 20:29:26 2017 New Revision: 312194 URL: https://svnweb.freebsd.org/changeset/base/312194 Log: Add include Makefiles for tests/sys/{fs,kern,kqueue,mac}/... The primary goal for doing this is to leverage the work done in r312114 for enabling WARNS to address trivial code quality issues with new tests MFC after: 6 days Tested with: make tinderbox Sponsored by: Dell EMC Isilon Added: head/tests/sys/fs/Makefile.inc - copied unchanged from r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/fs/Makefile.inc head/tests/sys/kern/Makefile.inc - copied unchanged from r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/kern/Makefile.inc head/tests/sys/kqueue/Makefile.inc - copied unchanged from r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/kqueue/Makefile.inc head/tests/sys/mac/Makefile.inc - copied unchanged from r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/mac/Makefile.inc Modified: Directory Properties: head/ (props changed) Copied: head/tests/sys/fs/Makefile.inc (from r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/fs/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/fs/Makefile.inc Sat Jan 14 20:29:26 2017 (r312194, copy of r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/fs/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Copied: head/tests/sys/kern/Makefile.inc (from r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/kern/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/Makefile.inc Sat Jan 14 20:29:26 2017 (r312194, copy of r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/kern/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Copied: head/tests/sys/kqueue/Makefile.inc (from r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/kqueue/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kqueue/Makefile.inc Sat Jan 14 20:29:26 2017 (r312194, copy of r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/kqueue/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Copied: head/tests/sys/mac/Makefile.inc (from r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/mac/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/mac/Makefile.inc Sat Jan 14 20:29:26 2017 (r312194, copy of r312193, projects/netbsd-tests-upstream-01-2017/tests/sys/mac/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" From owner-svn-src-all@freebsd.org Sat Jan 14 20:41:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E016CAF3E6; Sat, 14 Jan 2017 20:41:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2852E1F87; Sat, 14 Jan 2017 20:41:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EKfjaL054736; Sat, 14 Jan 2017 20:41:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EKfjg1054733; Sat, 14 Jan 2017 20:41:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701142041.v0EKfjg1054733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Jan 2017 20:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312195 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 20:41:46 -0000 Author: mav Date: Sat Jan 14 20:41:44 2017 New Revision: 312195 URL: https://svnweb.freebsd.org/changeset/base/312195 Log: Alike to r312190 decouple iSCSI connection limits from defaults. Connection parameters should remain at defaults until negotiated. While there, remove sythetic limits, applied if kernel provided none. iscsid has no own limitations, no configuration and no any idea what values are good. Assume kernel knows what it requests. Modified: head/usr.sbin/iscsid/iscsid.c head/usr.sbin/iscsid/iscsid.h head/usr.sbin/iscsid/login.c Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Sat Jan 14 20:29:26 2017 (r312194) +++ head/usr.sbin/iscsid/iscsid.c Sat Jan 14 20:41:44 2017 (r312195) @@ -172,8 +172,10 @@ connection_new(int iscsi_fd, const struc conn->conn_data_digest = CONN_DIGEST_NONE; conn->conn_initial_r2t = true; conn->conn_immediate_data = true; - conn->conn_max_burst_length = MAX_BURST_LENGTH; - conn->conn_first_burst_length = FIRST_BURST_LENGTH; + conn->conn_max_recv_data_segment_length = 8192; + conn->conn_max_send_data_segment_length = 8192; + conn->conn_max_burst_length = 262144; + conn->conn_first_burst_length = 65536; conn->conn_iscsi_fd = iscsi_fd; conn->conn_session_id = request->idr_session_id; @@ -190,31 +192,28 @@ connection_new(int iscsi_fd, const struc */ isl = &conn->conn_limits; memcpy(isl, &request->idr_limits, sizeof(*isl)); - if (isl->isl_max_recv_data_segment_length == 0) { - conn->conn_max_recv_data_segment_length = 8192; - conn->conn_max_send_data_segment_length = 8192; - isl->isl_max_recv_data_segment_length = 8192; - } else { - conn->conn_max_recv_data_segment_length = - isl->isl_max_recv_data_segment_length; - conn->conn_max_send_data_segment_length = - isl->isl_max_recv_data_segment_length; - } - if (isl->isl_max_send_data_segment_length == 0) { + if (isl->isl_max_recv_data_segment_length == 0) + isl->isl_max_recv_data_segment_length = (1 << 24) - 1; + if (isl->isl_max_send_data_segment_length == 0) isl->isl_max_send_data_segment_length = isl->isl_max_recv_data_segment_length; - } else { + if (isl->isl_max_burst_length == 0) + isl->isl_max_burst_length = (1 << 24) - 1; + if (isl->isl_first_burst_length == 0) + isl->isl_first_burst_length = (1 << 24) - 1; + if (isl->isl_first_burst_length > isl->isl_max_burst_length) + isl->isl_first_burst_length = isl->isl_max_burst_length; + + /* + * Limit default send length in case it won't be negotiated. + * We can't do it for other limits, since they may affect both + * sender and receiver operation, and we must obey defaults. + */ + if (conn->conn_max_send_data_segment_length > + isl->isl_max_send_data_segment_length) { conn->conn_max_send_data_segment_length = isl->isl_max_send_data_segment_length; } - if (isl->isl_max_burst_length == 0) - isl->isl_max_burst_length = conn->conn_max_burst_length; - if (isl->isl_first_burst_length == 0) { - if (isl->isl_max_burst_length < (int)conn->conn_first_burst_length) - isl->isl_first_burst_length = isl->isl_max_burst_length; - else - isl->isl_first_burst_length = conn->conn_first_burst_length; - } from_addr = conn->conn_conf.isc_initiator_addr; to_addr = conn->conn_conf.isc_target_addr; Modified: head/usr.sbin/iscsid/iscsid.h ============================================================================== --- head/usr.sbin/iscsid/iscsid.h Sat Jan 14 20:29:26 2017 (r312194) +++ head/usr.sbin/iscsid/iscsid.h Sat Jan 14 20:41:44 2017 (r312195) @@ -44,8 +44,6 @@ #define CONN_MUTUAL_CHALLENGE_LEN 1024 #define SOCKBUF_SIZE 1048576 -#define MAX_BURST_LENGTH (256 * 1024) -#define FIRST_BURST_LENGTH (128 * 1024) struct connection { int conn_iscsi_fd; Modified: head/usr.sbin/iscsid/login.c ============================================================================== --- head/usr.sbin/iscsid/login.c Sat Jan 14 20:29:26 2017 (r312194) +++ head/usr.sbin/iscsid/login.c Sat Jan 14 20:41:44 2017 (r312195) @@ -397,6 +397,9 @@ login_negotiate_key(struct connection *c tmp = isl->isl_max_send_data_segment_length; } conn->conn_max_send_data_segment_length = tmp; + /* We received target's limit, that means it accepted our's. */ + conn->conn_max_recv_data_segment_length = + isl->isl_max_recv_data_segment_length; } else if (strcmp(name, "MaxBurstLength") == 0) { tmp = strtoul(value, NULL, 10); if (tmp <= 0) From owner-svn-src-all@freebsd.org Sat Jan 14 22:06:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C036ACAFB33; Sat, 14 Jan 2017 22:06:26 +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 8AB1E15B3; Sat, 14 Jan 2017 22:06:26 +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 v0EM6PAD088572; Sat, 14 Jan 2017 22:06:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EM6PqT088571; Sat, 14 Jan 2017 22:06:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701142206.v0EM6PqT088571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 14 Jan 2017 22:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312196 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 22:06:26 -0000 Author: markj Date: Sat Jan 14 22:06:25 2017 New Revision: 312196 URL: https://svnweb.freebsd.org/changeset/base/312196 Log: Revert r311952. It broke DDB type-ahead since it caused db_check_interrupt() to drop unrecognized characters. Reported by: bde Modified: head/sys/ddb/db_input.c Modified: head/sys/ddb/db_input.c ============================================================================== --- head/sys/ddb/db_input.c Sat Jan 14 20:41:44 2017 (r312195) +++ head/sys/ddb/db_input.c Sat Jan 14 22:06:25 2017 (r312196) @@ -63,6 +63,7 @@ static int db_lhist_nlines; #define BLANK ' ' #define BACKUP '\b' +static int cnmaygetc(void); static void db_delete(int n, int bwd); static int db_inputchar(int c); static void db_putnchars(int c, int count); @@ -290,6 +291,12 @@ db_inputchar(c) return (0); } +static int +cnmaygetc() +{ + return (-1); +} + int db_readline(lstart, lsize) char * lstart; @@ -343,7 +350,7 @@ db_check_interrupt(void) { int c; - c = cncheckc(); + c = cnmaygetc(); switch (c) { case -1: /* no character */ return; @@ -354,7 +361,7 @@ db_check_interrupt(void) case CTRL('s'): do { - c = cncheckc(); + c = cnmaygetc(); if (c == CTRL('c')) db_error((char *)0); } while (c != CTRL('q')); From owner-svn-src-all@freebsd.org Sat Jan 14 22:06:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EAF0CAFB5D; Sat, 14 Jan 2017 22:06:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (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 0FBA315DA; Sat, 14 Jan 2017 22:06:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 75so1745349pgf.3; Sat, 14 Jan 2017 14:06:32 -0800 (PST) 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=B5dJHvF93BbMFgelc7PVnVp1eaL6j1kxIVieN2bMiTg=; b=sn1DxRSqWP5n7X3edZNmdXykfyTqO1ZQ0n+426nyHsR8rqvIpSMq3bebaO/90zSTm1 ty9VyN7w9HnmMK73SMjHzQ5bSORdFA6HL5UpxgV10amgybJGloVoXMVGXxzZr14FlTxM NHyp1EXLXoXIT2RE2wrWhEBz5HoxHK6EXCcxxKeUFA0LXskOGjVzQziaJm7xnqsleyv1 TDphm3n33WlFQmDwpSJl4v1MKNadhVZOHrUEwRFEB64Rb40ru/HZXPvV9uiFKRjeYnhP oooCi3PSbanksH2FbOj0P5USeowPJf/djnwC4kt2Qu/ke7PviuPaz6bCUz1yWsrjn1qT M3tQ== 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=B5dJHvF93BbMFgelc7PVnVp1eaL6j1kxIVieN2bMiTg=; b=s12QDqFZJI/bOC3M2VSJz46bV091BHzUalXrrCpqQj166vENm+gX/HGIPZklz7MkFC 0FMPc0kHSkFZVMC+i8zCatIruij5cVszbxQRBHZe4sILAwYinYHkiVEEfUQINJrDFbIc Ux4SeLdiUt0v1qEHOgnydXiLgxtA7vJrUU2OuYAjUMdD063bz39BVIf+9wUXArkNc0qd 4uQHQOvvs1m2A3dxVRyDWt+JtUHTnIfEnEnu8b0VnZq3VVZU+tAvBk8ty9dDg+BfXMYh 4A2krjFiW/iEK3ojnMdsAWvGv1qjpGmbwIm4oPKDtX3MvKFRiH/n7UeEMp0zcRXruXAT DyCQ== X-Gm-Message-State: AIkVDXLEz33WnBkScInay96fHldRocsPhVESsa9b9s/x0I+8favsJWou6NH8YOFbOTM0BQ== X-Received: by 10.84.199.194 with SMTP id d2mr39369975plh.134.1484431591543; Sat, 14 Jan 2017 14:06:31 -0800 (PST) Received: from raichu ([2604:4080:1102:0:ca60:ff:fe9d:3963]) by smtp.gmail.com with ESMTPSA id r1sm37534060pgn.48.2017.01.14.14.06.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Jan 2017 14:06:30 -0800 (PST) Sender: Mark Johnston Date: Sat, 14 Jan 2017 14:06:29 -0800 From: Mark Johnston To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, rang@acm.org Subject: Re: svn commit: r311952 - head/sys/ddb Message-ID: <20170114220629.GB18065@raichu> References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170113131948.P1465@besplex.bde.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 22:06:32 -0000 On Fri, Jan 13, 2017 at 02:51:04PM +1100, Bruce Evans wrote: > On Thu, 12 Jan 2017, Mark Johnston wrote: > > > Log: > > Enable the use of ^C and ^S/^Q in DDB. > > > > This lets one interrupt DDB's output, which is useful if paging is > > disabled and the output device is slow. > > This is quite broken. It removes the code that was necessary for avoiding > loss of input. Hi Bruce, I've reverted this for now. I haven't thought much about how db_check_interrupt() might losslessly poll the console driver for ctrl-C, but I do think it's a valuable feature to have - just this morning I absent-mindedly dumped a 128K-entry KTR ring from a DDB prompt after having set $lines = 0, and had to wait for quite a while to get my prompt back. > > > Modified: head/sys/ddb/db_input.c > > ============================================================================== > > --- head/sys/ddb/db_input.c Thu Jan 12 00:09:31 2017 (r311951) > > +++ head/sys/ddb/db_input.c Thu Jan 12 00:22:36 2017 (r311952) > > @@ -63,7 +63,6 @@ static int db_lhist_nlines; > > #define BLANK ' ' > > #define BACKUP '\b' > > > > -static int cnmaygetc(void); > > static void db_delete(int n, int bwd); > > static int db_inputchar(int c); > > static void db_putnchars(int c, int count); > > @@ -291,12 +290,6 @@ db_inputchar(c) > > return (0); > > } > > > > -static int > > -cnmaygetc() > > -{ > > - return (-1); > > -} > > - > > BSD never had a usable console API (function) for checking for input. > cncheckc() is the correct name for such a function. The actual > cncheckc() returns any input that it finds. This is not the main > problem here. The input will have to be read here anyway to determine > what it is. The problems are that there is no console API at all for > ungetting characters in the input stream, and this function doesn't > even use a stub cnungetc(), but drops the input on the floor. It does > document this behaviour in a comment, but doesn't say that it is wrong. > > > int > > db_readline(lstart, lsize) > > char * lstart; > > @@ -350,7 +343,7 @@ db_check_interrupt(void) > > { > > int c; > > > > - c = cnmaygetc(); > > + c = cncheckc(); > > switch (c) { > > case -1: /* no character */ > > return; > > The stub function always returns -1, so db_check_interrupt() is turned into > a no-op. > > db_check_interrupt() now eats the first byte of any input on every call. > > > @@ -361,7 +354,7 @@ db_check_interrupt(void) > > > > case CTRL('s'): > > do { > > - c = cnmaygetc(); > > + c = cncheckc(); > > if (c == CTRL('c')) > > db_error((char *)0); > > } while (c != CTRL('q')); > > This is now a bad implementation of xon/xoff. It doesn't support ixany, > but busy-waits for ^Q or ^C using cncheckc(). It should at least > busy-wait using cngetc(), since that might be do a smarter busy wait. > cngetc() is actually only slightly smarter -- it uses busy-waiting too, > but with cpu_spinwait() in the loop. This cpu_spinwait() makes little > difference since cncheckc() tends to be a heavyweight function. Only > cpu_spinwait()s in the innermost loops of cncheckc(), if any, are likely > to have much effect. > > Multiple consoles complicate this a bit. > > db_check_interrupt() is called after every db_putc() of a newline. So > the breakage is mainly for type-ahead while writing many lines. I'll note that type-ahead interacts rather poorly with DDB's behaviour of repeating the previous command upon reading an empty input line: entering a carriage return at any point while "show ktr" is working will cause it to be started again once it's finished. > > Control processing belongs in the lowest level of console drivers, and > at least the xon/xoff part is very easy to do. This makes it work for > contexts like boot messages -- this can only be controlled now by booting > with -p, which gives something like an automatic ^S after every line, > but the control characters for this mode are unusual and there is no > way to get back to -p mode after turning it off or not starting with it. > > [...] From owner-svn-src-all@freebsd.org Sat Jan 14 22:16:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63F54CAFF0D; Sat, 14 Jan 2017 22:16:04 +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 33A6B1EBD; Sat, 14 Jan 2017 22:16:04 +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 v0EMG3EX093071; Sat, 14 Jan 2017 22:16:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EMG3rN093070; Sat, 14 Jan 2017 22:16:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701142216.v0EMG3rN093070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 14 Jan 2017 22:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312199 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 22:16:04 -0000 Author: markj Date: Sat Jan 14 22:16:03 2017 New Revision: 312199 URL: https://svnweb.freebsd.org/changeset/base/312199 Log: Stop the scheduler upon panic even in non-SMP kernels. This is needed for kernel dumps to work, as the panicking thread will call into code that makes use of kernel locks. Reported and tested by: Eugene Grosbein MFC after: 1 week Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sat Jan 14 22:16:01 2017 (r312198) +++ head/sys/kern/kern_shutdown.c Sat Jan 14 22:16:03 2017 (r312199) @@ -733,13 +733,13 @@ vpanic(const char *fmt, va_list ap) CPU_CLR(PCPU_GET(cpuid), &other_cpus); stop_cpus_hard(other_cpus); } +#endif /* * Ensure that the scheduler is stopped while panicking, even if panic * has been entered from kdb. */ td->td_stopsched = 1; -#endif bootopt = RB_AUTOBOOT; newpanic = 0; From owner-svn-src-all@freebsd.org Sat Jan 14 22:27:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04DE4CB030E; Sat, 14 Jan 2017 22:27:33 +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 C89B41966; Sat, 14 Jan 2017 22:27:32 +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 v0EMRVsV097504; Sat, 14 Jan 2017 22:27:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EMRVF8097503; Sat, 14 Jan 2017 22:27:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701142227.v0EMRVF8097503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 Jan 2017 22:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r312202 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 22:27:33 -0000 Author: adrian Date: Sat Jan 14 22:27:31 2017 New Revision: 312202 URL: https://svnweb.freebsd.org/changeset/base/312202 Log: Release landon from mentorship! Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sat Jan 14 22:20:12 2017 (r312201) +++ svnadmin/conf/mentors Sat Jan 14 22:27:31 2017 (r312202) @@ -27,7 +27,6 @@ jkh rwatson jwd rmacklem kadesai ken Co-mentor: scottl, ambrisko karels gnn -landonf adrian mahrens mckusick miwi rwatson mizhka adrian Co-mentor: cognet From owner-svn-src-all@freebsd.org Sat Jan 14 22:56:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F8C1CB0D76; Sat, 14 Jan 2017 22:56:21 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 575521AE6; Sat, 14 Jan 2017 22:56:21 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EMuKKa010401; Sat, 14 Jan 2017 22:56:20 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EMuKBp010400; Sat, 14 Jan 2017 22:56:20 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201701142256.v0EMuKBp010400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Sat, 14 Jan 2017 22:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312203 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 22:56:21 -0000 Author: mizhka Date: Sat Jan 14 22:56:20 2017 New Revision: 312203 URL: https://svnweb.freebsd.org/changeset/base/312203 Log: [mips/onionomega] WiFi & gpio kernel configuration bits This patch adds missing hints for ath0 (eepromaddr) and GPIO (mask & leds). ath0 doesn't work without eeprom hints, so this commit should make wifi works on Onion Omega. GPIO mask is required if you want to use gpiobus and GPIO pins on your board. Onion Omega has several leds connected to gpio pins (one on board, one color on dock). This commit adds mask for gpiobus and allow you to turn off/on leds via /dev/leds/{board,blue,green,red} (on by default). Tested on Onion Omega 1. Reviewed by: adrian Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D9107 Modified: head/sys/mips/conf/ONIONOMEGA.hints Modified: head/sys/mips/conf/ONIONOMEGA.hints ============================================================================== --- head/sys/mips/conf/ONIONOMEGA.hints Sat Jan 14 22:27:31 2017 (r312202) +++ head/sys/mips/conf/ONIONOMEGA.hints Sat Jan 14 22:56:20 2017 (r312203) @@ -31,6 +31,10 @@ hint.arge.1.media=1000 hint.arge.1.fduplex=1 hint.arge.1.eeprommac=0x1fff0006 +# ath0 +hint.ath.0.eepromaddr=0x1fff0000 +hint.ath.0.eepromsize=16384 + # 16MB flash layout: # [ 0.510000] 5 tp-link partitions found on MTD device spi0.0 # [ 0.510000] Creating 5 MTD partitions on "spi0.0": @@ -92,3 +96,30 @@ hint.map.6.start=0x00ff0000 hint.map.6.end=0x01000000 hint.map.6.name="ART" hint.map.6.readonly=1 + +# GPIO +hint.gpio.0.pinmask=0x0c8ff1c3 + +hint.gpioled.0.at="gpiobus0" +hint.gpioled.0.pins=0x08000000 +hint.gpioled.0.name="board" +hint.gpioled.0.invert=0 + +#Red +hint.gpioled.1.at="gpiobus0" +hint.gpioled.1.pins=0x00020000 +hint.gpioled.1.name="red" +hint.gpioled.1.invert=0 + +#Green +hint.gpioled.2.at="gpiobus0" +hint.gpioled.2.pins=0x00010000 +hint.gpioled.2.name="green" +hint.gpioled.2.invert=0 + +#Blue +hint.gpioled.3.at="gpiobus0" +hint.gpioled.3.pins=0x00008000 +hint.gpioled.3.name="blue" +hint.gpioled.3.invert=0 + From owner-svn-src-all@freebsd.org Sat Jan 14 23:24:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4961CCAF5D8; Sat, 14 Jan 2017 23:24:51 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E3CD19DF; Sat, 14 Jan 2017 23:24:50 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0ENOo9C022798; Sat, 14 Jan 2017 23:24:50 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0ENOoSO022797; Sat, 14 Jan 2017 23:24:50 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201701142324.v0ENOoSO022797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Sat, 14 Jan 2017 23:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312204 - head/sys/dev/etherswitch/micrel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 23:24:51 -0000 Author: mizhka Date: Sat Jan 14 23:24:50 2017 New Revision: 312204 URL: https://svnweb.freebsd.org/changeset/base/312204 Log: [etherswitch] Support Micrel KSZ8995MA switch chip This is Micrel KSZ8995MA driver code. KSZ8995MA uses SPI bus to control. This code is written & tested on @SRCHACK's ksz8995ma board and FON2100 with gpiospi. etherswitchcfg support commands: addtag, ingress, striptag, dropuntagged. Submitted by: Hiroki Mori Reviewed by: mizhka, adrian Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D8790 Added: head/sys/dev/etherswitch/micrel/ head/sys/dev/etherswitch/micrel/ksz8995ma.c (contents, props changed) Added: head/sys/dev/etherswitch/micrel/ksz8995ma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/micrel/ksz8995ma.c Sat Jan 14 23:24:50 2017 (r312204) @@ -0,0 +1,960 @@ +/*- + * Copyright (c) 2016 Hiroki Mori + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 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$ + */ + +/* + * This is Micrel KSZ8995MA driver code. KSZ8995MA use SPI bus on control. + * This code development on @SRCHACK's ksz8995ma board and FON2100 with + * gpiospi. + * etherswitchcfg command port option support addtag, ingress, striptag, + * dropuntagged. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include "spibus_if.h" +#include "miibus_if.h" +#include "etherswitch_if.h" + +#define KSZ8995MA_SPI_READ 0x03 +#define KSZ8995MA_SPI_WRITE 0x02 + +#define KSZ8995MA_CID0 0x00 +#define KSZ8995MA_CID1 0x01 + +#define KSZ8995MA_GC0 0x02 +#define KSZ8995MA_GC1 0x03 +#define KSZ8995MA_GC2 0x04 +#define KSZ8995MA_GC3 0x05 + +#define KSZ8995MA_PORT_SIZE 0x10 + +#define KSZ8995MA_PC0_BASE 0x10 +#define KSZ8995MA_PC1_BASE 0x11 +#define KSZ8995MA_PC2_BASE 0x12 +#define KSZ8995MA_PC3_BASE 0x13 +#define KSZ8995MA_PC4_BASE 0x14 +#define KSZ8995MA_PC5_BASE 0x15 +#define KSZ8995MA_PC6_BASE 0x16 +#define KSZ8995MA_PC7_BASE 0x17 +#define KSZ8995MA_PC8_BASE 0x18 +#define KSZ8995MA_PC9_BASE 0x19 +#define KSZ8995MA_PC10_BASE 0x1a +#define KSZ8995MA_PC11_BASE 0x1b +#define KSZ8995MA_PC12_BASE 0x1c +#define KSZ8995MA_PC13_BASE 0x1d + +#define KSZ8995MA_PS0_BASE 0x1e + +#define KSZ8995MA_PC14_BASE 0x1f + +#define KSZ8995MA_IAC0 0x6e +#define KSZ8995MA_IAC1 0x6f +#define KSZ8995MA_IDR8 0x70 +#define KSZ8995MA_IDR7 0x71 +#define KSZ8995MA_IDR6 0x72 +#define KSZ8995MA_IDR5 0x73 +#define KSZ8995MA_IDR4 0x74 +#define KSZ8995MA_IDR3 0x75 +#define KSZ8995MA_IDR2 0x76 +#define KSZ8995MA_IDR1 0x77 +#define KSZ8995MA_IDR0 0x78 + +#define KSZ8995MA_FAMILI_ID 0x95 +#define KSZ8995MA_CHIP_ID 0x00 +#define KSZ8995MA_CHIP_ID_MASK 0xf0 +#define KSZ8995MA_START 0x01 +#define KSZ8995MA_VLAN_ENABLE 0x80 +#define KSZ8995MA_TAG_INS 0x04 +#define KSZ8995MA_TAG_RM 0x02 +#define KSZ8995MA_INGR_FILT 0x40 +#define KSZ8995MA_DROP_NONPVID 0x20 + +#define KSZ8995MA_PDOWN 0x08 +#define KSZ8995MA_STARTNEG 0x20 + +#define KSZ8995MA_MII_STAT 0x7808 +#define KSZ8995MA_MII_PHYID_H 0x0022 +#define KSZ8995MA_MII_PHYID_L 0x1450 +#define KSZ8995MA_MII_AA 0x0401 + +#define KSZ8995MA_VLAN_TABLE_VALID 0x20 +#define KSZ8995MA_VLAN_TABLE_READ 0x14 +#define KSZ8995MA_VLAN_TABLE_WRITE 0x04 + +#define KSZ8995MA_MAX_PORT 5 + +MALLOC_DECLARE(M_KSZ8995MA); +MALLOC_DEFINE(M_KSZ8995MA, "ksz8995ma", "ksz8995ma data structures"); + +struct ksz8995ma_softc { + struct mtx sc_mtx; /* serialize access to softc */ + device_t sc_dev; + int vlan_mode; + int media; /* cpu port media */ + int cpuport; /* which PHY is connected to the CPU */ + int phymask; /* PHYs we manage */ + int numports; /* number of ports */ + int ifpport[KSZ8995MA_MAX_PORT]; + int *portphy; + char **ifname; + device_t **miibus; + struct ifnet **ifp; + struct callout callout_tick; + etherswitch_info_t info; +}; + +#define KSZ8995MA_LOCK(_sc) \ + mtx_lock(&(_sc)->sc_mtx) +#define KSZ8995MA_UNLOCK(_sc) \ + mtx_unlock(&(_sc)->sc_mtx) +#define KSZ8995MA_LOCK_ASSERT(_sc, _what) \ + mtx_assert(&(_sc)->sc_mtx, (_what)) +#define KSZ8995MA_TRYLOCK(_sc) \ + mtx_trylock(&(_sc)->sc_mtx) + +#if defined(DEBUG) +#define DPRINTF(dev, args...) device_printf(dev, args) +#else +#define DPRINTF(dev, args...) +#endif + +static inline int ksz8995ma_portforphy(struct ksz8995ma_softc *, int); +static void ksz8995ma_tick(void *); +static int ksz8995ma_ifmedia_upd(struct ifnet *); +static void ksz8995ma_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int ksz8995ma_readreg(device_t dev, int addr); +static int ksz8995ma_writereg(device_t dev, int addr, int value); +static void ksz8995ma_portvlanreset(device_t dev); + +static int +ksz8995ma_probe(device_t dev) +{ + int id0, id1; + struct ksz8995ma_softc *sc; + + sc = device_get_softc(dev); + bzero(sc, sizeof(*sc)); + + id0 = ksz8995ma_readreg(dev, KSZ8995MA_CID0); + id1 = ksz8995ma_readreg(dev, KSZ8995MA_CID1); + if (bootverbose) + device_printf(dev,"Chip Identifier Register %x %x\n", id0, id1); + + /* check Product Code */ + if (id0 != KSZ8995MA_FAMILI_ID || (id1 & KSZ8995MA_CHIP_ID_MASK) != + KSZ8995MA_CHIP_ID) { + return (ENXIO); + } + + device_set_desc_copy(dev, "Micrel KSZ8995MA SPI switch driver"); + return (BUS_PROBE_DEFAULT); +} + +static int +ksz8995ma_attach_phys(struct ksz8995ma_softc *sc) +{ + int phy, port, err; + char name[IFNAMSIZ]; + + port = 0; + err = 0; + /* PHYs need an interface, so we generate a dummy one */ + snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev)); + for (phy = 0; phy < sc->numports; phy++) { + if (phy == sc->cpuport) + continue; + if (((1 << phy) & sc->phymask) == 0) + continue; + sc->ifpport[phy] = port; + sc->portphy[port] = phy; + sc->ifp[port] = if_alloc(IFT_ETHER); + sc->ifp[port]->if_softc = sc; + sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | + IFF_DRV_RUNNING | IFF_SIMPLEX; + if_initname(sc->ifp[port], name, port); + sc->miibus[port] = malloc(sizeof(device_t), M_KSZ8995MA, + M_WAITOK | M_ZERO); + if (sc->miibus[port] == NULL) { + err = ENOMEM; + goto failed; + } + err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port], + ksz8995ma_ifmedia_upd, ksz8995ma_ifmedia_sts, \ + BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", + device_get_nameunit(*sc->miibus[port]), + sc->ifp[port]->if_xname); + if (err != 0) { + device_printf(sc->sc_dev, + "attaching PHY %d failed\n", + phy); + goto failed; + } + ++port; + } + sc->info.es_nports = port; + if (sc->cpuport != -1) { + /* cpu port is MAC5 on ksz8995ma */ + sc->ifpport[sc->cpuport] = port; + sc->portphy[port] = sc->cpuport; + ++sc->info.es_nports; + } + + return (0); + +failed: + for (phy = 0; phy < sc->numports; phy++) { + if (((1 << phy) & sc->phymask) == 0) + continue; + port = ksz8995ma_portforphy(sc, phy); + if (sc->miibus[port] != NULL) + device_delete_child(sc->sc_dev, (*sc->miibus[port])); + if (sc->ifp[port] != NULL) + if_free(sc->ifp[port]); + if (sc->ifname[port] != NULL) + free(sc->ifname[port], M_KSZ8995MA); + if (sc->miibus[port] != NULL) + free(sc->miibus[port], M_KSZ8995MA); + } + return (err); +} + +static int +ksz8995ma_attach(device_t dev) +{ + struct ksz8995ma_softc *sc; + int err, reg; + + err = 0; + sc = device_get_softc(dev); + + sc->sc_dev = dev; + mtx_init(&sc->sc_mtx, "ksz8995ma", NULL, MTX_DEF); + strlcpy(sc->info.es_name, device_get_desc(dev), + sizeof(sc->info.es_name)); + + /* KSZ8995MA Defaults */ + sc->numports = KSZ8995MA_MAX_PORT; + sc->phymask = (1 << (KSZ8995MA_MAX_PORT + 1)) - 1; + sc->cpuport = -1; + sc->media = 100; + + (void) resource_int_value(device_get_name(dev), device_get_unit(dev), + "cpuport", &sc->cpuport); + + sc->info.es_nvlangroups = 16; + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOT1Q; + + sc->ifp = malloc(sizeof(struct ifnet *) * sc->numports, M_KSZ8995MA, + M_WAITOK | M_ZERO); + sc->ifname = malloc(sizeof(char *) * sc->numports, M_KSZ8995MA, + M_WAITOK | M_ZERO); + sc->miibus = malloc(sizeof(device_t *) * sc->numports, M_KSZ8995MA, + M_WAITOK | M_ZERO); + sc->portphy = malloc(sizeof(int) * sc->numports, M_KSZ8995MA, + M_WAITOK | M_ZERO); + + if (sc->ifp == NULL || sc->ifname == NULL || sc->miibus == NULL || + sc->portphy == NULL) { + err = ENOMEM; + goto failed; + } + + /* + * Attach the PHYs and complete the bus enumeration. + */ + err = ksz8995ma_attach_phys(sc); + if (err != 0) + goto failed; + + bus_generic_probe(dev); + bus_enumerate_hinted_children(dev); + err = bus_generic_attach(dev); + if (err != 0) + goto failed; + + callout_init(&sc->callout_tick, 0); + + ksz8995ma_tick(sc); + + /* start switch */ + sc->vlan_mode = 0; + reg = ksz8995ma_readreg(dev, KSZ8995MA_GC3); + ksz8995ma_writereg(dev, KSZ8995MA_GC3, + reg & ~KSZ8995MA_VLAN_ENABLE); + ksz8995ma_portvlanreset(dev); + ksz8995ma_writereg(dev, KSZ8995MA_CID1, KSZ8995MA_START); + + return (0); + +failed: + if (sc->portphy != NULL) + free(sc->portphy, M_KSZ8995MA); + if (sc->miibus != NULL) + free(sc->miibus, M_KSZ8995MA); + if (sc->ifname != NULL) + free(sc->ifname, M_KSZ8995MA); + if (sc->ifp != NULL) + free(sc->ifp, M_KSZ8995MA); + + return (err); +} + +static int +ksz8995ma_detach(device_t dev) +{ + struct ksz8995ma_softc *sc; + int i, port; + + sc = device_get_softc(dev); + + callout_drain(&sc->callout_tick); + + for (i = 0; i < KSZ8995MA_MAX_PORT; i++) { + if (((1 << i) & sc->phymask) == 0) + continue; + port = ksz8995ma_portforphy(sc, i); + if (sc->miibus[port] != NULL) + device_delete_child(dev, (*sc->miibus[port])); + if (sc->ifp[port] != NULL) + if_free(sc->ifp[port]); + free(sc->ifname[port], M_KSZ8995MA); + free(sc->miibus[port], M_KSZ8995MA); + } + + free(sc->portphy, M_KSZ8995MA); + free(sc->miibus, M_KSZ8995MA); + free(sc->ifname, M_KSZ8995MA); + free(sc->ifp, M_KSZ8995MA); + + bus_generic_detach(dev); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +/* + * Convert PHY number to port number. + */ +static inline int +ksz8995ma_portforphy(struct ksz8995ma_softc *sc, int phy) +{ + + return (sc->ifpport[phy]); +} + +static inline struct mii_data * +ksz8995ma_miiforport(struct ksz8995ma_softc *sc, int port) +{ + + if (port < 0 || port > sc->numports) + return (NULL); + if (port == sc->cpuport) + return (NULL); + return (device_get_softc(*sc->miibus[port])); +} + +static inline struct ifnet * +ksz8995ma_ifpforport(struct ksz8995ma_softc *sc, int port) +{ + + if (port < 0 || port > sc->numports) + return (NULL); + return (sc->ifp[port]); +} + +/* + * Poll the status for all PHYs. + */ +static void +ksz8995ma_miipollstat(struct ksz8995ma_softc *sc) +{ + int i, port; + struct mii_data *mii; + struct mii_softc *miisc; + + KSZ8995MA_LOCK_ASSERT(sc, MA_NOTOWNED); + + for (i = 0; i < KSZ8995MA_MAX_PORT; i++) { + if (i == sc->cpuport) + continue; + if (((1 << i) & sc->phymask) == 0) + continue; + port = ksz8995ma_portforphy(sc, i); + if ((*sc->miibus[port]) == NULL) + continue; + mii = device_get_softc(*sc->miibus[port]); + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { + if (IFM_INST(mii->mii_media.ifm_cur->ifm_media) != + miisc->mii_inst) + continue; + ukphy_status(miisc); + mii_phy_update(miisc, MII_POLLSTAT); + } + } +} + +static void +ksz8995ma_tick(void *arg) +{ + struct ksz8995ma_softc *sc; + + sc = arg; + + ksz8995ma_miipollstat(sc); + callout_reset(&sc->callout_tick, hz, ksz8995ma_tick, sc); +} + +static void +ksz8995ma_lock(device_t dev) +{ + struct ksz8995ma_softc *sc; + + sc = device_get_softc(dev); + + KSZ8995MA_LOCK_ASSERT(sc, MA_NOTOWNED); + KSZ8995MA_LOCK(sc); +} + +static void +ksz8995ma_unlock(device_t dev) +{ + struct ksz8995ma_softc *sc; + + sc = device_get_softc(dev); + + KSZ8995MA_LOCK_ASSERT(sc, MA_OWNED); + KSZ8995MA_UNLOCK(sc); +} + +static etherswitch_info_t * +ksz8995ma_getinfo(device_t dev) +{ + struct ksz8995ma_softc *sc; + + sc = device_get_softc(dev); + + return (&sc->info); +} + +static int +ksz8995ma_getport(device_t dev, etherswitch_port_t *p) +{ + struct ksz8995ma_softc *sc; + struct mii_data *mii; + struct ifmediareq *ifmr; + int phy, err; + int tag1, tag2, portreg; + + sc = device_get_softc(dev); + ifmr = &p->es_ifmr; + + if (p->es_port < 0 || p->es_port >= sc->numports) + return (ENXIO); + + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + tag1 = ksz8995ma_readreg(dev, KSZ8995MA_PC3_BASE + + KSZ8995MA_PORT_SIZE * p->es_port); + tag2 = ksz8995ma_readreg(dev, KSZ8995MA_PC4_BASE + + KSZ8995MA_PORT_SIZE * p->es_port); + p->es_pvid = (tag1 & 0x0f) << 8 | tag2; + + portreg = ksz8995ma_readreg(dev, KSZ8995MA_PC0_BASE + + KSZ8995MA_PORT_SIZE * p->es_port); + if (portreg & KSZ8995MA_TAG_INS) + p->es_flags |= ETHERSWITCH_PORT_ADDTAG; + if (portreg & KSZ8995MA_TAG_RM) + p->es_flags |= ETHERSWITCH_PORT_STRIPTAG; + + portreg = ksz8995ma_readreg(dev, KSZ8995MA_PC2_BASE + + KSZ8995MA_PORT_SIZE * p->es_port); + if (portreg & KSZ8995MA_DROP_NONPVID) + p->es_flags |= ETHERSWITCH_PORT_DROPUNTAGGED; + if (portreg & KSZ8995MA_INGR_FILT) + p->es_flags |= ETHERSWITCH_PORT_INGRESS; + } + + phy = sc->portphy[p->es_port]; + mii = ksz8995ma_miiforport(sc, p->es_port); + if (sc->cpuport != -1 && phy == sc->cpuport) { + /* fill in fixed values for CPU port */ + p->es_flags |= ETHERSWITCH_PORT_CPU; + ifmr->ifm_count = 0; + if (sc->media == 100) + ifmr->ifm_current = ifmr->ifm_active = + IFM_ETHER | IFM_100_TX | IFM_FDX; + else + ifmr->ifm_current = ifmr->ifm_active = + IFM_ETHER | IFM_1000_T | IFM_FDX; + ifmr->ifm_mask = 0; + ifmr->ifm_status = IFM_ACTIVE | IFM_AVALID; + } else if (mii != NULL) { + err = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, + &mii->mii_media, SIOCGIFMEDIA); + if (err) + return (err); + } else { + return (ENXIO); + } + + return (0); +} + +static int +ksz8995ma_setport(device_t dev, etherswitch_port_t *p) +{ + struct ksz8995ma_softc *sc; + struct mii_data *mii; + struct ifmedia *ifm; + struct ifnet *ifp; + int phy, err; + int portreg; + + sc = device_get_softc(dev); + + if (p->es_port < 0 || p->es_port >= sc->numports) + return (ENXIO); + + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + ksz8995ma_writereg(dev, KSZ8995MA_PC4_BASE + + KSZ8995MA_PORT_SIZE * p->es_port, p->es_pvid & 0xff); + portreg = ksz8995ma_readreg(dev, KSZ8995MA_PC3_BASE + + KSZ8995MA_PORT_SIZE * p->es_port); + ksz8995ma_writereg(dev, KSZ8995MA_PC3_BASE + + KSZ8995MA_PORT_SIZE * p->es_port, + (portreg & 0xf0) | ((p->es_pvid >> 8) & 0x0f)); + + portreg = ksz8995ma_readreg(dev, KSZ8995MA_PC0_BASE + + KSZ8995MA_PORT_SIZE * p->es_port); + if (p->es_flags & ETHERSWITCH_PORT_ADDTAG) + portreg |= KSZ8995MA_TAG_INS; + else + portreg &= ~KSZ8995MA_TAG_INS; + if (p->es_flags & ETHERSWITCH_PORT_STRIPTAG) + portreg |= KSZ8995MA_TAG_RM; + else + portreg &= ~KSZ8995MA_TAG_RM; + ksz8995ma_writereg(dev, KSZ8995MA_PC0_BASE + + KSZ8995MA_PORT_SIZE * p->es_port, portreg); + + portreg = ksz8995ma_readreg(dev, KSZ8995MA_PC2_BASE + + KSZ8995MA_PORT_SIZE * p->es_port); + if (p->es_flags & ETHERSWITCH_PORT_DROPUNTAGGED) + portreg |= KSZ8995MA_DROP_NONPVID; + else + portreg &= ~KSZ8995MA_DROP_NONPVID; + if (p->es_flags & ETHERSWITCH_PORT_INGRESS) + portreg |= KSZ8995MA_INGR_FILT; + else + portreg &= ~KSZ8995MA_INGR_FILT; + ksz8995ma_writereg(dev, KSZ8995MA_PC2_BASE + + KSZ8995MA_PORT_SIZE * p->es_port, portreg); + } + + phy = sc->portphy[p->es_port]; + mii = ksz8995ma_miiforport(sc, p->es_port); + if (phy != sc->cpuport) { + if (mii == NULL) + return (ENXIO); + ifp = ksz8995ma_ifpforport(sc, p->es_port); + ifm = &mii->mii_media; + err = ifmedia_ioctl(ifp, &p->es_ifr, ifm, SIOCSIFMEDIA); + } + return (0); +} + +static int +ksz8995ma_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + int data0, data1, data2; + int vlantab; + struct ksz8995ma_softc *sc; + + sc = device_get_softc(dev); + + if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { + if (vg->es_vlangroup < sc->numports) { + vg->es_vid = ETHERSWITCH_VID_VALID; + vg->es_vid |= vg->es_vlangroup; + data0 = ksz8995ma_readreg(dev, KSZ8995MA_PC1_BASE + + KSZ8995MA_PORT_SIZE * vg->es_vlangroup); + vg->es_member_ports = data0 & 0x1f; + vg->es_untagged_ports = vg->es_member_ports; + vg->es_fid = 0; + } else { + vg->es_vid = 0; + } + } else if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + ksz8995ma_writereg(dev, KSZ8995MA_IAC0, + KSZ8995MA_VLAN_TABLE_READ); + ksz8995ma_writereg(dev, KSZ8995MA_IAC1, vg->es_vlangroup); + data2 = ksz8995ma_readreg(dev, KSZ8995MA_IDR2); + data1 = ksz8995ma_readreg(dev, KSZ8995MA_IDR1); + data0 = ksz8995ma_readreg(dev, KSZ8995MA_IDR0); + vlantab = data2 << 16 | data1 << 8 | data0; + if (data2 & KSZ8995MA_VLAN_TABLE_VALID) { + vg->es_vid = ETHERSWITCH_VID_VALID; + vg->es_vid |= vlantab & 0xfff; + vg->es_member_ports = (vlantab >> 16) & 0x1f; + vg->es_untagged_ports = vg->es_member_ports; + vg->es_fid = (vlantab >> 12) & 0x0f; + } else { + vg->es_fid = 0; + } + } + + return (0); +} + +static int +ksz8995ma_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + struct ksz8995ma_softc *sc; + int data0; + + sc = device_get_softc(dev); + + if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { + data0 = ksz8995ma_readreg(dev, KSZ8995MA_PC1_BASE + + KSZ8995MA_PORT_SIZE * vg->es_vlangroup); + ksz8995ma_writereg(dev, KSZ8995MA_PC1_BASE + + KSZ8995MA_PORT_SIZE * vg->es_vlangroup, + (data0 & 0xe0) | (vg->es_member_ports & 0x1f)); + } else if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + if (vg->es_member_ports != 0) { + ksz8995ma_writereg(dev, KSZ8995MA_IDR2, + KSZ8995MA_VLAN_TABLE_VALID | + (vg->es_member_ports & 0x1f)); + ksz8995ma_writereg(dev, KSZ8995MA_IDR1, + vg->es_fid << 4 | vg->es_vid >> 8); + ksz8995ma_writereg(dev, KSZ8995MA_IDR0, + vg->es_vid & 0xff); + } else { + ksz8995ma_writereg(dev, KSZ8995MA_IDR2, 0); + ksz8995ma_writereg(dev, KSZ8995MA_IDR1, 0); + ksz8995ma_writereg(dev, KSZ8995MA_IDR0, 0); + } + ksz8995ma_writereg(dev, KSZ8995MA_IAC0, + KSZ8995MA_VLAN_TABLE_WRITE); + ksz8995ma_writereg(dev, KSZ8995MA_IAC1, vg->es_vlangroup); + } + + return (0); +} + +static int +ksz8995ma_getconf(device_t dev, etherswitch_conf_t *conf) +{ + struct ksz8995ma_softc *sc; + + sc = device_get_softc(dev); + + /* Return the VLAN mode. */ + conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; + conf->vlan_mode = sc->vlan_mode; + + return (0); +} + +static void +ksz8995ma_portvlanreset(device_t dev) +{ + int i, data; + struct ksz8995ma_softc *sc; + + sc = device_get_softc(dev); + + for (i = 0; i < sc->numports; ++i) { + data = ksz8995ma_readreg(dev, KSZ8995MA_PC1_BASE + + KSZ8995MA_PORT_SIZE * i); + ksz8995ma_writereg(dev, KSZ8995MA_PC1_BASE + + KSZ8995MA_PORT_SIZE * i, (data & 0xe0) | 0x1f); + } +} + +static int +ksz8995ma_setconf(device_t dev, etherswitch_conf_t *conf) +{ + int reg; + struct ksz8995ma_softc *sc; + + sc = device_get_softc(dev); + + if ((conf->cmd & ETHERSWITCH_CONF_VLAN_MODE) == 0) + return (0); + + if (conf->vlan_mode == ETHERSWITCH_VLAN_PORT) { + sc->vlan_mode = ETHERSWITCH_VLAN_PORT; + reg = ksz8995ma_readreg(dev, KSZ8995MA_GC3); + ksz8995ma_writereg(dev, KSZ8995MA_GC3, + reg & ~KSZ8995MA_VLAN_ENABLE); + ksz8995ma_portvlanreset(dev); + } else if (conf->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + sc->vlan_mode = ETHERSWITCH_VLAN_DOT1Q; + reg = ksz8995ma_readreg(dev, KSZ8995MA_GC3); + ksz8995ma_writereg(dev, KSZ8995MA_GC3, + reg | KSZ8995MA_VLAN_ENABLE); + } else { + sc->vlan_mode = 0; + reg = ksz8995ma_readreg(dev, KSZ8995MA_GC3); + ksz8995ma_writereg(dev, KSZ8995MA_GC3, + reg & ~KSZ8995MA_VLAN_ENABLE); + ksz8995ma_portvlanreset(dev); + } + return (0); +} + +static void +ksz8995ma_statchg(device_t dev) +{ + + DPRINTF(dev, "%s\n", __func__); +} + +static int +ksz8995ma_ifmedia_upd(struct ifnet *ifp) +{ + struct ksz8995ma_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = ksz8995ma_miiforport(sc, ifp->if_dunit); + + DPRINTF(sc->sc_dev, "%s\n", __func__); + if (mii == NULL) + return (ENXIO); + mii_mediachg(mii); + return (0); +} + +static void +ksz8995ma_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct ksz8995ma_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = ksz8995ma_miiforport(sc, ifp->if_dunit); + + DPRINTF(sc->sc_dev, "%s\n", __func__); + + if (mii == NULL) + return; + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; +} + +static int +ksz8995ma_readphy(device_t dev, int phy, int reg) +{ +int portreg; + + /* + * This is no mdio/mdc connection code. + * simulate MIIM Registers via the SPI interface + */ + if (reg == MII_BMSR) { + portreg = ksz8995ma_readreg(dev, KSZ8995MA_PS0_BASE + + KSZ8995MA_PORT_SIZE * phy); + return (KSZ8995MA_MII_STAT | + (portreg & 0x20 ? BMSR_LINK : 0x00) | + (portreg & 0x40 ? BMSR_ACOMP : 0x00)); + } else if (reg == MII_PHYIDR1) { + return (KSZ8995MA_MII_PHYID_H); + } else if (reg == MII_PHYIDR2) { + return (KSZ8995MA_MII_PHYID_L); + } else if (reg == MII_ANAR) { + portreg = ksz8995ma_readreg(dev, KSZ8995MA_PC12_BASE + + KSZ8995MA_PORT_SIZE * phy); + return (KSZ8995MA_MII_AA | (portreg & 0x0f) << 5); + } else if (reg == MII_ANLPAR) { + portreg = ksz8995ma_readreg(dev, KSZ8995MA_PS0_BASE + + KSZ8995MA_PORT_SIZE * phy); + return (((portreg & 0x0f) << 5) | 0x01); + } + + return (0); +} + +static int +ksz8995ma_writephy(device_t dev, int phy, int reg, int data) +{ +int portreg; + + /* + * This is no mdio/mdc connection code. + * simulate MIIM Registers via the SPI interface + */ + if (reg == MII_BMCR) { + portreg = ksz8995ma_readreg(dev, KSZ8995MA_PC13_BASE + + KSZ8995MA_PORT_SIZE * phy); + if (data & BMCR_PDOWN) + portreg |= KSZ8995MA_PDOWN; + else + portreg &= ~KSZ8995MA_PDOWN; + if (data & BMCR_STARTNEG) + portreg |= KSZ8995MA_STARTNEG; + else + portreg &= ~KSZ8995MA_STARTNEG; + ksz8995ma_writereg(dev, KSZ8995MA_PC13_BASE + + KSZ8995MA_PORT_SIZE * phy, portreg); + } else if (reg == MII_ANAR) { + portreg = ksz8995ma_readreg(dev, KSZ8995MA_PC12_BASE + + KSZ8995MA_PORT_SIZE * phy); + portreg &= 0xf; + portreg |= ((data >> 5) & 0x0f); + ksz8995ma_writereg(dev, KSZ8995MA_PC12_BASE + + KSZ8995MA_PORT_SIZE * phy, portreg); + } + return (0); +} + +static int +ksz8995ma_readreg(device_t dev, int addr) +{ + uint8_t txBuf[8], rxBuf[8]; + struct spi_command cmd; + int err; + + memset(&cmd, 0, sizeof(cmd)); + memset(txBuf, 0, sizeof(txBuf)); + memset(rxBuf, 0, sizeof(rxBuf)); + + /* read spi */ + txBuf[0] = KSZ8995MA_SPI_READ; + txBuf[1] = addr; + cmd.tx_cmd = &txBuf; + cmd.rx_cmd = &rxBuf; + cmd.tx_cmd_sz = 3; + cmd.rx_cmd_sz = 3; + err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); + if (err) + return(0); + + return (rxBuf[2]); +} + +static int +ksz8995ma_writereg(device_t dev, int addr, int value) +{ + uint8_t txBuf[8], rxBuf[8]; + struct spi_command cmd; + int err; + + memset(&cmd, 0, sizeof(cmd)); + memset(txBuf, 0, sizeof(txBuf)); + memset(rxBuf, 0, sizeof(rxBuf)); + + /* write spi */ + txBuf[0] = KSZ8995MA_SPI_WRITE; + txBuf[1] = addr; + txBuf[2] = value; + cmd.tx_cmd = &txBuf; + cmd.rx_cmd = &rxBuf; + cmd.tx_cmd_sz = 3; + cmd.rx_cmd_sz = 3; + err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); + if (err) + return(0); + + return (0); +} + +static device_method_t ksz8995ma_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ksz8995ma_probe), + DEVMETHOD(device_attach, ksz8995ma_attach), + DEVMETHOD(device_detach, ksz8995ma_detach), + + /* bus interface */ + DEVMETHOD(bus_add_child, device_add_child_ordered), + + /* MII interface */ + DEVMETHOD(miibus_readreg, ksz8995ma_readphy), + DEVMETHOD(miibus_writereg, ksz8995ma_writephy), + DEVMETHOD(miibus_statchg, ksz8995ma_statchg), + + /* etherswitch interface */ + DEVMETHOD(etherswitch_lock, ksz8995ma_lock), + DEVMETHOD(etherswitch_unlock, ksz8995ma_unlock), + DEVMETHOD(etherswitch_getinfo, ksz8995ma_getinfo), + DEVMETHOD(etherswitch_readreg, ksz8995ma_readreg), + DEVMETHOD(etherswitch_writereg, ksz8995ma_writereg), + DEVMETHOD(etherswitch_readphyreg, ksz8995ma_readphy), + DEVMETHOD(etherswitch_writephyreg, ksz8995ma_writephy), + DEVMETHOD(etherswitch_getport, ksz8995ma_getport), + DEVMETHOD(etherswitch_setport, ksz8995ma_setport), + DEVMETHOD(etherswitch_getvgroup, ksz8995ma_getvgroup), + DEVMETHOD(etherswitch_setvgroup, ksz8995ma_setvgroup), + DEVMETHOD(etherswitch_setconf, ksz8995ma_setconf), + DEVMETHOD(etherswitch_getconf, ksz8995ma_getconf), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(ksz8995ma, ksz8995ma_driver, ksz8995ma_methods, + sizeof(struct ksz8995ma_softc)); +static devclass_t ksz8995ma_devclass; + +DRIVER_MODULE(ksz8995ma, spibus, ksz8995ma_driver, ksz8995ma_devclass, 0, 0); +DRIVER_MODULE(miibus, ksz8995ma, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(etherswitch, ksz8995ma, etherswitch_driver, etherswitch_devclass, + 0, 0); +MODULE_VERSION(ksz8995ma, 1); +MODULE_DEPEND(ksz8995ma, spibus, 1, 1, 1); /* XXX which versions? */ +MODULE_DEPEND(ksz8995ma, miibus, 1, 1, 1); /* XXX which versions? */ +MODULE_DEPEND(ksz8995ma, etherswitch, 1, 1, 1); /* XXX which versions? */